Files
FT577-WMS/ruoyi-admin/src/main/resources/mapper/out/OutStockoutDetailMapper.xml
2026-09-21 08:42:34 +08:00

166 lines
9.7 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.ruoyi.out.stockoutdetail.mapper.OutStockoutDetailMapper">
<resultMap type="OutStockoutDetail" id="OutStockoutDetailResult">
<result property="stockoutDetailId" column="stockout_detail_id" />
<result property="stockoutId" column="stockout_id" />
<result property="lotNo" column="lot_no" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="rollerNumber" column="roller_number" />
<result property="quantity" column="quantity" />
<result property="allotNum" column="allot_num" />
<result property="assignNum" column="assign_num" />
<result property="remark" column="remark" />
<result property="status" column="status" />
<result property="colorSequence" column="color_sequence" />
<result property="color" column="color" />
<result property="spec" column="spec" />
<result property="length" column="length" />
<result property="perimeter" column="perimeter" />
</resultMap>
<sql id="selectOutStockoutDetailVo">
select stockout_detail_id, stockout_id, lot_no, product_id, product_name, quantity, allot_num, assign_num, roller_number, color_sequence, color, spec, length, perimeter, status, remark from out_stockout_detail
</sql>
<sql id="selectOutStockoutDetailFinishVo">
select stockout_detail_id, stockout_id, lot_no, product_id, product_name, quantity, allot_num, assign_num, roller_number, color_sequence, color, spec, length, perimeter, status, remark from out_stockout_detail_finish
</sql>
<select id="selectOutStockoutDetailList" parameterType="OutStockoutDetail" resultMap="OutStockoutDetailResult">
<include refid="selectOutStockoutDetailVo"/>
<where>
<if test="stockoutId != null and stockoutId != ''"> and stockout_id = #{stockoutId}</if>
<if test="stockoutDetailId != null and stockoutDetailId != ''"> and stockout_detail_id = #{stockoutDetailId}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="rollerNumber != null and rollerNumber != ''"> and roller_number like concat('%', #{rollerNumber}, '%')</if>
<if test="quantity != null "> and quantity = #{quantity}</if>
<if test="allotNum != null "> and allot_num = #{allotNum}</if>
<if test="assignNum != null "> and assign_num = #{assignNum}</if>
<if test="colorSequence != null "> and color_sequence = #{colorSequence}</if>
<if test="color != null "> and color = #{color}</if>
<if test="spec != null and spec != '' "> and spec like concat('%', #{spec}, '%')</if>
<if test="length != null"> and length = #{length}</if>
<if test="perimeter != null"> and perimeter = #{perimeter}</if>
<if test="status != null"> and status = #{status}</if>
</where>
</select>
<select id="selectOutStockoutDetailByStockoutDetailId" parameterType="String" resultMap="OutStockoutDetailResult">
<include refid="selectOutStockoutDetailVo"/>
where stockout_detail_id = #{stockoutDetailId}
</select>
<select id="selectOutStockoutDetailByRollerNumber" parameterType="String" resultMap="OutStockoutDetailResult">
<include refid="selectOutStockoutDetailVo"/>
where roller_number = #{rollerNumeber}
</select>
<select id="selectOutStockoutDetailListByStockoutId" parameterType="String" resultMap="OutStockoutDetailResult">
<include refid="selectOutStockoutDetailVo"/>
where stockout_id = #{stockoutId}
</select>
<select id="outboundTaskList" resultMap="OutStockoutDetailResult">
<include refid="selectOutStockoutDetailVo"/>
where quantity > assign_num
</select>
<select id="selectOutStockoutDetailFinishList" parameterType="OutStockoutDetail" resultMap="OutStockoutDetailResult">
<include refid="selectOutStockoutDetailFinishVo"/>
<where>
<if test="stockoutId != null and stockoutId != ''"> and stockout_id = #{stockoutId}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="rollerNumber != null and rollerNumber != ''"> and roller_number like concat('%', #{rollerNumber}, '%')</if>
<if test="quantity != null "> and quantity = #{quantity}</if>
<if test="allotNum != null "> and allot_num = #{allotNum}</if>
<if test="assignNum != null "> and assign_num = #{assignNum}</if>
<if test="colorSequence != null "> and color_sequence = #{colorSequence}</if>
<if test="color != null "> and color = #{color}</if>
<if test="spec != null and spec != '' "> and spec like concat('%', #{spec}, '%')</if>
<if test="status != null"> and status = #{status}</if>
<if test="length != null"> and length = #{length}</if>
<if test="perimeter != null"> and perimeter = #{perimeter}</if>
</where>
</select>
<insert id="insertOutStockoutDetail" parameterType="OutStockoutDetail">
insert into out_stockout_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stockoutDetailId != null">stockout_detail_id,</if>
<if test="stockoutId != null and stockoutId != ''">stockout_id,</if>
<if test="lotNo != null">lot_no,</if>
<if test="productId != null and productId != ''">product_id,</if>
<if test="productName != null">product_name,</if>
<if test="rollerNumber != null">roller_number,</if>
<if test="quantity != null">quantity,</if>
<if test="allotNum != null">allot_num,</if>
<if test="assignNum != null">assign_num,</if>
<if test="colorSequence != null ">color_sequence,</if>
<if test="color != null ">color,</if>
<if test="spec != null ">spec,</if>
<if test="remark != null">remark,</if>
<if test="status != null">status,</if>
<if test="length != null">length,</if>
<if test="perimeter != null">perimeter,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stockoutDetailId != null">#{stockoutDetailId},</if>
<if test="stockoutId != null and stockoutId != ''">#{stockoutId},</if>
<if test="lotNo != null">#{lotNo},</if>
<if test="productId != null and productId != ''">#{productId},</if>
<if test="productName != null">#{productName},</if>
<if test="rollerNumber != null">#{rollerNumber},</if>
<if test="quantity != null">#{quantity},</if>
<if test="allotNum != null">#{allotNum},</if>
<if test="assignNum != null">#{assignNum},</if>
<if test="colorSequence != null ">#{colorSequence},</if>
<if test="color != null ">#{color},</if>
<if test="spec != null ">#{spec},</if>
<if test="remark != null">#{remark},</if>
<if test="status != null">#{status},</if>
<if test="length != null">#{length},</if>
<if test="perimeter != null">#{perimeter},</if>
</trim>
</insert>
<update id="updateOutStockoutDetail" parameterType="OutStockoutDetail">
update out_stockout_detail
<trim prefix="SET" suffixOverrides=",">
<if test="stockoutId != null and stockoutId != ''">stockout_id = #{stockoutId},</if>
<if test="lotNo != null">lot_no = #{lotNo},</if>
<if test="productId != null and productId != ''">product_id = #{productId},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="rollerNumber != null">roller_number = #{rollerNumber},</if>
<if test="quantity != null">quantity = #{quantity},</if>
<if test="allotNum != null">allot_num = #{allotNum},</if>
<if test="assignNum != null">assign_num = #{assignNum},</if>
<if test="colorSequence != null ">color_sequence = #{colorSequence},</if>
<if test="color != null ">color = #{color},</if>
<if test="spec != null ">spec = #{spec},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="status != null">status = #{status},</if>
<if test="length != null">length = #{length},</if>
<if test="perimeter != null">perimeter = #{perimeter},</if>
</trim>
where stockout_detail_id = #{stockoutDetailId}
</update>
<delete id="deleteOutStockoutDetailByStockoutDetailId" parameterType="String">
delete from out_stockout_detail where stockout_detail_id = #{stockoutDetailId}
</delete>
<delete id="deleteOutStockoutDetailByStockoutDetailIds" parameterType="String">
delete from out_stockout_detail where stockout_detail_id in
<foreach item="stockoutDetailId" collection="array" open="(" separator="," close=")">
#{stockoutDetailId}
</foreach>
</delete>
</mapper>