猫妈狗爸伴宠师小程序后端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
4.4 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  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.ruoyi.model.mapper.AppletCommentMapper">
  6. <resultMap type="AppletComment" id="AppletCommentResult">
  7. <result property="id" column="id" />
  8. <result property="comment" column="comment" />
  9. <result property="satisfaction" column="satisfaction" />
  10. <result property="user1Id" column="user1_id" />
  11. <result property="user2Id" column="user2_id" />
  12. <result property="delFlag" column="del_flag" />
  13. <result property="createBy" column="create_by" />
  14. <result property="createTime" column="create_time" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="updateTime" column="update_time" />
  17. </resultMap>
  18. <sql id="selectAppletCommentVo">
  19. select id, comment, satisfaction, user1_id, user2_id, del_flag, create_by, create_time, update_by, update_time from applet_comment
  20. </sql>
  21. <select id="selectAppletCommentList" parameterType="AppletComment" resultMap="AppletCommentResult">
  22. <include refid="selectAppletCommentVo"/>
  23. <where>
  24. <if test="comment != null and comment != ''"> and comment = #{comment}</if>
  25. <if test="satisfaction != null "> and satisfaction = #{satisfaction}</if>
  26. <if test="user1Id != null "> and user1_id = #{user1Id}</if>
  27. <if test="user2Id != null "> and user2_id = #{user2Id}</if>
  28. </where>
  29. </select>
  30. <select id="selectAppletCommentById" parameterType="AppletComment" resultMap="AppletCommentResult">
  31. <include refid="selectAppletCommentVo"/>
  32. where id = #{id}
  33. </select>
  34. <insert id="insertAppletComment" parameterType="AppletComment" useGeneratedKeys="true" keyProperty="id">
  35. insert into applet_comment
  36. <trim prefix="(" suffix=")" suffixOverrides=",">
  37. <if test="comment != null and comment != ''">comment,</if>
  38. <if test="satisfaction != null">satisfaction,</if>
  39. <if test="user1Id != null">user1_id,</if>
  40. <if test="user2Id != null">user2_id,</if>
  41. <if test="delFlag != null">del_flag,</if>
  42. <if test="createBy != null">create_by,</if>
  43. <if test="createTime != null">create_time,</if>
  44. <if test="updateBy != null">update_by,</if>
  45. <if test="updateTime != null">update_time,</if>
  46. </trim>
  47. <trim prefix="values (" suffix=")" suffixOverrides=",">
  48. <if test="comment != null and comment != ''">#{comment},</if>
  49. <if test="satisfaction != null">#{satisfaction},</if>
  50. <if test="user1Id != null">#{user1Id},</if>
  51. <if test="user2Id != null">#{user2Id},</if>
  52. <if test="delFlag != null">#{delFlag},</if>
  53. <if test="createBy != null">#{createBy},</if>
  54. <if test="createTime != null">#{createTime},</if>
  55. <if test="updateBy != null">#{updateBy},</if>
  56. <if test="updateTime != null">#{updateTime},</if>
  57. </trim>
  58. </insert>
  59. <update id="updateAppletComment" parameterType="AppletComment">
  60. update applet_comment
  61. <trim prefix="SET" suffixOverrides=",">
  62. <if test="comment != null and comment != ''">comment = #{comment},</if>
  63. <if test="satisfaction != null">satisfaction = #{satisfaction},</if>
  64. <if test="user1Id != null">user1_id = #{user1Id},</if>
  65. <if test="user2Id != null">user2_id = #{user2Id},</if>
  66. <if test="delFlag != null">del_flag = #{delFlag},</if>
  67. <if test="createBy != null">create_by = #{createBy},</if>
  68. <if test="createTime != null">create_time = #{createTime},</if>
  69. <if test="updateBy != null">update_by = #{updateBy},</if>
  70. <if test="updateTime != null">update_time = #{updateTime},</if>
  71. </trim>
  72. where id = #{id}
  73. </update>
  74. <delete id="deleteAppletCommentById" parameterType="Long">
  75. delete from applet_comment where id = #{id}
  76. </delete>
  77. <delete id="deleteAppletCommentByIds" parameterType="String">
  78. delete from applet_comment where id in
  79. <foreach item="id" collection="array" open="(" separator="," close=")">
  80. #{id}
  81. </foreach>
  82. </delete>
  83. </mapper>