123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?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.FsCourseWatchCommentMapper">
- <resultMap type="FsCourseWatchComment" id="FsCourseWatchCommentResult">
- <result property="commentId" column="comment_id" />
- <result property="userId" column="user_id" />
- <result property="userType" column="user_type" />
- <result property="courseId" column="course_id" />
- <result property="videoId" column="video_id" />
- <result property="type" column="type" />
- <result property="parentId" column="parent_id" />
- <result property="content" column="content" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- <result property="isRevoke" column="is_revoke" />
- </resultMap>
- <sql id="selectFsCourseWatchCommentVo">
- select comment_id, user_id, user_type, course_id, video_id, type, parent_id, content, create_time, update_time, is_revoke from fs_course_watch_comment
- </sql>
- <select id="selectFsCourseWatchCommentList" parameterType="FsCourseWatchComment" resultMap="FsCourseWatchCommentResult">
- <include refid="selectFsCourseWatchCommentVo"/>
- <where>
- <if test="userId != null "> and user_id = #{userId}</if>
- <if test="userType != null "> and user_type = #{userType}</if>
- <if test="courseId != null "> and course_id = #{courseId}</if>
- <if test="videoId != null "> and video_id = #{videoId}</if>
- <if test="type != null "> and type = #{type}</if>
- <if test="parentId != null "> and parent_id = #{parentId}</if>
- <if test="content != null and content != ''"> and content = #{content}</if>
- <if test="isRevoke != null "> and is_revoke = #{isRevoke}</if>
- </where>
- </select>
- <select id="selectFsCourseWatchCommentByCommentId" parameterType="Long" resultMap="FsCourseWatchCommentResult">
- <include refid="selectFsCourseWatchCommentVo"/>
- where comment_id = #{commentId}
- </select>
- <insert id="insertFsCourseWatchComment" parameterType="FsCourseWatchComment" useGeneratedKeys="true" keyProperty="commentId">
- insert into fs_course_watch_comment
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="userId != null">user_id,</if>
- <if test="userType != null">user_type,</if>
- <if test="courseId != null">course_id,</if>
- <if test="videoId != null">video_id,</if>
- <if test="type != null">type,</if>
- <if test="parentId != null">parent_id,</if>
- <if test="content != null">content,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="isRevoke != null">is_revoke,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="userId != null">#{userId},</if>
- <if test="userType != null">#{userType},</if>
- <if test="courseId != null">#{courseId},</if>
- <if test="videoId != null">#{videoId},</if>
- <if test="type != null">#{type},</if>
- <if test="parentId != null">#{parentId},</if>
- <if test="content != null">#{content},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="isRevoke != null">#{isRevoke},</if>
- </trim>
- </insert>
- <update id="updateFsCourseWatchComment" parameterType="FsCourseWatchComment">
- update fs_course_watch_comment
- <trim prefix="SET" suffixOverrides=",">
- <if test="userId != null">user_id = #{userId},</if>
- <if test="userType != null">user_type = #{userType},</if>
- <if test="courseId != null">course_id = #{courseId},</if>
- <if test="videoId != null">video_id = #{videoId},</if>
- <if test="type != null">type = #{type},</if>
- <if test="parentId != null">parent_id = #{parentId},</if>
- <if test="content != null">content = #{content},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="isRevoke != null">is_revoke = #{isRevoke},</if>
- </trim>
- where comment_id = #{commentId}
- </update>
- <delete id="deleteFsCourseWatchCommentByCommentId" parameterType="Long">
- delete from fs_course_watch_comment where comment_id = #{commentId}
- </delete>
- <delete id="deleteFsCourseWatchCommentByCommentIds" parameterType="String">
- delete from fs_course_watch_comment where comment_id in
- <foreach item="commentId" collection="array" open="(" separator="," close=")">
- #{commentId}
- </foreach>
- </delete>
- <select id="selectH5CourseWatchComments" resultType="com.fs.course.vo.FsCourseWatchCommentVO">
- select comment_id, user_id, user_type, course_id, video_id, type, content, create_time from fs_course_watch_comment
- <where>
- and is_revoke = 0
- </where>
- order by create_time desc
- </select>
- </mapper>
|