DepotItemMapper.xml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  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.jsh.erp.datasource.mappers.DepotItemMapper">
  4. <resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.DepotItem">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="header_id" jdbcType="BIGINT" property="headerId" />
  7. <result column="material_id" jdbcType="BIGINT" property="materialId" />
  8. <result column="material_extend_id" jdbcType="BIGINT" property="materialExtendId" />
  9. <result column="material_unit" jdbcType="VARCHAR" property="materialUnit" />
  10. <result column="sku" jdbcType="VARCHAR" property="sku" />
  11. <result column="oper_number" jdbcType="DECIMAL" property="operNumber" />
  12. <result column="basic_number" jdbcType="DECIMAL" property="basicNumber" />
  13. <result column="unit_price" jdbcType="DECIMAL" property="unitPrice" />
  14. <result column="purchase_unit_price" jdbcType="DECIMAL" property="purchaseUnitPrice" />
  15. <result column="tax_unit_price" jdbcType="DECIMAL" property="taxUnitPrice" />
  16. <result column="all_price" jdbcType="DECIMAL" property="allPrice" />
  17. <result column="remark" jdbcType="VARCHAR" property="remark" />
  18. <result column="depot_id" jdbcType="BIGINT" property="depotId" />
  19. <result column="another_depot_id" jdbcType="BIGINT" property="anotherDepotId" />
  20. <result column="tax_rate" jdbcType="DECIMAL" property="taxRate" />
  21. <result column="tax_money" jdbcType="DECIMAL" property="taxMoney" />
  22. <result column="tax_last_money" jdbcType="DECIMAL" property="taxLastMoney" />
  23. <result column="material_type" jdbcType="VARCHAR" property="materialType" />
  24. <result column="sn_list" jdbcType="VARCHAR" property="snList" />
  25. <result column="batch_number" jdbcType="VARCHAR" property="batchNumber" />
  26. <result column="expiration_date" jdbcType="TIMESTAMP" property="expirationDate" />
  27. <result column="link_id" jdbcType="BIGINT" property="linkId" />
  28. <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
  29. <result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
  30. <result column="actual_quantity_in_storage" jdbcType="DECIMAL" property="actualQuantityInStorage" />
  31. <result column="warehousing_variance" jdbcType="DECIMAL" property="warehousingVariance" />
  32. <result column="reason_of_difference" jdbcType="VARCHAR" property="reasonOfDifference" />
  33. <result column="warehousing_user" jdbcType="VARCHAR" property="warehousingUser" />
  34. <result column="warehousing_time" jdbcType="DATE" property="warehousingTime" />
  35. </resultMap>
  36. <sql id="Example_Where_Clause">
  37. <where>
  38. <foreach collection="oredCriteria" item="criteria" separator="or">
  39. <if test="criteria.valid">
  40. <trim prefix="(" prefixOverrides="and" suffix=")">
  41. <foreach collection="criteria.criteria" item="criterion">
  42. <choose>
  43. <when test="criterion.noValue">
  44. and ${criterion.condition}
  45. </when>
  46. <when test="criterion.singleValue">
  47. and ${criterion.condition} #{criterion.value}
  48. </when>
  49. <when test="criterion.betweenValue">
  50. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  51. </when>
  52. <when test="criterion.listValue">
  53. and ${criterion.condition}
  54. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  55. #{listItem}
  56. </foreach>
  57. </when>
  58. </choose>
  59. </foreach>
  60. </trim>
  61. </if>
  62. </foreach>
  63. </where>
  64. </sql>
  65. <sql id="Update_By_Example_Where_Clause">
  66. <where>
  67. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  68. <if test="criteria.valid">
  69. <trim prefix="(" prefixOverrides="and" suffix=")">
  70. <foreach collection="criteria.criteria" item="criterion">
  71. <choose>
  72. <when test="criterion.noValue">
  73. and ${criterion.condition}
  74. </when>
  75. <when test="criterion.singleValue">
  76. and ${criterion.condition} #{criterion.value}
  77. </when>
  78. <when test="criterion.betweenValue">
  79. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  80. </when>
  81. <when test="criterion.listValue">
  82. and ${criterion.condition}
  83. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  84. #{listItem}
  85. </foreach>
  86. </when>
  87. </choose>
  88. </foreach>
  89. </trim>
  90. </if>
  91. </foreach>
  92. </where>
  93. </sql>
  94. <sql id="Base_Column_List">
  95. id, header_id, material_id, material_extend_id, material_unit, sku, oper_number,
  96. basic_number, unit_price, purchase_unit_price, tax_unit_price, all_price, remark,
  97. depot_id, another_depot_id, tax_rate, tax_money, tax_last_money, material_type, sn_list,
  98. batch_number, expiration_date, link_id, tenant_id, delete_flag
  99. </sql>
  100. <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="BaseResultMap">
  101. select
  102. <if test="distinct">
  103. distinct
  104. </if>
  105. <include refid="Base_Column_List" />
  106. from jsh_depot_item
  107. <if test="_parameter != null">
  108. <include refid="Example_Where_Clause" />
  109. </if>
  110. <if test="orderByClause != null">
  111. order by ${orderByClause}
  112. </if>
  113. </select>
  114. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  115. select
  116. <include refid="Base_Column_List" />
  117. from jsh_depot_item
  118. where id = #{id,jdbcType=BIGINT}
  119. </select>
  120. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  121. delete from jsh_depot_item
  122. where id = #{id,jdbcType=BIGINT}
  123. </delete>
  124. <delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample">
  125. delete from jsh_depot_item
  126. <if test="_parameter != null">
  127. <include refid="Example_Where_Clause" />
  128. </if>
  129. </delete>
  130. <insert id="insert" parameterType="com.jsh.erp.datasource.entities.DepotItem">
  131. insert into jsh_depot_item (id, header_id, material_id,
  132. material_extend_id, material_unit, sku,
  133. oper_number, basic_number, unit_price,
  134. purchase_unit_price, tax_unit_price, all_price,
  135. remark, depot_id, another_depot_id,
  136. tax_rate, tax_money, tax_last_money,
  137. material_type, sn_list, batch_number,
  138. expiration_date, link_id, tenant_id,
  139. delete_flag)
  140. values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT},
  141. #{materialExtendId,jdbcType=BIGINT}, #{materialUnit,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR},
  142. #{operNumber,jdbcType=DECIMAL}, #{basicNumber,jdbcType=DECIMAL}, #{unitPrice,jdbcType=DECIMAL},
  143. #{purchaseUnitPrice,jdbcType=DECIMAL}, #{taxUnitPrice,jdbcType=DECIMAL}, #{allPrice,jdbcType=DECIMAL},
  144. #{remark,jdbcType=VARCHAR}, #{depotId,jdbcType=BIGINT}, #{anotherDepotId,jdbcType=BIGINT},
  145. #{taxRate,jdbcType=DECIMAL}, #{taxMoney,jdbcType=DECIMAL}, #{taxLastMoney,jdbcType=DECIMAL},
  146. #{materialType,jdbcType=VARCHAR}, #{snList,jdbcType=VARCHAR}, #{batchNumber,jdbcType=VARCHAR},
  147. #{expirationDate,jdbcType=TIMESTAMP}, #{linkId,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT},
  148. #{deleteFlag,jdbcType=VARCHAR})
  149. </insert>
  150. <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotItem" useGeneratedKeys="true" keyProperty="id">
  151. insert into jsh_depot_item
  152. <trim prefix="(" suffix=")" suffixOverrides=",">
  153. <if test="id != null">
  154. id,
  155. </if>
  156. <if test="headerId != null">
  157. header_id,
  158. </if>
  159. <if test="materialId != null">
  160. material_id,
  161. </if>
  162. <if test="materialExtendId != null">
  163. material_extend_id,
  164. </if>
  165. <if test="materialUnit != null">
  166. material_unit,
  167. </if>
  168. <if test="sku != null">
  169. sku,
  170. </if>
  171. <if test="operNumber != null">
  172. oper_number,
  173. </if>
  174. <if test="basicNumber != null">
  175. basic_number,
  176. </if>
  177. <if test="unitPrice != null">
  178. unit_price,
  179. </if>
  180. <if test="purchaseUnitPrice != null">
  181. purchase_unit_price,
  182. </if>
  183. <if test="taxUnitPrice != null">
  184. tax_unit_price,
  185. </if>
  186. <if test="allPrice != null">
  187. all_price,
  188. </if>
  189. <if test="remark != null">
  190. remark,
  191. </if>
  192. <if test="depotId != null">
  193. depot_id,
  194. </if>
  195. <if test="anotherDepotId != null">
  196. another_depot_id,
  197. </if>
  198. <if test="taxRate != null">
  199. tax_rate,
  200. </if>
  201. <if test="taxMoney != null">
  202. tax_money,
  203. </if>
  204. <if test="taxLastMoney != null">
  205. tax_last_money,
  206. </if>
  207. <if test="materialType != null">
  208. material_type,
  209. </if>
  210. <if test="snList != null">
  211. sn_list,
  212. </if>
  213. <if test="batchNumber != null">
  214. batch_number,
  215. </if>
  216. <if test="expirationDate != null">
  217. expiration_date,
  218. </if>
  219. <if test="linkId != null">
  220. link_id,
  221. </if>
  222. <if test="tenantId != null">
  223. tenant_id,
  224. </if>
  225. <if test="deleteFlag != null">
  226. delete_flag,
  227. </if>
  228. <if test="actualQuantityInStorage != null">
  229. actual_quantity_in_storage,
  230. </if>
  231. <if test="warehousingVariance != null">
  232. warehousing_variance,
  233. </if>
  234. <if test="reasonOfDifference != null">
  235. reason_of_difference,
  236. </if>
  237. <if test="warehousingUser != null">
  238. warehousing_user,
  239. </if>
  240. <if test="warehousingTime != null and warehousingTime != ''">
  241. warehousing_time,
  242. </if>
  243. <if test="createTime != null">
  244. create_time,
  245. </if>
  246. </trim>
  247. <trim prefix="values (" suffix=")" suffixOverrides=",">
  248. <if test="id != null">
  249. #{id,jdbcType=BIGINT},
  250. </if>
  251. <if test="headerId != null">
  252. #{headerId,jdbcType=BIGINT},
  253. </if>
  254. <if test="materialId != null">
  255. #{materialId,jdbcType=BIGINT},
  256. </if>
  257. <if test="materialExtendId != null">
  258. #{materialExtendId,jdbcType=BIGINT},
  259. </if>
  260. <if test="materialUnit != null">
  261. #{materialUnit,jdbcType=VARCHAR},
  262. </if>
  263. <if test="sku != null">
  264. #{sku,jdbcType=VARCHAR},
  265. </if>
  266. <if test="operNumber != null">
  267. #{operNumber,jdbcType=DECIMAL},
  268. </if>
  269. <if test="basicNumber != null">
  270. #{basicNumber,jdbcType=DECIMAL},
  271. </if>
  272. <if test="unitPrice != null">
  273. #{unitPrice,jdbcType=DECIMAL},
  274. </if>
  275. <if test="purchaseUnitPrice != null">
  276. #{purchaseUnitPrice,jdbcType=DECIMAL},
  277. </if>
  278. <if test="taxUnitPrice != null">
  279. #{taxUnitPrice,jdbcType=DECIMAL},
  280. </if>
  281. <if test="allPrice != null">
  282. #{allPrice,jdbcType=DECIMAL},
  283. </if>
  284. <if test="remark != null">
  285. #{remark,jdbcType=VARCHAR},
  286. </if>
  287. <if test="depotId != null">
  288. #{depotId,jdbcType=BIGINT},
  289. </if>
  290. <if test="anotherDepotId != null">
  291. #{anotherDepotId,jdbcType=BIGINT},
  292. </if>
  293. <if test="taxRate != null">
  294. #{taxRate,jdbcType=DECIMAL},
  295. </if>
  296. <if test="taxMoney != null">
  297. #{taxMoney,jdbcType=DECIMAL},
  298. </if>
  299. <if test="taxLastMoney != null">
  300. #{taxLastMoney,jdbcType=DECIMAL},
  301. </if>
  302. <if test="materialType != null">
  303. #{materialType,jdbcType=VARCHAR},
  304. </if>
  305. <if test="snList != null">
  306. #{snList,jdbcType=VARCHAR},
  307. </if>
  308. <if test="batchNumber != null">
  309. #{batchNumber,jdbcType=VARCHAR},
  310. </if>
  311. <if test="expirationDate != null">
  312. #{expirationDate,jdbcType=TIMESTAMP},
  313. </if>
  314. <if test="linkId != null">
  315. #{linkId,jdbcType=BIGINT},
  316. </if>
  317. <if test="tenantId != null">
  318. #{tenantId,jdbcType=BIGINT},
  319. </if>
  320. <if test="deleteFlag != null">
  321. #{deleteFlag,jdbcType=VARCHAR},
  322. </if>
  323. <if test="actualQuantityInStorage != null">
  324. #{actualQuantityInStorage,jdbcType=DECIMAL},
  325. </if>
  326. <if test="warehousingVariance != null">
  327. #{warehousingVariance,jdbcType=DECIMAL},
  328. </if>
  329. <if test="reasonOfDifference != null">
  330. #{reasonOfDifference,jdbcType=VARCHAR},
  331. </if>
  332. <if test="warehousingUser != null">
  333. #{warehousingUser,jdbcType=BIGINT},
  334. </if>
  335. <if test="warehousingTime != null and warehousingTime != ''">
  336. #{warehousingTime,jdbcType=DATE},
  337. </if>
  338. <if test="createTime != null">
  339. #{createTime,jdbcType=DATE},
  340. </if>
  341. </trim>
  342. </insert>
  343. <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultType="java.lang.Long">
  344. select count(*) from jsh_depot_item
  345. <if test="_parameter != null">
  346. <include refid="Example_Where_Clause" />
  347. </if>
  348. </select>
  349. <update id="updateByExampleSelective" parameterType="map">
  350. update jsh_depot_item
  351. <set>
  352. <if test="record.id != null">
  353. id = #{record.id,jdbcType=BIGINT},
  354. </if>
  355. <if test="record.headerId != null">
  356. header_id = #{record.headerId,jdbcType=BIGINT},
  357. </if>
  358. <if test="record.materialId != null">
  359. material_id = #{record.materialId,jdbcType=BIGINT},
  360. </if>
  361. <if test="record.materialExtendId != null">
  362. material_extend_id = #{record.materialExtendId,jdbcType=BIGINT},
  363. </if>
  364. <if test="record.materialUnit != null">
  365. material_unit = #{record.materialUnit,jdbcType=VARCHAR},
  366. </if>
  367. <if test="record.sku != null">
  368. sku = #{record.sku,jdbcType=VARCHAR},
  369. </if>
  370. <if test="record.operNumber != null">
  371. oper_number = #{record.operNumber,jdbcType=DECIMAL},
  372. </if>
  373. <if test="record.basicNumber != null">
  374. basic_number = #{record.basicNumber,jdbcType=DECIMAL},
  375. </if>
  376. <if test="record.unitPrice != null">
  377. unit_price = #{record.unitPrice,jdbcType=DECIMAL},
  378. </if>
  379. <if test="record.purchaseUnitPrice != null">
  380. purchase_unit_price = #{record.purchaseUnitPrice,jdbcType=DECIMAL},
  381. </if>
  382. <if test="record.taxUnitPrice != null">
  383. tax_unit_price = #{record.taxUnitPrice,jdbcType=DECIMAL},
  384. </if>
  385. <if test="record.allPrice != null">
  386. all_price = #{record.allPrice,jdbcType=DECIMAL},
  387. </if>
  388. <if test="record.remark != null">
  389. remark = #{record.remark,jdbcType=VARCHAR},
  390. </if>
  391. <if test="record.depotId != null">
  392. depot_id = #{record.depotId,jdbcType=BIGINT},
  393. </if>
  394. <if test="record.anotherDepotId != null">
  395. another_depot_id = #{record.anotherDepotId,jdbcType=BIGINT},
  396. </if>
  397. <if test="record.taxRate != null">
  398. tax_rate = #{record.taxRate,jdbcType=DECIMAL},
  399. </if>
  400. <if test="record.taxMoney != null">
  401. tax_money = #{record.taxMoney,jdbcType=DECIMAL},
  402. </if>
  403. <if test="record.taxLastMoney != null">
  404. tax_last_money = #{record.taxLastMoney,jdbcType=DECIMAL},
  405. </if>
  406. <if test="record.materialType != null">
  407. material_type = #{record.materialType,jdbcType=VARCHAR},
  408. </if>
  409. <if test="record.snList != null">
  410. sn_list = #{record.snList,jdbcType=VARCHAR},
  411. </if>
  412. <if test="record.batchNumber != null">
  413. batch_number = #{record.batchNumber,jdbcType=VARCHAR},
  414. </if>
  415. <if test="record.expirationDate != null">
  416. expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP},
  417. </if>
  418. <if test="record.linkId != null">
  419. link_id = #{record.linkId,jdbcType=BIGINT},
  420. </if>
  421. <if test="record.tenantId != null">
  422. tenant_id = #{record.tenantId,jdbcType=BIGINT},
  423. </if>
  424. <if test="record.deleteFlag != null">
  425. delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
  426. </if>
  427. </set>
  428. <if test="_parameter != null">
  429. <include refid="Update_By_Example_Where_Clause" />
  430. </if>
  431. </update>
  432. <update id="updateByExample" parameterType="map">
  433. update jsh_depot_item
  434. set id = #{record.id,jdbcType=BIGINT},
  435. header_id = #{record.headerId,jdbcType=BIGINT},
  436. material_id = #{record.materialId,jdbcType=BIGINT},
  437. material_extend_id = #{record.materialExtendId,jdbcType=BIGINT},
  438. material_unit = #{record.materialUnit,jdbcType=VARCHAR},
  439. sku = #{record.sku,jdbcType=VARCHAR},
  440. oper_number = #{record.operNumber,jdbcType=DECIMAL},
  441. basic_number = #{record.basicNumber,jdbcType=DECIMAL},
  442. unit_price = #{record.unitPrice,jdbcType=DECIMAL},
  443. purchase_unit_price = #{record.purchaseUnitPrice,jdbcType=DECIMAL},
  444. tax_unit_price = #{record.taxUnitPrice,jdbcType=DECIMAL},
  445. all_price = #{record.allPrice,jdbcType=DECIMAL},
  446. remark = #{record.remark,jdbcType=VARCHAR},
  447. depot_id = #{record.depotId,jdbcType=BIGINT},
  448. another_depot_id = #{record.anotherDepotId,jdbcType=BIGINT},
  449. tax_rate = #{record.taxRate,jdbcType=DECIMAL},
  450. tax_money = #{record.taxMoney,jdbcType=DECIMAL},
  451. tax_last_money = #{record.taxLastMoney,jdbcType=DECIMAL},
  452. material_type = #{record.materialType,jdbcType=VARCHAR},
  453. sn_list = #{record.snList,jdbcType=VARCHAR},
  454. batch_number = #{record.batchNumber,jdbcType=VARCHAR},
  455. expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP},
  456. link_id = #{record.linkId,jdbcType=BIGINT},
  457. tenant_id = #{record.tenantId,jdbcType=BIGINT},
  458. delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
  459. <if test="_parameter != null">
  460. <include refid="Update_By_Example_Where_Clause" />
  461. </if>
  462. </update>
  463. <update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.DepotItem">
  464. update jsh_depot_item
  465. <set>
  466. <if test="headerId != null">
  467. header_id = #{headerId,jdbcType=BIGINT},
  468. </if>
  469. <if test="materialId != null">
  470. material_id = #{materialId,jdbcType=BIGINT},
  471. </if>
  472. <if test="materialExtendId != null">
  473. material_extend_id = #{materialExtendId,jdbcType=BIGINT},
  474. </if>
  475. <if test="materialUnit != null">
  476. material_unit = #{materialUnit,jdbcType=VARCHAR},
  477. </if>
  478. <if test="sku != null">
  479. sku = #{sku,jdbcType=VARCHAR},
  480. </if>
  481. <if test="operNumber != null">
  482. oper_number = #{operNumber,jdbcType=DECIMAL},
  483. </if>
  484. <if test="basicNumber != null">
  485. basic_number = #{basicNumber,jdbcType=DECIMAL},
  486. </if>
  487. <if test="unitPrice != null">
  488. unit_price = #{unitPrice,jdbcType=DECIMAL},
  489. </if>
  490. <if test="purchaseUnitPrice != null">
  491. purchase_unit_price = #{purchaseUnitPrice,jdbcType=DECIMAL},
  492. </if>
  493. <if test="taxUnitPrice != null">
  494. tax_unit_price = #{taxUnitPrice,jdbcType=DECIMAL},
  495. </if>
  496. <if test="allPrice != null">
  497. all_price = #{allPrice,jdbcType=DECIMAL},
  498. </if>
  499. <if test="remark != null">
  500. remark = #{remark,jdbcType=VARCHAR},
  501. </if>
  502. <if test="depotId != null">
  503. depot_id = #{depotId,jdbcType=BIGINT},
  504. </if>
  505. <if test="anotherDepotId != null">
  506. another_depot_id = #{anotherDepotId,jdbcType=BIGINT},
  507. </if>
  508. <if test="taxRate != null">
  509. tax_rate = #{taxRate,jdbcType=DECIMAL},
  510. </if>
  511. <if test="taxMoney != null">
  512. tax_money = #{taxMoney,jdbcType=DECIMAL},
  513. </if>
  514. <if test="taxLastMoney != null">
  515. tax_last_money = #{taxLastMoney,jdbcType=DECIMAL},
  516. </if>
  517. <if test="materialType != null">
  518. material_type = #{materialType,jdbcType=VARCHAR},
  519. </if>
  520. <if test="snList != null">
  521. sn_list = #{snList,jdbcType=VARCHAR},
  522. </if>
  523. <if test="batchNumber != null">
  524. batch_number = #{batchNumber,jdbcType=VARCHAR},
  525. </if>
  526. <if test="expirationDate != null">
  527. expiration_date = #{expirationDate,jdbcType=TIMESTAMP},
  528. </if>
  529. <if test="linkId != null">
  530. link_id = #{linkId,jdbcType=BIGINT},
  531. </if>
  532. <if test="tenantId != null">
  533. tenant_id = #{tenantId,jdbcType=BIGINT},
  534. </if>
  535. <if test="deleteFlag != null">
  536. delete_flag = #{deleteFlag,jdbcType=VARCHAR},
  537. </if>
  538. </set>
  539. where id = #{id,jdbcType=BIGINT}
  540. </update>
  541. <update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.DepotItem">
  542. update jsh_depot_item
  543. set header_id = #{headerId,jdbcType=BIGINT},
  544. material_id = #{materialId,jdbcType=BIGINT},
  545. material_extend_id = #{materialExtendId,jdbcType=BIGINT},
  546. material_unit = #{materialUnit,jdbcType=VARCHAR},
  547. sku = #{sku,jdbcType=VARCHAR},
  548. oper_number = #{operNumber,jdbcType=DECIMAL},
  549. basic_number = #{basicNumber,jdbcType=DECIMAL},
  550. unit_price = #{unitPrice,jdbcType=DECIMAL},
  551. purchase_unit_price = #{purchaseUnitPrice,jdbcType=DECIMAL},
  552. tax_unit_price = #{taxUnitPrice,jdbcType=DECIMAL},
  553. all_price = #{allPrice,jdbcType=DECIMAL},
  554. remark = #{remark,jdbcType=VARCHAR},
  555. depot_id = #{depotId,jdbcType=BIGINT},
  556. another_depot_id = #{anotherDepotId,jdbcType=BIGINT},
  557. tax_rate = #{taxRate,jdbcType=DECIMAL},
  558. tax_money = #{taxMoney,jdbcType=DECIMAL},
  559. tax_last_money = #{taxLastMoney,jdbcType=DECIMAL},
  560. material_type = #{materialType,jdbcType=VARCHAR},
  561. sn_list = #{snList,jdbcType=VARCHAR},
  562. batch_number = #{batchNumber,jdbcType=VARCHAR},
  563. expiration_date = #{expirationDate,jdbcType=TIMESTAMP},
  564. link_id = #{linkId,jdbcType=BIGINT},
  565. tenant_id = #{tenantId,jdbcType=BIGINT},
  566. delete_flag = #{deleteFlag,jdbcType=VARCHAR}
  567. where id = #{id,jdbcType=BIGINT}
  568. </update>
  569. <select id="pdaList" resultType="com.jsh.erp.datasource.pda.vo.PDADepotItemVO">
  570. SELECT
  571. di.id AS id,
  572. m.`name` AS material_name,
  573. m.standard AS material_standard,
  574. me.batch_number AS batch_number,
  575. me.production_date AS production_date,
  576. me.position AS position,
  577. me.inventory AS inventory,
  578. me.bar_code AS bar_code,
  579. di.oper_number AS oper_number,
  580. me.commodity_unit AS commodity_unit,
  581. di.material_unit AS material_unit,
  582. di.actual_quantity_in_storage AS actual_quantity_in_storage,
  583. di.material_id AS material_id,
  584. m.img_name AS img_name
  585. FROM
  586. jsh_depot_item di
  587. LEFT JOIN jsh_material m ON di.material_id = m.id
  588. LEFT JOIN jsh_material_extend me ON di.material_extend_id = me.id
  589. WHERE
  590. di.delete_flag = '0'
  591. AND di.header_id = #{id}
  592. </select>
  593. <select id="pdaDetail" resultType="com.jsh.erp.datasource.pda.vo.PDADepotItemVO">
  594. SELECT
  595. di.id AS id,
  596. m.`name` AS material_name,
  597. m.standard AS material_standard,
  598. me.batch_number AS batch_number,
  599. me.production_date AS production_date,
  600. me.position AS position,
  601. me.inventory AS inventory,
  602. me.bar_code AS bar_code,
  603. di.oper_number AS oper_number,
  604. di.material_unit AS material_unit,
  605. me.create_time AS create_time,
  606. di.material_id AS material_id,
  607. m.img_name AS img_name
  608. FROM
  609. jsh_depot_item di
  610. LEFT JOIN jsh_material m ON di.material_id = m.id
  611. LEFT JOIN jsh_material_extend me ON di.material_extend_id = me.id
  612. WHERE
  613. di.delete_flag = '0'
  614. AND di.id = #{id}
  615. </select>
  616. <select id="materialDepotDetail" resultType="com.jsh.erp.datasource.pda.vo.PDADepotItemVO">
  617. SELECT
  618. di.id AS id,
  619. di.material_id AS material_id,
  620. m.`name` AS material_name,
  621. d.name AS depot_name,
  622. m.standard AS material_standard,
  623. di.actual_quantity_in_storage AS actual_quantity_in_storage,
  624. di.warehousing_time AS warehousing_time,
  625. me.commodity_unit AS commodity_unit,
  626. m.img_name AS img_name
  627. FROM
  628. jsh_depot_item di
  629. LEFT JOIN jsh_depot_head dh ON di.header_id = dh.id
  630. LEFT JOIN jsh_material m ON di.material_id = m.id
  631. LEFT JOIN jsh_material_extend me ON di.material_extend_id = me.id
  632. LEFT JOIN jsh_depot d ON di.depot_id = d.id
  633. WHERE
  634. di.delete_flag = '0'
  635. AND dh.status in ('2','3')
  636. AND dh.type = #{type}
  637. AND di.material_id = #{materialId}
  638. </select>
  639. </mapper>