退料问题修复
This commit is contained in:
parent
c2b63488af
commit
1ffe0cb288
|
|
@ -373,14 +373,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="getNum" resultType="java.lang.Integer">
|
<select id="getNum" resultType="java.lang.Integer">
|
||||||
SELECT
|
SELECT
|
||||||
SUM( CASE WHEN sai.agreement_id = #{agreementId} AND sai.STATUS = '0' THEN sai.num ELSE 0 END ) AS num
|
SUM( IF(sai.STATUS = '0',sai.num,0)) as num
|
||||||
|
|
||||||
FROM
|
FROM
|
||||||
ma_type mt
|
ma_type mt
|
||||||
LEFT JOIN slt_agreement_info sai ON mt.type_id = sai.type_id
|
LEFT JOIN slt_agreement_info sai ON mt.type_id = sai.type_id
|
||||||
WHERE
|
WHERE
|
||||||
EXISTS ( SELECT 1 FROM slt_agreement_info sai2 WHERE sai2.type_id = mt.type_id AND sai2.agreement_id = #{agreementId}
|
|
||||||
AND sai2.STATUS = '0' and IFNULL(sai.lease_type,0) = 0 and sai2.num > 0)
|
sai.agreement_id =#{agreementId}
|
||||||
AND mt.type_id = #{typeId}
|
|
||||||
|
AND mt.type_id = #{typeId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectBackApplyDetailsById" resultType="com.bonus.material.back.domain.BackApplyDetails">
|
<select id="selectBackApplyDetailsById" resultType="com.bonus.material.back.domain.BackApplyDetails">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue