|
|
|
@ -7,5 +7,45 @@ |
|
|
|
SELECT site FROM AccessSite WHERE userID = #{userName} |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 快速查询物料总数(不需要复杂的JOIN,只查询Part表) --> |
|
|
|
<select id="queryPartCount" resultType="int"> |
|
|
|
SELECT COUNT(1) |
|
|
|
FROM Part A |
|
|
|
WHERE A.Site = #{site} |
|
|
|
<if test="partNo != null and partNo != ''"> |
|
|
|
AND A.PartNo LIKE '%' + #{partNo} + '%' |
|
|
|
</if> |
|
|
|
<if test="partDesc != null and partDesc != ''"> |
|
|
|
AND A.PartDescription LIKE '%' + #{partDesc} + '%' |
|
|
|
</if> |
|
|
|
<if test="spec != null and spec != ''"> |
|
|
|
AND A.Spec LIKE '%' + #{spec} + '%' |
|
|
|
</if> |
|
|
|
<if test="iqcExempt != null and iqcExempt != ''"> |
|
|
|
<choose> |
|
|
|
<when test="iqcExempt == '是'">AND A.iqc_exempt = 'Y'</when> |
|
|
|
<when test="iqcExempt == '否'">AND (A.iqc_exempt IS NULL OR A.iqc_exempt != 'Y')</when> |
|
|
|
</choose> |
|
|
|
</if> |
|
|
|
<if test="ipqcExempt != null and ipqcExempt != ''"> |
|
|
|
<choose> |
|
|
|
<when test="ipqcExempt == '是'">AND A.ipqc_exempt = 'Y'</when> |
|
|
|
<when test="ipqcExempt == '否'">AND (A.ipqc_exempt IS NULL OR A.ipqc_exempt != 'Y')</when> |
|
|
|
</choose> |
|
|
|
</if> |
|
|
|
<if test="fqcExempt != null and fqcExempt != ''"> |
|
|
|
<choose> |
|
|
|
<when test="fqcExempt == '是'">AND A.fqc_exempt = 'Y'</when> |
|
|
|
<when test="fqcExempt == '否'">AND (A.fqc_exempt IS NULL OR A.fqc_exempt != 'Y')</when> |
|
|
|
</choose> |
|
|
|
</if> |
|
|
|
<if test="oqcExempt != null and oqcExempt != ''"> |
|
|
|
<choose> |
|
|
|
<when test="oqcExempt == '是'">AND A.oqc_exempt = 'Y'</when> |
|
|
|
<when test="oqcExempt == '否'">AND (A.oqc_exempt IS NULL OR A.oqc_exempt != 'Y')</when> |
|
|
|
</choose> |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
</mapper> |
|
|
|
|