refactor(入库任务): 列表数据,根据创建时间倒序

This commit is contained in:
LJW 2024-11-05 10:59:33 +08:00
parent b4566baedc
commit 74147f2703

View File

@ -1,66 +1,89 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ktg.mes.wm.mapper.WmsInTaskMapper">
<resultMap type="WmsInTask" id="WmsInTaskResult">
<result property="id" column="ID" />
<result property="taskInCode" column="TASK_IN_CODE" />
<result property="planInId" column="PLAN_IN_ID" />
<result property="taskInQuantity" column="TASK_IN_QUANTITY" />
<result property="actualInQuantity" column="ACTUAL_IN_QUANTITY" />
<result property="cellTgt" column="CELL_TGT" />
<result property="cellOrig" column="CELL_ORIG" />
<result property="remark" column="REMARK" />
<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="isActivy" column="IS_ACTIVY" />
<result property="isDelete" column="IS_DELETE" />
<result property="batch" column="BATCH" />
<result property="materialId" column="MATERIAL_ID" />
<result property="planTypeId" column="PLAN_TYPE_ID" />
<result property="planInStatus" column="PLAN_IN_STATUS" />
<result property="planInCode" column="PLAN_IN_CODE" />
<result property="materialCode" column="MATERIAL_CODE" />
<result property="id" column="ID"/>
<result property="taskInCode" column="TASK_IN_CODE"/>
<result property="planInId" column="PLAN_IN_ID"/>
<result property="taskInQuantity" column="TASK_IN_QUANTITY"/>
<result property="actualInQuantity" column="ACTUAL_IN_QUANTITY"/>
<result property="cellTgt" column="CELL_TGT"/>
<result property="cellOrig" column="CELL_ORIG"/>
<result property="remark" column="REMARK"/>
<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="isActivy" column="IS_ACTIVY"/>
<result property="isDelete" column="IS_DELETE"/>
<result property="batch" column="BATCH"/>
<result property="materialId" column="MATERIAL_ID"/>
<result property="planTypeId" column="PLAN_TYPE_ID"/>
<result property="planInStatus" column="PLAN_IN_STATUS"/>
<result property="planInCode" column="PLAN_IN_CODE"/>
<result property="materialCode" column="MATERIAL_CODE"/>
</resultMap>
<sql id="selectWmsInTaskVo">
select ID, TASK_IN_CODE, PLAN_IN_ID, TASK_IN_QUANTITY, ACTUAL_IN_QUANTITY, CELL_TGT, CELL_ORIG, REMARK, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, IS_ACTIVY, IS_DELETE, BATCH, MATERIAL_ID, PLAN_TYPE_ID, PLAN_IN_STATUS, PLAN_IN_CODE, MATERIAL_CODE from WMS_IN_TASK
select ID,
TASK_IN_CODE,
PLAN_IN_ID,
TASK_IN_QUANTITY,
ACTUAL_IN_QUANTITY,
CELL_TGT,
CELL_ORIG,
REMARK,
CREATE_BY,
CREATE_TIME,
UPDATE_BY,
UPDATE_TIME,
IS_ACTIVY,
IS_DELETE,
BATCH,
MATERIAL_ID,
PLAN_TYPE_ID,
PLAN_IN_STATUS,
PLAN_IN_CODE,
MATERIAL_CODE
from WMS_IN_TASK
order by CREATE_TIME desc
</sql>
<select id="selectWmsInTaskList" parameterType="WmsInTask" resultMap="WmsInTaskResult">
<include refid="selectWmsInTaskVo"/>
<where>
<if test="taskInCode != null and taskInCode != ''"> and TASK_IN_CODE = #{taskInCode}</if>
<if test="planInId != null and planInId != ''"> and PLAN_IN_ID = #{planInId}</if>
<if test="taskInQuantity != null and taskInQuantity != ''"> and TASK_IN_QUANTITY = #{taskInQuantity}</if>
<if test="actualInQuantity != null and actualInQuantity != ''"> and ACTUAL_IN_QUANTITY = #{actualInQuantity}</if>
<if test="cellTgt != null and cellTgt != ''"> and CELL_TGT = #{cellTgt}</if>
<if test="cellOrig != null and cellOrig != ''"> and CELL_ORIG = #{cellOrig}</if>
<if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
<if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if>
<if test="createTime != null and createTime != ''"> and CREATE_TIME = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
<if test="updateTime != null and updateTime != ''"> and UPDATE_TIME = #{updateTime}</if>
<if test="isActivy != null and isActivy != ''"> and IS_ACTIVY = #{isActivy}</if>
<if test="isDelete != null and isDelete != ''"> and IS_DELETE = #{isDelete}</if>
<if test="batch != null and batch != ''"> and BATCH = #{batch}</if>
<if test="materialId != null and materialId != ''"> and MATERIAL_ID = #{materialId}</if>
<if test="planTypeId != null and planTypeId != ''"> and PLAN_TYPE_ID = #{planTypeId}</if>
<if test="planInStatus != null and planInStatus != ''"> and PLAN_IN_STATUS = #{planInStatus}</if>
<if test="planInCode != null and planInCode != ''"> and PLAN_IN_CODE = #{planInCode}</if>
<if test="materialCode != null and materialCode != ''"> and MATERIAL_CODE = #{materialCode}</if>
<where>
<if test="taskInCode != null and taskInCode != ''">and TASK_IN_CODE = #{taskInCode}</if>
<if test="planInId != null and planInId != ''">and PLAN_IN_ID = #{planInId}</if>
<if test="taskInQuantity != null and taskInQuantity != ''">and TASK_IN_QUANTITY = #{taskInQuantity}</if>
<if test="actualInQuantity != null and actualInQuantity != ''">and ACTUAL_IN_QUANTITY =
#{actualInQuantity}
</if>
<if test="cellTgt != null and cellTgt != ''">and CELL_TGT = #{cellTgt}</if>
<if test="cellOrig != null and cellOrig != ''">and CELL_ORIG = #{cellOrig}</if>
<if test="remark != null and remark != ''">and REMARK = #{remark}</if>
<if test="createBy != null and createBy != ''">and CREATE_BY = #{createBy}</if>
<if test="createTime != null and createTime != ''">and CREATE_TIME = #{createTime}</if>
<if test="updateBy != null and updateBy != ''">and UPDATE_BY = #{updateBy}</if>
<if test="updateTime != null and updateTime != ''">and UPDATE_TIME = #{updateTime}</if>
<if test="isActivy != null and isActivy != ''">and IS_ACTIVY = #{isActivy}</if>
<if test="isDelete != null and isDelete != ''">and IS_DELETE = #{isDelete}</if>
<if test="batch != null and batch != ''">and BATCH = #{batch}</if>
<if test="materialId != null and materialId != ''">and MATERIAL_ID = #{materialId}</if>
<if test="planTypeId != null and planTypeId != ''">and PLAN_TYPE_ID = #{planTypeId}</if>
<if test="planInStatus != null and planInStatus != ''">and PLAN_IN_STATUS = #{planInStatus}</if>
<if test="planInCode != null and planInCode != ''">and PLAN_IN_CODE = #{planInCode}</if>
<if test="materialCode != null and materialCode != ''">and MATERIAL_CODE = #{materialCode}</if>
</where>
</select>
<select id="selectWmsInTaskById" parameterType="String" resultMap="WmsInTaskResult">
<include refid="selectWmsInTaskVo"/>
where ID = #{id}
</select>
<insert id="insertWmsInTask" parameterType="WmsInTask" useGeneratedKeys="true" keyProperty="id">
insert into WMS_IN_TASK
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -83,7 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planInStatus != null">PLAN_IN_STATUS,</if>
<if test="planInCode != null">PLAN_IN_CODE,</if>
<if test="materialCode != null">MATERIAL_CODE,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskInCode != null">#{taskInCode},</if>
<if test="planInId != null">#{planInId},</if>
@ -104,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planInStatus != null">#{planInStatus},</if>
<if test="planInCode != null">#{planInCode},</if>
<if test="materialCode != null">#{materialCode},</if>
</trim>
</trim>
</insert>
<update id="updateWmsInTask" parameterType="WmsInTask">
@ -134,11 +157,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteWmsInTaskById" parameterType="String">
delete from WMS_IN_TASK where ID = #{id}
delete
from WMS_IN_TASK
where ID = #{id}
</delete>
<delete id="deleteWmsInTaskByIds" parameterType="String">
delete from WMS_IN_TASK where ID in
delete from WMS_IN_TASK where ID in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>