wms-serve-mule/src/main/resources/mapper/AppOrderInMapper.xml
icewint 42635073fe <fix>[important]基本测试版本,已完成和其他系统交互feat(wms_serve): 实现空托盘入库和补盘功能
- 实现空托盘入库逻辑,包括生成虚拟托盘号和创建入库任务
- 添加补盘功能,处理空托盘出库和创建出库任务
2025-02-20 13:38:20 +08:00

170 lines
7.9 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.wms.mapper.AppOrderInMapper">
<resultMap type="AppOrderIn" id="AppOrderInMap">
<result property="rowId" column="row_id"/>
<result property="guid" column="guid"/>
<result property="inType" column="in_type"/>
<result property="batchNo" column="batch_no"/>
<result property="vehicleNo" column="vehicle_no"/>
<result property="goodsId" column="goods_id"/>
<result property="goodsNum" column="goods_num"/>
<result property="wareHouse" column="ware_house"/>
<result property="orderStatus" column="order_status"/>
<result property="createTime" column="create_time"/>
<result property="createPerson" column="create_person"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="productionDate" column="production_date"/>
</resultMap>
<!-- 条件插查询并将结果倒序排列-->
<select id="select" parameterType="AppOrderIn" resultMap="AppOrderInMap">
select row_id, guid, in_type, batch_no, vehicle_no, goods_id, goods_num,
ware_house, order_status, create_time, create_person, update_time, remark
from tbl_app_order_in
<where>
<if test="rowId != null"> and row_id = #{rowId}</if>
<if test="guid != null"> and guid = #{guid}</if>
<if test="inType != null"> and in_type = #{inType}</if>
<if test="batchNo != null"> and batch_no = #{batchNo}</if>
<if test="vehicleNo != null"> and vehicle_no = #{vehicleNo}</if>
<if test="goodsId != null"> and goods_id = #{goodsId}</if>
<if test="goodsNum != null"> and goods_num = #{goodsNum}</if>
<if test="wareHouse != null"> and ware_house = #{wareHouse}</if>
<if test="orderStatus != null"> and order_status = #{orderStatus}</if>
<if test="createPerson != null"> and create_person = #{createPerson}</if>
<if test="remark != null"> and remark = #{remark}</if>
</where>
order by create_time desc
</select>
<!-- 插入一条数据-->
<insert id="insert" parameterType="AppOrderIn">
insert into tbl_app_order_in
(row_id, guid, in_type, batch_no, vehicle_no, goods_id, goods_num,
ware_house, order_status, create_time, create_person, update_time, remark, production_date)
values (#{rowId}, #{guid}, #{inType}, #{batchNo}, #{vehicleNo}, #{goodsId}, #{goodsNum},
#{wareHouse}, #{orderStatus}, #{createTime}, #{createPerson}, #{updateTime}, #{remark}, #{productionDate})
</insert>
<insert id="insertList" parameterType="java.util.List">
insert into tbl_app_order_in(row_id, guid, in_type, batch_no, vehicle_no, goods_id, goods_num,
ware_house, order_status, create_time, create_person, update_time, remark)
values
<foreach collection="list" index="index" item="item" separator=",">
(#{rowId}, #{guid}, #{inType}, #{batchNo}, #{vehicleNo}, #{goodsId}, #{goodsNum},
#{wareHouse}, #{orderStatus}, #{createTime}, #{createPerson}, #{updateTime}, #{remark})
</foreach>
</insert>
<!-- 根据 row_id 更新数据-->
<update id="update" parameterType="AppOrderIn">
update tbl_app_order_in
<set>
<if test="guid != null">guid = #{guid},</if>
<if test="inType != null">in_type = #{inType},</if>
<if test="batchNo != null">batch_no = #{batchNo},</if>
<if test="vehicleNo != null">vehicle_no = #{vehicleNo},</if>
<if test="goodsId != null">goods_id = #{goodsId}, </if>
<if test="goodsNum != null">goods_num = #{goodsNum},</if>
<if test="wareHouse != null">ware_house = #{wareHouse},</if>
<if test="orderStatus != null">order_status = #{orderStatus},</if>
<if test="createPerson != null">create_person = #{createPerson},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="productionDate != null">production_date = #{productionDate},</if>
</set>
where row_id = #{rowId}
</update>
<!-- 根据 row_id 删除数据-->
<delete id="delete" parameterType="String">
delete from tbl_app_order_in where row_id = #{rowId}
</delete>
<select id="selectWithParams" resultMap="AppOrderInMap">
select row_id, guid, in_type, batch_no, vehicle_no, goods_id, goods_num,
ware_house, order_status, create_time, create_person, update_time, remark
from tbl_app_order_in
<where>
order_status in
<foreach collection="orderStatus" item="orderStatus" separator="," open="(" close=")">
#{orderStatus}
</foreach>
<if test="searchStr != null and searchStr != ''">
and (row_id like concat('%', #{searchStr}, '%') or guid like concat('%', #{searchStr}, '%')
or in_type like concat('%', #{searchStr}, '%')
or batch_no like concat('%', #{searchStr}, '%')
or vehicle_no like concat('%', #{searchStr}, '%')
or goods_id like concat('%', #{searchStr}, '%')
or ware_house like concat('%', #{searchStr}, '%'))
</if>
</where>
order by create_time desc
</select>
<select id="selectWithVehicle" parameterType="String" resultMap="AppOrderInMap">
select row_id, guid, in_type, batch_no, vehicle_no, goods_id, goods_num,
ware_house, order_status, create_time, create_person, update_time, remark, production_date
from tbl_app_order_in
<where>
<if test="vehicleNo != null"> and vehicle_no = #{vehicleNo}</if>
</where>
order by create_time asc
</select>
<select id="selectWithGoodsId" parameterType="String" resultMap="AppOrderInMap">
select row_id, guid, in_type, batch_no, vehicle_no, goods_id, goods_num,
ware_house, order_status, create_time, create_person, update_time, remark
from tbl_app_order_in
<where>
<if test="goodsId != null"> and goods_id = #{goodsId}</if>
</where>
order by create_time asc
</select>
<select id="selectWithRowId" parameterType="String" resultMap="AppOrderInMap">
select row_id, guid, in_type, batch_no, vehicle_no, goods_id, goods_num,
ware_house, order_status, create_time, create_person, update_time, remark, production_date
from tbl_app_order_in
<where>
<if test="rowId != null"> and row_id = #{rowId}</if>
</where>
order by create_time asc
</select>
<select id="selectWithBatchNo" parameterType="Map" resultMap="AppOrderInMap">
select row_id, guid, in_type, batch_no, vehicle_no, goods_id, goods_num,
ware_house, order_status, create_time, create_person, update_time, remark, production_date
from tbl_app_order_in
<where>
<if test="batch_no != null"> and batch_no = #{batchNo}</if>
<if test="goods_num != null"> and goods_num = #{goodsNum}</if>
<if test="production_date != null"> and production_date = #{date}</if>
<if test="goods_id != null"> and goods_id = #{goodsId}</if>
</where>
order by update_time desc
</select>
<update id="updateStatusWithVehicleNo">
update tbl_app_order_in
set order_status = #{orderStatus}
where vehicle_no = #{vehicleNo}
</update>
<delete id="deleteByCheckNoGood" parameterType="String">
delete from tbl_app_order_in where remark = #{remark}
</delete>
</mapper>