浏览代码

fix: 修复统计客户已经付金额数据错误的问题

suntg 6 年之前
父节点
当前提交
7838d27a38
共有 1 个文件被更改,包括 7 次插入7 次删除
  1. 7 7
      src/main/java/com/uas/platform/b2b/model/util/ProdIoPayCountSqls.java

+ 7 - 7
src/main/java/com/uas/platform/b2b/model/util/ProdIoPayCountSqls.java

@@ -12,7 +12,7 @@ public class ProdIoPayCountSqls {
      * 货款调账付款记录
      */
     public static final String ADJUSTMENT_COUNT_SQL = "select sum(coalesce(aa_payment, 0)) as count, aa_currency as currency from purc$apbilladjustment" +
-        " where aa_enuu = ? and aa_custuu = ? and aa_date >= ? and aa_date < ? and coalesce(aa_payment, 0) > 0" +
+        " where aa_enuu = ? and aa_custuu = ? and aa_date >= ? and aa_date < ? and aa_payment is not null" +
         " group by aa_currency, aa_payment";
 
     /**
@@ -20,7 +20,7 @@ public class ProdIoPayCountSqls {
      */
     public static final String SALE_ACCEPT_COUNT_SQL = "select sum(coalesce(pai_payment, 0)) as count, pa_currency as currency" +
         " from purc$accept left join `purc$acceptitem` on pai_paid = pa_id " +
-        " where pa_venduu = ? and pa_enuu = ? and pa_date >= ? and pa_date < ? and coalesce(pai_payment, 0) > 0" +
+        " where pa_venduu = ? and pa_enuu = ? and pa_date >= ? and pa_date < ? and pai_payment is not null" +
         " group by pa_currency, pai_payment";
 
     /**
@@ -28,7 +28,7 @@ public class ProdIoPayCountSqls {
      */
     public static final String SALE_RETURN_COUNT_SQL = "select sum(coalesce(pri_payment, 0)) as count, pr_currency as currency " +
         " from `purc$return` left join `purc$returnitem` on pr_id = pri_prid " +
-        " where pr_venduu = ? and pr_enuu = ? and pr_date >= ? and pr_date < ? and coalesce(pri_payment, 0) > 0 " +
+        " where pr_venduu = ? and pr_enuu = ? and pr_date >= ? and pr_date < ? and pri_payment is not null " +
         " group by pr_currency,pri_payment";
 
     /**
@@ -37,7 +37,7 @@ public class ProdIoPayCountSqls {
     public static final String MAKE_ACCEPT_COUNT_SQL = "select sum(coalesce(mai_payment, 0)) as count, ma_currency as currency" +
         " from make$accept" +
         " join make$acceptitem on ma_id = mai_paid" +
-        " where ma_venduu = ? and ma_enuu = ? and mai_orderpice > 0 and ma_date >= ? and ma_date < ? and coalesce(mai_payment, 0) > 0" +
+        " where ma_venduu = ? and ma_enuu = ? and mai_orderpice > 0 and ma_date >= ? and ma_date < ? and mai_payment is not null" +
         " group by ma_currency,mai_payment";
 
     /**
@@ -46,7 +46,7 @@ public class ProdIoPayCountSqls {
     public static final String MAKE_RETURN_COUNT_SQL = "select sum(coalesce(mri_payment, 0)) as count, mr_currency as currency" +
         " from make$return" +
         " join make$returnitem on mr_id =  mri_paid" +
-        " where mr_venduu = ? and mr_enuu = ? and mri_orderpice > 0 and mr_date >= ? and mr_date < ? and coalesce(mri_payment, 0) > 0" +
+        " where mr_venduu = ? and mr_enuu = ? and mri_orderpice > 0 and mr_date >= ? and mr_date < ? and mri_payment is not null" +
         " group by mr_currency,mri_payment";
 
     /**
@@ -55,7 +55,7 @@ public class ProdIoPayCountSqls {
     public static final String SALE_BAD_IN_COUNT_SQL = "select sum(pbi_payment) as count, pb_currency as currency" +
         " from purc$badin" +
         " join purc$badinitem on pb_id = pbi_pbid" +
-        " where pb_venduu = ? and pb_enuu = ? and pb_date >= ? and pb_date < ? and coalesce(pbi_payment, 0) > 0" +
+        " where pb_venduu = ? and pb_enuu = ? and pb_date >= ? and pb_date < ? and pbi_payment is not null" +
         " group by pb_currency, pbi_payment";
 
     /**
@@ -64,6 +64,6 @@ public class ProdIoPayCountSqls {
     public static final String SALE_BAD_OUT_COUNT_SQL = "select sum(poi_payment) as count, po_currency as currency" +
         " from purc$badout" +
         " join purc$badoutitem on po_id = poi_poid" +
-        " where po_venduu = ? and po_enuu = ? and po_date >=? and po_date < ?" +
+        " where po_venduu = ? and po_enuu = ? and po_date >=? and po_date < ? and poi_payment is not null" +
         " group by poi_payment,po_currency";
 }