You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
200 lines
8.4 KiB
XML
200 lines
8.4 KiB
XML
<?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">
|
|
<select id="selectById" parameterType="java.lang.Long"
|
|
resultType="com.glxp.sale.admin.entity.inout.WarehouseEntity">
|
|
select *
|
|
FROM io_codes_temp
|
|
WHERE id = #{id}
|
|
</select>
|
|
|
|
<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, reCount, nameCode,supId,invStorageCode,invWarehouseCode,locStorageCode,relId)
|
|
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.reCount},
|
|
#{item.nameCode},#{item.supId},
|
|
#{item.invStorageCode},#{item.invWarehouseCode},#{item.locStorageCode},#{item.relId}
|
|
)
|
|
</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, reCount, nameCode, supId, invStorageCode, invWarehouseCode, locStorageCode, relId)
|
|
values (#{action},
|
|
#{mainAction},
|
|
#{code},
|
|
#{corpOrderId},
|
|
#{actor},
|
|
#{actDate},
|
|
#{fromCorpId},
|
|
#{fromCorp},
|
|
#{orderId},
|
|
#{batchNo},
|
|
#{produceDate},
|
|
#{expireDate},
|
|
#{serialNo},
|
|
#{count},
|
|
#{reCount},
|
|
#{nameCode}, #{supId}, #{invStorageCode}, #{invWarehouseCode}, #{locStorageCode}, #{relId})
|
|
</insert>
|
|
|
|
<insert id="replaceCodesTempSingle" keyProperty="id"
|
|
parameterType="com.glxp.sale.admin.entity.inout.WarehouseEntity">
|
|
replace INTO io_codes_temp(id,action, mainAction, code, corpOrderId, actor, actDate,
|
|
fromCorpId, fromCorp, orderId, batchNo, produceDate, expireDate, serialNo,
|
|
count, reCount, nameCode, supId, invStorageCode, invWarehouseCode, locStorageCode, relId)
|
|
values (#{id},#{action},
|
|
#{mainAction},
|
|
#{code},
|
|
#{corpOrderId},
|
|
#{actor},
|
|
#{actDate},
|
|
#{fromCorpId},
|
|
#{fromCorp},
|
|
#{orderId},
|
|
#{batchNo},
|
|
#{produceDate},
|
|
#{expireDate},
|
|
#{serialNo},
|
|
#{count},
|
|
#{reCount},
|
|
#{nameCode}, #{supId}, #{invStorageCode}, #{invWarehouseCode}, #{locStorageCode}, #{relId})
|
|
</insert>
|
|
|
|
<select id="findByOrderId" parameterType="com.glxp.sale.admin.req.inout.WarehouseQueryRequest"
|
|
resultType="com.glxp.sale.admin.entity.inout.WarehouseEntity">
|
|
SELECT io_codes_temp.*,basic_corp.name supName
|
|
FROM io_codes_temp left join basic_corp on io_codes_temp.supId = basic_corp.erpId
|
|
<where>
|
|
<if test="orderId != '' and orderId!=null">
|
|
and io_codes_temp.orderId =#{orderId}
|
|
</if>
|
|
<if test="code != '' and code!=null">
|
|
and io_codes_temp.code LIKE concat('%',#{code},'%')
|
|
</if>
|
|
<if test="batchNo != '' and batchNo!=null">
|
|
and io_codes_temp.batchNo =#{batchNo}
|
|
</if>
|
|
</where>
|
|
group by io_codes_temp.id
|
|
order by io_codes_temp.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>
|
|
<if test="reCount != null">`reCount`=#{reCount},</if>
|
|
<if test="action != null">`action`=#{action},</if>
|
|
<if test="mainAction != null">`mainAction`=#{mainAction},</if>
|
|
<if test="fromCorpId != null">`fromCorpId`=#{fromCorpId},</if>
|
|
<if test="fromCorp != null">`fromCorp`=#{fromCorp},</if>
|
|
<if test="locStorageCode != null">`locStorageCode`=#{locStorageCode},</if>
|
|
<if test="produceDate != null">`produceDate`=#{produceDate},</if>
|
|
<if test="expireDate != null">`expireDate`=#{expireDate},</if>
|
|
<if test="batchNo != null">`batchNo`=#{batchNo},</if>
|
|
<if test="serialNo != null">`serialNo`=#{serialNo},</if>
|
|
<if test="supId != null">`supId`=#{supId},</if>
|
|
<if test="relId != null">`relId`=#{relId},</if>
|
|
</set>
|
|
WHERE id=#{id}
|
|
</update>
|
|
|
|
<update id="update" parameterType="com.glxp.sale.admin.entity.inout.WarehouseEntity">
|
|
UPDATE io_codes_temp
|
|
<set>
|
|
<if test="action != null">`action`=#{action},</if>
|
|
<if test="mainAction != null">`mainAction`=#{mainAction},</if>
|
|
<if test="fromCorpId != null">`fromCorpId`=#{fromCorpId},</if>
|
|
<if test="fromCorp != null">`fromCorp`=#{fromCorp},</if>
|
|
<if test="locStorageCode != null">`locStorageCode`=#{locStorageCode},</if>
|
|
<if test="supId != null">`supId`=#{supId},</if>
|
|
<if test="produceDate != null">`produceDate`=#{produceDate},</if>
|
|
<if test="expireDate != null">`expireDate`=#{expireDate},</if>
|
|
<if test="batchNo != null">`batchNo`=#{batchNo},</if>
|
|
<if test="serialNo != null">`serialNo`=#{serialNo},</if>
|
|
<if test="relId != null">`relId`=#{relId},</if>
|
|
<if test="count != null">`count`=#{count},</if>
|
|
<if test="reCount != null">`reCount`=#{reCount},</if>
|
|
</set>
|
|
WHERE id=#{id}
|
|
</update>
|
|
|
|
|
|
<update id="updateByOrderId" parameterType="com.glxp.sale.admin.entity.inout.WarehouseEntity">
|
|
UPDATE io_codes_temp
|
|
<set>
|
|
<if test="action != null">`action`=#{action},</if>
|
|
<if test="mainAction != null">`mainAction`=#{mainAction},</if>
|
|
<if test="fromCorpId != null">`fromCorpId`=#{fromCorpId},</if>
|
|
<if test="fromCorp != null">`fromCorp`=#{fromCorp},</if>
|
|
<if test="locStorageCode != null">`locStorageCode`=#{locStorageCode},</if>
|
|
<if test="supId != null">`supId`=#{supId},</if>
|
|
<if test="serialNo != null">`serialNo`=#{serialNo},</if>
|
|
<if test="relId != null">`relId`=#{relId},</if>
|
|
</set>
|
|
WHERE orderId=#{orderId}
|
|
</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>
|
|
<delete id="deleteByOrderId">
|
|
delete
|
|
from io_codes_temp
|
|
where orderId = #{orderId};
|
|
</delete>
|
|
</mapper> |