LiveAfterSalesItemMapper.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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.live.mapper.LiveAfterSalesItemMapper">
  6. <resultMap type="LiveAfterSalesItem" id="LiveAfterSalesItemResult">
  7. <result property="id" column="id" />
  8. <result property="afterSalesId" column="after_sales_id" />
  9. <result property="goodsId" column="goods_id" />
  10. <result property="productId" column="product_id" />
  11. <result property="jsonInfo" column="json_info" />
  12. <result property="isDel" column="is_del" />
  13. <result property="productAttrValueId" column="product_attr_value_id" />
  14. </resultMap>
  15. <sql id="selectLiveAfterSalesItemVo">
  16. select id, after_sales_id, goods_id, product_id, json_info, is_del, product_attr_value_id from live_after_sales_item
  17. </sql>
  18. <select id="selectLiveAfterSalesItemList" parameterType="LiveAfterSalesItem" resultMap="LiveAfterSalesItemResult">
  19. <include refid="selectLiveAfterSalesItemVo"/>
  20. <where>
  21. <if test="afterSalesId != null "> and after_sales_id = #{afterSalesId}</if>
  22. <if test="goodsId != null "> and goods_id = #{goodsId}</if>
  23. <if test="productId != null "> and product_id = #{productId}</if>
  24. <if test="jsonInfo != null and jsonInfo != ''"> and json_info = #{jsonInfo}</if>
  25. <if test="isDel != null "> and is_del = #{isDel}</if>
  26. <if test="productAttrValueId != null "> and product_attr_value_id = #{productAttrValueId}</if>
  27. </where>
  28. </select>
  29. <select id="selectLiveAfterSalesItemById" parameterType="Long" resultMap="LiveAfterSalesItemResult">
  30. <include refid="selectLiveAfterSalesItemVo"/>
  31. where id = #{id}
  32. </select>
  33. <insert id="insertLiveAfterSalesItem" parameterType="LiveAfterSalesItem" useGeneratedKeys="true" keyProperty="id">
  34. insert into live_after_sales_item
  35. <trim prefix="(" suffix=")" suffixOverrides=",">
  36. <if test="afterSalesId != null">after_sales_id,</if>
  37. <if test="goodsId != null">goods_id,</if>
  38. <if test="productId != null">product_id,</if>
  39. <if test="jsonInfo != null and jsonInfo != ''">json_info,</if>
  40. <if test="isDel != null">is_del,</if>
  41. <if test="productAttrValueId != null">product_attr_value_id,</if>
  42. </trim>
  43. <trim prefix="values (" suffix=")" suffixOverrides=",">
  44. <if test="afterSalesId != null">#{afterSalesId},</if>
  45. <if test="goodsId != null">#{goodsId},</if>
  46. <if test="productId != null">#{productId},</if>
  47. <if test="jsonInfo != null and jsonInfo != ''">#{jsonInfo},</if>
  48. <if test="isDel != null">#{isDel},</if>
  49. <if test="productAttrValueId != null">#{productAttrValueId},</if>
  50. </trim>
  51. </insert>
  52. <update id="updateLiveAfterSalesItem" parameterType="LiveAfterSalesItem">
  53. update live_after_sales_item
  54. <trim prefix="SET" suffixOverrides=",">
  55. <if test="afterSalesId != null">after_sales_id = #{afterSalesId},</if>
  56. <if test="goodsId != null">goods_id = #{goodsId},</if>
  57. <if test="productId != null">product_id = #{productId},</if>
  58. <if test="jsonInfo != null and jsonInfo != ''">json_info = #{jsonInfo},</if>
  59. <if test="isDel != null">is_del = #{isDel},</if>
  60. <if test="productAttrValueId != null">product_attr_value_id = #{productAttrValueId},</if>
  61. </trim>
  62. where id = #{id}
  63. </update>
  64. <delete id="deleteLiveAfterSalesItemById" parameterType="Long">
  65. delete from live_after_sales_item where id = #{id}
  66. </delete>
  67. <delete id="deleteLiveAfterSalesItemByIds" parameterType="String">
  68. delete from live_after_sales_item where id in
  69. <foreach item="id" collection="array" open="(" separator="," close=")">
  70. #{id}
  71. </foreach>
  72. </delete>
  73. </mapper>