Browse Source

财务统计财务调用修改

anderx 2 years ago
parent
commit
bd6d2f0266

+ 9 - 17
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -1405,23 +1405,15 @@
       select x.aid,x.orderCount,x.expenseCount,x.invoiceCount,x.memberCount,x.paymentCount,b.counts publicCount,y.orderUnauditedCount,
              c.counts receivables,y.expenseUnauditedCount,y.invoiceUnauditedCount,y.memberUnauditedCount,y.paymentUnauditedCount
       from ( select a.aid,sum(a.order_count)orderCount ,sum(a.expense_count)expenseCount ,SUM(a.invoice_count) invoiceCount,
-                    sum(a.member_count) memberCount ,sum(a.payment_count)paymentCount
-             from finance_count a
-             where a.aid= #{aid} )x,
-           (select aid,sum(if(a.`type` in (0,1,2),1,0)) counts
-            from public_release a left join public_release_details b on a.id=b.prid
-
-            where a.status=2 and  a.aid= #{aid} )b ,
-           (SELECT c.finance_id aid,sum(a.money) counts
-            from new_order_dun a left join t_order_new b on a.order_no =b.order_no
-                                 left join department c on b.order_dep =c.id
-            where a.status =1   and b.delete_sign in (0,2,3)
-              and c.finance_id = #{aid} )c ,
-           (select a.aid,sum(a.order_unaudited_count)orderUnauditedCount ,sum(a.expense_unaudited_count)expenseUnauditedCount ,
-                   SUM(a.invoice_unaudited_count) invoiceUnauditedCount,sum(a.member_unaudited_count) memberUnauditedCount ,
-                   sum(a.payment_unaudited_count)paymentUnauditedCount
-            from finance_count a where a.aid= #{aid} and a.date_time BETWEEN #{startTime}  and #{endTime}
-            group by a.aid)y
+            sum(a.member_count) memberCount ,sum(a.payment_count)paymentCount from finance_count a where a.aid= #{aid} )x
+      left join(select aid,sum(if(a.`type` in (0,1,2),1,0)) counts from public_release a left join public_release_details b on a.id=b.prid
+          where a.status=2 and  a.aid= #{aid} )b  on x.aid=b.aid
+      left join (SELECT c.finance_id aid,sum(a.money) counts from new_order_dun a left join t_order_new b on a.order_no =b.order_no
+            left join department c on b.order_dep =c.id where a.status =1   and b.delete_sign in (0,2,3) and c.finance_id = #{aid} )c on x.aid=c.aid
+      left join (select a.aid,sum(a.order_unaudited_count)orderUnauditedCount , sum(a.expense_unaudited_count)expenseUnauditedCount ,
+            SUM(a.invoice_unaudited_count) invoiceUnauditedCount, sum(a.member_unaudited_count) memberUnauditedCount ,
+            sum(a.payment_unaudited_count)paymentUnauditedCount from finance_count a where a.aid= #{aid}
+            and a.date_time BETWEEN #{startTime}  and #{endTime} group by a.aid)y on x.aid=y.aid
     </select>
   <select id="financeCountRangeReceivables" resultType="java.math.BigDecimal">
     SELECT  ifnull(sum(a.money),0)  receivables

+ 5 - 5
src/main/resources/props/config_local.properties

@@ -1,12 +1,12 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
-#jdbc.url=jdbc\:mysql://localhost:3306/aft20221026?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql://localhost:3306/aft20221026?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.username=root
-#jdbc.password=123456
-jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 jdbc.username=root
-jdbc.password=aftdev
+jdbc.password=123456
+#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.username=root
+#jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.maxActive=20