MkActivitiesFullGiftDao.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.kmall.admin.dao.MkActivitiesFullGiftDao">
  4. <resultMap type="com.kmall.admin.entity.MkActivitiesFullGiftEntity" id="mkActivitiesFullGiftMap">
  5. <result property="mafrId" column="mafr_id"/>
  6. <result property="productName" column="product_name"/>
  7. <result property="shopSn" column="shop_sn"/>
  8. <result property="goodsSn" column="goods_sn"/>
  9. <result property="barcode" column="barcode"/>
  10. <result property="productBrand" column="product_brand"/>
  11. <result property="productSeries" column="product_series"/>
  12. <result property="qualifiedAmount" column="qualified_amount"/>
  13. <result property="giftBarcode" column="gift_barcode"/>
  14. <result property="createTime" column="create_time"/>
  15. <result property="createrSn" column="creater_sn"/>
  16. <result property="moderSn" column="moder_sn"/>
  17. <result property="updateTime" column="update_time"/>
  18. </resultMap>
  19. <select id="queryObject" resultType="com.kmall.admin.entity.MkActivitiesFullGiftEntity">
  20. select
  21. `mafr_id`,
  22. `product_name`,
  23. `shop_sn`,
  24. `goods_sn`,
  25. `barcode`,
  26. `product_brand`,
  27. `product_series`,
  28. `qualified_amount`,
  29. `gift_barcode`,
  30. `create_time`,
  31. `creater_sn`,
  32. `moder_sn`,
  33. `update_time`
  34. from mk_activities_full_gift
  35. where mafr_id = #{id}
  36. </select>
  37. <select id="queryList" resultType="com.kmall.admin.entity.MkActivitiesFullGiftEntity">
  38. select
  39. `mafr_id`,
  40. `product_name`,
  41. `shop_sn`,
  42. `goods_sn`,
  43. `barcode`,
  44. `product_brand`,
  45. `product_series`,
  46. `qualified_amount`,
  47. `gift_barcode`,
  48. `create_time`,
  49. `creater_sn`,
  50. `moder_sn`,
  51. `update_time`
  52. from mk_activities_full_gift
  53. WHERE 1=1
  54. <if test="name != null and name.trim() != ''">
  55. AND name LIKE concat('%',#{name},'%')
  56. </if>
  57. <choose>
  58. <when test="sidx != null and sidx.trim() != ''">
  59. order by ${sidx} ${order}
  60. </when>
  61. <otherwise>
  62. order by mafr_id desc
  63. </otherwise>
  64. </choose>
  65. <if test="offset != null and limit != null">
  66. limit #{offset}, #{limit}
  67. </if>
  68. </select>
  69. <select id="queryTotal" resultType="int">
  70. select count(*) from mk_activities_full_gift
  71. WHERE 1=1
  72. <if test="name != null and name.trim() != ''">
  73. AND name LIKE concat('%',#{name},'%')
  74. </if>
  75. </select>
  76. <insert id="save" parameterType="com.kmall.admin.entity.MkActivitiesFullGiftEntity" useGeneratedKeys="true" keyProperty="mafrId">
  77. insert into mk_activities_full_gift(
  78. `product_name`,
  79. `shop_sn`,
  80. `goods_sn`,
  81. `barcode`,
  82. `product_brand`,
  83. `product_series`,
  84. `qualified_amount`,
  85. `gift_barcode`,
  86. `create_time`,
  87. `creater_sn`,
  88. `moder_sn`,
  89. `update_time`)
  90. values(
  91. #{productName},
  92. #{shopSn},
  93. #{goodsSn},
  94. #{barcode},
  95. #{productBrand},
  96. #{productSeries},
  97. #{qualifiedAmount},
  98. #{giftBarcode},
  99. #{createTime},
  100. #{createrSn},
  101. #{moderSn},
  102. #{updateTime})
  103. </insert>
  104. <update id="update" parameterType="com.kmall.admin.entity.MkActivitiesFullGiftEntity">
  105. update mk_activities_full_gift
  106. <set>
  107. <if test="productName != null">`product_name` = #{productName}, </if>
  108. <if test="shopSn != null">`shop_sn` = #{shopSn}, </if>
  109. <if test="goodsSn != null">`goods_sn` = #{goodsSn}, </if>
  110. <if test="barcode != null">`barcode` = #{barcode}, </if>
  111. <if test="productBrand != null">`product_brand` = #{productBrand}, </if>
  112. <if test="productSeries != null">`product_series` = #{productSeries}, </if>
  113. <if test="qualifiedAmount != null">`qualified_amount` = #{qualifiedAmount}, </if>
  114. <if test="giftBarcode != null">`gift_barcode` = #{giftBarcode}, </if>
  115. <if test="createTime != null">`create_time` = #{createTime}, </if>
  116. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  117. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  118. <if test="updateTime != null">`update_time` = #{updateTime}</if>
  119. </set>
  120. where mafr_id = #{mafrId}
  121. </update>
  122. <delete id="delete">
  123. delete from mk_activities_full_gift where mafr_id = #{value}
  124. </delete>
  125. <delete id="deleteBatch">
  126. delete from mk_activities_full_gift where mafr_id in
  127. <foreach item="mafrId" collection="array" open="(" separator="," close=")">
  128. #{mafrId}
  129. </foreach>
  130. </delete>
  131. </mapper>