|
@@ -0,0 +1,87 @@
|
|
|
+<?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.FsUserCoursePeriodMapper">
|
|
|
+
|
|
|
+ <resultMap type="FsUserCoursePeriod" id="FsUserCoursePeriodResult">
|
|
|
+ <result property="periodId" column="period_id" />
|
|
|
+ <result property="periodName" column="period_name" />
|
|
|
+ <result property="companyId" column="company_id" />
|
|
|
+ <result property="courseId" column="course_id" />
|
|
|
+ <result property="videoId" column="video_id" />
|
|
|
+ <result property="startingTime" column="starting_time" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectFsUserCoursePeriodVo">
|
|
|
+ select period_id, period_name, company_id, course_id, video_id, starting_time, create_time, update_time from fs_user_course_period
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectFsUserCoursePeriodList" parameterType="FsUserCoursePeriod" resultMap="FsUserCoursePeriodResult">
|
|
|
+ <include refid="selectFsUserCoursePeriodVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="periodName != null and periodName != ''"> and period_name like concat('%', #{periodName}, '%')</if>
|
|
|
+ <if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
+ <if test="courseId != null "> and course_id = #{courseId}</if>
|
|
|
+ <if test="videoId != null "> and video_id = #{videoId}</if>
|
|
|
+ <if test="startingTime != null "> and starting_time = #{startingTime}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsUserCoursePeriodById" parameterType="Long" resultMap="FsUserCoursePeriodResult">
|
|
|
+ <include refid="selectFsUserCoursePeriodVo"/>
|
|
|
+ where period_id = #{periodId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertFsUserCoursePeriod" parameterType="FsUserCoursePeriod">
|
|
|
+ insert into fs_user_course_period
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="periodId != null">period_id,</if>
|
|
|
+ <if test="periodName != null">period_name,</if>
|
|
|
+ <if test="companyId != null">company_id,</if>
|
|
|
+ <if test="courseId != null">course_id,</if>
|
|
|
+ <if test="videoId != null">video_id,</if>
|
|
|
+ <if test="startingTime != null">starting_time,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="periodId != null">#{periodId},</if>
|
|
|
+ <if test="periodName != null">#{periodName},</if>
|
|
|
+ <if test="companyId != null">#{companyId},</if>
|
|
|
+ <if test="courseId != null">#{courseId},</if>
|
|
|
+ <if test="videoId != null">#{videoId},</if>
|
|
|
+ <if test="startingTime != null">#{startingTime},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateFsUserCoursePeriod" parameterType="FsUserCoursePeriod">
|
|
|
+ update fs_user_course_period
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="periodName != null">period_name = #{periodName},</if>
|
|
|
+ <if test="companyId != null">company_id = #{companyId},</if>
|
|
|
+ <if test="courseId != null">course_id = #{courseId},</if>
|
|
|
+ <if test="videoId != null">video_id = #{videoId},</if>
|
|
|
+ <if test="startingTime != null">starting_time = #{startingTime},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where period_id = #{periodId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteFsUserCoursePeriodById" parameterType="Long">
|
|
|
+ delete from fs_user_course_period where period_id = #{periodId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteFsUserCoursePeriodByIds" parameterType="String">
|
|
|
+ delete from fs_user_course_period where period_id in
|
|
|
+ <foreach item="periodId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{periodId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|