FsUserVideoCommentLikeMapper.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.fs.course.mapper.FsUserVideoCommentLikeMapper">
  6. <resultMap type="FsUserVideoCommentLike" id="FsUserVideoCommentLikeResult">
  7. <result property="id" column="id" />
  8. <result property="userId" column="user_id" />
  9. <result property="commentId" column="comment_id" />
  10. <result property="createTime" column="create_time" />
  11. <result property="updateTime" column="update_time" />
  12. </resultMap>
  13. <sql id="selectFsUserVideoCommentLikeVo">
  14. select id, user_id, comment_id, create_time, update_time from fs_user_video_comment_like
  15. </sql>
  16. <select id="selectFsUserVideoCommentLikeList" parameterType="FsUserVideoCommentLike" resultMap="FsUserVideoCommentLikeResult">
  17. <include refid="selectFsUserVideoCommentLikeVo"/>
  18. <where>
  19. <if test="userId != null "> and user_id = #{userId}</if>
  20. <if test="commentId != null "> and comment_id = #{commentId}</if>
  21. </where>
  22. </select>
  23. <select id="selectFsUserVideoCommentLikeById" parameterType="Long" resultMap="FsUserVideoCommentLikeResult">
  24. <include refid="selectFsUserVideoCommentLikeVo"/>
  25. where id = #{id}
  26. </select>
  27. <insert id="insertFsUserVideoCommentLike" parameterType="FsUserVideoCommentLike" useGeneratedKeys="true" keyProperty="id">
  28. insert into fs_user_video_comment_like
  29. <trim prefix="(" suffix=")" suffixOverrides=",">
  30. <if test="userId != null">user_id,</if>
  31. <if test="commentId != null">comment_id,</if>
  32. <if test="createTime != null">create_time,</if>
  33. <if test="updateTime != null">update_time,</if>
  34. </trim>
  35. <trim prefix="values (" suffix=")" suffixOverrides=",">
  36. <if test="userId != null">#{userId},</if>
  37. <if test="commentId != null">#{commentId},</if>
  38. <if test="createTime != null">#{createTime},</if>
  39. <if test="updateTime != null">#{updateTime},</if>
  40. </trim>
  41. </insert>
  42. <update id="updateFsUserVideoCommentLike" parameterType="FsUserVideoCommentLike">
  43. update fs_user_video_comment_like
  44. <trim prefix="SET" suffixOverrides=",">
  45. <if test="userId != null">user_id = #{userId},</if>
  46. <if test="commentId != null">comment_id = #{commentId},</if>
  47. <if test="createTime != null">create_time = #{createTime},</if>
  48. <if test="updateTime != null">update_time = #{updateTime},</if>
  49. </trim>
  50. where id = #{id}
  51. </update>
  52. <delete id="deleteFsUserVideoCommentLikeById" parameterType="Long">
  53. delete from fs_user_video_comment_like where id = #{id}
  54. </delete>
  55. <delete id="deleteFsUserVideoCommentLikeByIds" parameterType="String">
  56. delete from fs_user_video_comment_like where id in
  57. <foreach item="id" collection="array" open="(" separator="," close=")">
  58. #{id}
  59. </foreach>
  60. </delete>
  61. </mapper>