InventoryMapper.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  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.dk.mdm.mapper.ivt.InventoryMapper">
  4. <!-- 通用设置 -->
  5. <!-- 通用查询列 -->
  6. <sql id="Base_Column_List">
  7. inv_id, wh_id, sku_id, non_std_code, sys.f_remove_zero(inv_qty) as inv_qty, sys.f_remove_zero(outing_qty) as outing_qty,
  8. sys.f_remove_zero(usable_qty) as usable_qty, cost_price, cost_amt, remarks, flg_valid, cp_id, op_create_time,
  9. op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user, sys.f_remove_zero(freeze_qty) as freeze_qty
  10. </sql>
  11. <!-- 通用查询列Response -->
  12. <sql id="Base_Column_List_Response">
  13. tpi.inv_id, tpi.wh_id, tpi.sku_id, tpi.non_std_code, sys.f_remove_zero(tpi.inv_qty) as inv_qty,
  14. sys.f_remove_zero(tpi.outing_qty) as outing_qty,
  15. sys.f_remove_zero(tpi.usable_qty) as usable_qty, tpi.cost_price, tpi.cost_amt, tpi.remarks, tpi.flg_valid,
  16. tpi.cp_id,sys.f_remove_zero(tpi.freeze_qty) as freeze_qty
  17. </sql>
  18. <!-- 通用查询映射结果 -->
  19. <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.ivt.Inventory">
  20. <id column="inv_id" property="invId"/>
  21. <result column="wh_id" property="whId" typeHandler="UuidTypeHandler"/>
  22. <result column="sku_id" property="skuId" typeHandler="UuidTypeHandler"/>
  23. <result column="non_std_code" property="nonStdCode"/>
  24. <result column="inv_qty" property="invQty"/>
  25. <result column="outing_qty" property="outingQty"/>
  26. <result column="usable_qty" property="usableQty"/>
  27. <result column="cost_price" property="costPrice"/>
  28. <result column="cost_amt" property="costAmt"/>
  29. <result column="remarks" property="remarks"/>
  30. <result column="flg_valid" property="flgValid"/>
  31. <result column="cp_id" property="cpId"/>
  32. <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
  33. <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
  34. <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
  35. <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
  36. <result column="op_app_code" property="opAppCode"/>
  37. <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
  38. <result column="op_db_user" property="opDbUser"/>
  39. <result column="freeze_qty" property="freezeQty"/>
  40. <result column="decimalPlaces" property="decimalPlaces"/>
  41. </resultMap>
  42. <!-- 通用查询映射结果Response -->
  43. <resultMap id="BaseResultMapResponse" type="com.dk.mdm.model.response.ivt.InventoryResponse">
  44. <id column="inv_id" property="invId"/>
  45. <result column="wh_id" property="whId" typeHandler="UuidTypeHandler"/>
  46. <result column="sku_id" property="skuId" typeHandler="UuidTypeHandler"/>
  47. <result column="non_std_code" property="nonStdCode"/>
  48. <result column="inv_qty" property="invQty"/>
  49. <result column="outing_qty" property="outingQty"/>
  50. <result column="usable_qty" property="usableQty"/>
  51. <result column="cost_price" property="costPrice"/>
  52. <result column="cost_amt" property="costAmt"/>
  53. <result column="remarks" property="remarks"/>
  54. <result column="flg_valid" property="flgValid"/>
  55. <result column="cp_id" property="cpId"/>
  56. <result column="sku_code" property="skuCode"/>
  57. <result column="sku_name" property="skuName"/>
  58. <result column="sku_spec" property="skuSpec"/>
  59. <result column="sku_model" property="skuModel"/>
  60. <result column="brand_name" property="brandName"/>
  61. <result column="short_name" property="shortName"/>
  62. <result column="wh_name" property="whName"/>
  63. <result column="price_purchase" property="pricePurchase"/>
  64. <result column="price_standard" property="priceStandard"/>
  65. <result column="price_wholesale" property="priceWholesale"/>
  66. <result column="price_limited" property="priceLimited"/>
  67. <result column="unit_id" property="unitId" typeHandler="UuidTypeHandler"/>
  68. <result column="sub_unit_id" property="subUnitId" typeHandler="UuidTypeHandler"/>
  69. <result column="pack_box" property="packBox"/>
  70. <result column="subUnitName" property="subUnitName"/>
  71. <result column="unitName" property="unitName"/>
  72. <result column="flg_sub_unit" property="flgSubUnit"/>
  73. <result column="seriesName" property="seriesName"/>
  74. <result column="catName" property="catName"/>
  75. <result column="price_other" property="priceOther"/>
  76. <result column="warning_upper_limit" property="warningUpperLimit"/>
  77. <result column="warning_lower_limit" property="warningLowerLimit"/>
  78. <result column="sku_images" property="skuImages" typeHandler="JsonTypeHandler"/>
  79. <result column="decimalPlaces" property="decimalPlaces"/>
  80. <result column="flg_price" property="flgPrice"/>
  81. </resultMap>
  82. <!-- 通用条件列 -->
  83. <sql id="Condition">
  84. <where>
  85. <if test="whId != null and whId != ''">
  86. AND tpi.wh_id = #{whId}::UUID
  87. </if>
  88. <if test="whIds != null and whIds.size()>0">
  89. AND tpi.wh_id =
  90. any(#{whIds, typeHandler=UuidListTypeHandler})
  91. </if>
  92. <if test="warehouseIds != null and warehouseIds.size()>0">
  93. AND tpi.wh_id =
  94. any(#{warehouseIds, typeHandler=UuidListTypeHandler})
  95. </if>
  96. <if test="skuId != null and skuId != ''">
  97. AND tpi.sku_id = #{skuId}
  98. </if>
  99. <if test="nonStdCode != null and nonStdCode != ''">
  100. AND tpi.non_std_code = #{nonStdCode}
  101. </if>
  102. <if test="invQty != null">
  103. AND tpi.inv_qty = #{invQty}
  104. </if>
  105. <if test="outingQty != null">
  106. AND tpi.outing_qty = #{outingQty}
  107. </if>
  108. <if test="usableQty != null">
  109. AND tpi.usable_qty = #{usableQty}
  110. </if>
  111. <if test="costPrice != null">
  112. AND tpi.cost_price = #{costPrice}
  113. </if>
  114. <if test="costAmt != null">
  115. AND tpi.cost_amt = #{costAmt}
  116. </if>
  117. <if test="flgValid != null">
  118. AND tpi.flg_valid = #{flgValid}
  119. </if>
  120. <if test="flgZero == true">
  121. AND tpi.inv_qty != 0
  122. </if>
  123. <if test="cpId != null">
  124. AND tpi.cp_id = #{cpId}
  125. </if>
  126. <if test="freezeQty != null">
  127. AND tpi.freeze_qty = #{freezeQty}
  128. </if>
  129. <if test="categoryId != null and categoryId != ''">
  130. AND tmgs.category_id = #{categoryId}::UUID
  131. </if>
  132. <if test="brandId != null and brandId != ''">
  133. AND tmgs.brand_id = #{brandId}::UUID
  134. </if>
  135. <if test="searchText != null">
  136. AND (tmgs.sku_model like concat('%', my_ex.likequery(#{searchText}) , '%')
  137. OR tmgs.sku_name like concat('%', my_ex.likequery(#{searchText}) , '%')
  138. OR tpi.non_std_code like concat('%', my_ex.likequery(#{searchText}) , '%')
  139. )
  140. </if>
  141. <if test="invQtyFlag != null and invQtyFlag = true">
  142. and tpi.inv_qty != 0
  143. </if>
  144. </where>
  145. </sql>
  146. <sql id="idsForeach">
  147. <!-- 根据主键invId批量操作 -->
  148. WHERE inv_id in
  149. <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
  150. #{item}
  151. </foreach>
  152. </sql>
  153. <!-- 查询表dkic_b.t_psi_inventory,(条件查询+分页)列表 -->
  154. <select id="selectByCond" resultMap="BaseResultMapResponse">
  155. SELECT
  156. <include refid="Base_Column_List_Response"/>
  157. ,tmgs.sku_code
  158. ,tmgs.sku_model
  159. ,tmgs.sku_name
  160. ,tmgs.sku_spec
  161. ,tmgs.price_purchase
  162. ,tmgs.price_standard
  163. ,tmgs.price_wholesale
  164. ,tmgs.price_other
  165. ,tmgs.price_limited
  166. ,tmgs.sku_images
  167. ,tmgs.unit_id
  168. ,tmgs.sub_unit_id
  169. ,tmgs.warning_upper_limit
  170. ,tmgs.warning_lower_limit
  171. ,tmgs.pack_box
  172. ,tmu.unit_name AS "unitName"
  173. ,subtmu.unit_name AS "subUnitName"
  174. ,tmgs.flg_sub_unit
  175. ,tmgb.brand_name
  176. ,tmgb.short_name
  177. ,tmw.wh_name
  178. ,tmgc.cat_name as "catName"
  179. ,tmgseries.series_name as "seriesName"
  180. ,tmu.decimal_places as "decimalPlaces"
  181. ,tmgs.flg_price
  182. FROM dkic_b.t_psi_inventory tpi
  183. <include refid="Join_Table"/>
  184. <include refid="Condition"/>
  185. <if test="desc != null and desc != ''">
  186. order by tpi.usable_qty desc
  187. </if>
  188. <if test="desc == null or desc == ''">
  189. order by tpi.usable_qty
  190. </if>
  191. <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
  192. limit #{end} offset #{start}
  193. </if>
  194. </select>
  195. <!-- 查询表dkic_b.t_psi_inventory,(条件查询)个数 -->
  196. <select id="countByCond" resultType="Long">
  197. SELECT
  198. count(1)
  199. FROM dkic_b.t_psi_inventory tpi
  200. <include refid="Join_Table"/>
  201. <include refid="Condition"/>
  202. </select>
  203. <sql id="Join_Table">
  204. left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpi.sku_id
  205. left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpi.wh_id
  206. LEFT JOIN dkic_b.t_mst_goods_brand tmgb ON tmgb.brand_id = tmgs.brand_id
  207. LEFT JOIN dkic_b.t_mst_unit tmu ON tmu.unit_id = tmgs.unit_id
  208. LEFT JOIN dkic_b.t_mst_unit subtmu ON subtmu.unit_id = tmgs.sub_unit_id
  209. left join dkic_b.t_mst_goods_category as tmgc on tmgs.category_id = tmgc.cat_id
  210. left join dkic_b.t_mst_goods_series as tmgseries on tmgs.series_id = tmgseries.series_id
  211. </sql>
  212. <!-- 根据主键查询表dkic_b.t_psi_inventory的一行数据 -->
  213. <select id="selectById" resultMap="BaseResultMapResponse">
  214. SELECT
  215. <include refid="Base_Column_List_Response"/>
  216. ,tmu.decimal_places as "decimalPlaces"
  217. FROM dkic_b.t_psi_inventory tpi
  218. left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpi.sku_id
  219. LEFT JOIN dkic_b.t_mst_unit tmu ON tmu.unit_id = tmgs.unit_id
  220. WHERE tpi.inv_id = #{id}::uuid
  221. </select>
  222. <!-- 根据主键锁定表dkic_b.t_psi_inventory的一行数据 -->
  223. <select id="selectByIdForUpdate" resultMap="BaseResultMap">
  224. SELECT
  225. <include refid="Base_Column_List"/>
  226. FROM dkic_b.t_psi_inventory
  227. WHERE inv_id = #{id}::uuid
  228. for update
  229. </select>
  230. <!-- 根据主键锁定表dkic_b.t_psi_inventory的多行数据 -->
  231. <select id="selectByIdsForUpdate" resultMap="BaseResultMap">
  232. SELECT
  233. <include refid="Base_Column_List"/>
  234. FROM dkic_b.t_psi_inventory
  235. <include refid="idsForeach"/>
  236. for update
  237. </select>
  238. <insert id="insertBatch">
  239. insert into dkic_b.t_psi_inventory
  240. (
  241. <trim suffixOverrides=",">
  242. wh_id,
  243. sku_id,
  244. non_std_code,
  245. inv_qty,
  246. outing_qty,
  247. usable_qty,
  248. cost_price,
  249. cost_amt,
  250. remarks,
  251. cp_id,
  252. op_app_code,
  253. freeze_qty,
  254. </trim>
  255. )
  256. values
  257. <foreach collection="list" index="index" item="item" separator=",">
  258. (
  259. <trim suffixOverrides=",">
  260. #{item.whId}::uuid,
  261. #{item.skuId}::uuid,
  262. #{item.nonStdCode},
  263. #{item.invQty},
  264. #{item.outingQty},
  265. #{item.usableQty},
  266. #{item.costPrice},
  267. #{item.costAmt},
  268. #{item.remarks},
  269. #{item.cpId},
  270. #{item.opAppCode},
  271. #{item.freezeQty},
  272. </trim>
  273. )
  274. </foreach>
  275. </insert>
  276. <!-- 查询表dkic_b.t_psi_inventory,(条件查询+分页)列表 -->
  277. <select id="selectByOther" resultMap="BaseResultMapResponse">
  278. SELECT
  279. <include refid="Base_Column_List_Response"/>
  280. ,tmu.decimal_places as "decimalPlaces"
  281. FROM dkic_b.t_psi_inventory tpi
  282. left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpi.sku_id
  283. LEFT JOIN dkic_b.t_mst_unit tmu ON tmu.unit_id = tmgs.unit_id
  284. <where>
  285. <if test="whId != null and whId != ''">
  286. AND tpi.wh_id = #{whId}::uuid
  287. </if>
  288. <if test="skuId != null and skuId != ''">
  289. AND tpi.sku_id = #{skuId}::uuid
  290. </if>
  291. <if test="nonStdCode != null and nonStdCode != ''">
  292. AND tpi.non_std_code = #{nonStdCode}
  293. </if>
  294. <if test="nonStdCode == null or nonStdCode == ''">
  295. AND tpi.non_std_code = '-'
  296. </if>
  297. </where>
  298. </select>
  299. <select id="warningCountByCond" resultType="java.lang.Long">
  300. SELECT
  301. count(1)
  302. FROM dkic_b.t_psi_inventory tpi
  303. <include refid="Join_Table"/>
  304. <where>
  305. ((tmgs.warning_lower_limit &lt;&gt; 0 AND tpi.inv_qty &lt; tmgs.warning_lower_limit)
  306. OR (tmgs.warning_upper_limit &lt;&gt; 0 AND tpi.inv_qty > tmgs.warning_upper_limit))
  307. <if test="whId != null and whId != ''">
  308. AND tpi.wh_id = #{whId}::UUID
  309. </if>
  310. <if test="whIds != null and whIds.size()>0">
  311. AND tpi.wh_id =
  312. any(#{whIds, typeHandler=UuidListTypeHandler})
  313. </if>
  314. <if test="skuId != null and skuId != ''">
  315. AND tpi.sku_id = #{skuId}
  316. </if>
  317. <if test="nonStdCode != null and nonStdCode != ''">
  318. AND tpi.non_std_code = #{nonStdCode}
  319. </if>
  320. <if test="invQty != null">
  321. AND tpi.inv_qty = #{invQty}
  322. </if>
  323. <if test="outingQty != null">
  324. AND tpi.outing_qty = #{outingQty}
  325. </if>
  326. <if test="usableQty != null">
  327. AND tpi.usable_qty = #{usableQty}
  328. </if>
  329. <if test="costPrice != null">
  330. AND tpi.cost_price = #{costPrice}
  331. </if>
  332. <if test="costAmt != null">
  333. AND tpi.cost_amt = #{costAmt}
  334. </if>
  335. <if test="flgValid != null">
  336. AND tpi.flg_valid = #{flgValid}
  337. </if>
  338. <if test="flgZero == true">
  339. AND tpi.inv_qty != 0
  340. </if>
  341. <if test="cpId != null">
  342. AND tpi.cp_id = #{cpId}
  343. </if>
  344. <if test="freezeQty != null">
  345. AND tpi.freeze_qty = #{freezeQty}
  346. </if>
  347. <if test="categoryId != null and categoryId != ''">
  348. AND tmgs.category_id = #{categoryId}::UUID
  349. </if>
  350. <if test="brandId != null and brandId != ''">
  351. AND tmgs.brand_id = #{brandId}::UUID
  352. </if>
  353. <if test="searchText != null and searchText != ''">
  354. AND (tmgs.sku_model like concat('%', my_ex.likequery(#{searchText}) , '%')
  355. OR tmgs.sku_name like concat('%', my_ex.likequery(#{searchText}) , '%')
  356. OR tpi.non_std_code like concat('%', my_ex.likequery(#{searchText}) , '%')
  357. )
  358. </if>
  359. <if test="invQtyFlag != null and invQtyFlag = true">
  360. and tpi.inv_qty != 0
  361. </if>
  362. </where>
  363. </select>
  364. <select id="warningSelectByCond" resultType="com.dk.mdm.model.response.ivt.InventoryResponse">
  365. SELECT
  366. SUM(sys.f_remove_zero(tpi.inv_qty)) as inv_qty
  367. ,tmgs.sku_name
  368. ,tmgs.sku_spec
  369. ,tmgs.unit_id
  370. ,tmgs.sku_model
  371. ,tmgs.sub_unit_id
  372. ,tmgs.warning_upper_limit
  373. ,tmgs.warning_lower_limit
  374. ,tmgs.pack_box
  375. ,tmu.unit_name AS "unitName"
  376. ,subtmu.unit_name AS "subUnitName"
  377. ,tmu.decimal_places as "decimalPlaces"
  378. FROM dkic_b.t_psi_inventory tpi
  379. left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpi.sku_id
  380. LEFT JOIN dkic_b.t_mst_unit tmu ON tmu.unit_id = tmgs.unit_id
  381. LEFT JOIN dkic_b.t_mst_unit subtmu ON subtmu.unit_id = tmgs.sub_unit_id
  382. <where>
  383. ((tmgs.warning_lower_limit &lt;&gt; 0 AND tpi.inv_qty &lt; tmgs.warning_lower_limit)
  384. OR (tmgs.warning_upper_limit &lt;&gt; 0 AND tpi.inv_qty > tmgs.warning_upper_limit))
  385. <if test="flgValid != null">
  386. AND tpi.flg_valid = #{flgValid}
  387. </if>
  388. <if test="flgZero == true">
  389. AND tpi.inv_qty != 0
  390. </if>
  391. <if test="cpId != null">
  392. AND tpi.cp_id = #{cpId}
  393. </if>
  394. <if test="categoryId != null and categoryId != ''">
  395. AND tmgs.category_id = #{categoryId}::UUID
  396. </if>
  397. <if test="brandId != null and brandId != ''">
  398. AND tmgs.brand_id = #{brandId}::UUID
  399. </if>
  400. <if test="searchText != null and searchText != ''">
  401. AND (tmgs.sku_model like concat('%', my_ex.likequery(#{searchText}) , '%')
  402. OR tmgs.sku_name like concat('%', my_ex.likequery(#{searchText}) , '%')
  403. OR tpi.non_std_code like concat('%', my_ex.likequery(#{searchText}) , '%')
  404. )
  405. </if>
  406. <if test="invQtyFlag != null and invQtyFlag = true">
  407. and tpi.inv_qty != 0
  408. </if>
  409. </where>
  410. group by
  411. tmgs.sku_name
  412. ,tmgs.sku_spec
  413. ,tmgs.unit_id
  414. ,tmgs.sku_model
  415. ,tmgs.sub_unit_id
  416. ,tmgs.warning_upper_limit
  417. ,tmgs.warning_lower_limit
  418. ,tmgs.pack_box
  419. ,tmu.unit_name
  420. ,subtmu.unit_name
  421. ,tmgs.flg_sub_unit
  422. ,tmu.decimal_places
  423. <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
  424. limit #{end} offset #{start}
  425. </if>
  426. </select>
  427. <!--修改库存数量金额-->
  428. <update id="updateAmountAndQuantity" parameterType="com.dk.mdm.model.vo.ivt.InventoryVO">
  429. update dkic_b.t_psi_inventory
  430. <set>
  431. <if test="invQty != null">
  432. inv_qty = inv_qty + #{invQty,jdbcType=NUMERIC},
  433. usable_qty = (inv_qty + #{invQty,jdbcType=NUMERIC}) - outing_qty - freeze_qty,
  434. <if test="zeroFlag">
  435. cost_amt = 0,
  436. cost_price = 0 ,
  437. </if>
  438. <if test="!zeroFlag">
  439. cost_amt = cost_amt + #{costAmt,jdbcType=NUMERIC},
  440. cost_price = (cost_amt + #{costAmt,jdbcType=NUMERIC}) / (inv_qty + #{invQty,jdbcType=NUMERIC}) ,
  441. </if>
  442. </if>
  443. </set>
  444. where inv_id =#{invId,typeHandler=UuidTypeHandler}
  445. and inv_qty + #{invQty,jdbcType=NUMERIC}>=0
  446. and cost_amt + #{costAmt,jdbcType=NUMERIC}>=0
  447. </update>
  448. <!--修改库存数量金额(删除用)-->
  449. <update id="updateAmtAndQty" parameterType="com.dk.mdm.model.pojo.ivt.Inventory">
  450. update dkic_b.t_psi_inventory
  451. <set>
  452. <if test="invQty != null">
  453. inv_qty = #{invQty,jdbcType=NUMERIC},
  454. </if>
  455. <if test="usableQty != null">
  456. usable_qty = #{usableQty,jdbcType=NUMERIC},
  457. </if>
  458. <if test="costPrice != null">
  459. cost_price = #{costPrice,jdbcType=NUMERIC},
  460. </if>
  461. <if test="costAmt != null">
  462. cost_amt = #{costAmt,jdbcType=NUMERIC},
  463. </if>
  464. </set>
  465. where inv_id =#{invId,typeHandler=UuidTypeHandler}
  466. and #{invQty,jdbcType=NUMERIC}>=0
  467. and #{costAmt,jdbcType=NUMERIC}>=0
  468. </update>
  469. <!--删除数据-->
  470. <delete id="deleteData" parameterType="com.dk.mdm.model.pojo.ivt.InOutRecord">
  471. DELETE
  472. FROM dkic_b.t_psi_inventory
  473. where inv_id = #{invId,typeHandler=UuidTypeHandler}
  474. </delete>
  475. <!--修改存货单价/存货资产-->
  476. <update id="updateCost" parameterType="com.dk.mdm.model.pojo.ivt.Inventory">
  477. update dkic_b.t_psi_inventory
  478. <set>
  479. <if test="costPrice != null">
  480. cost_price = #{costPrice,jdbcType=NUMERIC},
  481. </if>
  482. <if test="costAmt != null">
  483. cost_amt = #{costAmt,jdbcType=NUMERIC},
  484. </if>
  485. </set>
  486. where inv_id =#{invId,typeHandler=UuidTypeHandler}
  487. </update>
  488. </mapper>