Browse Source

发布渠道横坐标更换

develop
wangsixiang 6 months ago
parent
commit
eac584bb94
  1. 34
      zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml

34
zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml

@ -272,30 +272,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY h.hour, pc.publish_channels; ORDER BY h.hour, pc.publish_channels;
</select> </select>
<select id="monthTrendsPublishManage" resultType="java.util.HashMap"> <select id="monthTrendsPublishManage" resultType="java.util.HashMap">
SELECT h.hour, pc.publish_channels publishChannels, COALESCE(m.number, 0) AS number SELECT
FROM ( DATE_FORMAT(pm.publish_time, '%Y-%m-%d') AS publishTime,
SELECT 0 AS hour UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL pm.publish_channels AS publishChannels,
SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL COALESCE(COUNT(pm.publish_time), 0) AS number
SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL FROM dc_publish_manage AS pm
SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12 UNION ALL where YEAR(pm.publish_time) = YEAR(CURDATE())
SELECT 13 UNION ALL SELECT 14 UNION ALL SELECT 15 UNION ALL AND MONTH(pm.publish_time) = MONTH(#{publishTime})
SELECT 16 UNION ALL SELECT 17 UNION ALL SELECT 18 UNION ALL AND pm.publish_time is not null
SELECT 19 UNION ALL SELECT 20 UNION ALL SELECT 21 UNION ALL GROUP BY publishTime, pm.publish_channels
SELECT 22 UNION ALL SELECT 23 ORDER BY publishTime
) AS h
CROSS JOIN (
SELECT 1 AS publish_channels UNION ALL
SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL
SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7
) AS pc
LEFT JOIN (
SELECT HOUR(publish_time) AS hour, publish_channels, COUNT(*) AS number
FROM dc_publish_manage
WHERE YEAR(publish_time) = YEAR(CURDATE())
AND MONTH(publish_time) = MONTH(#{publishTime})
GROUP BY HOUR(publish_time), publish_channels
) AS m ON h.hour = m.hour AND pc.publish_channels = m.publish_channels
ORDER BY h.hour, pc.publish_channels;
</select> </select>
<select id="eventTypePublishManageSum" resultType="java.util.HashMap"> <select id="eventTypePublishManageSum" resultType="java.util.HashMap">
SELECT h.eventType, SELECT h.eventType,

Loading…
Cancel
Save