Browse Source

装箱下拉BUG修护

caozj 2 years ago
parent
commit
4e0e8112ba
1 changed files with 12 additions and 5 deletions
  1. 12 5
      hx-sale/src/main/resources/mapper/contract/ContractMapper.xml

+ 12 - 5
hx-sale/src/main/resources/mapper/contract/ContractMapper.xml

@@ -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 &lt; t1.cpQuantity
-        AND t1.`status` &gt;=30 &lt;999
+        AND t1.`status` &gt;=30
+        AND t1.`status` &lt;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 &lt; t1.cpQuantity
           AND t1.id = #{contractId}