BomDetailMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  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.usoftchina.saas.document.mapper.BomDetailMapper" >
  4. <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.BomDetail" >
  5. <id column="bd_id" property="id" jdbcType="INTEGER" />
  6. <result column="bd_bomid" property="bd_bomid" jdbcType="INTEGER" />
  7. <result column="bd_detno" property="bd_detno" jdbcType="INTEGER" />
  8. <result column="bd_sonid" property="bd_sonid" jdbcType="INTEGER" />
  9. <result column="bd_soncode" property="bd_soncode" jdbcType="VARCHAR" />
  10. <result column="bd_unit" property="bd_unit" jdbcType="VARCHAR" />
  11. <result column="bd_baseqty" property="bd_baseqty" jdbcType="INTEGER" />
  12. <result column="bd_replace" property="bd_replace" jdbcType="VARCHAR" />
  13. <result column="bd_remark" property="bd_remark" jdbcType="VARCHAR" />
  14. <result column="comapnyId" property="companyId" jdbcType="INTEGER" />
  15. <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
  16. <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
  17. <result column="bd_text1" property="bd_text1" jdbcType="VARCHAR" />
  18. <result column="bd_text2" property="bd_text2" jdbcType="VARCHAR" />
  19. <result column="bd_text3" property="bd_text3" jdbcType="VARCHAR" />
  20. <result column="bd_text4" property="bd_text4" jdbcType="VARCHAR" />
  21. <result column="bd_text5" property="bd_text5" jdbcType="VARCHAR" />
  22. </resultMap>
  23. <sql id="Base_Column_List" >
  24. bd_id, bd_bomid, bd_detno, bd_sonid, bd_soncode, bd_unit, bd_baseqty, bd_replace,
  25. bd_remark, comapnyId, updaterId, updateTime, bd_text1, bd_text2, bd_text3, bd_text4,
  26. bd_text5
  27. </sql>
  28. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
  29. select
  30. <include refid="Base_Column_List" />
  31. from bomdetail
  32. where bd_id = #{id}
  33. </select>
  34. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
  35. delete from bomdetail
  36. where bd_id = #{id}
  37. </delete>
  38. <insert id="insert" parameterType="com.usoftchina.saas.document.entities.BomDetail" >
  39. insert into bomdetail (bd_bomid, bd_detno,
  40. bd_sonid, bd_soncode, bd_unit,
  41. bd_baseqty, bd_replace, bd_remark,
  42. comapnyId, updaterId, updateTime,
  43. bd_text1, bd_text2, bd_text3,
  44. bd_text4, bd_text5)
  45. values ( #{bd_bomid,jdbcType=INTEGER}, #{bd_detno,jdbcType=INTEGER},
  46. #{bd_sonid,jdbcType=INTEGER}, #{bd_soncode,jdbcType=VARCHAR}, #{bd_unit,jdbcType=VARCHAR},
  47. #{bd_baseqty,jdbcType=INTEGER}, #{bd_replace,jdbcType=VARCHAR}, #{bd_remark,jdbcType=VARCHAR},
  48. #{comapnyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
  49. #{bd_text1,jdbcType=VARCHAR}, #{bd_text2,jdbcType=VARCHAR}, #{bd_text3,jdbcType=VARCHAR},
  50. #{bd_text4,jdbcType=VARCHAR}, #{bd_text5,jdbcType=VARCHAR})
  51. </insert>
  52. <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.BomDetail" >
  53. insert into bomdetail
  54. <trim prefix="(" suffix=")" suffixOverrides="," >
  55. <if test="bd_bomid != null" >
  56. bd_bomid,
  57. </if>
  58. <if test="bd_detno != null" >
  59. bd_detno,
  60. </if>
  61. <if test="bd_sonid != null" >
  62. bd_sonid,
  63. </if>
  64. <if test="bd_soncode != null" >
  65. bd_soncode,
  66. </if>
  67. <if test="bd_unit != null" >
  68. bd_unit,
  69. </if>
  70. <if test="bd_baseqty != null" >
  71. bd_baseqty,
  72. </if>
  73. <if test="bd_replace != null" >
  74. bd_replace,
  75. </if>
  76. <if test="bd_remark != null" >
  77. bd_remark,
  78. </if>
  79. <if test="comapnyId != null" >
  80. comapnyId,
  81. </if>
  82. <if test="updaterId != null" >
  83. updaterId,
  84. </if>
  85. <if test="updateTime != null" >
  86. updateTime,
  87. </if>
  88. <if test="bd_text1 != null" >
  89. bd_text1,
  90. </if>
  91. <if test="bd_text2 != null" >
  92. bd_text2,
  93. </if>
  94. <if test="bd_text3 != null" >
  95. bd_text3,
  96. </if>
  97. <if test="bd_text4 != null" >
  98. bd_text4,
  99. </if>
  100. <if test="bd_text5 != null" >
  101. bd_text5,
  102. </if>
  103. </trim>
  104. <trim prefix="values (" suffix=")" suffixOverrides="," >
  105. <if test="bd_bomid != null" >
  106. #{bd_bomid,jdbcType=INTEGER},
  107. </if>
  108. <if test="bd_detno != null" >
  109. #{bd_detno,jdbcType=INTEGER},
  110. </if>
  111. <if test="bd_sonid != null" >
  112. #{bd_sonid,jdbcType=INTEGER},
  113. </if>
  114. <if test="bd_soncode != null" >
  115. #{bd_soncode,jdbcType=VARCHAR},
  116. </if>
  117. <if test="bd_unit != null" >
  118. #{bd_unit,jdbcType=VARCHAR},
  119. </if>
  120. <if test="bd_baseqty != null" >
  121. #{bd_baseqty,jdbcType=INTEGER},
  122. </if>
  123. <if test="bd_replace != null" >
  124. #{bd_replace,jdbcType=VARCHAR},
  125. </if>
  126. <if test="bd_remark != null" >
  127. #{bd_remark,jdbcType=VARCHAR},
  128. </if>
  129. <if test="comapnyId != null" >
  130. #{comapnyId,jdbcType=INTEGER},
  131. </if>
  132. <if test="updaterId != null" >
  133. #{updaterId,jdbcType=INTEGER},
  134. </if>
  135. <if test="updateTime != null" >
  136. #{updateTime,jdbcType=TIMESTAMP},
  137. </if>
  138. <if test="bd_text1 != null" >
  139. #{bd_text1,jdbcType=VARCHAR},
  140. </if>
  141. <if test="bd_text2 != null" >
  142. #{bd_text2,jdbcType=VARCHAR},
  143. </if>
  144. <if test="bd_text3 != null" >
  145. #{bd_text3,jdbcType=VARCHAR},
  146. </if>
  147. <if test="bd_text4 != null" >
  148. #{bd_text4,jdbcType=VARCHAR},
  149. </if>
  150. <if test="bd_text5 != null" >
  151. #{bd_text5,jdbcType=VARCHAR},
  152. </if>
  153. </trim>
  154. </insert>
  155. <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.BomDetail" >
  156. update bomdetail
  157. <set >
  158. <if test="bd_bomid != null" >
  159. bd_bomid = #{bd_bomid,jdbcType=INTEGER},
  160. </if>
  161. <if test="bd_detno != null" >
  162. bd_detno = #{bd_detno,jdbcType=INTEGER},
  163. </if>
  164. <if test="bd_sonid != null" >
  165. bd_sonid = #{bd_sonid,jdbcType=INTEGER},
  166. </if>
  167. <if test="bd_soncode != null" >
  168. bd_soncode = #{bd_soncode,jdbcType=VARCHAR},
  169. </if>
  170. <if test="bd_unit != null" >
  171. bd_unit = #{bd_unit,jdbcType=VARCHAR},
  172. </if>
  173. <if test="bd_baseqty != null" >
  174. bd_baseqty = #{bd_baseqty,jdbcType=INTEGER},
  175. </if>
  176. <if test="bd_replace != null" >
  177. bd_replace = #{bd_replace,jdbcType=VARCHAR},
  178. </if>
  179. <if test="bd_remark != null" >
  180. bd_remark = #{bd_remark,jdbcType=VARCHAR},
  181. </if>
  182. <if test="comapnyId != null" >
  183. comapnyId = #{comapnyId,jdbcType=INTEGER},
  184. </if>
  185. <if test="updaterId != null" >
  186. updaterId = #{updaterId,jdbcType=INTEGER},
  187. </if>
  188. <if test="updateTime != null" >
  189. updateTime = #{updateTime,jdbcType=TIMESTAMP},
  190. </if>
  191. <if test="bd_text1 != null" >
  192. bd_text1 = #{bd_text1,jdbcType=VARCHAR},
  193. </if>
  194. <if test="bd_text2 != null" >
  195. bd_text2 = #{bd_text2,jdbcType=VARCHAR},
  196. </if>
  197. <if test="bd_text3 != null" >
  198. bd_text3 = #{bd_text3,jdbcType=VARCHAR},
  199. </if>
  200. <if test="bd_text4 != null" >
  201. bd_text4 = #{bd_text4,jdbcType=VARCHAR},
  202. </if>
  203. <if test="bd_text5 != null" >
  204. bd_text5 = #{bd_text5,jdbcType=VARCHAR},
  205. </if>
  206. </set>
  207. where bd_id = #{id}
  208. </update>
  209. <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.BomDetail" >
  210. update bomdetail
  211. set bd_bomid = #{bd_bomid,jdbcType=INTEGER},
  212. bd_detno = #{bd_detno,jdbcType=INTEGER},
  213. bd_sonid = #{bd_sonid,jdbcType=INTEGER},
  214. bd_soncode = #{bd_soncode,jdbcType=VARCHAR},
  215. bd_unit = #{bd_unit,jdbcType=VARCHAR},
  216. bd_baseqty = #{bd_baseqty,jdbcType=INTEGER},
  217. bd_replace = #{bd_replace,jdbcType=VARCHAR},
  218. bd_remark = #{bd_remark,jdbcType=VARCHAR},
  219. comapnyId = #{comapnyId,jdbcType=INTEGER},
  220. updaterId = #{updaterId,jdbcType=INTEGER},
  221. updateTime = #{updateTime,jdbcType=TIMESTAMP},
  222. bd_text1 = #{bd_text1,jdbcType=VARCHAR},
  223. bd_text2 = #{bd_text2,jdbcType=VARCHAR},
  224. bd_text3 = #{bd_text3,jdbcType=VARCHAR},
  225. bd_text4 = #{bd_text4,jdbcType=VARCHAR},
  226. bd_text5 = #{bd_text5,jdbcType=VARCHAR}
  227. where bd_id = #{id}
  228. </update>
  229. <insert id="batchInsert" parameterType="java.util.List">
  230. <foreach collection="list" item="item" index="index" open="" close="" separator=",">
  231. INSERT INTO BOMDETAIL
  232. <trim prefix="(" suffix=")" suffixOverrides=",">
  233. <if test="item.bd_bomid != null" >
  234. bd_bomid,
  235. </if>
  236. <if test="item.bd_detno != null" >
  237. bd_detno,
  238. </if>
  239. <if test="item.bd_sonid != null" >
  240. bd_sonid,
  241. </if>
  242. <if test="item.bd_soncode != null" >
  243. bd_soncode,
  244. </if>
  245. <if test="item.bd_unit != null" >
  246. bd_unit,
  247. </if>
  248. <if test="item.bd_baseqty != null" >
  249. bd_baseqty,
  250. </if>
  251. <if test="item.bd_replace != null" >
  252. bd_replace,
  253. </if>
  254. <if test="item.bd_remark != null" >
  255. bd_remark,
  256. </if>
  257. <if test="item.comapnyId != null" >
  258. comapnyId,
  259. </if>
  260. <if test="item.updaterId != null" >
  261. updaterId,
  262. </if>
  263. <if test="item.updateTime != null" >
  264. updateTime,
  265. </if>
  266. <if test="item.bd_text1 != null" >
  267. bd_text1,
  268. </if>
  269. <if test="item.bd_text2 != null" >
  270. bd_text2,
  271. </if>
  272. <if test="item.bd_text3 != null" >
  273. bd_text3,
  274. </if>
  275. <if test="item.bd_text4 != null" >
  276. bd_text4,
  277. </if>
  278. <if test="item.bd_text5 != null" >
  279. bd_text5,
  280. </if>
  281. </trim>
  282. <trim prefix="values (" suffix=")" suffixOverrides="," >
  283. <if test="item.bd_bomid != null" >
  284. #{item.bd_bomid},
  285. </if>
  286. <if test="bd_detno != null" >
  287. #{item.bd_detno,jdbcType=INTEGER},
  288. </if>
  289. <if test="bd_sonid != null" >
  290. #{item.bd_sonid,jdbcType=INTEGER},
  291. </if>
  292. <if test="bd_soncode != null" >
  293. #{item.bd_soncode,jdbcType=VARCHAR},
  294. </if>
  295. <if test="bd_unit != null" >
  296. #{item.bd_unit,jdbcType=VARCHAR},
  297. </if>
  298. <if test="bd_baseqty != null" >
  299. #{item.bd_baseqty,jdbcType=INTEGER},
  300. </if>
  301. <if test="bd_replace != null" >
  302. #{item.bd_replace,jdbcType=VARCHAR},
  303. </if>
  304. <if test="bd_remark != null" >
  305. #{item.bd_remark,jdbcType=VARCHAR},
  306. </if>
  307. <if test="comapnyId != null" >
  308. #{item.comapnyId,jdbcType=INTEGER},
  309. </if>
  310. <if test="updaterId != null" >
  311. #{item.updaterId,jdbcType=INTEGER},
  312. </if>
  313. <if test="updateTime != null" >
  314. #{item.updateTime,jdbcType=TIMESTAMP},
  315. </if>
  316. <if test="bd_text1 != null" >
  317. #{item.bd_text1,jdbcType=VARCHAR},
  318. </if>
  319. <if test="bd_text2 != null" >
  320. #{item.bd_text2,jdbcType=VARCHAR},
  321. </if>
  322. <if test="bd_text3 != null" >
  323. #{item.bd_text3,jdbcType=VARCHAR},
  324. </if>
  325. <if test="bd_text4 != null" >
  326. #{item.bd_text4,jdbcType=VARCHAR},
  327. </if>
  328. <if test="bd_text5 != null" >
  329. #{item.bd_text5,jdbcType=VARCHAR},
  330. </if>
  331. </trim>
  332. </foreach>
  333. </insert>
  334. <update id="batchUpdate" parameterType="com.usoftchina.saas.document.entities.BomDetail">
  335. <foreach collection="list" item="item" index="index" open="" close="" separator=";">
  336. UPDATE BOMDETAIL
  337. <set >
  338. <if test="item.bd_bomid != null" >
  339. bd_bomid = #{item.bd_bomid},
  340. </if>
  341. <if test="bd_detno != null" >
  342. bd_detno = #{item.bd_detno,jdbcType=INTEGER},
  343. </if>
  344. <if test="bd_sonid != null" >
  345. bd_sonid = #{item.bd_sonid,jdbcType=INTEGER},
  346. </if>
  347. <if test="bd_soncode != null" >
  348. bd_soncode = #{item.bd_soncode,jdbcType=VARCHAR},
  349. </if>
  350. <if test="bd_unit != null" >
  351. bd_unit = #{item.bd_unit,jdbcType=VARCHAR},
  352. </if>
  353. <if test="bd_baseqty != null" >
  354. bd_baseqty = #{item.bd_baseqty,jdbcType=INTEGER},
  355. </if>
  356. <if test="bd_replace != null" >
  357. bd_replace = #{item.bd_replace,jdbcType=VARCHAR},
  358. </if>
  359. <if test="bd_remark != null" >
  360. bd_remark = #{item.bd_remark,jdbcType=VARCHAR},
  361. </if>
  362. <if test="comapnyId != null" >
  363. comapnyId = #{item.comapnyId,jdbcType=INTEGER},
  364. </if>
  365. <if test="updaterId != null" >
  366. updaterId = #{item.updaterId,jdbcType=INTEGER},
  367. </if>
  368. <if test="updateTime != null" >
  369. updateTime = #{item.updateTime,jdbcType=TIMESTAMP},
  370. </if>
  371. <if test="bd_text1 != null" >
  372. bd_text1 = #{item.bd_text1,jdbcType=VARCHAR},
  373. </if>
  374. <if test="bd_text2 != null" >
  375. bd_text2 = #{item.bd_text2,jdbcType=VARCHAR},
  376. </if>
  377. <if test="bd_text3 != null" >
  378. bd_text3 = #{item.bd_text3,jdbcType=VARCHAR},
  379. </if>
  380. <if test="bd_text4 != null" >
  381. bd_text4 = #{item.bd_text4,jdbcType=VARCHAR},
  382. </if>
  383. <if test="bd_text5 != null" >
  384. bd_text5 = #{item.bd_text5,jdbcType=VARCHAR},
  385. </if>
  386. </set>
  387. where bd_id = #{item.id}
  388. </foreach>
  389. </update>
  390. <delete id="deleteByFK" parameterType="java.lang.Long">
  391. DELETE FROM BOMDETAIL
  392. WHERE BD_BOMID=#{id}
  393. </delete>
  394. <select id="selectByFK" resultMap="BaseResultMap">
  395. SELECT * FROM BOMDETAIL WHERE BD_BOMID = #{id}
  396. </select>
  397. </mapper>