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.
135 lines
5.0 KiB
XML
135 lines
5.0 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.thrsys.ThrOrderDetailDao">
|
|
|
|
<select id="filterThrOrderDetailDetail" parameterType="com.glxp.sale.admin.req.thrsys.FilterThrOrderDetailRequest"
|
|
resultType="com.glxp.sale.admin.entity.thrsys.ThrOrderDetailEntity">
|
|
SELECT * FROM thr_order_detail
|
|
<where>
|
|
<if test="orderIdFk != '' and orderIdFk != null">
|
|
AND orderIdFk = #{orderIdFk}
|
|
</if>
|
|
<if test="thirdSysFk != '' and thirdSysFk != null">
|
|
AND thirdSysFk = #{thirdSysFk}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
|
|
<insert id="insertThrOrderDetail" keyProperty="id"
|
|
parameterType="com.glxp.sale.admin.entity.thrsys.ThrOrderDetailEntity">
|
|
replace
|
|
INTO thr_order_detail
|
|
(productId, productName, spec, batchNo, expireDate,
|
|
productDate, `count`, reCount, orderIdFk, thirdSysFk, updateTime, price, corpName,ylqxzcrbarmc,zczbhhzbapzbh,manufactory)
|
|
values (
|
|
#{productId},
|
|
#{productName},
|
|
#{spec},
|
|
#{batchNo},
|
|
#{expireDate},
|
|
#{productDate},
|
|
#{count},
|
|
#{reCount},
|
|
#{orderIdFk},
|
|
#{thirdSysFk},
|
|
#{updateTime},
|
|
#{price},
|
|
#{corpName},
|
|
#{ylqxzcrbarmc},
|
|
#{zczbhhzbapzbh},
|
|
#{manufactory}
|
|
)
|
|
</insert>
|
|
|
|
<insert id="insertThrOrderDetails" keyProperty="id" parameterType="java.util.List" useGeneratedKeys="true">
|
|
replace INTO thr_order_detail
|
|
(productId, productName, spec, batchNo, expireDate,
|
|
productDate, `count`, reCount, orderIdFk, thirdSysFk, updateTime
|
|
, price, corpName,ylqxzcrbarmc,zczbhhzbapzbh,manufactory)
|
|
values
|
|
|
|
<foreach collection="thrOrderDetailEntities" item="item" index="index"
|
|
separator=",">
|
|
(#{item.productId}, #{item.productName}, #{item.spec}, #{item.batchNo}, #{item.expireDate},
|
|
#{item.productDate}, #{item.count}, #{item.reCount}, #{item.orderIdFk}, #{item.thirdSysFk},
|
|
#{item.updateTime},
|
|
#{item.price}, #{item.corpName}, #{item.ylqxzcrbarmc}, #{item.zczbhhzbapzbh}, #{item.manufactory})
|
|
</foreach>
|
|
</insert>
|
|
|
|
<insert id="importThrOrderDetail" keyProperty="id"
|
|
parameterType="com.glxp.sale.admin.entity.thrsys.ThrOrderDetailEntity">
|
|
replace
|
|
INTO thr_order_detail
|
|
(id,productId, productName, spec, batchNo, expireDate,
|
|
productDate, `count`, reCount, orderIdFk, thirdSysFk, updateTime, price, corpName,ylqxzcrbarmc,zczbhhzbapzbh,manufactory)
|
|
values (
|
|
#{id},
|
|
#{productId},
|
|
#{productName},
|
|
#{spec},
|
|
#{batchNo},
|
|
#{expireDate},
|
|
#{productDate},
|
|
#{count},
|
|
#{reCount},
|
|
#{orderIdFk},
|
|
#{thirdSysFk},
|
|
#{updateTime},
|
|
#{price},
|
|
#{corpName},
|
|
#{ylqxzcrbarmc},
|
|
#{zczbhhzbapzbh},
|
|
#{manufactory}
|
|
)
|
|
</insert>
|
|
|
|
<delete id="deleteById" parameterType="Map">
|
|
DELETE
|
|
FROM thr_order_detail
|
|
WHERE id = #{id}
|
|
</delete>
|
|
<delete id="deleteByOrderIdFk" parameterType="Map">
|
|
DELETE
|
|
FROM thr_order_detail
|
|
WHERE orderIdFk = #{orderIdFk}
|
|
</delete>
|
|
|
|
<update id="updateThrOrderDetail" parameterType="com.glxp.sale.admin.entity.thrsys.ThrOrderDetailEntity">
|
|
UPDATE thr_order_detail
|
|
<trim prefix="set" suffixOverrides=",">
|
|
<if test="productId != null">productId=#{productId},</if>
|
|
<if test="productName != null">productName=#{productName},</if>
|
|
<if test="spec != null">spec=#{spec},</if>
|
|
<if test="batchNo != null">batchNo=#{batchNo},</if>
|
|
<if test="expireDate != null">expireDate=#{expireDate},</if>
|
|
<if test="productDate != null">productDate=#{productDate},</if>
|
|
<if test="count != null">count=#{count},</if>
|
|
<if test="reCount != null">reCount=#{reCount},</if>
|
|
<if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if>
|
|
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
|
|
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
|
<if test="price != null">price=#{price},</if>
|
|
<if test="corpName != null">corpName=#{corpName},
|
|
</if>
|
|
<if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
|
|
<if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if>
|
|
<if test="manufactory != null">manufactory=#{manufactory},</if>
|
|
</trim>
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
|
|
<delete id="deleteAll">
|
|
DELETE
|
|
FROM thr_order_detail
|
|
</delete>
|
|
|
|
<delete id="deleteByTime">
|
|
Delete From thr_order_detail
|
|
where date(updateTime) <= date(DATE_SUB(NOW(),INTERVAL 30 day))
|
|
</delete>
|
|
|
|
</mapper> |