Procházet zdrojové kódy

新上监控提交

zhouzeyu@c-top.com.cn před 3 roky
rodič
revize
9880520a7e

+ 20 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/NewMonitorMapper.xml

@@ -147,7 +147,16 @@
     </select>
 
     <select id="getKuaiShouGroupMessageGroup" resultType="com.alibaba.fastjson.JSONObject" >
-    SELECT DATE_FORMAT(t.create_time,'%Y-%m-%d') as 'statDate',COUNT(t.effective) as 'new',COUNT(IF(t.effective ='1', TRUE, NULL))  as 'valid' from ctop_new_monitor_group t
+    SELECT
+        <choose>
+            <when test='group=="1"'>
+                DATE_FORMAT(t.create_time,'%Y-%m') as 'statDate',
+            </when>
+            <otherwise>
+                DATE_FORMAT(t.create_time,'%Y-%m-%d') as 'statDate',
+            </otherwise>
+        </choose>
+     COUNT(t.effective) as 'new',COUNT(IF(t.effective ='1', TRUE, NULL))  as 'valid' from ctop_new_monitor_group t
      where  (create_time between #{startDate}  and #{endDate}) and t.account_id in
         <foreach item="item" collection="array" separator="," open="(" close=")" index="">
             #{item}
@@ -164,7 +173,16 @@
     </select>
 
     <select id="getPlanMessageGroup" resultType="com.alibaba.fastjson.JSONObject" >
-        SELECT DATE_FORMAT(t.create_time,'%Y-%m-%d') as 'statDate',COUNT(t.effective) as 'new',COUNT(IF(t.effective ='1', TRUE, NULL))  as 'valid' from ctop_new_monitor_campaign t
+        SELECT
+        <choose>
+            <when test='group=="1"'>
+                DATE_FORMAT(t.create_time,'%Y-%m') as 'statDate',
+            </when>
+            <otherwise>
+                DATE_FORMAT(t.create_time,'%Y-%m-%d') as 'statDate',
+            </otherwise>
+        </choose>
+        COUNT(t.effective) as 'new',COUNT(IF(t.effective ='1', TRUE, NULL))  as 'valid' from ctop_new_monitor_campaign t
         where project_type=#{project} and  (create_time between #{startDate}  and #{endDate}) and t.account_id in
         <foreach item="item" collection="array" separator="," open="(" close=")" index="">
             #{item}