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;
</select>
<select id="monthTrendsPublishManage" resultType="java.util.HashMap">
SELECT h.hour, pc.publish_channels publishChannels, COALESCE(m.number, 0) AS number
FROM (
SELECT 0 AS hour UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL
SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL
SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9 UNION ALL
SELECT 10 UNION ALL SELECT 11 UNION ALL SELECT 12 UNION ALL
SELECT 13 UNION ALL SELECT 14 UNION ALL SELECT 15 UNION ALL
SELECT 16 UNION ALL SELECT 17 UNION ALL SELECT 18 UNION ALL
SELECT 19 UNION ALL SELECT 20 UNION ALL SELECT 21 UNION ALL
SELECT 22 UNION ALL SELECT 23
) 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
DATE_FORMAT(pm.publish_time, '%Y-%m-%d') AS publishTime,
pm.publish_channels AS publishChannels,
COALESCE(COUNT(pm.publish_time), 0) AS number
FROM dc_publish_manage AS pm
where YEAR(pm.publish_time) = YEAR(CURDATE())
AND MONTH(pm.publish_time) = MONTH(#{publishTime})
AND pm.publish_time is not null
GROUP BY publishTime, pm.publish_channels
ORDER BY publishTime
</select>
<select id="eventTypePublishManageSum" resultType="java.util.HashMap">
SELECT h.eventType,

Loading…
Cancel
Save