Merge remote-tracking branch 'origin/develop_master' into develop_master

This commit is contained in:
yuezhihang
2022-07-21 17:04:20 +08:00
2 changed files with 75 additions and 22 deletions
@@ -94,7 +94,7 @@
where sar_bussioness_stand.TEXT_STATUS_BUSS = '9z741h2m3j' AND sar_bussioness_stand.ISSUE_TIME IS NOT NULL and sar_bussioness_stand.VALID_FLAG = '0'
<trim suffixOverrides="," >
<if test="standCode != null and standCode != '' " >
and STAND_CODE like concat(concat('%',#{standCode}),'%')
and (STAND_CODE like concat(concat('%',#{standCode}),'%') or STAND_NAME like concat(concat('%',#{standCode}),'%'))
</if>
<if test="reviewTimeStart != null and reviewTimeStart != '' and reviewTimeEnd != null and reviewTimeEnd != ''">
and DATE_FORMAT(sar_buss_stand_attr_info.FSRQBUSS, '%Y-%m-%d') between DATE_FORMAT(#{reviewTimeStart}, '%Y-%m-%d') AND DATE_FORMAT(#{reviewTimeEnd}, '%Y-%m-%d')
@@ -145,28 +145,81 @@
<select id="selectLawsId" resultType="string">
select stand_id from sar_laws_attr_detailed_list
LEFT JOIN sar_standards_info si ON sar_laws_attr_detailed_list.stand_id = si.ID
<where>
<if test="standId != null">
and detailed_list_id = #{standId}
</if>
<if test="sar.standSort != null">
and si.STAND_SORT = #{sar.standSort}
</if>
<if test="sar.standType != null">
and si.STAND_TYPE = #{sar.standType}
</if>
<if test="sar.standNumber != null">
and concat(concat(concat(concat(si.STAND_SORT,' '),si.STAND_NUMBER),'-'),si.STAND_YEAR) like concat(concat('%', #{sar.standNumber}),'%')
or si.STAND_NAME like concat(concat('%', #{sar.standNumber}),'%')
</if>
<if test="sar.standName != null">
and si.STAND_NAME like concat(concat('%', #{sar.standName}),'%')
</if>
SELECT A.stand_id FROM (
select stand_id,number from sar_laws_attr_detailed_list
LEFT JOIN sar_standards_info si ON sar_laws_attr_detailed_list.stand_id = si.ID
<where>
<if test="standId != null">
and detailed_list_id = #{standId}
</if>
<if test="sar.standSort != null">
and si.STAND_SORT = #{sar.standSort}
</if>
<if test="sar.standType != null">
and si.STAND_TYPE = #{sar.standType}
</if>
<if test="sar.standNumber != null">
and (
(trim(replace(concat(si.STAND_SORT,' ',si.STAND_NUMBER,'-',
si.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{sar.standNumber}),'%'),' ','')) and si.STAND_YEAR != '')
or (trim(replace(concat(si.STAND_SORT,' ',si.STAND_NUMBER),' ','')) like trim(replace(concat(concat('%',#{sar.standNumber}),'%'),' ',''))
)
<!-- and SAR_STANDARDS_INFO.STAND_YEAR = '' -->
or (stand_name like concat(concat('%',#{sar.standNumber}),'%')))
</if>
<if test="sar.standName != null">
and si.STAND_NAME like concat(concat('%', #{sar.standName}),'%')
</if>
</where>
order by number
</where>
UNION
select stand_id,number from sar_laws_attr_detailed_list
LEFT JOIN sar_bussioness_stand si ON sar_laws_attr_detailed_list.stand_id = si.ID
<where>
<if test="standId != null">
and detailed_list_id = #{standId}
</if>
<if test="sar.standSort != null">
and si.STAND_SORT = #{sar.standSort}
</if>
<if test="sar.standNumber != null">
and (si.STAND_CODE like concat('%', #{sar.standNumber}, '%')
or REPLACE( si.STAND_CODE,' ','') like REPLACE( concat('%', #{sar.standNumber}, '%'),' ',''))
</if>
<if test="sar.standName != null">
and si.STAND_NAME like concat(concat('%', #{sar.standName}),'%')
</if>
</where>
UNION
select stand_id,number from sar_laws_attr_detailed_list
LEFT JOIN sar_laws_stand_info si ON sar_laws_attr_detailed_list.stand_id = si.ID
LEFT JOIN TS_DICTYPE dicstandSort ON (
dicstandSort.dic_type_code = si.LAWS_TYPE
AND dicstandSort.dic_id IS NOT NULL
AND dicstandSort.valid_flag = 0
AND dicstandSort.PARENT_ID IS NULL
)
<where>
<if test="standId != null">
and detailed_list_id = #{standId}
</if>
<if test="sar.standSort != null">
and si.LAWS_TYPE = #{sar.standSort}
</if>
<if test="sar.standNumber != null">
and concat(concat(concat(concat(si.LAWS_TYPE,' '),si.LAWS_NUMBER),'-'),si.LAWS_YEAR) like concat(concat('%', #{sar.standNumber}),'%')
or si.LAWS_NAME like concat(concat('%', #{sar.standNumber}),'%')
or dicstandSort.DIC_TYPE_NAME like concat(concat('%', #{sar.standNumber}),'%')
</if>
<if test="sar.standName != null">
and si.LAWS_NAME like concat(concat('%', #{sar.standName}),'%')
</if>
</where>
) A
order by A.number
LIMIT #{param3} , #{param2};
</select>