|
@@ -229,8 +229,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
d.user_id AS userId,
|
|
d.user_id AS userId,
|
|
|
d.status AS status,
|
|
d.status AS status,
|
|
|
d.exception_info AS exceptionInfo
|
|
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
|
|
|
|
|
|
|
+ FROM fs_im_msg_send_detail d
|
|
|
|
|
+ LEFT JOIN fs_im_msg_send_log l ON l.log_id = d.log_id
|
|
|
<where>
|
|
<where>
|
|
|
<if test="companyUserId != null"> AND l.company_user_id = #{companyUserId}</if>
|
|
<if test="companyUserId != null"> AND l.company_user_id = #{companyUserId}</if>
|
|
|
<if test="companyId != null"> AND l.company_id = #{companyId}</if>
|
|
<if test="companyId != null"> AND l.company_id = #{companyId}</if>
|
|
@@ -257,18 +257,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
<select id="getFsImMsgSendStatistics" resultType="com.fs.app.service.param.FsImMsgSendLogStatisticsResponse">
|
|
<select id="getFsImMsgSendStatistics" resultType="com.fs.app.service.param.FsImMsgSendLogStatisticsResponse">
|
|
|
SELECT
|
|
SELECT
|
|
|
- count(d.log_id) as total,
|
|
|
|
|
|
|
+ count(d.log_detail_id) as total,
|
|
|
sum(case when d.status = 0 then 1 else 0 end) as sent,
|
|
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.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
|
|
|
|
|
|
|
+ sum(case when d.status = 1 then 1 else 0 end) as failed
|
|
|
|
|
+ FROM fs_im_msg_send_detail d
|
|
|
|
|
+ LEFT JOIN fs_im_msg_send_log l 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="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>
|
|
|
|
|
+ </where>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|