1
0

StockChangeDao.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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.haikong.StockChangeDao">
  4. <resultMap type="com.kmall.admin.entity.haikong.StockChangeEntity" id="stockChangeMap">
  5. <result property="id" column="id"/>
  6. <result property="type" column="type"/>
  7. <result property="time" column="time"/>
  8. <result property="merchSn" column="merch_sn"/>
  9. <result property="merch" column="merch"/>
  10. <result property="storeId" column="store_id"/>
  11. <result property="store" column="store"/>
  12. <result property="thirdMerchSn" column="third_merch_sn"/>
  13. <result property="audit" column="audit"/>
  14. <result property="thirdMerch" column="third_merch"/>
  15. <result property="remark" column="remark"/>
  16. <result property="createBy" column="create_by"/>
  17. <result property="createTime" column="create_time"/>
  18. <result property="modifyBy" column="modify_by"/>
  19. <result property="modifyTime" column="modify_time"/>
  20. <result property="auditBy" column="audit_by"/>
  21. <result property="auditTime" column="audit_time"/>
  22. </resultMap>
  23. <select id="queryObject" resultType="com.kmall.admin.entity.haikong.StockChangeEntity">
  24. select
  25. `id`,
  26. `type`,
  27. `time`,
  28. `merch_sn`,
  29. `merch`,
  30. `store_id`,
  31. `store`,
  32. `third_merch_sn`,
  33. `audit`,
  34. `third_merch`,
  35. `remark`,
  36. `create_by`,
  37. `create_time`,
  38. `modify_by`,
  39. `modify_time`,
  40. `audit_by`,
  41. `audit_time`
  42. from mall_stock_change
  43. where id = #{id}
  44. </select>
  45. <select id="queryList" resultType="com.kmall.admin.entity.haikong.StockChangeEntity">
  46. select
  47. `id`,
  48. `type`,
  49. `time`,
  50. `merch_sn`,
  51. `merch`,
  52. `store_id`,
  53. `store`,
  54. `third_merch_sn`,
  55. `audit`,
  56. `third_merch`,
  57. `remark`,
  58. `create_by`,
  59. `create_time`,
  60. `modify_by`,
  61. `modify_time`,
  62. `audit_by`,
  63. `audit_time`
  64. from mall_stock_change
  65. WHERE 1=1
  66. <if test="name != null and name.trim() != ''">
  67. AND name LIKE concat('%',#{name},'%')
  68. </if>
  69. <choose>
  70. <when test="sidx != null and sidx.trim() != ''">
  71. order by ${sidx} ${order}
  72. </when>
  73. <otherwise>
  74. order by id desc
  75. </otherwise>
  76. </choose>
  77. <if test="offset != null and limit != null">
  78. limit #{offset}, #{limit}
  79. </if>
  80. </select>
  81. <select id="queryTotal" resultType="int">
  82. select count(*) from mall_stock_change
  83. WHERE 1=1
  84. <if test="name != null and name.trim() != ''">
  85. AND name LIKE concat('%',#{name},'%')
  86. </if>
  87. </select>
  88. <select id="queryListByIds" resultType="com.kmall.admin.entity.haikong.StockChangeEntity">
  89. select * from mall_stock_change
  90. where id in
  91. <foreach item="id" collection="array" open="(" separator="," close=")">
  92. #{id}
  93. </foreach>
  94. </select>
  95. <insert id="save" parameterType="com.kmall.admin.entity.haikong.StockChangeEntity">
  96. insert into mall_stock_change(
  97. `id`,
  98. `type`,
  99. `time`,
  100. `merch_sn`,
  101. `merch`,
  102. `store_id`,
  103. `store`,
  104. `third_merch_sn`,
  105. `audit`,
  106. `third_merch`,
  107. `remark`,
  108. `create_by`,
  109. `create_time`,
  110. `modify_by`,
  111. `modify_time`,
  112. `audit_by`,
  113. `audit_time`)
  114. values(
  115. #{id},
  116. #{type},
  117. #{time},
  118. #{merchSn},
  119. #{merch},
  120. #{storeId},
  121. #{store},
  122. #{thirdMerchSn},
  123. #{audit},
  124. #{thirdMerch},
  125. #{remark},
  126. #{createBy},
  127. #{createTime},
  128. #{modifyBy},
  129. #{modifyTime},
  130. #{auditBy},
  131. #{auditTime})
  132. </insert>
  133. <update id="update" parameterType="com.kmall.admin.entity.haikong.StockChangeEntity">
  134. update mall_stock_change
  135. <set>
  136. <if test="type != null">`type` = #{type}, </if>
  137. <if test="time != null">`time` = #{time}, </if>
  138. <if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
  139. <if test="merch != null">`merch` = #{merch}, </if>
  140. <if test="storeId != null">`store_id` = #{storeId}, </if>
  141. <if test="store != null">`store` = #{store}, </if>
  142. <if test="thirdMerchSn != null">`third_merch_sn` = #{thirdMerchSn}, </if>
  143. <if test="audit != null">`audit` = #{audit}, </if>
  144. <if test="thirdMerch != null">`third_merch` = #{thirdMerch}, </if>
  145. <if test="remark != null">`remark` = #{remark}, </if>
  146. <if test="createBy != null">`create_by` = #{createBy}, </if>
  147. <if test="createTime != null">`create_time` = #{createTime}, </if>
  148. <if test="modifyBy != null">`modify_by` = #{modifyBy}, </if>
  149. <if test="modifyTime != null">`modify_time` = #{modifyTime}, </if>
  150. <if test="auditBy != null">`audit_by` = #{auditBy}, </if>
  151. <if test="auditTime != null">`audit_time` = #{auditTime}</if>
  152. </set>
  153. where id = #{id}
  154. </update>
  155. <update id="updateAuditStatus">
  156. update mall_stock_change set audit = #{type}
  157. where id in
  158. <foreach collection="array" item="item" open="(" separator="," close=")">
  159. #{item}
  160. </foreach>
  161. </update>
  162. <delete id="delete">
  163. delete from mall_stock_change where id = #{value}
  164. </delete>
  165. <delete id="deleteBatch">
  166. delete from mall_stock_change where id in
  167. <foreach item="id" collection="array" open="(" separator="," close=")">
  168. #{id}
  169. </foreach>
  170. </delete>
  171. </mapper>