退料问题修复

This commit is contained in:
hongchao 2025-09-18 14:55:39 +08:00
parent c2b63488af
commit 1ffe0cb288
1 changed files with 6 additions and 4 deletions

View File

@ -373,14 +373,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getNum" resultType="java.lang.Integer">
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
ma_type mt
LEFT JOIN slt_agreement_info sai ON mt.type_id = sai.type_id
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)
AND mt.type_id = #{typeId}
sai.agreement_id =#{agreementId}
AND mt.type_id = #{typeId}
</select>
<select id="selectBackApplyDetailsById" resultType="com.bonus.material.back.domain.BackApplyDetails">