InventoryMapper.xml 21 KB

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