Sfoglia il codice sorgente

2、列表增加“已付款金额(CNY)”列;

caozj 1 anno fa
parent
commit
81d0f9b66d

+ 5 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/purchase/vo/PurchaseVo.java

@@ -44,4 +44,9 @@ public class PurchaseVo extends Purchase {
      * 其他费用列表
      */
     private List<PurchaseOtherFee> otherFeeList;
+
+    /**
+     * 已付款金额
+     */
+    private BigDecimal paySumAmount;
 }

+ 16 - 14
hx-purchase/src/main/resources/mapper/purchase/PurchaseDetailMapper.xml

@@ -60,20 +60,22 @@
         data_resource_id
     </select>
     <select id="getSumCountByDataResourceId" resultType="com.fjhx.purchase.entity.purchase.vo.PurchaseDetailVo">
-        SELECT
-            SUM(t1.count),
-            t1.data_resource_id
-        FROM
-            purchase_detail t1
-        LEFT JOIN purchase t2 ON t1.purchase_id = t2.id
-        WHERE
-        t2.purchase_status =10
-        <if test="dataResourceIds neq null and dataResourceIds.size() > 0">
-            <foreach collection="dataResourceIds" item="dataResourceId" open="AND t1.data_resource_id IN ("
-                     separator="," close=")">
-                #{dataResourceId}
-            </foreach>
-        </if>
+            SELECT
+                SUM(t1.count),
+                t1.data_resource_id
+            FROM
+                purchase_detail t1
+            LEFT JOIN purchase t2 ON t1.purchase_id = t2.id
+            WHERE
+            t2.purchase_status =10
+            <if test="dataResourceIds neq null and dataResourceIds.size() > 0">
+                <foreach collection="dataResourceIds" item="dataResourceId" open="AND t1.data_resource_id IN ("
+                         separator="," close=")">
+                    #{dataResourceId}
+                </foreach>
+            </if>
+            AND t2.data_resource_id IS NOT NULL
+            GROUP BY data_resource_id
     </select>
     <select id="getPurchaseDetailList" resultType="com.fjhx.purchase.entity.purchase.vo.PurchaseDetailVo">
         SELECT pd.*

+ 7 - 1
hx-purchase/src/main/resources/mapper/purchase/PurchaseMapper.xml

@@ -3,7 +3,13 @@
 <mapper namespace="com.fjhx.purchase.mapper.purchase.PurchaseMapper">
     <select id="getPage" resultType="com.fjhx.purchase.entity.purchase.vo.PurchaseVo">
         select
-            p.*
+            p.*,
+            (
+                select IFNULL(SUM(IFNULL(money,0)*IFNULL(rate,0)),0) from pay_detail t1
+                                                                              LEFT JOIN pay t2 ON t1.pay_id = t2.id
+                WHERE t2.`status`  &gt;= 30 AND t2.`status` &lt; 88
+                  AND t1.purchase_id = p.id
+            )AS paySumAmount
         from purchase p
             ${ew.customSqlSegment}
     </select>