PosOrderRatingMapper.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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.system.mapper.PosOrderRatingMapper">
  6. <resultMap type="PosOrderRating" id="PosOrderRatingResult">
  7. <result property="id" column="id" />
  8. <result property="ddId" column="dd_id" />
  9. <result property="userId" column="user_id" />
  10. <result property="qsId" column="qs_id" />
  11. <result property="qsStars" column="qs_stars" />
  12. <result property="qsComment" column="qs_comment" />
  13. <result property="qsImage" column="qs_image" />
  14. <result property="mdId" column="md_id" />
  15. <result property="mdStars" column="md_stars" />
  16. <result property="mdComment" column="md_comment" />
  17. <result property="mdImage" column="md_image" />
  18. <result property="createTime" column="create_time" />
  19. </resultMap>
  20. <sql id="selectPosOrderRatingVo">
  21. select id, dd_id, user_id, qs_id, qs_stars, qs_comment, qs_image, md_id, md_stars, md_comment, md_image, create_time from pos_order_rating
  22. </sql>
  23. <select id="selectPosOrderRatingList" parameterType="PosOrderRating" resultMap="PosOrderRatingResult">
  24. <include refid="selectPosOrderRatingVo"/>
  25. <where>
  26. <if test="ddId != null "> and dd_id = #{ddId}</if>
  27. <if test="userId != null "> and user_id = #{userId}</if>
  28. <if test="qsId != null "> and qs_id = #{qsId}</if>
  29. <if test="qsStars != null and qsStars != ''"> and qs_stars = #{qsStars}</if>
  30. <if test="qsComment != null and qsComment != ''"> and qs_comment = #{qsComment}</if>
  31. <if test="qsImage != null and qsImage != ''"> and qs_image = #{qsImage}</if>
  32. <if test="mdId != null "> and md_id = #{mdId}</if>
  33. <if test="mdStars != null and mdStars != ''"> and md_stars = #{mdStars}</if>
  34. <if test="mdComment != null and mdComment != ''"> and md_comment = #{mdComment}</if>
  35. <if test="mdImage != null and mdImage != ''"> and md_image = #{mdImage}</if>
  36. </where>
  37. </select>
  38. <select id="selectPosOrderRatingById" parameterType="Long" resultMap="PosOrderRatingResult">
  39. <include refid="selectPosOrderRatingVo"/>
  40. where id = #{id}
  41. </select>
  42. <insert id="insertPosOrderRating" parameterType="PosOrderRating" useGeneratedKeys="true" keyProperty="id">
  43. insert into pos_order_rating
  44. <trim prefix="(" suffix=")" suffixOverrides=",">
  45. <if test="ddId != null">dd_id,</if>
  46. <if test="userId != null">user_id,</if>
  47. <if test="qsId != null">qs_id,</if>
  48. <if test="qsStars != null">qs_stars,</if>
  49. <if test="qsComment != null">qs_comment,</if>
  50. <if test="qsImage != null">qs_image,</if>
  51. <if test="mdId != null">md_id,</if>
  52. <if test="mdStars != null">md_stars,</if>
  53. <if test="mdComment != null">md_comment,</if>
  54. <if test="mdImage != null">md_image,</if>
  55. <if test="createTime != null">create_time,</if>
  56. </trim>
  57. <trim prefix="values (" suffix=")" suffixOverrides=",">
  58. <if test="ddId != null">#{ddId},</if>
  59. <if test="userId != null">#{userId},</if>
  60. <if test="qsId != null">#{qsId},</if>
  61. <if test="qsStars != null">#{qsStars},</if>
  62. <if test="qsComment != null">#{qsComment},</if>
  63. <if test="qsImage != null">#{qsImage},</if>
  64. <if test="mdId != null">#{mdId},</if>
  65. <if test="mdStars != null">#{mdStars},</if>
  66. <if test="mdComment != null">#{mdComment},</if>
  67. <if test="mdImage != null">#{mdImage},</if>
  68. <if test="createTime != null">#{createTime},</if>
  69. </trim>
  70. </insert>
  71. <update id="updatePosOrderRating" parameterType="PosOrderRating">
  72. update pos_order_rating
  73. <trim prefix="SET" suffixOverrides=",">
  74. <if test="ddId != null">dd_id = #{ddId},</if>
  75. <if test="userId != null">user_id = #{userId},</if>
  76. <if test="qsId != null">qs_id = #{qsId},</if>
  77. <if test="qsStars != null">qs_stars = #{qsStars},</if>
  78. <if test="qsComment != null">qs_comment = #{qsComment},</if>
  79. <if test="qsImage != null">qs_image = #{qsImage},</if>
  80. <if test="mdId != null">md_id = #{mdId},</if>
  81. <if test="mdStars != null">md_stars = #{mdStars},</if>
  82. <if test="mdComment != null">md_comment = #{mdComment},</if>
  83. <if test="mdImage != null">md_image = #{mdImage},</if>
  84. <if test="createTime != null">create_time = #{createTime},</if>
  85. </trim>
  86. where id = #{id}
  87. </update>
  88. <delete id="deletePosOrderRatingById" parameterType="Long">
  89. delete from pos_order_rating where id = #{id}
  90. </delete>
  91. <delete id="deletePosOrderRatingByIds" parameterType="String">
  92. delete from pos_order_rating where id in
  93. <foreach item="id" collection="array" open="(" separator="," close=")">
  94. #{id}
  95. </foreach>
  96. </delete>
  97. </mapper>