|
|
|
@ -5,6 +5,7 @@
|
|
|
|
|
<id column="id" jdbcType="INTEGER" property="id"/>
|
|
|
|
|
<result column="orderIdFk" jdbcType="VARCHAR" property="orderIdFk"/>
|
|
|
|
|
<result column="productId" jdbcType="VARCHAR" property="productId"/>
|
|
|
|
|
<result column="nameCode" jdbcType="VARCHAR" property="nameCode"/>
|
|
|
|
|
<result column="batchNo" jdbcType="VARCHAR" property="batchNo"/>
|
|
|
|
|
<result column="produceDate" jdbcType="VARCHAR" property="produceDate"/>
|
|
|
|
|
<result column="expireDate" jdbcType="VARCHAR" property="expireDate"/>
|
|
|
|
@ -20,6 +21,7 @@
|
|
|
|
|
id,
|
|
|
|
|
orderIdFk,
|
|
|
|
|
productId,
|
|
|
|
|
nameCode,
|
|
|
|
|
batchNo,
|
|
|
|
|
produceDate,
|
|
|
|
|
expireDate,
|
|
|
|
@ -46,11 +48,12 @@
|
|
|
|
|
|
|
|
|
|
<insert id="insert" keyColumn="id" keyProperty="id"
|
|
|
|
|
parameterType="com.glxp.api.admin.entity.inventory.InvCountOrderDetail" useGeneratedKeys="true">
|
|
|
|
|
insert into inv_count_order_detail (orderIdFk, productId, batchNo,
|
|
|
|
|
insert into inv_count_order_detail (orderIdFk, productId, nameCode, batchNo,
|
|
|
|
|
produceDate, expireDate, serialNo,
|
|
|
|
|
countNum, invNum, profitNum,
|
|
|
|
|
lossNum, `status`)
|
|
|
|
|
values (#{orderIdFk,jdbcType=VARCHAR}, #{productId,jdbcType=VARCHAR}, #{batchNo,jdbcType=VARCHAR},
|
|
|
|
|
values (#{orderIdFk,jdbcType=VARCHAR}, #{productId,jdbcType=VARCHAR}, #{nameCode,jdbcType=VARCHAR},
|
|
|
|
|
#{batchNo,jdbcType=VARCHAR},
|
|
|
|
|
#{produceDate,jdbcType=VARCHAR}, #{expireDate,jdbcType=VARCHAR}, #{serialNo,jdbcType=VARCHAR},
|
|
|
|
|
#{countNum,jdbcType=INTEGER}, #{invNum,jdbcType=INTEGER}, #{profitNum,jdbcType=INTEGER},
|
|
|
|
|
#{lossNum,jdbcType=INTEGER}, #{status,jdbcType=INTEGER})
|
|
|
|
@ -66,6 +69,9 @@
|
|
|
|
|
<if test="productId != null">
|
|
|
|
|
productId,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="nameCode != null">
|
|
|
|
|
nameCode,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="batchNo != null">
|
|
|
|
|
batchNo,
|
|
|
|
|
</if>
|
|
|
|
@ -101,6 +107,9 @@
|
|
|
|
|
<if test="productId != null">
|
|
|
|
|
#{productId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="nameCode != null">
|
|
|
|
|
#{nameCode,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="batchNo != null">
|
|
|
|
|
#{batchNo,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
@ -140,6 +149,9 @@
|
|
|
|
|
<if test="productId != null">
|
|
|
|
|
productId = #{productId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="nameCode != null">
|
|
|
|
|
nameCode = #{nameCode,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="batchNo != null">
|
|
|
|
|
batchNo = #{batchNo,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
@ -175,6 +187,7 @@
|
|
|
|
|
update inv_count_order_detail
|
|
|
|
|
set orderIdFk = #{orderIdFk,jdbcType=VARCHAR},
|
|
|
|
|
productId = #{productId,jdbcType=VARCHAR},
|
|
|
|
|
nameCode = #{nameCode,jdbcType=VARCHAR},
|
|
|
|
|
batchNo = #{batchNo,jdbcType=VARCHAR},
|
|
|
|
|
produceDate = #{produceDate,jdbcType=VARCHAR},
|
|
|
|
|
expireDate = #{expireDate,jdbcType=VARCHAR},
|
|
|
|
@ -200,6 +213,11 @@
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.productId,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="nameCode = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.nameCode,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="batchNo = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.batchNo,jdbcType=VARCHAR}
|
|
|
|
@ -254,11 +272,12 @@
|
|
|
|
|
|
|
|
|
|
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
|
|
|
|
|
insert into inv_count_order_detail
|
|
|
|
|
(orderIdFk, productId, batchNo, produceDate, expireDate, serialNo, countNum, invNum,
|
|
|
|
|
(orderIdFk, productId, nameCode, 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.orderIdFk,jdbcType=VARCHAR}, #{item.productId,jdbcType=VARCHAR}, #{item.nameCode,jdbcType=VARCHAR},
|
|
|
|
|
#{item.batchNo,jdbcType=VARCHAR},
|
|
|
|
|
#{item.produceDate,jdbcType=VARCHAR}, #{item.expireDate,jdbcType=VARCHAR},
|
|
|
|
|
#{item.serialNo,jdbcType=VARCHAR}, #{item.countNum,jdbcType=INTEGER}, #{item.invNum,jdbcType=INTEGER},
|
|
|
|
|
#{item.profitNum,jdbcType=INTEGER}, #{item.lossNum,jdbcType=INTEGER}, #{item.status,jdbcType=INTEGER})
|
|
|
|
@ -295,17 +314,14 @@
|
|
|
|
|
group by od.id
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectByOrderIdAndProductId" resultMap="BaseResultMap">
|
|
|
|
|
select *
|
|
|
|
|
from inv_count_order_detail
|
|
|
|
|
where orderIdFk = #{orderIdFk}
|
|
|
|
|
and productId = #{productId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteByOrderIdAndProductId">
|
|
|
|
|
delete
|
|
|
|
|
from inv_count_codes
|
|
|
|
|
where orderIdFk = #{orderIdFk}
|
|
|
|
|
and productId = #{productId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="selectByOrderIdAndNameCode" resultMap="BaseResultMap">
|
|
|
|
|
select * from inv_count_order_detail where orderIdFk = #{orderIdFk} and nameCode = #{nameCode}
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|