浏览代码

BUG修护

caozj 2 年之前
父节点
当前提交
a26d5a5aad
共有 1 个文件被更改,包括 9 次插入8 次删除
  1. 9 8
      hx-sale/src/main/resources/mapper/contract/ContractProductMapper.xml

+ 9 - 8
hx-sale/src/main/resources/mapper/contract/ContractProductMapper.xml

@@ -33,17 +33,18 @@
 
     <select id="getNoPackContractProductById" resultType="com.fjhx.sale.entity.contract.vo.ContractProductVo">
         SELECT
-        *
+            *
         FROM
         (
         SELECT
-        t1.*,
-        t1.`code` AS contractCode,
-        t2.quantity AS cpQuantity,
-        t2.id AS contractProductId,
-        ( SELECT IFNULL( SUM( quantity ), 0 ) FROM pack_detail_product WHERE contract_product_id = t2.id ) AS sumPackQuantity
+            t2.*,
+            t1.id AS contractId,
+            t1.`code` AS contractCode,
+            t2.quantity AS cpQuantity,
+            t2.id AS contractProductId,
+            ( SELECT IFNULL( SUM( quantity ), 0 ) FROM pack_detail_product WHERE contract_product_id = t2.id ) AS sumPackQuantity
         FROM
-        contract t1
+            contract t1
         LEFT JOIN contract_product t2 ON t1.id = t2.contract_id
         <where>
             <if test="customerId neq null and customerId neq '' ">
@@ -53,7 +54,7 @@
         ) t1
         WHERE t1.sumPackQuantity &lt; t1.cpQuantity
         <if test="contractIds neq null and contractIds.size() > 0">
-            <foreach collection="contractIds" item="contractId" open="AND t1.id IN (" separator="," close=")">
+            <foreach collection="contractIds" item="contractId" open="AND contractId IN (" separator="," close=")">
                 #{contractId}
             </foreach>
         </if>