|
|
@@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="selectFsCourseWatchLogListVO" resultType="com.fs.course.vo.FsCourseWatchLogListVO">
|
|
|
- select l.log_id,l.project,l.period_id,l.user_id,uc.course_name,v.title as video_name,qec.avatar as external_user_avatar,
|
|
|
+ select l.interflow_content, l.log_id,l.project,l.period_id,l.user_id,uc.course_name,v.title as video_name,qec.avatar as external_user_avatar,
|
|
|
l.log_type,SEC_TO_TIME(l.duration) as duration,c.company_name,l.camp_period_time,l.finish_time,
|
|
|
cu.nick_name as company_user_name ,l.send_type,l.create_time,l.update_time,l.last_heartbeat_time,
|
|
|
qu.qw_user_name,qec.name as external_user_name,c.company_id,u.avatar as fsAvatar,u.nick_name as fsNickName,qec.create_time as qec_create_time,
|
|
|
@@ -407,6 +407,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="lastHeartbeatTime != null">last_heartbeat_time = #{lastHeartbeatTime},</if>
|
|
|
<if test="periodId != null">period_id = #{periodId},</if>
|
|
|
<if test="project != null">project = #{project},</if>
|
|
|
+ <if test="interflowContent != null">interflow_content = #{interflowContent},</if>
|
|
|
</trim>
|
|
|
where log_id = #{logId}
|
|
|
</update>
|
|
|
@@ -999,5 +1000,95 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
o.company_id,
|
|
|
o.send_type
|
|
|
</select>
|
|
|
+ <select id="selectFsCourseWatchLogStatisticsListVO"
|
|
|
+ resultType="com.fs.course.vo.FsCourseWatchLogStatisticsListVO">
|
|
|
+ select t.*
|
|
|
+ <if test="sendType != 1">
|
|
|
+ ,concat(round(if(t.send_number=0,0,(t.on_line_num/t.send_number)*100),2),'%') on_line_rate
|
|
|
+ ,concat(round(if(t.send_number=0,0,(t.type2/t.send_number)*100),2),'%') finished_rate
|
|
|
+ </if>
|
|
|
+ from (
|
|
|
+ SELECT
|
|
|
+ o.video_id,o.company_id,o.qw_user_id,DATE(o.create_time) create_time,
|
|
|
+ <if test="sendType != 1">
|
|
|
+ qu.qw_user_name qw_user_name,
|
|
|
+ </if>
|
|
|
+ <if test="sendType == 1">
|
|
|
+ cu.nick_name qw_user_name,
|
|
|
+ </if>
|
|
|
+ v.title videoName,uc.course_name,
|
|
|
+ SUM(CASE WHEN o.log_type = '1' THEN 1 ELSE 0 END) AS type1,
|
|
|
+ SUM(CASE WHEN o.log_type = '2' THEN 1 ELSE 0 END) AS type2,
|
|
|
+ SUM(CASE WHEN o.log_type = '3' THEN 1 ELSE 0 END) AS type3,
|
|
|
+ SUM(CASE WHEN o.log_type = '4' THEN 1 ELSE 0 END) AS type4,
|
|
|
+ (
|
|
|
+ SUM(CASE WHEN o.log_type = '1' THEN 1 ELSE 0 END) +
|
|
|
+ SUM(CASE WHEN o.log_type = '2' THEN 1 ELSE 0 END) +
|
|
|
+ SUM(CASE WHEN o.log_type = '4' THEN 1 ELSE 0 END)
|
|
|
+ ) AS on_line_num,
|
|
|
+
|
|
|
+ concat(round(if( SUM(CASE WHEN o.log_type = '2' THEN 1 ELSE 0 END)=0,0,( SUM(CASE WHEN o.log_type = '2' THEN 1 ELSE 0 END)/SUM(CASE WHEN o.log_type = '1' THEN 1 ELSE 0 END) +
|
|
|
+ SUM(CASE WHEN o.log_type = '2' THEN 1 ELSE 0 END) +
|
|
|
+ SUM(CASE WHEN o.log_type = '4' THEN 1 ELSE 0 END))*100),2),'%') as on_line_complete_rate
|
|
|
+ <if test="sendType != 1">
|
|
|
+ ,count(o.log_id) send_number
|
|
|
+ ,sum(if((o.user_id is not null or o.user_id>0) and o.log_type=3,1,0)) is_user_wait_number
|
|
|
+ ,sum(if((o.user_id is null or o.user_id=0) and o.log_type=3,1,0)) no_user_wait_number
|
|
|
+ ,(SELECT SUM(amount) FROM fs_course_red_packet_log
|
|
|
+ WHERE user_id = o.user_id AND video_id = o.video_id) as red_amount
|
|
|
+ </if>
|
|
|
+ FROM fs_course_watch_log o
|
|
|
+ <if test="sendType != 1">
|
|
|
+ LEFT JOIN qw_user qu on qu.id=o.qw_user_id
|
|
|
+ </if>
|
|
|
+ LEFT JOIN fs_user_course_video v on v.video_id=o.video_id
|
|
|
+ LEFT JOIN fs_user_course uc on uc.course_id=v.course_id
|
|
|
+ <if test="sendType == 1">
|
|
|
+ LEFT JOIN company_user cu on cu.user_id=o.company_user_id
|
|
|
+ </if>
|
|
|
+ where o.company_id=#{companyId}
|
|
|
+ <if test="sendType != null">
|
|
|
+ and send_type= #{sendType}
|
|
|
+ </if>
|
|
|
+ <if test="sTime != null">
|
|
|
+ and DATE(o.create_time) >= DATE(#{sTime})
|
|
|
+ </if>
|
|
|
+ <if test="eTime != null">
|
|
|
+ and DATE(o.create_time) <= DATE(#{eTime})
|
|
|
+ </if>
|
|
|
+ <if test="sendType != 1 and nickName != null and nickName != ''">
|
|
|
+ and qu.qw_user_name like concat(#{nickName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="sendType == 1 and nickName != null and nickName != ''">
|
|
|
+ and cu.nick_name like concat(#{nickName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="courseId != null">
|
|
|
+ and o.course_id = #{courseId}
|
|
|
+ </if>
|
|
|
+ <if test="videoId != null">
|
|
|
+ and o.video_id = #{videoId}
|
|
|
+ </if>
|
|
|
+ GROUP BY o.video_id,
|
|
|
+ <if test="sendType != 1">
|
|
|
+ o.qw_user_id,
|
|
|
+ </if>
|
|
|
+ <if test="sendType == 1">
|
|
|
+ o.company_user_id,
|
|
|
+ </if>
|
|
|
+ DATE(o.create_time)
|
|
|
+ ORDER BY o.video_id ,DATE(o.create_time)
|
|
|
+ ) t
|
|
|
+ </select>
|
|
|
+ <select id="getUserBlackCountByCampId" resultType="java.lang.Integer">
|
|
|
+ SELECT COUNT(id) FROM fs_user_company_user WHERE `status`=2
|
|
|
+ and company_id=#{companyId}
|
|
|
+ <if test="trainingCampId != null and trainingCampId !=''">
|
|
|
+ AND user_id IN(select distinct cwl.user_id
|
|
|
+ from fs_user_course_period ucp
|
|
|
+ inner join fs_course_watch_log cwl on ucp.period_id = cwl.period_id
|
|
|
+ where ucp.training_camp_id = #{trainingCampId})
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|