|
@@ -23,10 +23,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<result property="completeWatchDate" column="complete_watch_date" />
|
|
<result property="completeWatchDate" column="complete_watch_date" />
|
|
<result property="completeWatchCount" column="complete_watch_count" />
|
|
<result property="completeWatchCount" column="complete_watch_count" />
|
|
<result property="watchTimes" column="watch_times" />
|
|
<result property="watchTimes" column="watch_times" />
|
|
|
|
+ <result property="createDate" column="create_date" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectFsUserCourseCountVo">
|
|
<sql id="selectFsUserCourseCountVo">
|
|
- select id, user_id, watch_course_count, miss_course_count, miss_course_status, miss_course_days, course_ids, part_course_count, last_watch_date, status, stop_watch_days, create_time, update_time, create_by, update_by, complete_watch_date, complete_watch_count, watch_times from fs_user_course_count
|
|
|
|
|
|
+ select id, user_id, watch_course_count, miss_course_count, miss_course_status, miss_course_days, course_ids, part_course_count, last_watch_date, status, stop_watch_days, create_time, update_time, create_by, update_by, complete_watch_date, complete_watch_count, watch_times, create_date from fs_user_course_count
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectFsUserCourseCountList" parameterType="FsUserCourseCount" resultMap="FsUserCourseCountResult">
|
|
<select id="selectFsUserCourseCountList" parameterType="FsUserCourseCount" resultMap="FsUserCourseCountResult">
|
|
@@ -45,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="completeWatchDate != null "> and complete_watch_date = #{completeWatchDate}</if>
|
|
<if test="completeWatchDate != null "> and complete_watch_date = #{completeWatchDate}</if>
|
|
<if test="completeWatchCount != null "> and complete_watch_count = #{completeWatchCount}</if>
|
|
<if test="completeWatchCount != null "> and complete_watch_count = #{completeWatchCount}</if>
|
|
<if test="watchTimes != null "> and watch_times = #{watchTimes}</if>
|
|
<if test="watchTimes != null "> and watch_times = #{watchTimes}</if>
|
|
|
|
+ <if test="createDate != null "> and create_date = #{createDate}</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -77,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="completeWatchDate != null">complete_watch_date,</if>
|
|
<if test="completeWatchDate != null">complete_watch_date,</if>
|
|
<if test="completeWatchCount != null">complete_watch_count,</if>
|
|
<if test="completeWatchCount != null">complete_watch_count,</if>
|
|
<if test="watchTimes != null">watch_times,</if>
|
|
<if test="watchTimes != null">watch_times,</if>
|
|
|
|
+ <if test="createDate != null">create_date,</if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="id != null">#{id},</if>
|
|
@@ -97,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="completeWatchDate != null">#{completeWatchDate},</if>
|
|
<if test="completeWatchDate != null">#{completeWatchDate},</if>
|
|
<if test="completeWatchCount != null">#{completeWatchCount},</if>
|
|
<if test="completeWatchCount != null">#{completeWatchCount},</if>
|
|
<if test="watchTimes != null">#{watchTimes},</if>
|
|
<if test="watchTimes != null">#{watchTimes},</if>
|
|
|
|
+ <if test="createDate != null">#{createDate},</if>
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
@@ -120,6 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="completeWatchDate != null">complete_watch_date = #{completeWatchDate},</if>
|
|
<if test="completeWatchDate != null">complete_watch_date = #{completeWatchDate},</if>
|
|
<if test="completeWatchCount != null">complete_watch_count = #{completeWatchCount},</if>
|
|
<if test="completeWatchCount != null">complete_watch_count = #{completeWatchCount},</if>
|
|
<if test="watchTimes != null">watch_times = #{watchTimes},</if>
|
|
<if test="watchTimes != null">watch_times = #{watchTimes},</if>
|
|
|
|
+ <if test="createDate != null">create_date = #{createDate},</if>
|
|
</trim>
|
|
</trim>
|
|
where id = #{id}
|
|
where id = #{id}
|
|
</update>
|
|
</update>
|
|
@@ -157,7 +162,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
max( CASE WHEN fwl.log_type = 2 THEN fwl.last_heartbeat_time END ) AS completeWatchDate,
|
|
max( CASE WHEN fwl.log_type = 2 THEN fwl.last_heartbeat_time END ) AS completeWatchDate,
|
|
count( CASE WHEN fwl.log_type = 2 THEN fwl.log_id END ) AS completeWatchCount,
|
|
count( CASE WHEN fwl.log_type = 2 THEN fwl.log_id END ) AS completeWatchCount,
|
|
count( CASE WHEN fwl.log_type != 3 THEN fwl.log_id END ) AS watch_times,
|
|
count( CASE WHEN fwl.log_type != 3 THEN fwl.log_id END ) AS watch_times,
|
|
- NOW() AS create_time
|
|
|
|
|
|
+ NOW() AS create_time,
|
|
|
|
+ NOW() AS updateTime,
|
|
|
|
+ curdate() AS create_date
|
|
FROM
|
|
FROM
|
|
( SELECT fs_course_watch_log.user_id, Max( fs_course_watch_log.last_heartbeat_time ) AS last_heartbeat_time, log_type FROM fs_course_watch_log GROUP BY fs_course_watch_log.user_id ) a
|
|
( SELECT fs_course_watch_log.user_id, Max( fs_course_watch_log.last_heartbeat_time ) AS last_heartbeat_time, log_type FROM fs_course_watch_log GROUP BY fs_course_watch_log.user_id ) a
|
|
INNER JOIN fs_course_watch_log fwl ON fwl.user_id = a.user_id
|
|
INNER JOIN fs_course_watch_log fwl ON fwl.user_id = a.user_id
|
|
@@ -183,6 +190,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="completeWatchDate != null">complete_watch_date,</if>
|
|
<if test="completeWatchDate != null">complete_watch_date,</if>
|
|
<if test="completeWatchCount != null">complete_watch_count,</if>
|
|
<if test="completeWatchCount != null">complete_watch_count,</if>
|
|
<if test="watchTimes != null">watch_times,</if>
|
|
<if test="watchTimes != null">watch_times,</if>
|
|
|
|
+ <if test="createDate != null">create_date,</if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="userId != null">#{userId},</if>
|
|
<if test="userId != null">#{userId},</if>
|
|
@@ -200,6 +208,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="completeWatchDate != null">#{completeWatchDate},</if>
|
|
<if test="completeWatchDate != null">#{completeWatchDate},</if>
|
|
<if test="completeWatchCount != null">#{completeWatchCount},</if>
|
|
<if test="completeWatchCount != null">#{completeWatchCount},</if>
|
|
<if test="watchTimes != null">#{watchTimes},</if>
|
|
<if test="watchTimes != null">#{watchTimes},</if>
|
|
|
|
+ <if test="createDate != null">#{createDate},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ on duplicate key update
|
|
|
|
+ <trim suffixOverrides=",">
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</insert>
|
|
|
|
|