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.
82 lines
2.7 KiB
XML
82 lines
2.7 KiB
XML
2 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.api.dao.inv.InnerOrderDetailDao">
|
||
|
|
||
|
|
||
|
<select id="joinQueryList" parameterType="com.glxp.api.req.inv.InnerOrderDetailRequest"
|
||
|
resultType="com.glxp.api.res.inv.innerOrderDetailResponse">
|
||
|
select
|
||
|
inv_inner_order_detail.*,
|
||
|
basic_products.ggxh spec,
|
||
|
basic_products.measname,
|
||
|
basic_products.manufactory
|
||
|
FROM inv_inner_order_detail
|
||
|
INNER JOIN basic_udirel on inv_inner_order_detail.productId = basic_udirel.id
|
||
|
INNER JOIN basic_products on basic_udirel.uuid = basic_products.uuid
|
||
|
<where>
|
||
|
<if test="orderIdFk != '' and orderIdFk != null">
|
||
|
AND orderIdFk = #{orderIdFk}
|
||
|
</if>
|
||
|
<if test="productId != null">
|
||
|
AND productId = #{productId}
|
||
|
</if>
|
||
|
</where>
|
||
|
|
||
|
</select>
|
||
|
|
||
|
<insert id="insert" keyProperty="id"
|
||
|
parameterType="com.glxp.api.entity.inv.InnerOrderDetailEntity">
|
||
|
replace
|
||
|
INTO inv_inner_order_detail
|
||
|
(
|
||
|
orderIdFk,productId,productName,`count`,productDate,expireDate,batchNo
|
||
|
)
|
||
|
values (
|
||
|
#{orderIdFk},
|
||
|
#{productId},
|
||
|
#{productName},
|
||
|
#{count},
|
||
|
#{productDate},
|
||
|
#{expireDate},
|
||
|
#{batchNo}
|
||
|
)
|
||
|
</insert>
|
||
|
|
||
|
|
||
|
<delete id="deleteByIds" parameterType="java.util.List">
|
||
|
DELETE FROM inv_inner_order_detail WHERE id in
|
||
|
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||
|
#{item}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
|
||
|
<delete id="deleteById" parameterType="Map">
|
||
|
DELETE
|
||
|
FROM inv_inner_order_detail
|
||
|
WHERE id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteByOrderId" parameterType="Map">
|
||
|
DELETE
|
||
|
FROM inv_inner_order_detail
|
||
|
WHERE orderIdFk = #{orderIdFk}
|
||
|
</delete>
|
||
|
|
||
|
|
||
|
<update id="update" parameterType="com.glxp.api.entity.inv.InnerOrderDetailEntity">
|
||
|
UPDATE inv_inner_order_detail
|
||
|
<trim prefix="set" suffixOverrides=",">
|
||
|
<if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if>
|
||
|
<if test="productId != null">productId=#{productId},</if>
|
||
|
<if test="productName != null">productName=#{productName},</if>
|
||
|
<if test="count != null">`count`=#{count},</if>
|
||
|
<if test="expireDate != null">expireDate=#{expireDate},</if>
|
||
|
<if test="productDate != null">productDate=#{productDate},</if>
|
||
|
<if test="batchNo != null">batchNo=#{batchNo},</if>
|
||
|
</trim>
|
||
|
WHERE id = #{id}
|
||
|
</update>
|
||
|
|
||
|
</mapper>
|