123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <?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.ams.order.mapper.ActAllocationDetailsMapper">
- <resultMap type="ActAllocationDetails" id="ActAllocationDetailsResult">
- <result property="allocationId" column="allocation_id"/>
- <result property="orderNo" column="order_no"/>
- <result property="lineNo" column="line_no"/>
- <result property="material" column="material"/>
- <result property="locationId" column="location_id"/>
- <result property="callTransactionId" column="call_transaction_id"/>
- <result property="status" column="status"/>
- <result property="lotnum" column="lotnum"/>
- <result property="qty" column="qty"/>
- <result property="pickTransactionId" column="pick_transaction_id"/>
- <result property="pickToLocation" column="pick_to_location"/>
- <result property="pickQty" column="pick_qty"/>
- <result property="createBy" column="create_by"/>
- <result property="createTime" column="create_time"/>
- <result property="updateBy" column="update_by"/>
- <result property="updateTime" column="update_time"/>
- <result property="userdefine1" column="userdefine1"/>
- <result property="userdefine2" column="userdefine2"/>
- <result property="userdefine3" column="userdefine3"/>
- <result property="userdefine4" column="userdefine4"/>
- </resultMap>
- <sql id="selectActAllocationDetailsVo">
- select allocation_id,
- order_no,
- line_no,
- material,
- location_id,
- call_transaction_id,
- status,
- lotnum,
- qty,
- pick_transaction_id,
- pick_to_location,
- pick_qty,
- create_by,
- create_time,
- update_by,
- update_time,
- userdefine1,
- userdefine2,
- userdefine3,
- userdefine4
- from act_allocation_details
- </sql>
- <select id="selectActAllocationDetailsList" parameterType="ActAllocationDetails"
- resultMap="ActAllocationDetailsResult">
- <include refid="selectActAllocationDetailsVo"/>
- <where>
- <if test="allocationId != null and allocationId != ''"> and allocation_id = #{allocationId}</if>
- <if test="orderNo != null and orderNo != ''"> and order_no like concat('%', #{orderNo}, '%')</if>
- <if test="material != null and material != ''"> and material = #{material}</if>
- <if test="status != null and status != ''"> and status = #{status}</if>
- <if test="params.beginTime != null and params.beginTime != ''">
- AND date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
- </if>
- <if test="params.endTime != null and params.endTime != ''">
- AND date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
- </if>
- </where>
- </select>
- <select id="selectActAllocationDetailsByAllocationId" parameterType="String" resultMap="ActAllocationDetailsResult">
- <include refid="selectActAllocationDetailsVo"/>
- where allocation_id = #{allocationId}
- </select>
- <select id="selectselectActAllocationDetailsBy" resultMap="ActAllocationDetailsResult">
- <include refid="selectActAllocationDetailsVo"/>
- where order_no = #{orderNo} and line_no = #{orderLineNo} and material = #{sku} and lotnum = #{lotnum}
- </select>
- <insert id="insertActAllocationDetails" parameterType="ActAllocationDetails">
- insert into act_allocation_details
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="allocationId != null">allocation_id,</if>
- <if test="orderNo != null and orderNo != ''">order_no,</if>
- <if test="lineNo != null">line_no,</if>
- <if test="material != null and material != ''">material,</if>
- <if test="locationId != null">location_id,</if>
- <if test="callTransactionId != null">call_transaction_id,</if>
- <if test="status != null">status,</if>
- <if test="lotnum != null">lotnum,</if>
- <if test="qty != null">qty,</if>
- <if test="pickTransactionId != null">pick_transaction_id,</if>
- <if test="pickToLocation != null">pick_to_location,</if>
- <if test="pickQty != null">pick_qty,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="userdefine1 != null">userdefine1,</if>
- <if test="userdefine2 != null">userdefine2,</if>
- <if test="userdefine3 != null">userdefine3,</if>
- <if test="userdefine4 != null">userdefine4,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="allocationId != null">#{allocationId},</if>
- <if test="orderNo != null and orderNo != ''">#{orderNo},</if>
- <if test="lineNo != null">#{lineNo},</if>
- <if test="material != null and material != ''">#{material},</if>
- <if test="locationId != null">#{locationId},</if>
- <if test="callTransactionId != null">#{callTransactionId},</if>
- <if test="status != null">#{status},</if>
- <if test="lotnum != null">#{lotnum},</if>
- <if test="qty != null">#{qty},</if>
- <if test="pickTransactionId != null">#{pickTransactionId},</if>
- <if test="pickToLocation != null">#{pickToLocation},</if>
- <if test="pickQty != null">#{pickQty},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="userdefine1 != null">#{userdefine1},</if>
- <if test="userdefine2 != null">#{userdefine2},</if>
- <if test="userdefine3 != null">#{userdefine3},</if>
- <if test="userdefine4 != null">#{userdefine4},</if>
- </trim>
- </insert>
- <update id="updateActAllocationDetails" parameterType="ActAllocationDetails">
- update act_allocation_details
- <trim prefix="SET" suffixOverrides=",">
- <if test="orderNo != null and orderNo != ''">order_no = #{orderNo},</if>
- <if test="lineNo != null">line_no = #{lineNo},</if>
- <if test="material != null and material != ''">material = #{material},</if>
- <if test="locationId != null">location_id = #{locationId},</if>
- <if test="callTransactionId != null">call_transaction_id = #{callTransactionId},</if>
- <if test="status != null">status = #{status},</if>
- <if test="lotnum != null">lotnum = #{lotnum},</if>
- <if test="qty != null">qty = #{qty},</if>
- <if test="pickTransactionId != null">pick_transaction_id = #{pickTransactionId},</if>
- <if test="pickToLocation != null">pick_to_location = #{pickToLocation},</if>
- <if test="pickQty != null">pick_qty = #{pickQty},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="userdefine1 != null">userdefine1 = #{userdefine1},</if>
- <if test="userdefine2 != null">userdefine2 = #{userdefine2},</if>
- <if test="userdefine3 != null">userdefine3 = #{userdefine3},</if>
- <if test="userdefine4 != null">userdefine4 = #{userdefine4},</if>
- </trim>
- where allocation_id = #{allocationId}
- </update>
- <delete id="deleteActAllocationDetailsByAllocationId" parameterType="String">
- delete
- from act_allocation_details
- where allocation_id = #{allocationId}
- </delete>
- <delete id="deleteActAllocationDetailsByAllocationIds" parameterType="String">
- delete from act_allocation_details where allocation_id in
- <foreach item="allocationId" collection="array" open="(" separator="," close=")">
- #{allocationId}
- </foreach>
- </delete>
- <select id="queryAllocationDetailsByPalletNo" parameterType="String" resultMap="ActAllocationDetailsResult">
- select al.*
- from act_allocation_details al
- where al.userdefine1 = #{palletNo}
- </select>
- <select id="queryAllocationDetailsByOrderNo" parameterType="String" resultMap="ActAllocationDetailsResult">
- select al.*
- from act_allocation_details al
- where al.order_no = #{orderNo}
- and status in (10, 20, 30, 40)
- </select>
- <update id="updateAllocationDetailsLocationIdByPalletNo">
- update act_allocation_details set location_id = #{locationId} where userdefine1 = #{palletNo}
- </update>
- </mapper>
|