Mall2ShippingReminderAlarmDao.xml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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.alarm.Mall2ShippingReminderAlarmDao">
  4. <resultMap type="com.kmall.admin.entity.alarm.Mall2ShippingReminderAlarmEntity" id="mall2ShippingReminderAlarmMap">
  5. <result property="msraId" column="msra_id"/>
  6. <result property="goodsId" column="goods_id"/>
  7. <result property="goodsName" column="goods_name"/>
  8. <result property="averageSales" column="average_sales"/>
  9. <result property="storeId" column="store_id"/>
  10. <result property="sku" column="sku"/>
  11. <result property="storeName" column="store_name"/>
  12. <result property="stockNum" column="stock_num"/>
  13. <result property="alarmType" column="alarm_type"/>
  14. <result property="alarmTime" column="alarm_time"/>
  15. <result property="isWarning" column="is_warning"/>
  16. <result property="createrSn" column="creater_sn"/>
  17. <result property="createTime" column="create_time"/>
  18. <result property="moderSn" column="moder_sn"/>
  19. <result property="modTime" column="mod_time"/>
  20. <result property="tstm" column="tstm"/>
  21. </resultMap>
  22. <select id="queryObject" resultType="com.kmall.admin.entity.alarm.Mall2ShippingReminderAlarmEntity">
  23. select
  24. `msra_id`,
  25. `goods_id`,
  26. `goods_name`,
  27. `average_sales`,
  28. `store_id`,
  29. `sku`,
  30. `store_name`,
  31. `stock_num`,
  32. `alarm_type`,
  33. `alarm_time`,
  34. `is_warning`,
  35. `creater_sn`,
  36. `create_time`,
  37. `moder_sn`,
  38. `mod_time`,
  39. `tstm`
  40. from mall2_shipping_reminder_alarm
  41. where msra_id = #{id}
  42. </select>
  43. <select id="queryList" resultType="com.kmall.admin.entity.alarm.Mall2ShippingReminderAlarmEntity">
  44. select
  45. `msra_id`,
  46. `goods_id`,
  47. `goods_name`,
  48. `average_sales`,
  49. `store_id`,
  50. `sku`,
  51. `store_name`,
  52. `stock_num`,
  53. `alarm_type`,
  54. `alarm_time`,
  55. `is_warning`,
  56. `creater_sn`,
  57. `create_time`,
  58. `moder_sn`,
  59. `mod_time`,
  60. `tstm`
  61. from mall2_shipping_reminder_alarm
  62. WHERE 1=1
  63. and is_warning = 1
  64. <if test="name != null and name.trim() != ''">
  65. AND name LIKE concat('%',#{name},'%')
  66. </if>
  67. <choose>
  68. <when test="sidx != null and sidx.trim() != ''">
  69. order by ${sidx} ${order}
  70. </when>
  71. <otherwise>
  72. order by msra_id desc
  73. </otherwise>
  74. </choose>
  75. <if test="offset != null and limit != null">
  76. limit #{offset}, #{limit}
  77. </if>
  78. </select>
  79. <select id="queryTotal" resultType="int">
  80. select count(*) from mall2_shipping_reminder_alarm
  81. WHERE 1=1
  82. and is_warning = 1
  83. <if test="name != null and name.trim() != ''">
  84. AND name LIKE concat('%',#{name},'%')
  85. </if>
  86. </select>
  87. <insert id="save" parameterType="com.kmall.admin.entity.alarm.Mall2ShippingReminderAlarmEntity" useGeneratedKeys="true" keyProperty="id">
  88. insert into mall2_shipping_reminder_alarm(
  89. `msra_id`,
  90. `goods_id`,
  91. `goods_name`,
  92. `average_sales`,
  93. `store_id`,
  94. `sku`,
  95. `store_name`,
  96. `stock_num`,
  97. `alarm_type`,
  98. `alarm_time`,
  99. `is_warning`,
  100. `creater_sn`,
  101. `create_time`,
  102. `moder_sn`,
  103. `mod_time`,
  104. `tstm`)
  105. values(
  106. #{msraId},
  107. #{goodsId},
  108. #{goodsName},
  109. #{averageSales},
  110. #{storeId},
  111. #{sku},
  112. #{storeName},
  113. #{stockNum},
  114. #{alarmType},
  115. #{alarmTime},
  116. #{isWarning},
  117. #{createrSn},
  118. #{createTime},
  119. #{moderSn},
  120. #{modTime},
  121. #{tstm})
  122. </insert>
  123. <update id="update" parameterType="com.kmall.admin.entity.alarm.Mall2ShippingReminderAlarmEntity">
  124. update mall2_shipping_reminder_alarm
  125. <set>
  126. <if test="goodsId != null">`goods_id` = #{goodsId}, </if>
  127. <if test="goodsName != null">`goods_name` = #{goodsName}, </if>
  128. <if test="averageSales != null">`average_sales` = #{averageSales}, </if>
  129. <if test="storeId != null">`store_id` = #{storeId}, </if>
  130. <if test="sku != null">`sku` = #{sku}, </if>
  131. <if test="storeName != null">`store_name` = #{storeName}, </if>
  132. <if test="stockNum != null">`stock_num` = #{stockNum}, </if>
  133. <if test="alarmType != null">`alarm_type` = #{alarmType}, </if>
  134. <if test="alarmTime != null">`alarm_time` = #{alarmTime}, </if>
  135. <if test="isWarning != null">`is_warning` = #{isWarning}, </if>
  136. <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
  137. <if test="createTime != null">`create_time` = #{createTime}, </if>
  138. <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
  139. <if test="modTime != null">`mod_time` = #{modTime}, </if>
  140. <if test="tstm != null">`tstm` = #{tstm}</if>
  141. </set>
  142. where msra_id = #{msraId}
  143. </update>
  144. <delete id="delete">
  145. delete from mall2_shipping_reminder_alarm where msra_id = #{value}
  146. </delete>
  147. <delete id="deleteBatch">
  148. delete from mall2_shipping_reminder_alarm where msra_id in
  149. <foreach item="msraId" collection="array" open="(" separator="," close=")">
  150. #{msraId}
  151. </foreach>
  152. </delete>
  153. <select id="queryByGoodsIdAndStoreId" resultType="com.kmall.admin.entity.alarm.Mall2ShippingReminderAlarmEntity">
  154. select
  155. `msra_id`,
  156. `goods_id`,
  157. `goods_name`,
  158. `average_sales`,
  159. `store_id`,
  160. `sku`,
  161. `store_name`,
  162. `stock_num`,
  163. `alarm_type`,
  164. `alarm_time`,
  165. `is_warning`,
  166. `creater_sn`,
  167. `create_time`,
  168. `moder_sn`,
  169. `mod_time`,
  170. `tstm`
  171. from mall2_shipping_reminder_alarm
  172. where goods_id = #{goodsId} and store_id = #{storeId}
  173. </select>
  174. <insert id="insertBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
  175. insert into mall2_shipping_reminder_alarm(
  176. `msra_id`,
  177. `goods_id`,
  178. `goods_name`,
  179. `average_sales`,
  180. `store_id`,
  181. `sku`,
  182. `store_name`,
  183. `stock_num`,
  184. `alarm_type`,
  185. `alarm_time`,
  186. `is_warning`,
  187. `creater_sn`,
  188. `create_time`,
  189. `moder_sn`,
  190. `mod_time`,
  191. `tstm`)
  192. values
  193. <foreach collection="list" index="index" item="item" separator=",">
  194. (
  195. #{item.msraId},
  196. #{item.goodsId},
  197. #{item.goodsName},
  198. #{item.averageSales},
  199. #{item.storeId},
  200. #{item.sku},
  201. #{item.storeName},
  202. #{item.stockNum},
  203. #{item.alarmType},
  204. #{item.alarmTime},
  205. #{item.isWarning},
  206. #{item.createrSn},
  207. #{item.createTime},
  208. #{item.moderSn},
  209. #{item.modTime},
  210. #{item.tstm}
  211. )
  212. </foreach>
  213. </insert>
  214. <update id="updateBatch" parameterType="java.util.List">
  215. <foreach collection="list" item="item" index="index" open="" close="" separator=";">
  216. update mall2_shipping_reminder_alarm
  217. <set>
  218. <if test="item.goodsId != null">`goods_id` = #{item.goodsId}, </if>
  219. <if test="item.goodsName != null">`goods_name` = #{item.goodsName}, </if>
  220. <if test="item.averageSales != null">`average_sales` = #{item.averageSales}, </if>
  221. <if test="item.storeId != null">`store_id` = #{item.storeId}, </if>
  222. <if test="item.sku != null">`sku` = #{item.sku}, </if>
  223. <if test="item.storeName != null">`store_name` = #{item.storeName}, </if>
  224. <if test="item.stockNum != null">`stock_num` = #{item.stockNum}, </if>
  225. <if test="item.alarmType != null">`alarm_type` = #{item.alarmType}, </if>
  226. <if test="item.alarmTime != null">`alarm_time` = #{item.alarmTime}, </if>
  227. <if test="item.isWarning != null">`is_warning` = #{item.isWarning}, </if>
  228. <if test="item.createrSn != null">`creater_sn` = #{item.createrSn}, </if>
  229. <if test="item.createTime != null">`create_time` = #{item.createTime}, </if>
  230. <if test="item.moderSn != null">`moder_sn` = #{item.moderSn}, </if>
  231. <if test="item.modTime != null">`mod_time` = #{item.modTime}, </if>
  232. <if test="item.tstm != null">`tstm` = #{item.tstm}</if>
  233. </set>
  234. where msra_id = #{item.msraId}
  235. </foreach>
  236. </update>
  237. </mapper>