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.
spms-java/api-admin/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml

105 lines
3.6 KiB
XML

4 years ago
<?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)
4 years ago
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}
4 years ago
)
</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)
4 years ago
values(
#{action},
#{mainAction},
#{code},
#{corpOrderId},
#{actor},
#{actDate},
#{fromCorpId},
#{fromCorp},
#{orderId},
#{batchNo},
#{produceDate},
#{expireDate},
#{serialNo},
#{count},#{nameCode}
4 years ago
)
</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>
</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>
<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>