Browse Source

fix: 修复对账明细数据统计问题: 时间筛选精确范围更新

hejq 7 years ago
parent
commit
2bf0ded829

+ 5 - 5
src/main/java/com/uas/platform/b2b/model/util/ApCheckDoneCountSqls.java

@@ -20,7 +20,7 @@ public class ApCheckDoneCountSqls {
      * 当月货款调账未对账金额查询语句
      * 当月货款调账未对账金额查询语句
      */
      */
     public static final String THISMONTH_ADJUSTMENT_COUNT_SQL = "select coalesce(sum((coalesce(aa_ycheckqty, 0)) * aa_orderprice), 0) as count, aa_currency as currency \n" +
     public static final String THISMONTH_ADJUSTMENT_COUNT_SQL = "select coalesce(sum((coalesce(aa_ycheckqty, 0)) * aa_orderprice), 0) as count, aa_currency as currency \n" +
-        "from purc$apbilladjustment where coalesce(aa_thischeckqty, 0) <> 0 and aa_enuu = ? and aa_custuu = ? and aa_date between ? and ?" +
+        "from purc$apbilladjustment where coalesce(aa_thischeckqty, 0) <> 0 and aa_enuu = ? and aa_custuu = ? and aa_date >= ? and aa_date < ?" +
         "group by aa_currency";
         "group by aa_currency";
 
 
     /**
     /**
@@ -36,7 +36,7 @@ public class ApCheckDoneCountSqls {
      */
      */
     public static final String THISMONTH_SALE_ACCEPT_COUNT_SQL = "select coalesce(sum((coalesce(pai_ycheckqty, 0)) * pai_orderprice), 0) as count, pa_currency as currency \n" +
     public static final String THISMONTH_SALE_ACCEPT_COUNT_SQL = "select coalesce(sum((coalesce(pai_ycheckqty, 0)) * pai_orderprice), 0) as count, pa_currency as currency \n" +
         "from purc$accept left join `purc$acceptitem` on pai_paid = pa_id " +
         "from purc$accept left join `purc$acceptitem` on pai_paid = pa_id " +
-        "where pa_venduu = ? and pa_enuu = ? and pai_orderprice <> 0 and pa_date between ? and ? " +
+        "where pa_venduu = ? and pa_enuu = ? and pai_orderprice <> 0 and pa_date >= ? and pa_date < ? " +
         "group by pa_currency";
         "group by pa_currency";
 
 
     /**
     /**
@@ -51,7 +51,7 @@ public class ApCheckDoneCountSqls {
      */
      */
     public static final String THISMONTH_SALE_RETURN_COUNT_SQL = "select sum(coalesce(pri_ycheckqty, 0) *  pri_orderprice) as count, pr_currency as currency \n" +
     public static final String THISMONTH_SALE_RETURN_COUNT_SQL = "select sum(coalesce(pri_ycheckqty, 0) *  pri_orderprice) as count, pr_currency as currency \n" +
         "from `purc$return` left join `purc$returnitem` on pr_id = pri_prid " +
         "from `purc$return` left join `purc$returnitem` on pr_id = pri_prid " +
-        "where pr_venduu = ? and pr_enuu = ? and pr_date between ? and ? group by pr_currency";
+        "where pr_venduu = ? and pr_enuu = ? and pr_date >= ? and pr_date < ? group by pr_currency";
 
 
     /**
     /**
      * 客户委外验收单未对账金额查询语句
      * 客户委外验收单未对账金额查询语句
@@ -67,7 +67,7 @@ public class ApCheckDoneCountSqls {
     public static final String THISMONTH_MAKE_ACCEPT_COUNT_SQL = "select coalesce(sum(coalesce(mai_ycheckqty, 0) * mai_orderpice), 0) as count, ma_currency as currency " +
     public static final String THISMONTH_MAKE_ACCEPT_COUNT_SQL = "select coalesce(sum(coalesce(mai_ycheckqty, 0) * mai_orderpice), 0) as count, ma_currency as currency " +
         " from make$accept " +
         " from make$accept " +
         "join make$acceptitem on ma_id = mai_paid " +
         "join make$acceptitem on ma_id = mai_paid " +
-        "where ma_venduu = ? and ma_enuu = ? and mai_orderpice > 0 and ma_date between ? and ? group by ma_currency";
+        "where ma_venduu = ? and ma_enuu = ? and mai_orderpice > 0 and ma_date >= ? and ma_date < ? group by ma_currency";
 
 
     /**
     /**
      * 客户委外验退单未对账金额查询语句
      * 客户委外验退单未对账金额查询语句
@@ -83,6 +83,6 @@ public class ApCheckDoneCountSqls {
     public static final String THISMONTH_MAKE_RETURN_COUNT_SQL = "select coalesce(sum(coalesce(mri_ycheckqty, 0) * mri_orderpice), 0) as count, mr_currency as currency " +
     public static final String THISMONTH_MAKE_RETURN_COUNT_SQL = "select coalesce(sum(coalesce(mri_ycheckqty, 0) * mri_orderpice), 0) as count, mr_currency as currency " +
         " from make$return " +
         " from make$return " +
         "join make$returnitem on mr_id =  mri_paid " +
         "join make$returnitem on mr_id =  mri_paid " +
-        "where mr_venduu = ? and mr_enuu = ? and mri_orderpice > 0 and mr_date between ? and ? " +
+        "where mr_venduu = ? and mr_enuu = ? and mri_orderpice > 0 and mr_date >= ? and mr_date < ? " +
         "group by mr_currency";
         "group by mr_currency";
 }
 }

+ 5 - 5
src/main/java/com/uas/platform/b2b/model/util/ApCheckTodoCountSqls.java

@@ -20,7 +20,7 @@ public class ApCheckTodoCountSqls {
      * 当月货款调账未对账金额查询语句
      * 当月货款调账未对账金额查询语句
      */
      */
     public static final String THISMONTH_ADJUSTMENT_COUNT_SQL = "select coalesce(sum((aa_qty - coalesce(aa_ycheckqty, 0)) * aa_orderprice), 0) as count, aa_currency as currency \n" +
     public static final String THISMONTH_ADJUSTMENT_COUNT_SQL = "select coalesce(sum((aa_qty - coalesce(aa_ycheckqty, 0)) * aa_orderprice), 0) as count, aa_currency as currency \n" +
-        "from purc$apbilladjustment where aa_enuu = ? and aa_custuu = ? and aa_date between ? and ? and coalesce(aa_thischeckqty, 0) <> 0 " +
+        "from purc$apbilladjustment where aa_enuu = ? and aa_custuu = ? and aa_date >= ? and aa_date < ? and coalesce(aa_thischeckqty, 0) <> 0 " +
         "group by aa_currency";
         "group by aa_currency";
 
 
     /**
     /**
@@ -36,7 +36,7 @@ public class ApCheckTodoCountSqls {
      */
      */
     public static final String THISMONTH_SALE_ACCEPT_COUNT_SQL = "select coalesce(sum((pai_qty - coalesce(pai_ycheckqty, 0)) * pai_orderprice), 0) as count, pa_currency as currency \n" +
     public static final String THISMONTH_SALE_ACCEPT_COUNT_SQL = "select coalesce(sum((pai_qty - coalesce(pai_ycheckqty, 0)) * pai_orderprice), 0) as count, pa_currency as currency \n" +
         "from purc$accept left join `purc$acceptitem` on pai_paid = pa_id " +
         "from purc$accept left join `purc$acceptitem` on pai_paid = pa_id " +
-        "where pa_venduu = ? and pa_enuu = ? and pai_qty > coalesce(pai_ycheckqty, 0) and pai_orderprice <> 0 and pa_date between ? and ? " +
+        "where pa_venduu = ? and pa_enuu = ? and pai_qty > coalesce(pai_ycheckqty, 0) and pai_orderprice <> 0 and pa_date >= ? and pa_date < ? " +
         "group by pa_currency";
         "group by pa_currency";
 
 
     /**
     /**
@@ -51,7 +51,7 @@ public class ApCheckTodoCountSqls {
      */
      */
     public static final String THISMONTH_SALE_RETURN_COUNT_SQL = "select sum(((-(1) * pri_qty ) - coalesce(pri_ycheckqty, 0)) *  pri_orderprice) as count, pr_currency as currency \n" +
     public static final String THISMONTH_SALE_RETURN_COUNT_SQL = "select sum(((-(1) * pri_qty ) - coalesce(pri_ycheckqty, 0)) *  pri_orderprice) as count, pr_currency as currency \n" +
         "from `purc$return` left join `purc$returnitem` on pr_id = pri_prid " +
         "from `purc$return` left join `purc$returnitem` on pr_id = pri_prid " +
-        "where pr_venduu = ? and pr_enuu = ? and pr_date between ? and ? and pri_qty > abs(coalesce(pri_ycheckqty, 0)) group by pr_currency";
+        "where pr_venduu = ? and pr_enuu = ? and pr_date >= ? and pr_date < ? and pri_qty > abs(coalesce(pri_ycheckqty, 0)) group by pr_currency";
 
 
     /**
     /**
      * 客户委外验收单未对账金额查询语句
      * 客户委外验收单未对账金额查询语句
@@ -67,7 +67,7 @@ public class ApCheckTodoCountSqls {
     public static final String THISMONTH_MAKE_ACCEPT_COUNT_SQL = "select coalesce(sum((mai_qty - coalesce(mai_ycheckqty, 0)) * mai_orderpice), 0) as count, ma_currency as currency " +
     public static final String THISMONTH_MAKE_ACCEPT_COUNT_SQL = "select coalesce(sum((mai_qty - coalesce(mai_ycheckqty, 0)) * mai_orderpice), 0) as count, ma_currency as currency " +
         " from make$accept " +
         " from make$accept " +
         "join make$acceptitem on ma_id = mai_paid " +
         "join make$acceptitem on ma_id = mai_paid " +
-        "where ma_venduu = ? and ma_enuu = ? and mai_orderpice > 0 and ma_date between ? and ? and mai_qty > coalesce(mai_ycheckqty, 0) group by ma_currency";
+        "where ma_venduu = ? and ma_enuu = ? and mai_orderpice > 0 and ma_date >= ? and ma_date < ? and mai_qty > coalesce(mai_ycheckqty, 0) group by ma_currency";
 
 
     /**
     /**
      * 客户委外验退单未对账金额查询语句
      * 客户委外验退单未对账金额查询语句
@@ -83,6 +83,6 @@ public class ApCheckTodoCountSqls {
     public static final String THISMONTH_MAKE_RETURN_COUNT_SQL = "select coalesce(sum(((-(1) *  mri_qty ) - coalesce(mri_ycheckqty, 0)) * mri_orderpice), 0) as count, mr_currency as currency " +
     public static final String THISMONTH_MAKE_RETURN_COUNT_SQL = "select coalesce(sum(((-(1) *  mri_qty ) - coalesce(mri_ycheckqty, 0)) * mri_orderpice), 0) as count, mr_currency as currency " +
         " from make$return " +
         " from make$return " +
         "join make$returnitem on mr_id =  mri_paid " +
         "join make$returnitem on mr_id =  mri_paid " +
-        "where mr_venduu = ? and mr_enuu = ? and mri_orderpice > 0 and mr_date between ? and ? and mri_qty > abs(coalesce(mri_ycheckqty, 0)) " +
+        "where mr_venduu = ? and mr_enuu = ? and mri_orderpice > 0 and mr_date >= ? and mr_date < ? and mri_qty > abs(coalesce(mri_ycheckqty, 0)) " +
         "group by mr_currency";
         "group by mr_currency";
 }
 }