|
@@ -3,38 +3,83 @@
|
|
|
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="trainingCampId" column="training_camp_id" />
|
|
|
<result property="createTime" column="create_time" />
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
+ <result property="courseStyle" column="course_style" />
|
|
|
+ <result property="liveRoomStyle" column="live_room_style" />
|
|
|
+ <result property="redPacketGrantMethod" column="red_packet_grant_method" />
|
|
|
+ <result property="periodType" column="period_type" />
|
|
|
+ <result property="periodStartingTime" column="period_starting_time" />
|
|
|
+ <result property="periodEndTime" column="period_end_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
|
|
|
+ select period_id, period_name, company_id, course_id, video_id, training_camp_id, create_time, update_time, course_style, live_room_style, red_packet_grant_method, period_type, period_starting_time, period_end_time from fs_user_course_period
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectFsUserCoursePeriodList" parameterType="FsUserCoursePeriod" resultMap="FsUserCoursePeriodResult">
|
|
|
<include refid="selectFsUserCoursePeriodVo"/>
|
|
|
- <where>
|
|
|
+ <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>
|
|
|
+ <if test="trainingCampId != null "> and training_camp_id = #{trainingCampId}</if>
|
|
|
+ <if test="courseStyle != null and courseStyle != ''"> and course_style = #{courseStyle}</if>
|
|
|
+ <if test="liveRoomStyle != null and liveRoomStyle != ''"> and live_room_style = #{liveRoomStyle}</if>
|
|
|
+ <if test="redPacketGrantMethod != null "> and red_packet_grant_method = #{redPacketGrantMethod}</if>
|
|
|
+ <if test="periodType != null "> and period_type = #{periodType}</if>
|
|
|
+ <if test="periodStartingTime != null "> and period_starting_time = #{periodStartingTime}</if>
|
|
|
+ <if test="periodEndTime != null "> and period_end_time = #{periodEndTime}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectFsUserCoursePeriodPage" parameterType="FsUserCoursePeriod" resultType="FsUserCoursePeriodVO">
|
|
|
+ SELECT
|
|
|
+ period_id,
|
|
|
+ period_name,
|
|
|
+ fs_user_course_period.company_id,
|
|
|
+ course_id,
|
|
|
+ video_id,
|
|
|
+ training_camp_id,
|
|
|
+ fs_user_course_period.create_time,
|
|
|
+ fs_user_course_period.update_time,
|
|
|
+ course_style,
|
|
|
+ live_room_style,
|
|
|
+ red_packet_grant_method,
|
|
|
+ period_type,
|
|
|
+ period_starting_time,
|
|
|
+ GROUP_CONCAT( company.company_name ) AS companyName
|
|
|
+ FROM
|
|
|
+ fs_user_course_period
|
|
|
+ LEFT JOIN company ON fs_user_course_period.company_id = company.company_id
|
|
|
+ <where>
|
|
|
+ <if test="periodName != null and periodName != ''"> and period_name like concat('%', #{periodName}, '%')</if>
|
|
|
+ <if test="companyIdList != null and companyIdList.size() > 0 ">
|
|
|
+ and fs_user_course_period.company_id in
|
|
|
+ <foreach item="companyId" index="index" collection="companyIdList"
|
|
|
+ open="(" separator="," close=")">
|
|
|
+ #{companyId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="periodStartingTime != null "> and period_starting_time = #{periodStartingTime}</if>
|
|
|
+ <if test="periodEndTime != null "> and period_end_time = #{periodEndTime}</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=",">
|
|
@@ -43,9 +88,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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="trainingCampId != null">training_camp_id,</if>
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="courseStyle != null">course_style,</if>
|
|
|
+ <if test="liveRoomStyle != null">live_room_style,</if>
|
|
|
+ <if test="redPacketGrantMethod != null">red_packet_grant_method,</if>
|
|
|
+ <if test="periodType != null">period_type,</if>
|
|
|
+ <if test="periodStartingTime != null">period_starting_time,</if>
|
|
|
+ <if test="periodEndTime != null">period_end_time,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="periodId != null">#{periodId},</if>
|
|
@@ -53,9 +104,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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="trainingCampId != null">#{trainingCampId},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="courseStyle != null">#{courseStyle},</if>
|
|
|
+ <if test="liveRoomStyle != null">#{liveRoomStyle},</if>
|
|
|
+ <if test="redPacketGrantMethod != null">#{redPacketGrantMethod},</if>
|
|
|
+ <if test="periodType != null">#{periodType},</if>
|
|
|
+ <if test="periodStartingTime != null">#{periodStartingTime},</if>
|
|
|
+ <if test="periodEndTime != null">#{periodEndTime},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -66,9 +123,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<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="trainingCampId != null">training_camp_id = #{trainingCampId},</if>
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="courseStyle != null">course_style = #{courseStyle},</if>
|
|
|
+ <if test="liveRoomStyle != null">live_room_style = #{liveRoomStyle},</if>
|
|
|
+ <if test="redPacketGrantMethod != null">red_packet_grant_method = #{redPacketGrantMethod},</if>
|
|
|
+ <if test="periodType != null">period_type = #{periodType},</if>
|
|
|
+ <if test="periodStartingTime != null">period_starting_time = #{periodStartingTime},</if>
|
|
|
+ <if test="periodEndTime != null">period_end_time = #{periodEndTime},</if>
|
|
|
</trim>
|
|
|
where period_id = #{periodId}
|
|
|
</update>
|
|
@@ -78,10 +141,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteFsUserCoursePeriodByIds" parameterType="String">
|
|
|
- delete from fs_user_course_period where period_id in
|
|
|
+ delete from fs_user_course_period where period_id in
|
|
|
<foreach item="periodId" collection="array" open="(" separator="," close=")">
|
|
|
#{periodId}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-
|
|
|
-</mapper>
|
|
|
+
|
|
|
+</mapper>
|