|
@@ -0,0 +1,115 @@
|
|
|
+<?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.store.mapper.FsUserCourseCountMapper">
|
|
|
+
|
|
|
+ <resultMap type="FsUserCourseCount" id="FsUserCourseCountResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="watchCourseCount" column="watch_course_count" />
|
|
|
+ <result property="missCourseCount" column="miss_course_count" />
|
|
|
+ <result property="missCourseStatus" column="miss_course_status" />
|
|
|
+ <result property="courseId" column="course_id" />
|
|
|
+ <result property="lastWatchDate" column="last_watch_date" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="stopWatchDays" column="stop_watch_days" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="completeWatchDate" column="complete_watch_date" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFsUserCourseCountVo">
|
|
|
+ select id, user_id, watch_course_count, miss_course_count, miss_course_status, course_id, last_watch_date, status, stop_watch_days, create_time, update_time, create_by, update_by, complete_watch_date from fs_user_course_count
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFsUserCourseCountList" parameterType="FsUserCourseCount" resultMap="FsUserCourseCountResult">
|
|
|
+ <include refid="selectFsUserCourseCountVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
+ <if test="watchCourseCount != null "> and watch_course_count = #{watchCourseCount}</if>
|
|
|
+ <if test="missCourseCount != null "> and miss_course_count = #{missCourseCount}</if>
|
|
|
+ <if test="missCourseStatus != null "> and miss_course_status = #{missCourseStatus}</if>
|
|
|
+ <if test="courseId != null "> and course_id = #{courseId}</if>
|
|
|
+ <if test="lastWatchDate != null "> and last_watch_date = #{lastWatchDate}</if>
|
|
|
+ <if test="status != null "> and status = #{status}</if>
|
|
|
+ <if test="stopWatchDays != null "> and stop_watch_days = #{stopWatchDays}</if>
|
|
|
+ <if test="completeWatchDate != null "> and complete_watch_date = #{completeWatchDate}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsUserCourseCountById" parameterType="Long" resultMap="FsUserCourseCountResult">
|
|
|
+ <include refid="selectFsUserCourseCountVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFsUserCourseCount" parameterType="FsUserCourseCount">
|
|
|
+ insert into fs_user_course_count
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="watchCourseCount != null">watch_course_count,</if>
|
|
|
+ <if test="missCourseCount != null">miss_course_count,</if>
|
|
|
+ <if test="missCourseStatus != null">miss_course_status,</if>
|
|
|
+ <if test="courseId != null">course_id,</if>
|
|
|
+ <if test="lastWatchDate != null">last_watch_date,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="stopWatchDays != null">stop_watch_days,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="completeWatchDate != null">complete_watch_date,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="watchCourseCount != null">#{watchCourseCount},</if>
|
|
|
+ <if test="missCourseCount != null">#{missCourseCount},</if>
|
|
|
+ <if test="missCourseStatus != null">#{missCourseStatus},</if>
|
|
|
+ <if test="courseId != null">#{courseId},</if>
|
|
|
+ <if test="lastWatchDate != null">#{lastWatchDate},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="stopWatchDays != null">#{stopWatchDays},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="completeWatchDate != null">#{completeWatchDate},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFsUserCourseCount" parameterType="FsUserCourseCount">
|
|
|
+ update fs_user_course_count
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="watchCourseCount != null">watch_course_count = #{watchCourseCount},</if>
|
|
|
+ <if test="missCourseCount != null">miss_course_count = #{missCourseCount},</if>
|
|
|
+ <if test="missCourseStatus != null">miss_course_status = #{missCourseStatus},</if>
|
|
|
+ <if test="courseId != null">course_id = #{courseId},</if>
|
|
|
+ <if test="lastWatchDate != null">last_watch_date = #{lastWatchDate},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="stopWatchDays != null">stop_watch_days = #{stopWatchDays},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="completeWatchDate != null">complete_watch_date = #{completeWatchDate},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteFsUserCourseCountById" parameterType="Long">
|
|
|
+ delete from fs_user_course_count where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteFsUserCourseCountByIds" parameterType="String">
|
|
|
+ delete from fs_user_course_count where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|