|
|
@@ -60,7 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
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,
|
|
|
- u.is_vip isVip,l.reward_type
|
|
|
+ u.is_vip isVip,l.reward_type,cu.dept_id
|
|
|
from fs_course_watch_log l
|
|
|
left join fs_user_course_video v on v.video_id = l.video_id
|
|
|
left join fs_user_course uc on uc.course_id = l.course_id
|
|
|
@@ -172,352 +172,358 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- </where>
|
|
|
- order by l.finish_time desc,l.update_time desc,l.create_time desc
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectFsCourseWatchLogListByParam" resultType="com.fs.course.vo.FsCourseWatchLogListVO">
|
|
|
- select l.log_id,l.user_id,uc.course_name,v.title as video_name,u.nick_name as fsNickName, u.avatar as fsAvatar,
|
|
|
- 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, qu.qw_user_name,qec.name as external_user_name
|
|
|
- from fs_course_watch_log l
|
|
|
- left join fs_user_course_video v on v.video_id = l.video_id
|
|
|
- left join fs_user_course uc on uc.course_id = l.course_id
|
|
|
- left join fs_user u on u.user_id = l.user_id
|
|
|
- left join company_user cu on cu.user_id = l.company_user_id
|
|
|
- left join company c on c.company_id = l.company_id
|
|
|
- LEFT JOIN qw_user qu on qu.id= l.qw_user_id
|
|
|
- LEFT JOIN qw_external_contact qec on l.qw_external_contact_id = qec.id
|
|
|
- <where>
|
|
|
- <if test ='userId !=null'>
|
|
|
- and l.user_id = #{userId}
|
|
|
- </if>
|
|
|
- <if test ='qwUserId !=null'>
|
|
|
- and l.qw_user_id = #{qwUserId}
|
|
|
- </if>
|
|
|
- <if test ='courseId !=null'>
|
|
|
- and l.course_id = #{courseId}
|
|
|
- </if>
|
|
|
- <if test ='videoId !=null'>
|
|
|
- and l.video_id = #{videoId}
|
|
|
- </if>
|
|
|
- <if test ='logType !=null'>
|
|
|
- and l.log_type = #{logType}
|
|
|
- </if>
|
|
|
- <if test ='companyId !=null'>
|
|
|
- and l.company_id = #{companyId}
|
|
|
- </if>
|
|
|
- <if test ='companyUserId !=null'>
|
|
|
- and l.company_user_id = #{companyUserId}
|
|
|
- </if>
|
|
|
- <if test ='companyUserName !=null and maps.companyUserName!=""'>
|
|
|
- and cu.nick_name like concat('%', #{companyUserName}, '%')
|
|
|
- </if>
|
|
|
- <if test ='nickName !=null and maps.nickName!=""'>
|
|
|
- and u.nick_name like concat('%', #{nickName}, '%')
|
|
|
- </if>
|
|
|
- <if test= 'sTime != null '>
|
|
|
- and DATE(l.create_time) >= DATE(#{sTime})
|
|
|
- </if>
|
|
|
- <if test='eTime != null '>
|
|
|
- and DATE(l.create_time) <= DATE(#{eTime})
|
|
|
- </if>
|
|
|
- <if test= 'maps.scheduleStartTime != null '>
|
|
|
- and DATE(l.camp_period_time) >= DATE(#{maps.scheduleStartTime})
|
|
|
- </if>
|
|
|
- <if test='maps.scheduleEndTime != null '>
|
|
|
- and DATE(l.camp_period_time) <= DATE(#{maps.scheduleEndTime})
|
|
|
- </if>
|
|
|
- <if test="sopIds != null and sopIds.size() > 0">
|
|
|
- and l.sop_id in
|
|
|
- <foreach item="sopId" index="index" collection="sopIds" open="(" separator="," close=")">
|
|
|
- #{sopId}
|
|
|
+ <if test="maps.userIds != null and !maps.userIds.isEmpty()">
|
|
|
+ AND cu.user_id IN
|
|
|
+ <foreach collection='maps.userIds' item='item' open='(' separator=',' close=')'>
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by l.finish_time desc,l.update_time desc,l.create_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsCourseWatchLogListByParam" resultType="com.fs.course.vo.FsCourseWatchLogListVO">
|
|
|
+ select l.log_id,l.user_id,uc.course_name,v.title as video_name,u.nick_name as fsNickName, u.avatar as fsAvatar,
|
|
|
+ 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, qu.qw_user_name,qec.name as external_user_name
|
|
|
+ from fs_course_watch_log l
|
|
|
+ left join fs_user_course_video v on v.video_id = l.video_id
|
|
|
+ left join fs_user_course uc on uc.course_id = l.course_id
|
|
|
+ left join fs_user u on u.user_id = l.user_id
|
|
|
+ left join company_user cu on cu.user_id = l.company_user_id
|
|
|
+ left join company c on c.company_id = l.company_id
|
|
|
+ LEFT JOIN qw_user qu on qu.id= l.qw_user_id
|
|
|
+ LEFT JOIN qw_external_contact qec on l.qw_external_contact_id = qec.id
|
|
|
+ <where>
|
|
|
+ <if test ='userId !=null'>
|
|
|
+ and l.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test ='qwUserId !=null'>
|
|
|
+ and l.qw_user_id = #{qwUserId}
|
|
|
+ </if>
|
|
|
+ <if test ='courseId !=null'>
|
|
|
+ and l.course_id = #{courseId}
|
|
|
+ </if>
|
|
|
+ <if test ='videoId !=null'>
|
|
|
+ and l.video_id = #{videoId}
|
|
|
+ </if>
|
|
|
+ <if test ='logType !=null'>
|
|
|
+ and l.log_type = #{logType}
|
|
|
+ </if>
|
|
|
+ <if test ='companyId !=null'>
|
|
|
+ and l.company_id = #{companyId}
|
|
|
+ </if>
|
|
|
+ <if test ='companyUserId !=null'>
|
|
|
+ and l.company_user_id = #{companyUserId}
|
|
|
+ </if>
|
|
|
+ <if test ='companyUserName !=null and maps.companyUserName!=""'>
|
|
|
+ and cu.nick_name like concat('%', #{companyUserName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test ='nickName !=null and maps.nickName!=""'>
|
|
|
+ and u.nick_name like concat('%', #{nickName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test= 'sTime != null '>
|
|
|
+ and DATE(l.create_time) >= DATE(#{sTime})
|
|
|
+ </if>
|
|
|
+ <if test='eTime != null '>
|
|
|
+ and DATE(l.create_time) <= DATE(#{eTime})
|
|
|
+ </if>
|
|
|
+ <if test= 'maps.scheduleStartTime != null '>
|
|
|
+ and DATE(l.camp_period_time) >= DATE(#{maps.scheduleStartTime})
|
|
|
+ </if>
|
|
|
+ <if test='maps.scheduleEndTime != null '>
|
|
|
+ and DATE(l.camp_period_time) <= DATE(#{maps.scheduleEndTime})
|
|
|
+ </if>
|
|
|
+ <if test="sopIds != null and sopIds.size() > 0">
|
|
|
+ and l.sop_id in
|
|
|
+ <foreach item="sopId" index="index" collection="sopIds" open="(" separator="," close=")">
|
|
|
+ #{sopId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by l.log_id desc
|
|
|
+ </select>
|
|
|
+ <insert id="insertFsCourseWatchLog" parameterType="FsCourseWatchLog" useGeneratedKeys="true" keyProperty="logId">
|
|
|
+ insert into fs_course_watch_log
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="videoId != null">video_id,</if>
|
|
|
+ <if test="logType != null">log_type,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="qwExternalContactId != null">qw_external_contact_id,</if>
|
|
|
+ <if test="duration != null">duration,</if>
|
|
|
+ <if test="qwUserId != null">qw_user_id,</if>
|
|
|
+ <if test="companyUserId != null">company_user_id,</if>
|
|
|
+ <if test="companyId != null">company_id,</if>
|
|
|
+ <if test="courseId != null">course_id,</if>
|
|
|
+ <if test="sendType != null">send_type,</if>
|
|
|
+ <if test="rewardType != null">reward_type,</if>
|
|
|
+ <if test="sopId != null">sop_id,</if>
|
|
|
+ <if test="finishTime != null">finish_time,</if>
|
|
|
+ <if test="sendFinishMsg != null">send_finish_msg,</if>
|
|
|
+ <if test="campPeriodTime != null">camp_period_time,</if>
|
|
|
+ <if test="periodId != null">period_id,</if>
|
|
|
+ <if test="project != null">project,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="videoId != null">#{videoId},</if>
|
|
|
+ <if test="logType != null">#{logType},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="qwExternalContactId != null">#{qwExternalContactId},</if>
|
|
|
+ <if test="duration != null">#{duration},</if>
|
|
|
+ <if test="qwUserId != null">#{qwUserId},</if>
|
|
|
+ <if test="companyUserId != null">#{companyUserId},</if>
|
|
|
+ <if test="companyId != null">#{companyId},</if>
|
|
|
+ <if test="courseId != null">#{courseId},</if>
|
|
|
+ <if test="sendType != null">#{sendType},</if>
|
|
|
+ <if test="rewardType != null">#{rewardType},</if>
|
|
|
+ <if test="sopId != null">#{sopId},</if>
|
|
|
+ <if test="finishTime != null">#{finishTime},</if>
|
|
|
+ <if test="sendFinishMsg != null">#{sendFinishMsg},</if>
|
|
|
+ <if test="campPeriodTime != null">#{campPeriodTime},</if>
|
|
|
+ <if test="periodId != null">#{periodId},</if>
|
|
|
+ <if test="project != null">#{project},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateFsCourseWatchLog" parameterType="FsCourseWatchLog">
|
|
|
+ insert into fs_course_watch_log
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="videoId != null">video_id,</if>
|
|
|
+ <if test="logType != null">log_type,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="qwExternalContactId != null">qw_external_contact_id,</if>
|
|
|
+ <if test="duration != null">duration,</if>
|
|
|
+ <if test="qwUserId != null">qw_user_id,</if>
|
|
|
+ <if test="companyUserId != null">company_user_id,</if>
|
|
|
+ <if test="companyId != null">company_id,</if>
|
|
|
+ <if test="courseId != null">course_id,</if>
|
|
|
+ <if test="sendType != null">send_type,</if>
|
|
|
+ <if test="rewardType != null">reward_type,</if>
|
|
|
+ <if test="sopId != null">sop_id,</if>
|
|
|
+ <if test="finishTime != null">finish_time,</if>
|
|
|
+ <if test="sendFinishMsg != null">send_finish_msg,</if>
|
|
|
+ <if test="campPeriodTime != null">camp_period_time,</if>
|
|
|
+ <if test="project != null">project,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="videoId != null">#{videoId},</if>
|
|
|
+ <if test="logType != null">#{logType},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="qwExternalContactId != null">#{qwExternalContactId},</if>
|
|
|
+ <if test="duration != null">#{duration},</if>
|
|
|
+ <if test="qwUserId != null">#{qwUserId},</if>
|
|
|
+ <if test="companyUserId != null">#{companyUserId},</if>
|
|
|
+ <if test="companyId != null">#{companyId},</if>
|
|
|
+ <if test="courseId != null">#{courseId},</if>
|
|
|
+ <if test="sendType != null">#{sendType},</if>
|
|
|
+ <if test="rewardType != null">#{rewardType},</if>
|
|
|
+ <if test="sopId != null">#{sopId},</if>
|
|
|
+ <if test="finishTime != null">#{finishTime},</if>
|
|
|
+ <if test="sendFinishMsg != null">#{sendFinishMsg},</if>
|
|
|
+ <if test="campPeriodTime != null">#{campPeriodTime},</if>
|
|
|
+ <if test="project != null">#{project},</if>
|
|
|
+ </trim>
|
|
|
+ on duplicate key update
|
|
|
+ <trim suffixOverrides=",">
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+
|
|
|
+ </insert>
|
|
|
+
|
|
|
+
|
|
|
+ <insert id="insertFsCourseWatchLogBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="logId">
|
|
|
+ INSERT INTO fs_course_watch_log (
|
|
|
+ user_id,
|
|
|
+ video_id,
|
|
|
+ log_type,
|
|
|
+ create_time,
|
|
|
+ update_time,
|
|
|
+ qw_external_contact_id,
|
|
|
+ duration,
|
|
|
+ qw_user_id,
|
|
|
+ company_user_id,
|
|
|
+ company_id,
|
|
|
+ course_id,
|
|
|
+ send_type,
|
|
|
+ reward_type,
|
|
|
+ sop_id,
|
|
|
+ camp_period_time,
|
|
|
+ project,
|
|
|
+ period_id,
|
|
|
+ im_msg_send_detail_id
|
|
|
+ )
|
|
|
+ VALUES
|
|
|
+ <foreach collection="watchLogs" item="log" separator=",">
|
|
|
+ (
|
|
|
+ #{log.userId},
|
|
|
+ #{log.videoId},
|
|
|
+ #{log.logType},
|
|
|
+ #{log.createTime},
|
|
|
+ #{log.updateTime},
|
|
|
+ #{log.qwExternalContactId},
|
|
|
+ #{log.duration},
|
|
|
+ #{log.qwUserId},
|
|
|
+ #{log.companyUserId},
|
|
|
+ #{log.companyId},
|
|
|
+ #{log.courseId},
|
|
|
+ #{log.sendType},
|
|
|
+ #{log.rewardType},
|
|
|
+ #{log.sopId},
|
|
|
+ #{log.campPeriodTime},
|
|
|
+ #{log.project},
|
|
|
+ #{log.periodId},
|
|
|
+ #{log.imMsgSendDetailId}
|
|
|
+ )
|
|
|
</foreach>
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- order by l.log_id desc
|
|
|
- </select>
|
|
|
- <insert id="insertFsCourseWatchLog" parameterType="FsCourseWatchLog" useGeneratedKeys="true" keyProperty="logId">
|
|
|
- insert into fs_course_watch_log
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="userId != null">user_id,</if>
|
|
|
- <if test="videoId != null">video_id,</if>
|
|
|
- <if test="logType != null">log_type,</if>
|
|
|
- <if test="createTime != null">create_time,</if>
|
|
|
- <if test="updateTime != null">update_time,</if>
|
|
|
- <if test="qwExternalContactId != null">qw_external_contact_id,</if>
|
|
|
- <if test="duration != null">duration,</if>
|
|
|
- <if test="qwUserId != null">qw_user_id,</if>
|
|
|
- <if test="companyUserId != null">company_user_id,</if>
|
|
|
- <if test="companyId != null">company_id,</if>
|
|
|
- <if test="courseId != null">course_id,</if>
|
|
|
- <if test="sendType != null">send_type,</if>
|
|
|
- <if test="rewardType != null">reward_type,</if>
|
|
|
- <if test="sopId != null">sop_id,</if>
|
|
|
- <if test="finishTime != null">finish_time,</if>
|
|
|
- <if test="sendFinishMsg != null">send_finish_msg,</if>
|
|
|
- <if test="campPeriodTime != null">camp_period_time,</if>
|
|
|
- <if test="periodId != null">period_id,</if>
|
|
|
- <if test="project != null">project,</if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="userId != null">#{userId},</if>
|
|
|
- <if test="videoId != null">#{videoId},</if>
|
|
|
- <if test="logType != null">#{logType},</if>
|
|
|
- <if test="createTime != null">#{createTime},</if>
|
|
|
- <if test="updateTime != null">#{updateTime},</if>
|
|
|
- <if test="qwExternalContactId != null">#{qwExternalContactId},</if>
|
|
|
- <if test="duration != null">#{duration},</if>
|
|
|
- <if test="qwUserId != null">#{qwUserId},</if>
|
|
|
- <if test="companyUserId != null">#{companyUserId},</if>
|
|
|
- <if test="companyId != null">#{companyId},</if>
|
|
|
- <if test="courseId != null">#{courseId},</if>
|
|
|
- <if test="sendType != null">#{sendType},</if>
|
|
|
- <if test="rewardType != null">#{rewardType},</if>
|
|
|
- <if test="sopId != null">#{sopId},</if>
|
|
|
- <if test="finishTime != null">#{finishTime},</if>
|
|
|
- <if test="sendFinishMsg != null">#{sendFinishMsg},</if>
|
|
|
- <if test="campPeriodTime != null">#{campPeriodTime},</if>
|
|
|
- <if test="periodId != null">#{periodId},</if>
|
|
|
- <if test="project != null">#{project},</if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
-
|
|
|
- <insert id="insertOrUpdateFsCourseWatchLog" parameterType="FsCourseWatchLog">
|
|
|
- insert into fs_course_watch_log
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="userId != null">user_id,</if>
|
|
|
- <if test="videoId != null">video_id,</if>
|
|
|
- <if test="logType != null">log_type,</if>
|
|
|
- <if test="createTime != null">create_time,</if>
|
|
|
- <if test="updateTime != null">update_time,</if>
|
|
|
- <if test="qwExternalContactId != null">qw_external_contact_id,</if>
|
|
|
- <if test="duration != null">duration,</if>
|
|
|
- <if test="qwUserId != null">qw_user_id,</if>
|
|
|
- <if test="companyUserId != null">company_user_id,</if>
|
|
|
- <if test="companyId != null">company_id,</if>
|
|
|
- <if test="courseId != null">course_id,</if>
|
|
|
- <if test="sendType != null">send_type,</if>
|
|
|
- <if test="rewardType != null">reward_type,</if>
|
|
|
- <if test="sopId != null">sop_id,</if>
|
|
|
- <if test="finishTime != null">finish_time,</if>
|
|
|
- <if test="sendFinishMsg != null">send_finish_msg,</if>
|
|
|
- <if test="campPeriodTime != null">camp_period_time,</if>
|
|
|
- <if test="project != null">project,</if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="userId != null">#{userId},</if>
|
|
|
- <if test="videoId != null">#{videoId},</if>
|
|
|
- <if test="logType != null">#{logType},</if>
|
|
|
- <if test="createTime != null">#{createTime},</if>
|
|
|
- <if test="updateTime != null">#{updateTime},</if>
|
|
|
- <if test="qwExternalContactId != null">#{qwExternalContactId},</if>
|
|
|
- <if test="duration != null">#{duration},</if>
|
|
|
- <if test="qwUserId != null">#{qwUserId},</if>
|
|
|
- <if test="companyUserId != null">#{companyUserId},</if>
|
|
|
- <if test="companyId != null">#{companyId},</if>
|
|
|
- <if test="courseId != null">#{courseId},</if>
|
|
|
- <if test="sendType != null">#{sendType},</if>
|
|
|
- <if test="rewardType != null">#{rewardType},</if>
|
|
|
- <if test="sopId != null">#{sopId},</if>
|
|
|
- <if test="finishTime != null">#{finishTime},</if>
|
|
|
- <if test="sendFinishMsg != null">#{sendFinishMsg},</if>
|
|
|
- <if test="campPeriodTime != null">#{campPeriodTime},</if>
|
|
|
- <if test="project != null">#{project},</if>
|
|
|
- </trim>
|
|
|
- on duplicate key update
|
|
|
- <trim suffixOverrides=",">
|
|
|
- <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
- </trim>
|
|
|
-
|
|
|
- </insert>
|
|
|
-
|
|
|
-
|
|
|
- <insert id="insertFsCourseWatchLogBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="logId">
|
|
|
- INSERT INTO fs_course_watch_log (
|
|
|
- user_id,
|
|
|
- video_id,
|
|
|
- log_type,
|
|
|
- create_time,
|
|
|
- update_time,
|
|
|
- qw_external_contact_id,
|
|
|
- duration,
|
|
|
- qw_user_id,
|
|
|
- company_user_id,
|
|
|
- company_id,
|
|
|
- course_id,
|
|
|
- send_type,
|
|
|
- reward_type,
|
|
|
- sop_id,
|
|
|
- camp_period_time,
|
|
|
- project,
|
|
|
- period_id,
|
|
|
- im_msg_send_detail_id
|
|
|
- )
|
|
|
- VALUES
|
|
|
- <foreach collection="watchLogs" item="log" separator=",">
|
|
|
- (
|
|
|
- #{log.userId},
|
|
|
- #{log.videoId},
|
|
|
- #{log.logType},
|
|
|
- #{log.createTime},
|
|
|
- #{log.updateTime},
|
|
|
- #{log.qwExternalContactId},
|
|
|
- #{log.duration},
|
|
|
- #{log.qwUserId},
|
|
|
- #{log.companyUserId},
|
|
|
- #{log.companyId},
|
|
|
- #{log.courseId},
|
|
|
- #{log.sendType},
|
|
|
- #{log.rewardType},
|
|
|
- #{log.sopId},
|
|
|
- #{log.campPeriodTime},
|
|
|
- #{log.project},
|
|
|
- #{log.periodId},
|
|
|
- #{log.imMsgSendDetailId}
|
|
|
- )
|
|
|
- </foreach>
|
|
|
- ON DUPLICATE KEY UPDATE
|
|
|
- update_time = NOW(),
|
|
|
- im_msg_send_detail_id = VALUES(im_msg_send_detail_id)
|
|
|
- </insert>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <update id="updateFsCourseWatchLog" parameterType="FsCourseWatchLog">
|
|
|
- update fs_course_watch_log
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="userId != null">user_id = #{userId},</if>
|
|
|
- <if test="videoId != null">video_id = #{videoId},</if>
|
|
|
- <if test="logType != null">log_type = #{logType},</if>
|
|
|
- <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
- <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
- <if test="qwExternalContactId != null">qw_external_contact_id = #{qwExternalContactId},</if>
|
|
|
- <if test="duration != null">duration = #{duration},</if>
|
|
|
- <if test="qwUserId != null">qw_user_id = #{qwUserId},</if>
|
|
|
- <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
|
|
|
- <if test="companyId != null">company_id = #{companyId},</if>
|
|
|
- <if test="courseId != null">course_id = #{courseId},</if>
|
|
|
- <if test="sendType != null">send_type = #{sendType},</if>
|
|
|
- <if test="rewardType != null">reward_type = #{rewardType},</if>
|
|
|
- <if test="sopId != null">sop_id = #{sopId},</if>
|
|
|
- <if test="finishTime != null">finish_time = #{finishTime},</if>
|
|
|
- <if test="sendFinishMsg != null">send_finish_msg = #{sendFinishMsg},</if>
|
|
|
- <if test="lastHeartbeatTime != null">last_heartbeat_time = #{lastHeartbeatTime},</if>
|
|
|
- <if test="periodId != null">period_id = #{periodId},</if>
|
|
|
- <if test="project != null">project = #{project},</if>
|
|
|
- </trim>
|
|
|
- where log_id = #{logId}
|
|
|
- </update>
|
|
|
-
|
|
|
- <delete id="deleteFsCourseWatchLogByLogId" parameterType="Long">
|
|
|
- delete from fs_course_watch_log where log_id = #{logId}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <delete id="deleteFsCourseWatchLogByLogIds" parameterType="String">
|
|
|
- delete from fs_course_watch_log where log_id in
|
|
|
- <foreach item="logId" collection="array" open="(" separator="," close=")">
|
|
|
- #{logId}
|
|
|
- </foreach>
|
|
|
- </delete>
|
|
|
-
|
|
|
- <select id="selectFsCourseWatchLogByFinishTime" resultType="com.fs.course.param.FsCourseWatchLogByFinishTimeParam">
|
|
|
- <![CDATA[
|
|
|
- SELECT
|
|
|
- fcwl.log_id,
|
|
|
- fcwl.create_time,
|
|
|
- fcwl.qw_external_contact_id,
|
|
|
- fcwl.qw_user_id,
|
|
|
- fcwl.user_id,
|
|
|
- fcwl.company_user_id,
|
|
|
- fcwl.company_id,
|
|
|
- fcwl.sop_id,
|
|
|
- fcwl.finish_time,
|
|
|
- fcwl.camp_period_time,
|
|
|
- qec.corp_id,
|
|
|
- qec.external_user_id,
|
|
|
- qec.tag_ids,
|
|
|
- qec.user_id AS qw_user,
|
|
|
- qec.name AS external_contact_name
|
|
|
- FROM
|
|
|
- fs_course_watch_log fcwl
|
|
|
- LEFT JOIN qw_external_contact qec ON fcwl.qw_external_contact_id = qec.id
|
|
|
- WHERE
|
|
|
- DATE(fcwl.finish_time)= '2025-02-09'
|
|
|
- and fcwl.camp_period_time is not NULL
|
|
|
- ]]>
|
|
|
- </select>
|
|
|
- <select id="getWatchLogByFsUser" resultType="com.fs.course.domain.FsCourseWatchLog">
|
|
|
- SELECT
|
|
|
- log_id,
|
|
|
- user_id,
|
|
|
- video_id,
|
|
|
- log_type,
|
|
|
- create_time,
|
|
|
- update_time,
|
|
|
- duration,
|
|
|
- company_user_id,
|
|
|
- company_id,
|
|
|
- course_id,
|
|
|
- send_type,
|
|
|
- reward_type,
|
|
|
- last_heartbeat_time,
|
|
|
- sop_id,
|
|
|
- finish_time,
|
|
|
- send_finish_msg,
|
|
|
- camp_period_time
|
|
|
- FROM
|
|
|
- fs_course_watch_log
|
|
|
- WHERE
|
|
|
- send_type = 1
|
|
|
- AND video_id = #{videoId}
|
|
|
- AND user_id = #{fsUserId}
|
|
|
- AND company_user_id = #{companyUserId} order by log_id desc limit 1
|
|
|
- </select>
|
|
|
- <select id="selectFsCourseWatchLogStatisticsListVONew"
|
|
|
- resultType="com.fs.course.vo.FsCourseWatchLogStatisticsListVO">
|
|
|
- SELECT
|
|
|
- o.company_user_id,o.user_id,DATE(o.create_time) create_time,
|
|
|
- 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,
|
|
|
- o.project as project,
|
|
|
- o.course_id as course_id,
|
|
|
- o.video_id as video_id
|
|
|
- FROM fs_course_watch_log o
|
|
|
- <where>
|
|
|
- send_type=1
|
|
|
- <if test="companyId != null">
|
|
|
- and o.company_id=#{companyId}
|
|
|
- </if>
|
|
|
- <if test= 'sTime != null '>
|
|
|
- and DATE(o.create_time) >= #{sTime}
|
|
|
- </if>
|
|
|
- <if test='eTime != null '>
|
|
|
- and DATE(o.create_time) <= #{eTime}
|
|
|
- </if>
|
|
|
- <if test ='courseId !=null'>
|
|
|
- and o.course_id = #{courseId}
|
|
|
- </if>
|
|
|
- <if test ='videoId !=null'>
|
|
|
- and o.video_id = #{videoId}
|
|
|
- </if>
|
|
|
- <if test="companyUserId != null">
|
|
|
- and o.company_user_id = #{companyUserId}
|
|
|
- </if>
|
|
|
- <if test="project != null">
|
|
|
- and o.project = #{project}
|
|
|
- </if>
|
|
|
- <if test="userId != null">
|
|
|
- and o.user_id = #{userId}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
-
|
|
|
- GROUP BY o.video_id,o.user_id,DATE(o.create_time),o.project,o.course_id
|
|
|
- ORDER BY o.video_id ,DATE(o.create_time)
|
|
|
-
|
|
|
-<!-- limit ${(pageNum-1)*pageSize},${pageSize}-->
|
|
|
+ ON DUPLICATE KEY UPDATE
|
|
|
+ update_time = NOW(),
|
|
|
+ im_msg_send_detail_id = VALUES(im_msg_send_detail_id)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <update id="updateFsCourseWatchLog" parameterType="FsCourseWatchLog">
|
|
|
+ update fs_course_watch_log
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="videoId != null">video_id = #{videoId},</if>
|
|
|
+ <if test="logType != null">log_type = #{logType},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="qwExternalContactId != null">qw_external_contact_id = #{qwExternalContactId},</if>
|
|
|
+ <if test="duration != null">duration = #{duration},</if>
|
|
|
+ <if test="qwUserId != null">qw_user_id = #{qwUserId},</if>
|
|
|
+ <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
|
|
|
+ <if test="companyId != null">company_id = #{companyId},</if>
|
|
|
+ <if test="courseId != null">course_id = #{courseId},</if>
|
|
|
+ <if test="sendType != null">send_type = #{sendType},</if>
|
|
|
+ <if test="rewardType != null">reward_type = #{rewardType},</if>
|
|
|
+ <if test="sopId != null">sop_id = #{sopId},</if>
|
|
|
+ <if test="finishTime != null">finish_time = #{finishTime},</if>
|
|
|
+ <if test="sendFinishMsg != null">send_finish_msg = #{sendFinishMsg},</if>
|
|
|
+ <if test="lastHeartbeatTime != null">last_heartbeat_time = #{lastHeartbeatTime},</if>
|
|
|
+ <if test="periodId != null">period_id = #{periodId},</if>
|
|
|
+ <if test="project != null">project = #{project},</if>
|
|
|
+ </trim>
|
|
|
+ where log_id = #{logId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteFsCourseWatchLogByLogId" parameterType="Long">
|
|
|
+ delete from fs_course_watch_log where log_id = #{logId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteFsCourseWatchLogByLogIds" parameterType="String">
|
|
|
+ delete from fs_course_watch_log where log_id in
|
|
|
+ <foreach item="logId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{logId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="selectFsCourseWatchLogByFinishTime" resultType="com.fs.course.param.FsCourseWatchLogByFinishTimeParam">
|
|
|
+ <![CDATA[
|
|
|
+ SELECT
|
|
|
+ fcwl.log_id,
|
|
|
+ fcwl.create_time,
|
|
|
+ fcwl.qw_external_contact_id,
|
|
|
+ fcwl.qw_user_id,
|
|
|
+ fcwl.user_id,
|
|
|
+ fcwl.company_user_id,
|
|
|
+ fcwl.company_id,
|
|
|
+ fcwl.sop_id,
|
|
|
+ fcwl.finish_time,
|
|
|
+ fcwl.camp_period_time,
|
|
|
+ qec.corp_id,
|
|
|
+ qec.external_user_id,
|
|
|
+ qec.tag_ids,
|
|
|
+ qec.user_id AS qw_user,
|
|
|
+ qec.name AS external_contact_name
|
|
|
+ FROM
|
|
|
+ fs_course_watch_log fcwl
|
|
|
+ LEFT JOIN qw_external_contact qec ON fcwl.qw_external_contact_id = qec.id
|
|
|
+ WHERE
|
|
|
+ DATE(fcwl.finish_time)= '2025-02-09'
|
|
|
+ and fcwl.camp_period_time is not NULL
|
|
|
+ ]]>
|
|
|
+ </select>
|
|
|
+ <select id="getWatchLogByFsUser" resultType="com.fs.course.domain.FsCourseWatchLog">
|
|
|
+ SELECT
|
|
|
+ log_id,
|
|
|
+ user_id,
|
|
|
+ video_id,
|
|
|
+ log_type,
|
|
|
+ create_time,
|
|
|
+ update_time,
|
|
|
+ duration,
|
|
|
+ company_user_id,
|
|
|
+ company_id,
|
|
|
+ course_id,
|
|
|
+ send_type,
|
|
|
+ reward_type,
|
|
|
+ last_heartbeat_time,
|
|
|
+ sop_id,
|
|
|
+ finish_time,
|
|
|
+ send_finish_msg,
|
|
|
+ camp_period_time
|
|
|
+ FROM
|
|
|
+ fs_course_watch_log
|
|
|
+ WHERE
|
|
|
+ send_type = 1
|
|
|
+ AND video_id = #{videoId}
|
|
|
+ AND user_id = #{fsUserId}
|
|
|
+ AND company_user_id = #{companyUserId} order by log_id desc limit 1
|
|
|
+ </select>
|
|
|
+ <select id="selectFsCourseWatchLogStatisticsListVONew"
|
|
|
+ resultType="com.fs.course.vo.FsCourseWatchLogStatisticsListVO">
|
|
|
+ SELECT
|
|
|
+ o.company_user_id,o.user_id,DATE(o.create_time) create_time,
|
|
|
+ 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,
|
|
|
+ o.project as project,
|
|
|
+ o.course_id as course_id,
|
|
|
+ o.video_id as video_id
|
|
|
+ FROM fs_course_watch_log o
|
|
|
+ <where>
|
|
|
+ send_type=1
|
|
|
+ <if test="companyId != null">
|
|
|
+ and o.company_id=#{companyId}
|
|
|
+ </if>
|
|
|
+ <if test= 'sTime != null '>
|
|
|
+ and DATE(o.create_time) >= #{sTime}
|
|
|
+ </if>
|
|
|
+ <if test='eTime != null '>
|
|
|
+ and DATE(o.create_time) <= #{eTime}
|
|
|
+ </if>
|
|
|
+ <if test ='courseId !=null'>
|
|
|
+ and o.course_id = #{courseId}
|
|
|
+ </if>
|
|
|
+ <if test ='videoId !=null'>
|
|
|
+ and o.video_id = #{videoId}
|
|
|
+ </if>
|
|
|
+ <if test="companyUserId != null">
|
|
|
+ and o.company_user_id = #{companyUserId}
|
|
|
+ </if>
|
|
|
+ <if test="project != null">
|
|
|
+ and o.project = #{project}
|
|
|
+ </if>
|
|
|
+ <if test="userId != null">
|
|
|
+ and o.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+
|
|
|
+ GROUP BY o.video_id,o.user_id,DATE(o.create_time),o.project,o.course_id
|
|
|
+ ORDER BY o.video_id ,DATE(o.create_time)
|
|
|
+
|
|
|
+ <!-- limit ${(pageNum-1)*pageSize},${pageSize}-->
|
|
|
</select>
|
|
|
<select id="selectFsCourseWatchLogStatisticsListVONewCount" resultType="java.lang.Long">
|
|
|
SELECT COUNT(*)
|