|
|
@@ -207,6 +207,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
#{logDetailId}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
+ <select id="selectFsImMsgSendLogInfoList" resultType="com.fs.app.service.param.FsImMsgSendLogResponse">
|
|
|
+ SELECT
|
|
|
+ d.log_id AS logId,
|
|
|
+ l.company_user_id AS companyUserId,
|
|
|
+ l.company_id AS companyId,
|
|
|
+ l.course_id AS courseId,
|
|
|
+ l.course_name AS courseName,
|
|
|
+ l.video_id AS videoId,
|
|
|
+ l.video_name AS videoName,
|
|
|
+ l.project_id AS projectId,
|
|
|
+ l.send_title AS sendTitle,
|
|
|
+ l.plan_send_time AS planSendTime,
|
|
|
+ l.send_type AS sendType,
|
|
|
+ l.send_mode AS sendMode,
|
|
|
+ l.is_urge_course AS isUrgeCourse,
|
|
|
+ l.msg_type AS msgType,
|
|
|
+ l.send_status AS sendStatus,
|
|
|
+ l.count AS count,
|
|
|
+ l.create_time AS createTime,
|
|
|
+ d.user_id AS userId,
|
|
|
+ d.status AS status,
|
|
|
+ d.exception_info AS exceptionInfo
|
|
|
+ FROM fs_im_msg_send_log l
|
|
|
+ LEFT JOIN fs_im_msg_send_detail d ON l.log_id = d.log_id
|
|
|
+ <where>
|
|
|
+ <if test="companyUserId != null"> AND l.company_user_id = #{companyUserId}</if>
|
|
|
+ <if test="companyId != null"> AND l.company_id = #{companyId}</if>
|
|
|
+ <if test="courseId != null"> AND l.course_id = #{courseId}</if>
|
|
|
+ <if test="courseName != null and courseName != ''"> AND l.course_name like concat('%', #{courseName}, '%')</if>
|
|
|
+ <if test="videoId != null"> AND l.video_id = #{videoId}</if>
|
|
|
+ <if test="videoName != null and videoName != ''"> AND l.video_name like concat('%', #{videoName}, '%')</if>
|
|
|
+ <if test="sendTitle != null and sendTitle != ''"> AND l.send_title like concat('%', #{sendTitle}, '%')</if>
|
|
|
+ <if test="planSendStartTime != null and planSendEndTime != null">
|
|
|
+ AND l.plan_send_time between #{planSendStartTime} and #{planSendEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="sendType != null"> AND l.send_type = #{sendType}</if>
|
|
|
+ <if test="sendMode != null"> AND l.send_mode = #{sendMode}</if>
|
|
|
+ <if test="sendStatus != null"> AND l.send_status = #{sendStatus}</if>
|
|
|
+ <if test="msgType != null"> AND l.msg_type = #{msgType}</if>
|
|
|
+ <if test="projectId != null"> AND l.project_id = #{projectId}</if>
|
|
|
+ <if test="createTimeStartTime != null and createTimeEndTime != null">
|
|
|
+ AND d.create_time between #{createTimeStartTime} and #{createTimeEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="status != null"> AND d.status = #{status}</if>
|
|
|
+ </where>
|
|
|
+ ORDER BY l.create_time DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getFsImMsgSendStatistics" resultType="com.fs.app.service.param.FsImMsgSendLogStatisticsResponse">
|
|
|
+ SELECT
|
|
|
+ count(d.log_id) as total,
|
|
|
+ sum(case when d.status = 0 then 1 else 0 end) as sent,
|
|
|
+ sum(case when d.send_status = 2 then 1 else 0 end) as pending,
|
|
|
+ sum(case when d.status = 1 then 1 else 0 end) as failed,
|
|
|
+
|
|
|
+ COUNT(DISTINCT log.log_id) AS total,
|
|
|
+ COUNT(DISTINCT log.log_id) FILTER (WHERE log.send_status = 1) AS sent,
|
|
|
+ COUNT(DISTINCT log.log_id) FILTER (WHERE log.send_status = 2) AS pending,
|
|
|
+ COUNT(DISTINCT log.log_id) FILTER (WHERE log.send_status = 3) AS failed
|
|
|
+ FROM
|
|
|
+ FROM fs_im_msg_send_log l
|
|
|
+ LEFT JOIN fs_im_msg_send_detail d ON l.log_id = d.log_id
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
</mapper>
|