GoodsProInputsMapper.xml 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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.hcloud.microservice.goods.dao.GoodsProInputsMapper">
  4. <resultMap id="BaseResultMap" type="com.hcloud.microservice.goods.facade.entity.GoodsProInputs">
  5. <id column="guid" jdbcType="CHAR" property="guid" />
  6. <result column="fk_org_guid" jdbcType="CHAR" property="fkOrgGuid" />
  7. <result column="fk_goods_batch_guid" jdbcType="CHAR" property="fkGoodsBatchGuid" />
  8. <result column="pro_inputs_no" jdbcType="CHAR" property="proInputsNo" />
  9. <result column="pro_inputs_name" jdbcType="CHAR" property="proInputsName" />
  10. <result column="inputs_process_name" jdbcType="VARCHAR" property="inputsProcessName" />
  11. <result column="inputs_time" jdbcType="TIMESTAMP" property="inputsTime" />
  12. <result column="input_do_user" jdbcType="VARCHAR" property="inputDoUser" />
  13. <result column="input_provider_user" jdbcType="VARCHAR" property="inputProviderUser" />
  14. <result column="state" jdbcType="INTEGER" property="state" />
  15. <result column="create_user" jdbcType="CHAR" property="createUser" />
  16. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  17. <result column="modified_user" jdbcType="CHAR" property="modifiedUser" />
  18. <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
  19. </resultMap>
  20. <sql id="Base_Column_List">
  21. guid, fk_org_guid, fk_goods_batch_guid, pro_inputs_no, pro_inputs_name, inputs_process_name,
  22. inputs_time, input_do_user, input_provider_user, state, create_user, create_time,
  23. modified_user, modified_time
  24. </sql>
  25. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  26. select
  27. <include refid="Base_Column_List" />
  28. from t_goods_pro_inputs
  29. where guid = #{guid,jdbcType=CHAR}
  30. </select>
  31. <select id="searchProInputsByPage" parameterType="com.hcloud.microserver.commoncore.base.PageBean" resultMap="BaseResultMap">
  32. select
  33. <include refid="Base_Column_List" />
  34. from t_goods_pro_inputs
  35. where
  36. data.state=1
  37. <if test="data.fkOrgGuid!=null and data.fkOrgGuid!=''">
  38. and fk_org_guid = #{data.fkOrgGuid,jdbcType=CHAR}
  39. </if>
  40. <if test="data.fkGoodsBatchGuid!=null and data.fkGoodsBatchGuid!=''">
  41. and fk_goods_batch_guid = #{data.fkGoodsBatchGuid,jdbcType=CHAR}
  42. </if>
  43. <if test="data.proInputsName!=null and data.proInputsName!=''">
  44. and pro_inputs_name = #{data.proInputsName,jdbcType=CHAR}
  45. </if>
  46. <if test="data.inputsProcessName!=null and data.inputsProcessName!=''">
  47. and inputs_process_name = #{data.inputsProcessName,jdbcType=CHAR}
  48. </if>
  49. </select>
  50. <select id="searchProInputsByBatchGuid" parameterType="java.lang.String" resultMap="BaseResultMap">
  51. select
  52. <include refid="Base_Column_List" />
  53. from t_goods_pro_inputs
  54. where fk_goods_batch_guid = #{fkGoodsBatchGuid,jdbcType=CHAR}
  55. order by inputs_time desc
  56. </select>
  57. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  58. delete from t_goods_pro_inputs
  59. where guid = #{guid,jdbcType=CHAR}
  60. </delete>
  61. <delete id="delProInputsByFK">
  62. delete from t_goods_pro_inputs
  63. where fk_goods_batch_guid = #{batid}
  64. </delete>
  65. <insert id="insert" parameterType="com.hcloud.microservice.goods.facade.entity.GoodsProInputs">
  66. insert into t_goods_pro_inputs (guid, fk_org_guid, fk_goods_batch_guid,
  67. pro_inputs_no, pro_inputs_name, inputs_process_name,
  68. inputs_time, input_do_user, input_provider_user,
  69. state, create_user, create_time,
  70. modified_user, modified_time)
  71. values (#{guid,jdbcType=CHAR}, #{fkOrgGuid,jdbcType=CHAR}, #{fkGoodsBatchGuid,jdbcType=CHAR},
  72. #{proInputsNo,jdbcType=CHAR}, #{proInputsName,jdbcType=CHAR}, #{inputsProcessName,jdbcType=VARCHAR},
  73. #{inputsTime,jdbcType=TIMESTAMP}, #{inputDoUser,jdbcType=VARCHAR}, #{inputProviderUser,jdbcType=VARCHAR},
  74. #{state,jdbcType=INTEGER}, #{createUser,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP},
  75. #{modifiedUser,jdbcType=CHAR}, #{modifiedTime,jdbcType=TIMESTAMP})
  76. </insert>
  77. <insert id="insertSelective" parameterType="com.hcloud.microservice.goods.facade.entity.GoodsProInputs">
  78. insert into t_goods_pro_inputs
  79. <trim prefix="(" suffix=")" suffixOverrides=",">
  80. <if test="guid != null">
  81. guid,
  82. </if>
  83. <if test="fkOrgGuid != null">
  84. fk_org_guid,
  85. </if>
  86. <if test="fkGoodsBatchGuid != null">
  87. fk_goods_batch_guid,
  88. </if>
  89. <if test="proInputsNo != null">
  90. pro_inputs_no,
  91. </if>
  92. <if test="proInputsName != null">
  93. pro_inputs_name,
  94. </if>
  95. <if test="inputsProcessName != null">
  96. inputs_process_name,
  97. </if>
  98. <if test="inputsTime != null">
  99. inputs_time,
  100. </if>
  101. <if test="inputDoUser != null">
  102. input_do_user,
  103. </if>
  104. <if test="inputProviderUser != null">
  105. input_provider_user,
  106. </if>
  107. <if test="state != null">
  108. state,
  109. </if>
  110. <if test="createUser != null">
  111. create_user,
  112. </if>
  113. <if test="createTime != null">
  114. create_time,
  115. </if>
  116. <if test="modifiedUser != null">
  117. modified_user,
  118. </if>
  119. <if test="modifiedTime != null">
  120. modified_time,
  121. </if>
  122. </trim>
  123. <trim prefix="values (" suffix=")" suffixOverrides=",">
  124. <if test="guid != null">
  125. #{guid,jdbcType=CHAR},
  126. </if>
  127. <if test="fkOrgGuid != null">
  128. #{fkOrgGuid,jdbcType=CHAR},
  129. </if>
  130. <if test="fkGoodsBatchGuid != null">
  131. #{fkGoodsBatchGuid,jdbcType=CHAR},
  132. </if>
  133. <if test="proInputsNo != null">
  134. #{proInputsNo,jdbcType=CHAR},
  135. </if>
  136. <if test="proInputsName != null">
  137. #{proInputsName,jdbcType=CHAR},
  138. </if>
  139. <if test="inputsProcessName != null">
  140. #{inputsProcessName,jdbcType=VARCHAR},
  141. </if>
  142. <if test="inputsTime != null">
  143. #{inputsTime,jdbcType=TIMESTAMP},
  144. </if>
  145. <if test="inputDoUser != null">
  146. #{inputDoUser,jdbcType=VARCHAR},
  147. </if>
  148. <if test="inputProviderUser != null">
  149. #{inputProviderUser,jdbcType=VARCHAR},
  150. </if>
  151. <if test="state != null">
  152. #{state,jdbcType=INTEGER},
  153. </if>
  154. <if test="createUser != null">
  155. #{createUser,jdbcType=CHAR},
  156. </if>
  157. <if test="createTime != null">
  158. #{createTime,jdbcType=TIMESTAMP},
  159. </if>
  160. <if test="modifiedUser != null">
  161. #{modifiedUser,jdbcType=CHAR},
  162. </if>
  163. <if test="modifiedTime != null">
  164. #{modifiedTime,jdbcType=TIMESTAMP},
  165. </if>
  166. </trim>
  167. </insert>
  168. <insert id="batchSaveProInputs">
  169. insert into t_goods_pro_inputs (guid, fk_org_guid, fk_goods_batch_guid,
  170. pro_inputs_name, inputs_process_name,
  171. inputs_time, input_do_user, input_provider_user,
  172. state, create_user, create_time,
  173. modified_user, modified_time)values
  174. <foreach collection="list" item="bean" open="" separator="," close="">
  175. (REPLACE(UUID(),'-',''), #{bean.fkOrgGuid,jdbcType=CHAR}, #{bean.fkGoodsBatchGuid,jdbcType=CHAR},
  176. #{bean.proInputsName,jdbcType=CHAR}, #{bean.inputsProcessName,jdbcType=VARCHAR},
  177. #{bean.inputsTime,jdbcType=TIMESTAMP}, #{bean.inputDoUser,jdbcType=VARCHAR},
  178. #{bean.inputProviderUser,jdbcType=VARCHAR},#{bean.state,jdbcType=INTEGER}, #{bean.createUser,jdbcType=CHAR},
  179. #{bean.createTime,jdbcType=TIMESTAMP},#{bean.modifiedUser,jdbcType=CHAR}, #{bean.modifiedTime,jdbcType=TIMESTAMP})
  180. </foreach>
  181. </insert>
  182. <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microservice.goods.facade.entity.GoodsProInputs">
  183. update t_goods_pro_inputs
  184. <set>
  185. <if test="fkOrgGuid != null">
  186. fk_org_guid = #{fkOrgGuid,jdbcType=CHAR},
  187. </if>
  188. <if test="fkGoodsBatchGuid != null">
  189. fk_goods_batch_guid = #{fkGoodsBatchGuid,jdbcType=CHAR},
  190. </if>
  191. <if test="proInputsNo != null">
  192. pro_inputs_no = #{proInputsNo,jdbcType=CHAR},
  193. </if>
  194. <if test="proInputsName != null">
  195. pro_inputs_name = #{proInputsName,jdbcType=CHAR},
  196. </if>
  197. <if test="inputsProcessName != null">
  198. inputs_process_name = #{inputsProcessName,jdbcType=VARCHAR},
  199. </if>
  200. <if test="inputsTime != null">
  201. inputs_time = #{inputsTime,jdbcType=TIMESTAMP},
  202. </if>
  203. <if test="inputDoUser != null">
  204. input_do_user = #{inputDoUser,jdbcType=VARCHAR},
  205. </if>
  206. <if test="inputProviderUser != null">
  207. input_provider_user = #{inputProviderUser,jdbcType=VARCHAR},
  208. </if>
  209. <if test="state != null">
  210. state = #{state,jdbcType=INTEGER},
  211. </if>
  212. <if test="createUser != null">
  213. create_user = #{createUser,jdbcType=CHAR},
  214. </if>
  215. <if test="createTime != null">
  216. create_time = #{createTime,jdbcType=TIMESTAMP},
  217. </if>
  218. <if test="modifiedUser != null">
  219. modified_user = #{modifiedUser,jdbcType=CHAR},
  220. </if>
  221. <if test="modifiedTime != null">
  222. modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
  223. </if>
  224. </set>
  225. where guid = #{guid,jdbcType=CHAR}
  226. </update>
  227. <update id="updateByPrimaryKey" parameterType="com.hcloud.microservice.goods.facade.entity.GoodsProInputs">
  228. update t_goods_pro_inputs
  229. set fk_org_guid = #{fkOrgGuid,jdbcType=CHAR},
  230. fk_goods_batch_guid = #{fkGoodsBatchGuid,jdbcType=CHAR},
  231. pro_inputs_no = #{proInputsNo,jdbcType=CHAR},
  232. pro_inputs_name = #{proInputsName,jdbcType=CHAR},
  233. inputs_process_name = #{inputsProcessName,jdbcType=VARCHAR},
  234. inputs_time = #{inputsTime,jdbcType=TIMESTAMP},
  235. input_do_user = #{inputDoUser,jdbcType=VARCHAR},
  236. input_provider_user = #{inputProviderUser,jdbcType=VARCHAR},
  237. state = #{state,jdbcType=INTEGER},
  238. create_user = #{createUser,jdbcType=CHAR},
  239. create_time = #{createTime,jdbcType=TIMESTAMP},
  240. modified_user = #{modifiedUser,jdbcType=CHAR},
  241. modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
  242. where guid = #{guid,jdbcType=CHAR}
  243. </update>
  244. </mapper>