浏览代码

盯盘-项目、账户维度数据修改

yangzian 3 年之前
父节点
当前提交
a404036ea8

+ 20 - 20
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/MaterialStareMapper.xml

@@ -202,25 +202,25 @@
         d.project_id AS projectId,
         d.project_name AS projectName,
         COUNT( DISTINCT d.user_id ) AS userNum,
-        SUM( d.activation ) AS activation,
+        IFNULL(SUM( d.activation ),0)  AS activation,
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.activation ), 2 ),0) AS activationPrice,
         IFNULL(CONCAT(ROUND(SUM( d.event_next_day_stay ) / SUM( d.activation ) * 100, 2 ),'%'),0) AS leave,
-        SUM( d.event_pay ) AS eventPay,
+        IFNULL(SUM( d.event_pay ),0)  AS eventPay,
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.event_pay ), 2 ),0) AS eventPayCost,
         IFNULL( CONCAT(ROUND( SUM( d.event_pay ) / ( SUM( d.activation ) + SUM( d.form_count )) * 100, 2 ),'%'),0) AS eventPayRate,
-        SUM( d.event_new_user_pay ) AS eventNewUserPay,
+        IFNULL(SUM( d.event_new_user_pay ),0)  AS eventNewUserPay,
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.event_new_user_pay ), 2 ),0) AS eventNewUserPayCost,
         IFNULL(CONCAT(ROUND( SUM( d.event_new_user_pay ) / ( SUM( d.activation ) + SUM( d.form_count )) * 100, 2 ),'%'),0) AS eventNewUserPayRate,
-        SUM( d.event_app_invoked ) AS eventAppInvoked,
+        IFNULL(SUM( d.event_app_invoked ),0)  AS eventAppInvoked,
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.event_app_invoked ), 2 ),0) AS eventAppInvokedCost,
-        SUM( d.event_register ) AS eventRegister,
+        IFNULL(SUM( d.event_register ),0)  AS eventRegister,
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.event_register ), 2 ),0) AS eventRegisterCost,
-        SUM( d.key_action ) AS keyAction,
+        IFNULL(SUM( d.key_action ),0)  AS keyAction,
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.key_action ), 2 ),0) AS keyActionCost,
         IFNULL(CONCAT( ROUND( SUM( d.charge )/ SUM( d.key_action )* 100, 2 ), '%' ),0) AS keyActionRate,
-        SUM( d.event_pay_purchase_amount_first_day ) AS eventPayPurchaseAmountFirstDay,
-        SUM( d.event_pay_first_day_roi ) AS eventPayFirstDayRoi,
-        SUM( d.form_count ) AS formCount,
+        IFNULL(SUM( d.event_pay_purchase_amount_first_day ),0)  AS eventPayPurchaseAmountFirstDay,
+        IFNULL(SUM( d.event_pay_first_day_roi ),0)  AS eventPayFirstDayRoi,
+        IFNULL(SUM( d.form_count ),0) AS formCount,
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.form_count ), 2 ),0) AS formCountPrice,
         IFNULL(m.newEffectNum,0) AS newEffectNum,
         IFNULL(m.newVideoNum,0) AS newVideoNum,
@@ -280,28 +280,28 @@
         d.project_name AS projectName,
         COUNT( DISTINCT d.user_id ) AS userNum,
         ( SELECT u.realname FROM `jeecg-boot`.sys_user u WHERE u.id = d.user_id ) AS userName,
-        SUM( d.activation ) AS activation,
+        IFNULL(SUM( d.activation ),0) AS activation,
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.activation ), 2 ),0) AS activationPrice,
         IFNULL(CONCAT(ROUND(SUM( d.event_next_day_stay ) / SUM( d.activation ) * 100, 2 ),'%'),0) AS leave,
-        SUM( d.event_pay ) AS eventPay,
+        IFNULL(SUM( d.event_pay ),0) AS eventPay,
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.event_pay ), 2 ),0) AS eventPayCost,
         IFNULL(CONCAT(ROUND( SUM( d.event_pay ) / ( SUM( d.activation ) + SUM( d.form_count )) * 100, 2 ),'%'),0) AS eventPayRate,
-        SUM( d.event_new_user_pay ) AS eventNewUserPay,
+        IFNULL(SUM( d.event_new_user_pay ),0) AS eventNewUserPay,
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.event_new_user_pay ), 2 ),0) AS eventNewUserPayCost,
         IFNULL(ROUND( SUM( d.event_new_user_pay ) / ( SUM( d.activation ) + SUM( d.form_count )), 2 ),0) AS eventNewUserPayRate,
-        SUM( d.event_app_invoked ) AS eventAppInvoked,
+        IFNULL(SUM( d.event_app_invoked ),0) AS eventAppInvoked,
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.event_app_invoked ), 2 ),0) AS eventAppInvokedCost,
-        SUM( d.event_register ) AS eventRegister,
+        IFNULL(SUM( d.event_register ),0) AS eventRegister,
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.event_register ), 2 ),0) AS eventRegisterCost,
-        SUM( d.key_action ) AS keyAction,
+        IFNULL(SUM( d.key_action ),0) AS keyAction,
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.key_action ), 2 ),0) AS keyActionCost,
         IFNULL(CONCAT( ROUND( SUM( d.charge )/ SUM( d.activation )* 100, 2 ), '%' ),0) AS keyActionRate,
-        SUM( d.event_pay_purchase_amount_first_day ) AS eventPayPurchaseAmountFirstDay,
-        SUM( d.event_pay_first_day_roi ) AS eventPayFirstDayRoi,
-        SUM( d.form_count ) AS formCount,
+        IFNULL(SUM( d.event_pay_purchase_amount_first_day ),0) AS eventPayPurchaseAmountFirstDay,
+        IFNULL(SUM( d.event_pay_first_day_roi ),0) AS eventPayFirstDayRoi,
+        IFNULL(SUM( d.form_count ),0) AS formCount,
         IFNULL(ROUND( SUM( d.charge ) / SUM( d.form_count ), 2 ),0) AS formCountPrice,
-        SUM(d.`show`) as photoShow,
-        SUM(d.photo_click) as photoClick,
+        IFNULL(SUM(d.`show`),0) as photoShow,
+        IFNULL(SUM(d.photo_click),0) as photoClick,
         IFNULL(m.newEffectNum,0) AS newEffectNum,
         IFNULL(m.newVideoNum,0) AS newVideoNum,
         IFNULL(m.newHotNum,0) AS newHotNum