|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
|
|
|
|
|
<mapper namespace="com.glxp.sale.admin.dao.inout.CodesTempDao">
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertCodesTemp" parameterType="java.util.List">
|
|
|
|
INSERT INTO io_codes_temp
|
|
|
|
(action, mainAction,code, corpOrderId, actor,actDate,
|
|
|
|
fromCorpId, fromCorp,
|
|
|
|
orderId,batchNo,produceDate,expireDate,serialNo,
|
|
|
|
count,nameCode,supId,invStorageCode,invWarehouseCode,locStorageCode)
|
|
|
|
VALUES
|
|
|
|
<foreach collection="codes" item="item" index="index"
|
|
|
|
separator=",">
|
|
|
|
(
|
|
|
|
#{item.action},
|
|
|
|
#{item.mainAction},
|
|
|
|
#{item.code},
|
|
|
|
#{item.corpOrderId},
|
|
|
|
#{item.actor},
|
|
|
|
#{item.actDate},
|
|
|
|
#{item.fromCorpId},
|
|
|
|
#{item.fromCorp},
|
|
|
|
#{item.orderId}
|
|
|
|
,#{item.batchNo}
|
|
|
|
,#{item.produceDate}
|
|
|
|
,#{item.expireDate}
|
|
|
|
,#{item.serialNo}
|
|
|
|
,#{item.count},#{item.nameCode},#{item.supId},
|
|
|
|
#{item.invStorageCode},#{item.invWarehouseCode},#{item.locStorageCode}
|
|
|
|
)
|
|
|
|
</foreach>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertCodesTempSingle" keyProperty="id"
|
|
|
|
parameterType="com.glxp.sale.admin.entity.inout.WarehouseEntity">
|
|
|
|
INSERT INTO io_codes_temp(action, mainAction, code, corpOrderId, actor, actDate,
|
|
|
|
fromCorpId, fromCorp, orderId, batchNo, produceDate, expireDate, serialNo,
|
|
|
|
count, nameCode, supId, invStorageCode, invWarehouseCode,locStorageCode)
|
|
|
|
values (#{action},
|
|
|
|
#{mainAction},
|
|
|
|
#{code},
|
|
|
|
#{corpOrderId},
|
|
|
|
#{actor},
|
|
|
|
#{actDate},
|
|
|
|
#{fromCorpId},
|
|
|
|
#{fromCorp},
|
|
|
|
#{orderId},
|
|
|
|
#{batchNo},
|
|
|
|
#{produceDate},
|
|
|
|
#{expireDate},
|
|
|
|
#{serialNo},
|
|
|
|
#{count}, #{nameCode}, #{supId}, #{invStorageCode}, #{invWarehouseCode},#{locStorageCode})
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<select id="findByOrderId" parameterType="com.glxp.sale.admin.req.inout.WarehouseQueryRequest"
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.WarehouseEntity">
|
|
|
|
SELECT *
|
|
|
|
FROM io_codes_temp
|
|
|
|
<where>
|
|
|
|
<if test="orderId != '' and orderId!=null">
|
|
|
|
and orderId =#{orderId}
|
|
|
|
</if>
|
|
|
|
<if test="code != '' and code!=null">
|
|
|
|
and code LIKE concat('%',#{code},'%')
|
|
|
|
</if>
|
|
|
|
<if test="batchNo != '' and batchNo!=null">
|
|
|
|
and batchNo =#{batchNo}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
order by id desc
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="findByOrderIdAndCode" parameterType="com.glxp.sale.admin.req.inout.WarehouseQueryRequest"
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.WarehouseEntity">
|
|
|
|
SELECT *
|
|
|
|
FROM io_codes_temp
|
|
|
|
<where>
|
|
|
|
<if test="orderId != '' and orderId!=null">
|
|
|
|
and orderId =#{orderId}
|
|
|
|
</if>
|
|
|
|
<if test="code != '' and code!=null">
|
|
|
|
and code =#{code}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<update id="updateById" parameterType="com.glxp.sale.admin.entity.inout.WarehouseEntity">
|
|
|
|
UPDATE io_codes_temp
|
|
|
|
<set>
|
|
|
|
<if test="count != null">`count`=#{count},</if>
|
|
|
|
</set>
|
|
|
|
WHERE id=#{id}
|
|
|
|
</update>
|
|
|
|
<update id="updateOrderId" parameterType="Map">
|
|
|
|
UPDATE io_codes_temp
|
|
|
|
SET orderId = #{newOrderId}
|
|
|
|
where orderId = #{oldOrderId}
|
|
|
|
</update>
|
|
|
|
<delete id="deleteCodesTemp" parameterType="java.util.List">
|
|
|
|
DELETE FROM io_codes_temp WHERE id IN
|
|
|
|
<foreach collection="codes" item="item" open="(" separator="," close=")">
|
|
|
|
#{item}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteCodesTempById" parameterType="com.glxp.sale.admin.entity.inout.WarehouseEntity">
|
|
|
|
DELETE
|
|
|
|
FROM io_codes_temp
|
|
|
|
WHERE id = #{id}
|
|
|
|
</delete>
|
|
|
|
</mapper>
|