Browse Source

2022年11月25 19:55

wangzhuo 3 years ago
parent
commit
283a9fb3cd

+ 2 - 8
blade-service/trade-finance/src/main/java/org/springblade/finance/mapper/AccMapper.xml

@@ -104,19 +104,13 @@
 
 
     <select id="SumBillBalance" resultType="java.util.Map">
     <select id="SumBillBalance" resultType="java.util.Map">
         SELECT
         SELECT
-            SUM(CASE WHEN bill_type = '收费' THEN Amount ELSE 0 END) AS ysAmount,
-            SUM(CASE WHEN bill_type = '申请' THEN Amount ELSE 0 END) AS yfAmount
+            IFNULL( ROUND( SUM(CASE WHEN bill_type = '收费' THEN Amount - Settlement_Amount ELSE 0 END) / 10000, 2), 0) AS ysAmount,
+            IFNULL( ROUND( SUM(CASE WHEN bill_type = '申请' THEN Amount - Settlement_Amount ELSE 0 END) / 10000, 2), 0) AS yfAmount
         FROM
         FROM
             finance_acc
             finance_acc
         <where>
         <where>
             is_deleted = 0
             is_deleted = 0
             and tenant_id = #{acc.tenantId}
             and tenant_id = #{acc.tenantId}
-            <if test='acc.createStartDate != null and acc.createStartDate != ""'>
-                and create_time &gt;= #{acc.createStartDate}
-            </if>
-            <if test='acc.createEndDate != null and acc.createEndDate != ""'>
-                and create_time &lt;= #{acc.createEndDate}
-            </if>
         </where>
         </where>
     </select>
     </select>