暴力UNION 去重
This commit is contained in:
+49
@@ -122,6 +122,31 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</where>
|
</where>
|
||||||
|
|
||||||
|
UNION
|
||||||
|
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
|
||||||
|
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
|
||||||
|
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
|
||||||
|
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
|
||||||
|
a.ID = b.STAND_ID
|
||||||
|
left join sar_stand_items ssi on ssi.stand_id = a.id
|
||||||
|
<where>
|
||||||
|
<if test="standName != null">
|
||||||
|
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
|
||||||
|
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
|
||||||
|
and
|
||||||
|
</if>
|
||||||
|
<if test="fileType !=null">
|
||||||
|
ssi.FILE_TYPE = #{fileType} and
|
||||||
|
</if>
|
||||||
|
<if test="standType !=null">
|
||||||
|
a.STAND_TYPE = #{standType} and
|
||||||
|
</if>
|
||||||
|
a.ID IN
|
||||||
|
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
limit #{start},#{end}
|
limit #{start},#{end}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -149,6 +174,30 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</where>
|
</where>
|
||||||
|
UNION
|
||||||
|
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
|
||||||
|
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
|
||||||
|
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
|
||||||
|
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
|
||||||
|
a.ID = b.STAND_ID
|
||||||
|
left join sar_stand_items ssi on ssi.stand_id = a.id
|
||||||
|
<where>
|
||||||
|
<if test="standName != null">
|
||||||
|
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
|
||||||
|
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
|
||||||
|
and
|
||||||
|
</if>
|
||||||
|
<if test="fileType !=null">
|
||||||
|
ssi.FILE_TYPE = #{fileType} and
|
||||||
|
</if>
|
||||||
|
<if test="standType !=null">
|
||||||
|
a.STAND_TYPE = #{standType} and
|
||||||
|
</if>
|
||||||
|
a.ID IN
|
||||||
|
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectTimes" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandRegionalTimeDto">
|
<select id="selectTimes" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandRegionalTimeDto">
|
||||||
|
|||||||
Reference in New Issue
Block a user