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.

71 lines
2.3 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.mipsdl.admin.dao.InvErpStockDao">
<select id="findByCode" parameterType="Map"
resultType="com.glxp.mipsdl.admin.entity.ErpStockEntity">
SELECT * FROM erpstock WHERE (
code = #{code} and batchNo = #{batchNo}) limit 1
</select>
<insert id="insertErpStock" keyProperty="id" parameterType="com.glxp.mipsdl.admin.entity.ErpStockEntity">
replace INTO erpstock
(
orderId,code,batchNo,manufacturingDate,expirationDate,count,remark,name
)
values
(
#{orderId},
#{code},
#{batchNo},
#{manufacturingDate},
#{count},
#{remark},
#{name}
)
</insert>
<insert id="insertErpStocks" keyProperty="id" parameterType="java.util.List">
replace INTO erpstock
(
orderId,code,batchNo,manufacturingDate,expirationDate,count,remark,name
)
values
<foreach collection="erpStockEntities" item="item" index="index"
separator=",">
(
#{item.orderId},
#{item.code},
#{item.batchNo},
#{item.manufacturingDate},
#{item.expirationDate},
#{item.count},
#{item.remark},
#{item.name}
)
</foreach>
</insert>
<delete id="deleteById" parameterType="Map">
DELETE FROM erpstock WHERE id = #{id}
</delete>
<update id="updateErpStock" parameterType="com.glxp.mipsdl.admin.entity.ErpStockEntity">
UPDATE erpstock
<set>
<if test="orderId != null">orderId=#{orderId},</if>
<if test="code != null">code=#{code},</if>
<if test="batchNo != null">batchNo=#{batchNo},</if>
<if test="manufacturingDate != null">manufacturingDate=#{manufacturingDate},</if>
<if test="expirationDate != null">expirationDate=#{expirationDate},</if>
<if test="count != null">count=#{count},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="name != null">name=#{name},</if>
</set>
WHERE id = #{id}
</update>
</mapper>