|
|
@ -33,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<result property="facilityName" column="facility_name" /> |
|
|
|
<result property="eventState" column="event_state" /> |
|
|
|
<result property="logId" column="log_id" /> |
|
|
|
<result property="voiceId" column="voice_id" /> |
|
|
|
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="selectDcPublishManageVo"> |
|
|
@ -62,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<select id="selectDcPublishManageList" parameterType="DcPublishManage" resultMap="DcPublishManageResult"> |
|
|
|
<include refid="selectDcPublishManageVo"/> |
|
|
|
<where> |
|
|
|
manage.event_id is not null |
|
|
|
<if test="eventState != null"> and event.event_state = #{eventState}</if> |
|
|
|
<if test="eventType != null and eventType != ''"> and event.event_type = #{eventType}</if> |
|
|
|
<if test="publishStatus != null and publishStatus != '' "> and manage.publish_status = #{publishStatus}</if> |
|
|
@ -103,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertDcPublishManage" parameterType="DcPublishManage" useGeneratedKeys="true" keyProperty="id"> |
|
|
|
insert into dc_publish_manage |
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
@ -126,7 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="updateTime != null">update_time,</if> |
|
|
|
<if test="createTime != null">create_time,</if> |
|
|
|
<if test="logId != null">log_id,</if> |
|
|
|
<if test="voiceId != null">voice_id,</if> |
|
|
|
|
|
|
|
</trim> |
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
|
<if test="eventId != null and eventId != ''">#{eventId},</if> |
|
|
@ -149,7 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="updateTime != null">#{updateTime},</if> |
|
|
|
<if test="createTime != null">#{createTime},</if> |
|
|
|
<if test="logId != null">#{logId},</if> |
|
|
|
<if test="voiceId != null">#{voiceId},</if> |
|
|
|
|
|
|
|
</trim> |
|
|
|
</insert> |
|
|
|
|
|
|
@ -176,7 +178,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if> |
|
|
|
<if test="createTime != null">create_time = #{createTime},</if> |
|
|
|
<if test="logId != null">log_id = #{logId},</if> |
|
|
|
<if test="voiceId != null">voice_id = #{voiceId},</if> |
|
|
|
</trim> |
|
|
|
where id = #{id} |
|
|
|
</update> |
|
|
@ -191,4 +192,60 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
#{id} |
|
|
|
</foreach> |
|
|
|
</delete> |
|
|
|
<select id="statisticsPublishManage" resultType="java.util.HashMap"> |
|
|
|
SELECT |
|
|
|
p.publish_channels publishChannels, |
|
|
|
COALESCE(SUM(CASE WHEN m.publish_channels = p.publish_channels THEN 1 ELSE 0 END), 0) AS number |
|
|
|
FROM ( |
|
|
|
SELECT 1 AS publish_channels UNION ALL |
|
|
|
SELECT 2 AS publish_channels UNION ALL |
|
|
|
SELECT 3 AS publish_channels UNION ALL |
|
|
|
SELECT 4 AS publish_channels UNION ALL |
|
|
|
SELECT 5 AS publish_channels UNION ALL |
|
|
|
SELECT 6 UNION ALL |
|
|
|
SELECT 7 |
|
|
|
) AS p |
|
|
|
LEFT JOIN dc_publish_manage AS m ON p.publish_channels = m.publish_channels |
|
|
|
AND DATE(m.publish_time) = CURDATE() |
|
|
|
GROUP BY p.publish_channels |
|
|
|
ORDER BY p.publish_channels; |
|
|
|
</select> |
|
|
|
<select id="eventTypePublishManage" resultType="java.util.HashMap"> |
|
|
|
SELECT event.event_type AS eventType, COUNT(manage.event_id) AS number |
|
|
|
FROM dc_event AS event |
|
|
|
LEFT JOIN dc_publish_manage AS manage ON event.id = manage.event_id AND DATE(manage.publish_time) = CURDATE() |
|
|
|
GROUP BY event.event_type |
|
|
|
ORDER BY event.event_type; |
|
|
|
</select> |
|
|
|
<select id="releaseTrendsPublishManage" 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 DATE(publish_time) = CURDATE() |
|
|
|
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> |
|
|
|
</mapper> |