Sfoglia il codice sorgente

销售钉盘—— 列表查询bug修改

zxa 3 anni fa
parent
commit
3fc4578ae7

+ 11 - 11
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/ManagerSaleValueMapper.xml

@@ -129,7 +129,7 @@
         SELECT IFNULL(sum(cost), 0.00)
         FROM application.bytedance_advertiser_report_hourly_dw
         WHERE stat_datetime >= DATE_FORMAT(#{startDay}, '%Y%m%d')
-        and stat_datetime < DATE_FORMAT(#{endDay}, '%Y%m%d')
+        and stat_datetime <= DATE_FORMAT(#{endDay}, '%Y%m%d')
         <if test="accountIds !=null and accountIds.size()>0">
             and account_id in
             <foreach collection="accountIds" item="id" separator=","
@@ -177,7 +177,7 @@
         FROM application.kuaishou_account_report_hourly_dw
         WHERE
         stat_date >= DATE_FORMAT(#{startDay}, '%Y%m%d')
-        and stat_date &lt; DATE_FORMAT(#{endDay}, '%Y%m%d')
+        and stat_date &lt;= DATE_FORMAT(#{endDay}, '%Y%m%d')
         <if test="accountIds !=null and accountIds.size()>0">
             and account_id in
             <foreach collection="accountIds" item="id" separator=","
@@ -459,7 +459,7 @@
         <if test="accountIds !=null and accountIds.size()>0">
             and t1.project_id in
             (
-            SELECT project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
+            SELECT distinct project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
             <foreach collection="accountIds" item="id" separator=","
                      open="(" close=")">
                 #{id}
@@ -479,7 +479,7 @@
         <if test="accountIds !=null and accountIds.size()>0">
             and t1.project_id in
             (
-            SELECT project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
+            SELECT distinct project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
             <foreach collection="accountIds" item="id" separator=","
                      open="(" close=")">
                 #{id}
@@ -513,7 +513,7 @@
         <if test="accountIds !=null and accountIds.size()>0">
             and project_id in
             (
-            SELECT project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
+            SELECT distinct project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
             <foreach collection="accountIds" item="id" separator=","
                      open="(" close=")">
                 #{id}
@@ -528,7 +528,7 @@
         <if test="accountIds !=null and accountIds.size()>0">
             and project_id in
             (
-            SELECT project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
+            SELECT distinct project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
             <foreach collection="accountIds" item="id" separator=","
                      open="(" close=")">
                 #{id}
@@ -539,11 +539,11 @@
         AND stat_date &lt;= DATE_FORMAT(DATE_ADD(#{endTime}, INTERVAL - ${days} DAY ), '%Y%m%d' )
         GROUP BY project_id ) t3 ON
         t1.project_id = t3.project_id
-        WHERE  hour &lt;= #{hour}
+        WHERE hour &lt;= #{hour}
         <if test="accountIds !=null and accountIds.size()>0">
             and t1.project_id in
             (
-            SELECT project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
+            SELECT distinct project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
             <foreach collection="accountIds" item="id" separator=","
                      open="(" close=")">
                 #{id}
@@ -579,7 +579,7 @@
         <if test="accountIds !=null and accountIds.size()>0">
             and project_id in
             (
-            SELECT project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
+            SELECT distinct project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
             <foreach collection="accountIds" item="id" separator=","
                      open="(" close=")">
                 #{id}
@@ -595,7 +595,7 @@
         <if test="accountIds !=null and accountIds.size()>0">
             and project_id in
             (
-            SELECT project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
+            SELECT distinct project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
             <foreach collection="accountIds" item="id" separator=","
                      open="(" close=")">
                 #{id}
@@ -610,7 +610,7 @@
         <if test="accountIds !=null and accountIds.size()>0">
             and t1.project_id in
             (
-            SELECT project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
+            SELECT distinct project_id FROM `jeecg-boot`.ctop_user_allocation WHERE account_id in
             <foreach collection="accountIds" item="id" separator=","
                      open="(" close=")">
                 #{id}