|
|
|
@ -10,7 +10,7 @@
|
|
|
|
|
<result column="expireDate" jdbcType="VARCHAR" property="expireDate"/>
|
|
|
|
|
<result column="serialNo" jdbcType="VARCHAR" property="serialNo"/>
|
|
|
|
|
<result column="countNum" jdbcType="INTEGER" property="countNum"/>
|
|
|
|
|
<result column="bookNum" jdbcType="INTEGER" property="bookNum"/>
|
|
|
|
|
<result column="invNum" jdbcType="INTEGER" property="invNum"/>
|
|
|
|
|
<result column="profitNum" jdbcType="INTEGER" property="profitNum"/>
|
|
|
|
|
<result column="lossNum" jdbcType="INTEGER" property="lossNum"/>
|
|
|
|
|
<result column="status" jdbcType="INTEGER" property="status"/>
|
|
|
|
@ -25,7 +25,7 @@
|
|
|
|
|
expireDate,
|
|
|
|
|
serialNo,
|
|
|
|
|
countNum,
|
|
|
|
|
bookNum,
|
|
|
|
|
invNum,
|
|
|
|
|
profitNum,
|
|
|
|
|
lossNum,
|
|
|
|
|
`status`
|
|
|
|
@ -48,11 +48,11 @@
|
|
|
|
|
parameterType="com.glxp.api.admin.entity.inventory.InvCountOrderDetail" useGeneratedKeys="true">
|
|
|
|
|
insert into inv_count_order_detail (orderIdFk, productId, batchNo,
|
|
|
|
|
produceDate, expireDate, serialNo,
|
|
|
|
|
countNum, bookNum, profitNum,
|
|
|
|
|
countNum, invNum, profitNum,
|
|
|
|
|
lossNum, `status`)
|
|
|
|
|
values (#{orderIdFk,jdbcType=VARCHAR}, #{productId,jdbcType=VARCHAR}, #{batchNo,jdbcType=VARCHAR},
|
|
|
|
|
#{produceDate,jdbcType=VARCHAR}, #{expireDate,jdbcType=VARCHAR}, #{serialNo,jdbcType=VARCHAR},
|
|
|
|
|
#{countNum,jdbcType=INTEGER}, #{bookNum,jdbcType=INTEGER}, #{profitNum,jdbcType=INTEGER},
|
|
|
|
|
#{countNum,jdbcType=INTEGER}, #{invNum,jdbcType=INTEGER}, #{profitNum,jdbcType=INTEGER},
|
|
|
|
|
#{lossNum,jdbcType=INTEGER}, #{status,jdbcType=INTEGER})
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
@ -81,8 +81,8 @@
|
|
|
|
|
<if test="countNum != null">
|
|
|
|
|
countNum,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="bookNum != null">
|
|
|
|
|
bookNum,
|
|
|
|
|
<if test="invNum != null">
|
|
|
|
|
invNum,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="profitNum != null">
|
|
|
|
|
profitNum,
|
|
|
|
@ -116,8 +116,8 @@
|
|
|
|
|
<if test="countNum != null">
|
|
|
|
|
#{countNum,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="bookNum != null">
|
|
|
|
|
#{bookNum,jdbcType=INTEGER},
|
|
|
|
|
<if test="invNum != null">
|
|
|
|
|
#{invNum,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="profitNum != null">
|
|
|
|
|
#{profitNum,jdbcType=INTEGER},
|
|
|
|
@ -155,8 +155,8 @@
|
|
|
|
|
<if test="countNum != null">
|
|
|
|
|
countNum = #{countNum,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="bookNum != null">
|
|
|
|
|
bookNum = #{bookNum,jdbcType=INTEGER},
|
|
|
|
|
<if test="invNum != null">
|
|
|
|
|
invNum = #{invNum,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="profitNum != null">
|
|
|
|
|
profitNum = #{profitNum,jdbcType=INTEGER},
|
|
|
|
@ -180,7 +180,7 @@
|
|
|
|
|
expireDate = #{expireDate,jdbcType=VARCHAR},
|
|
|
|
|
serialNo = #{serialNo,jdbcType=VARCHAR},
|
|
|
|
|
countNum = #{countNum,jdbcType=INTEGER},
|
|
|
|
|
bookNum = #{bookNum,jdbcType=INTEGER},
|
|
|
|
|
invNum = #{invNum,jdbcType=INTEGER},
|
|
|
|
|
profitNum = #{productId,jdbcType=INTEGER},
|
|
|
|
|
lossNum = #{lossNum,jdbcType=INTEGER},
|
|
|
|
|
`status` = #{status,jdbcType=INTEGER}
|
|
|
|
@ -225,9 +225,9 @@
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.countNum,jdbcType=INTEGER}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="bookNum = case" suffix="end,">
|
|
|
|
|
<trim prefix="invNum = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.bookNum,jdbcType=INTEGER}
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.invNum,jdbcType=INTEGER}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="profitNum = case" suffix="end,">
|
|
|
|
@ -254,13 +254,13 @@
|
|
|
|
|
|
|
|
|
|
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
|
|
|
|
|
insert into inv_count_order_detail
|
|
|
|
|
(orderIdFk, productId, batchNo, produceDate, expireDate, serialNo, countNum, bookNum,
|
|
|
|
|
(orderIdFk, productId, batchNo, produceDate, expireDate, serialNo, countNum, invNum,
|
|
|
|
|
profitNum, lossNum, `status`)
|
|
|
|
|
values
|
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
|
(#{item.orderIdFk,jdbcType=VARCHAR}, #{item.productId,jdbcType=VARCHAR}, #{item.batchNo,jdbcType=VARCHAR},
|
|
|
|
|
#{item.produceDate,jdbcType=VARCHAR}, #{item.expireDate,jdbcType=VARCHAR},
|
|
|
|
|
#{item.serialNo,jdbcType=VARCHAR}, #{item.countNum,jdbcType=INTEGER}, #{item.bookNum,jdbcType=INTEGER},
|
|
|
|
|
#{item.serialNo,jdbcType=VARCHAR}, #{item.countNum,jdbcType=INTEGER}, #{item.invNum,jdbcType=INTEGER},
|
|
|
|
|
#{item.profitNum,jdbcType=INTEGER}, #{item.lossNum,jdbcType=INTEGER}, #{item.status,jdbcType=INTEGER})
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
|
|
|
@ -279,6 +279,26 @@
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="countByOrderIdFk" resultType="java.lang.Long">
|
|
|
|
|
select count(*) from inv_count_order_detail where orderIdFk = #{orderIdFk}
|
|
|
|
|
select count(*)
|
|
|
|
|
from inv_count_order_detail
|
|
|
|
|
where orderIdFk = #{orderIdFk}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="filterCountDetail" resultType="com.glxp.api.admin.res.inventory.InvCountOrderDetailResponse">
|
|
|
|
|
select od.id,
|
|
|
|
|
orderIdFk,
|
|
|
|
|
productId,
|
|
|
|
|
batchNo,
|
|
|
|
|
produceDate,
|
|
|
|
|
expireDate,
|
|
|
|
|
serialNo,
|
|
|
|
|
countNum,
|
|
|
|
|
invNum,
|
|
|
|
|
profitNum,
|
|
|
|
|
lossNum,
|
|
|
|
|
status,
|
|
|
|
|
p.cpmctymc productName
|
|
|
|
|
from inv_count_order_detail od
|
|
|
|
|
left join basic_products p on od.productId = p.id
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|