|
@@ -20,11 +20,15 @@
|
|
|
FROM
|
|
|
contract t1
|
|
|
LEFT JOIN contract_product t2 ON t1.id = t2.contract_id
|
|
|
- WHERE
|
|
|
- buy_corporation_id = #{customerId}
|
|
|
+ <where>
|
|
|
+ <if test="customerId neq null and customerId neq '' ">
|
|
|
+ buy_corporation_id = #{customerId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
) t1
|
|
|
WHERE t1.sumPackQuantity < t1.cpQuantity
|
|
|
- AND t1.`status` >=30 <999
|
|
|
+ AND t1.`status` >=30
|
|
|
+ AND t1.`status` <999
|
|
|
GROUP BY t1.id
|
|
|
</select>
|
|
|
|
|
@@ -41,8 +45,11 @@
|
|
|
FROM
|
|
|
contract t1
|
|
|
LEFT JOIN contract_product t2 ON t1.id = t2.contract_id
|
|
|
- WHERE
|
|
|
- buy_corporation_id = #{customerId}
|
|
|
+ <where>
|
|
|
+ <if test="customerId neq null and customerId neq '' ">
|
|
|
+ buy_corporation_id = #{customerId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
) t1
|
|
|
WHERE t1.sumPackQuantity < t1.cpQuantity
|
|
|
AND t1.id = #{contractId}
|