123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.fs.course.mapper.FsCourseWatchLogMapper">
- <resultMap type="FsCourseWatchLog" id="FsCourseWatchLogResult">
- <result property="logId" column="log_id" />
- <result property="userId" column="user_id" />
- <result property="videoId" column="video_id" />
- <result property="logType" column="log_type" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- <result property="qwExternalContactId" column="qw_external_contact_id" />
- <result property="duration" column="duration" />
- <result property="qwUserId" column="qw_user_id" />
- <result property="companyUserId" column="company_user_id" />
- <result property="companyId" column="company_id" />
- <result property="courseId" column="course_id" />
- <result property="sendType" column="send_type" />
- <result property="rewardType" column="reward_type" />
- <result property="sopId" column="sop_id" />
- <result property="finishTime" column="finish_time" />
- <result property="sendFinishMsg" column="send_finish_msg" />
- <result property="campPeriodTime" column="camp_period_time" />
- <result property="lastHeartbeatTime" column="last_heartbeat_time" />
- </resultMap>
- <sql id="selectFsCourseWatchLogVo">
- select log_id, user_id,finish_time,send_finish_msg,sop_id,video_id,reward_type, log_type, create_time, update_time, qw_external_contact_id, duration, qw_user_id, company_user_id, company_id, course_id,camp_period_time from fs_course_watch_log
- </sql>
- <select id="selectFsCourseWatchLogList" parameterType="FsCourseWatchLog" resultMap="FsCourseWatchLogResult">
- <include refid="selectFsCourseWatchLogVo"/>
- <where>
- <if test="userId != null "> and user_id = #{userId}</if>
- <if test="videoId != null "> and video_id = #{videoId}</if>
- <if test="logType != null "> and log_type = #{logType}</if>
- <if test="qwExternalContactId != null "> and qw_external_contact_id = #{qwExternalContactId}</if>
- <if test="duration != null "> and duration = #{duration}</if>
- <if test="qwUserId != null and qwUserId != ''"> and qw_user_id = #{qwUserId}</if>
- <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
- <if test="companyId != null "> and company_id = #{companyId}</if>
- <if test="courseId != null "> and course_id = #{courseId}</if>
- <if test="sendType != null "> and send_type = #{sendType}</if>
- <if test="campPeriodTime != null "> and camp_period_time = #{campPeriodTime}</if>
- </where>
- </select>
- <select id="selectFsCourseWatchLogByLogId" parameterType="Long" resultMap="FsCourseWatchLogResult">
- <include refid="selectFsCourseWatchLogVo"/>
- where log_id = #{logId}
- </select>
- <select id="selectFsCourseWatchLogListVO" resultType="com.fs.course.vo.FsCourseWatchLogListVO">
- select l.log_id,
- l.project as project,
- 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,l.update_time,l.last_heartbeat_time,
- qu.qw_user_name,qec.name as external_user_name,c.company_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
- 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 ='maps.userId !=null'>
- and l.user_id = #{maps.userId}
- </if>
- <if test ='maps.qwExternalContactId !=null'>
- and l.qw_external_contact_id = #{maps.qwExternalContactId}
- </if>
- <if test ='maps.qwUserId !=null'>
- and l.qw_user_id = #{maps.qwUserId}
- </if>
- <if test ='maps.courseId !=null'>
- and l.course_id = #{maps.courseId}
- </if>
- <if test ='maps.videoId !=null'>
- and l.video_id = #{maps.videoId}
- </if>
- <if test ='maps.logType !=null'>
- and l.log_type = #{maps.logType}
- </if>
- <if test ='maps.companyId !=null'>
- and l.company_id = #{maps.companyId}
- </if>
- <if test ='maps.companyUserId !=null'>
- and l.company_user_id = #{maps.companyUserId}
- </if>
- <if test ='maps.companyUserName !=null and maps.companyUserName!=""'>
- and cu.nick_name like concat('%', #{maps.companyUserName}, '%')
- </if>
- <if test ='maps.nickName !=null and maps.nickName!=""'>
- and u.nick_name like concat('%', #{maps.nickName}, '%')
- </if>
- <if test ='maps.externalUserName !=null and maps.externalUserName!=""'>
- and qec.name like concat('%', #{maps.externalUserName}, '%')
- </if>
- <if test= 'maps.sTime != null '>
- and DATE(l.create_time) >= DATE(#{maps.sTime})
- </if>
- <if test='maps.eTime != null '>
- and DATE(l.create_time) <= DATE(#{maps.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= 'maps.upSTime != null '>
- and DATE(l.update_time) >= DATE(#{maps.upSTime})
- </if>
- <if test='maps.upETime != null '>
- and DATE(l.update_time) <= DATE(#{maps.upETime})
- </if>
- <if test="maps.sopIds != null and maps.sopIds.size() > 0">
- and l.sop_id in
- <foreach item="sopId" index="index" collection="maps.sopIds" open="(" separator="," close=")">
- #{sopId}
- </foreach>
- </if>
- </where>
- order by l.log_id 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>
- </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>
- </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>
- </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>
- </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
- )
- 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}
- )
- </foreach>
- ON DUPLICATE KEY UPDATE
- update_time = VALUES(update_time)
- </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>
- </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>
- <update id="batchUpdateWatchLog" parameterType="java.util.List">
- UPDATE fs_course_watch_log
- SET
- duration = CASE
- <foreach collection="list" item="item" index="index">
- WHEN video_id = #{item.videoId} AND qw_external_contact_id = #{item.qwExternalContactId} AND qw_user_id = #{item.qwUserId} THEN
- CASE
- <!-- 仅当传入的duration > 当前值时才更新 -->
- WHEN #{item.duration} IS NOT NULL AND #{item.duration} > duration THEN #{item.duration}
- ELSE duration <!-- 如果 duration 为 null,保持原值 -->
- END
- </foreach>
- END,
- last_heartbeat_time = CASE
- <foreach collection="list" item="item" index="index">
- WHEN video_id = #{item.videoId} AND qw_external_contact_id = #{item.qwExternalContactId} AND qw_user_id = #{item.qwUserId} THEN
- CASE
- WHEN #{item.lastHeartbeatTime} IS NOT NULL THEN #{item.lastHeartbeatTime}
- ELSE last_heartbeat_time <!-- 如果 last_heartbeat_time 为 null,保持原值 -->
- END
- </foreach>
- END,
- finish_time = CASE
- <foreach collection="list" item="item" index="index">
- WHEN video_id = #{item.videoId} AND qw_external_contact_id = #{item.qwExternalContactId} AND qw_user_id = #{item.qwUserId} THEN
- CASE
- WHEN finish_time IS NULL THEN #{item.finishTime} <!-- 如果表中 finish_time 为 null,更新为传入的值 -->
- ELSE finish_time <!-- 如果表中 finish_time 不为 null,保持原值 -->
- END
- </foreach>
- END,
- log_type = CASE
- <foreach collection="list" item="item" index="index">
- WHEN video_id = #{item.videoId} AND qw_external_contact_id = #{item.qwExternalContactId} AND qw_user_id = #{item.qwUserId} THEN
- CASE
- WHEN log_type = 2 THEN log_type <!-- 如果 log_type 已经是 2,保持原值 -->
- WHEN #{item.logType} IS NOT NULL AND log_type != 2 THEN #{item.logType} <!-- 如果 log_type 不是 2,更新为传入的值 -->
- ELSE log_type <!-- 其他情况保持原值 -->
- END
- </foreach>
- END
- WHERE
- (video_id, qw_external_contact_id, qw_user_id) IN
- <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
- (#{item.videoId}, #{item.qwExternalContactId}, #{item.qwUserId})
- </foreach>
- </update>
- <update id="batchUpdateWatchLogSendMsg" parameterType="java.util.List">
- UPDATE fs_course_watch_log
- SET send_finish_msg = CASE
- <foreach collection="list" item="item">
- WHEN log_id = #{item.logId} THEN #{item.sendFinishMsg}
- </foreach>
- ELSE send_finish_msg
- END
- WHERE log_id IN
- <foreach collection="list" item="item" open="(" separator="," close=")">
- #{item.logId}
- </foreach>
- </update>
- <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>
- <if test="companyId != null">
- o.company_id=#{companyId}
- </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 ='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)
- ORDER BY o.video_id ,DATE(o.create_time)
- </select>
- <select id="selectFsCourseWatchLogListVONew" resultType="com.fs.course.vo.FsCourseWatchLogListVO">
- SELECT
- l.log_id,
- l.project AS project,
- l.user_id,
- l.log_type,
- SEC_TO_TIME(l.duration) AS duration,
- l.camp_period_time,
- l.finish_time,
- l.send_type,
- l.create_time,
- l.update_time,
- l.last_heartbeat_time,
- l.company_id,
- l.company_user_id,
- l.course_id,
- l.video_id
- FROM
- fs_course_watch_log l
- INNER JOIN (
- SELECT log_id
- FROM fs_course_watch_log
- <where>
- <if test='maps.userId != null'>
- AND user_id = #{maps.userId}
- </if>
- <if test='maps.courseId != null'>
- AND course_id = #{maps.courseId}
- </if>
- <if test='maps.videoId != null'>
- AND video_id = #{maps.videoId}
- </if>
- <if test='maps.logType != null'>
- AND log_type = #{maps.logType}
- </if>
- <if test='maps.companyId != null'>
- AND company_id = #{maps.companyId}
- </if>
- <if test='maps.companyUserId != null'>
- AND company_user_id = #{maps.companyUserId}
- </if>
- <if test= 'maps.sTime != null '>
- and DATE(l.create_time) >= DATE(#{maps.sTime})
- </if>
- <if test='maps.eTime != null '>
- and DATE(l.create_time) <= DATE(#{maps.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= 'maps.upSTime != null '>
- and DATE(l.update_time) >= DATE(#{maps.upSTime})
- </if>
- <if test='maps.upETime != null '>
- and DATE(l.update_time) <= DATE(#{maps.upETime})
- </if>
- <if test="maps.sopIds != null and maps.sopIds.size() > 0">
- and l.sop_id in
- AND sop_id IN
- <foreach item="sopId" index="index" collection="maps.sopIds" open="(" separator="," close=")">
- #{sopId}
- </foreach>
- </if>
- </where>
- ORDER BY log_id DESC
- LIMIT ${(maps.pageNum-1)*maps.pageSize}, ${maps.pageSize}
- ) AS page_ids ON l.log_id = page_ids.log_id
- </select>
- <select id="selectFsCourseWatchLogListVONewCount" resultType="java.lang.Long">
- SELECT count(log_id)
- FROM fs_course_watch_log
- <where>
- <if test='maps.userId != null'>
- AND user_id = #{maps.userId}
- </if>
- <if test='maps.courseId != null'>
- AND course_id = #{maps.courseId}
- </if>
- <if test='maps.videoId != null'>
- AND video_id = #{maps.videoId}
- </if>
- <if test='maps.logType != null'>
- AND log_type = #{maps.logType}
- </if>
- <if test='maps.companyId != null'>
- AND company_id = #{maps.companyId}
- </if>
- <if test='maps.companyUserId != null'>
- AND company_user_id = #{maps.companyUserId}
- </if>
- <if test= 'maps.sTime != null '>
- and DATE(l.create_time) >= DATE(#{maps.sTime})
- </if>
- <if test='maps.eTime != null '>
- and DATE(l.create_time) <= DATE(#{maps.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= 'maps.upSTime != null '>
- and DATE(l.update_time) >= DATE(#{maps.upSTime})
- </if>
- <if test='maps.upETime != null '>
- and DATE(l.update_time) <= DATE(#{maps.upETime})
- </if>
- <if test="maps.sopIds != null and maps.sopIds.size() > 0">
- and l.sop_id in
- AND sop_id IN
- <foreach item="sopId" index="index" collection="maps.sopIds" open="(" separator="," close=")">
- #{sopId}
- </foreach>
- </if>
- </where>
- </select>
- </mapper>
|