不一致项 查询 加standType

This commit is contained in:
yanyizhou
2021-08-27 15:30:23 +08:00
committed by zhaokaiyao@91isoft.com
parent 3070ec5e59
commit 87f3c15a7b
5 changed files with 96 additions and 26 deletions
@@ -29,4 +29,50 @@
and a.stand_id = #{standId}
</if>
</select>
<select id="getSarStandUnqualifiedPage" resultType="com.adc.da.slrs.sarStandUnqualified.entity.SarStandUnqualified">
SELECT
sar_stand_unqualified.*, sar_standards_info.STAND_TYPE as standType
from
sar_stand_unqualified
left join sar_standards_info on sar_stand_unqualified.STAND_ID = sar_standards_info.id
WHERE
close_state = 1
<if test="sar.standId != null and sar.standId != '' ">
and STAND_ID = #{standId}
</if>
<if test="sar.productName != null and sar.productName != '' ">
and PRODUCT_NAME like concat(concat('%',#{sar.productName}),'%')
</if>
<if test="sar.responsibleUnit != null and sar.responsibleUnit != '' ">
and RESPONSIBLE_UNIT = #{sar.responsibleUnit}
</if>
<if test="sar.standSerialNumber != null and sar.standSerialNumber != '' ">
and STAND_SERIAL_NUMBER like concat(concat('%',#{sar.standSerialNumber}),'%')
</if>
limit #{start},#{end}
</select>
<select id="getSarStandUnqualifiedCount" resultType="java.lang.Integer">
SELECT
count(sar_stand_unqualified.ID)
from
sar_stand_unqualified
left join sar_standards_info on sar_stand_unqualified.STAND_ID = sar_standards_info.id
WHERE
close_state = 1
<if test="sar.standId != null and sar.standId != '' ">
and STAND_ID = #{standId}
</if>
<if test="sar.productName != null and sar.productName != '' ">
and PRODUCT_NAME like concat(concat('%',#{sar.productName}),'%')
</if>
<if test="sar.responsibleUnit != null and sar.responsibleUnit != '' ">
and RESPONSIBLE_UNIT = #{sar.responsibleUnit}
</if>
<if test="sar.standSerialNumber != null and sar.standSerialNumber != '' ">
and STAND_SERIAL_NUMBER like concat(concat('%',#{sar.standSerialNumber}),'%')
</if>
</select>
</mapper>