清单导入

This commit is contained in:
yuezhihang
2022-04-27 19:11:16 +08:00
parent 41b19d1481
commit 44ed3af251
6 changed files with 353 additions and 182 deletions
@@ -2,57 +2,134 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.regulations.dao.StandDataDao">
<resultMap id="BaseResultMap" type="com.adc.da.slrs.regulations.entity.StandData" >
<resultMap id="BaseResultMap" type="com.adc.da.slrs.regulations.entity.StandData">
</resultMap>
<select id="searchStandData" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.regulations.entity.SearchStandContext">
SELECT
t.standId,
t.standType,
t.standSort,
t.standNumber,
t.standName
FROM (
SELECT
sar_standards_info.id AS standId,
sar_standards_info.STAND_TYPE AS standType,
sar_standards_info.STAND_SORT AS standSort,
sar_standards_info.STAND_NUMBER AS standNumber,
sar_standards_info.STAND_NAME AS standName
FROM
sar_standards_info
LEFT JOIN SAR_STAND_ATTR_INFO ON (
SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id
AND SAR_STAND_ATTR_INFO.valid_flag = 0
)
WHERE sar_standards_info.valid_flag = 0
<if test="vppsCode != null and vppsCode != ''">
and (SAR_STAND_ATTR_INFO.KCCVPPSBM like concat('%',#{vppsCode},'%') or SAR_STAND_ATTR_INFO.CYCVPPSBM like concat('%',#{vppsCode},'%'))
</if>
<if test="vppsName != null and vppsName != ''">
and (SAR_STAND_ATTR_INFO.KCCVPPSCN like concat('%',#{vppsName},'%') or SAR_STAND_ATTR_INFO.CYCVPPSCN like concat('%',#{vppsName},'%'))
</if>
UNION
SELECT
sar_bussioness_stand.id AS standId,
'BUSINESS_STAND' AS standType,
sar_bussioness_stand.STAND_SORT AS standSort,
sar_bussioness_stand.STAND_NUMBER AS standNumber,
sar_bussioness_stand.STAND_NAME AS standName
FROM
sar_bussioness_stand
LEFT JOIN sar_buss_stand_attr_info ON (
sar_buss_stand_attr_info.stand_id = sar_bussioness_stand.id
AND sar_buss_stand_attr_info.valid_flag = 0
)
WHERE sar_bussioness_stand.valid_flag = 0
<if test="vppsCode != null and vppsCode != ''">
and (sar_buss_stand_attr_info.KCVPPSBMBUSS like concat('%',#{vppsCode},'%') or sar_buss_stand_attr_info.CYCVPPSBMBUSS like concat('%',#{vppsCode},'%'))
</if>
<if test="vppsName != null and vppsName != ''">
and (sar_buss_stand_attr_info.KCVPPSCNBUSS like concat('%',#{vppsName},'%') or sar_buss_stand_attr_info.CYCVPPSCNBUSS like concat('%',#{vppsName},'%'))
</if>
) t
SELECT
t.standId,
t.standType,
t.standSort,
t.standNumber,
t.standName
FROM (
SELECT
sar_standards_info.id AS standId,
sar_standards_info.STAND_TYPE AS standType,
sar_standards_info.STAND_SORT AS standSort,
sar_standards_info.STAND_NUMBER AS standNumber,
sar_standards_info.STAND_NAME AS standName
FROM
sar_standards_info
LEFT JOIN SAR_STAND_ATTR_INFO ON (
SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id
AND SAR_STAND_ATTR_INFO.valid_flag = 0
)
WHERE sar_standards_info.valid_flag = 0
<if test="vppsCode != null and vppsCode != ''">
and (SAR_STAND_ATTR_INFO.KCCVPPSBM like concat('%',#{vppsCode},'%') or SAR_STAND_ATTR_INFO.CYCVPPSBM like
concat('%',#{vppsCode},'%'))
</if>
<if test="vppsName != null and vppsName != ''">
and (SAR_STAND_ATTR_INFO.KCCVPPSCN like concat('%',#{vppsName},'%') or SAR_STAND_ATTR_INFO.CYCVPPSCN like
concat('%',#{vppsName},'%'))
</if>
UNION
SELECT
sar_bussioness_stand.id AS standId,
'BUSINESS_STAND' AS standType,
sar_bussioness_stand.STAND_SORT AS standSort,
sar_bussioness_stand.STAND_NUMBER AS standNumber,
sar_bussioness_stand.STAND_NAME AS standName
FROM
sar_bussioness_stand
LEFT JOIN sar_buss_stand_attr_info ON (
sar_buss_stand_attr_info.stand_id = sar_bussioness_stand.id
AND sar_buss_stand_attr_info.valid_flag = 0
)
WHERE sar_bussioness_stand.valid_flag = 0
<if test="vppsCode != null and vppsCode != ''">
and (sar_buss_stand_attr_info.KCVPPSBMBUSS like concat('%',#{vppsCode},'%') or
sar_buss_stand_attr_info.CYCVPPSBMBUSS like concat('%',#{vppsCode},'%'))
</if>
<if test="vppsName != null and vppsName != ''">
and (sar_buss_stand_attr_info.KCVPPSCNBUSS like concat('%',#{vppsName},'%') or
sar_buss_stand_attr_info.CYCVPPSCNBUSS like concat('%',#{vppsName},'%'))
</if>
) t
</select>
<select id="searchStandDataThree" resultMap="BaseResultMap">
SELECT
t.standId,
t.standType
FROM (
SELECT
sar_standards_info.id AS standId,
sar_standards_info.STAND_TYPE AS standType
FROM
sar_standards_info
LEFT JOIN SAR_STAND_ATTR_INFO ON (
SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id
AND SAR_STAND_ATTR_INFO.valid_flag = 0
)
WHERE sar_standards_info.valid_flag = 0
<if test="vppsCode != null and vppsCode != ''">
and (SAR_STAND_ATTR_INFO.KCCVPPSBM like concat('%',#{vppsCode},'%') or SAR_STAND_ATTR_INFO.CYCVPPSBM like
concat('%',#{vppsCode},'%'))
</if>
<if test="vppsName != null and vppsName != ''">
and (SAR_STAND_ATTR_INFO.KCCVPPSCN like concat('%',#{vppsName},'%') or SAR_STAND_ATTR_INFO.CYCVPPSCN like
concat('%',#{vppsName},'%'))
</if>
<if test="standCode != null and standCode != ''">
and (
(trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{standCode}),'%'),' ','')) and
SAR_STANDARDS_INFO.STAND_YEAR != '')
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like
trim(replace(concat(concat('%',#{standCode}),'%'),' ',''))))
</if>
UNION
SELECT
sar_bussioness_stand.id AS standId,
'BUSINESS_STAND' AS standType
FROM
sar_bussioness_stand
LEFT JOIN sar_buss_stand_attr_info ON (
sar_buss_stand_attr_info.stand_id = sar_bussioness_stand.id
AND sar_buss_stand_attr_info.valid_flag = 0
)
WHERE sar_bussioness_stand.valid_flag = 0
<if test="vppsCode != null and vppsCode != ''">
and (sar_buss_stand_attr_info.KCVPPSBMBUSS like concat('%',#{vppsCode},'%') or
sar_buss_stand_attr_info.CYCVPPSBMBUSS like concat('%',#{vppsCode},'%'))
</if>
<if test="vppsName != null and vppsName != ''">
and (sar_buss_stand_attr_info.KCVPPSCNBUSS like concat('%',#{vppsName},'%') or
sar_buss_stand_attr_info.CYCVPPSCNBUSS like concat('%',#{vppsName},'%'))
</if>
<if test="standCode != null" >
and (SAR_BUSSIONESS_STAND.STAND_CODE = #{standCode}
or REPLACE( SAR_BUSSIONESS_STAND.STAND_CODE,' ','') = REPLACE( #{standCode},' ',''))
</if>
UNION
SELECT
SAR_LAWS_STAND_INFO.id AS standId,
'LAWS_TYPE' AS standType
FROM
SAR_LAWS_STAND_INFO
LEFT JOIN sar_laws_attr_info ON (
sar_laws_attr_info.LAWS_ID = SAR_LAWS_STAND_INFO.id
AND sar_laws_attr_info.valid_flag = 0
)
WHERE SAR_LAWS_STAND_INFO.valid_flag = 0
<if test="standCode != null and standCode != ''">
and SAR_LAWS_STAND_INFO.LAWS_NUMBER = #{standCode}
</if>
) t
</select>
</mapper>
@@ -668,13 +668,13 @@
<!--<if test="validFlag != null" >-->
<!--and SAR_BUSSIONESS_STAND.valid_flag = #{validFlag}-->
<!--</if>-->
<!--&lt;!&ndash; 导出数据过程中,选择的id &ndash;&gt;-->
<!--<if test="idlist != null" >-->
<!--and SAR_BUSSIONESS_STAND.id in-->
<!--<foreach collection="idlist" index="index" item="item" open="(" separator="," close=")">-->
<!--#{item}-->
<!--</foreach>-->
<!--</if>-->
<!-- 导出数据过程中,选择的id -->
<if test="idlist != null" >
and SAR_BUSSIONESS_STAND.id in
<foreach collection="idlist" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!--<if test="id != null and id != '' " >-->
<!--and SAR_BUSSIONESS_STAND.id = #{id}-->
<!--</if>-->