审核逻辑修改前项目保存

This commit is contained in:
2025-07-10 08:40:36 +08:00
parent f3752c7cbc
commit fb5c21dbfe
70 changed files with 3710 additions and 974 deletions

View File

@@ -5,10 +5,10 @@
<mapper namespace="com.zg.project.Inventory.AutoInventory.mapper.InventoryMatchScanMapper">
<insert id="insertBatch">
INSERT INTO inventory_match_scan (task_name,device_id, pcde, tme, scan_type, status, created_at)
INSERT INTO inventory_match_scan (task_id, device_id, pcode, tme, scan_type, status)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.taskName},#{item.deviceId}, #{item.pcde}, #{item.tme}, #{item.scanType}, #{item.status}, NOW())
(#{item.taskId}, #{item.deviceId}, #{item.pcode}, #{item.tme}, #{item.scanType}, #{item.status})
</foreach>
</insert>
@@ -18,9 +18,7 @@
<select id="getAllSod" resultType="com.zg.project.Inventory.domain.entity.Sod">
SELECT * FROM inventory_match_scan i
LEFT JOIN sod s ON i.pcde = s.fycde_1
LEFT JOIN sod s ON i.pcde = s.fycde_1
WHERE s.rmn > 0
</select>
@@ -45,61 +43,10 @@
GROUP BY s.pcde
</select>
<!-- <select id="getByTaskName" resultType="com.zg.project.Inventory.domain.vo.InventoryMatchScanVO">-->
<!-- SELECT-->
<!-- i.id,-->
<!-- i.device_id AS deviceId,-->
<!-- i.task_name AS taskName,-->
<!-- s.pcde,-->
<!-- i.tme,-->
<!-- i.scan_type AS scanType,-->
<!-- i.status,-->
<!-- i.created_at AS createdAt,-->
<!-- s.mid,-->
<!-- s.des_mat AS desMat,-->
<!-- s.rmn,-->
<!-- s.unt,-->
<!-- s.des_pro AS desPro,-->
<!-- s.bnum,-->
<!-- s.tcde-->
<!-- FROM-->
<!-- inventory_match_scan i-->
<!-- JOIN-->
<!-- sod s ON i.pcde = s.fycde_1-->
<!-- WHERE-->
<!-- i.pcde IS NOT NULL-->
<!-- AND s.rmn > 0-->
<!-- <if test="taskName != null and taskName != ''">-->
<!-- AND i.task_name LIKE CONCAT('%', #{taskName}, '%')-->
<!-- </if>-->
<!-- <if test="status != null and status != ''">-->
<!-- AND i.status = #{status}-->
<!-- </if>-->
<!-- </select>-->
<!-- <select id="getByTaskName" resultType="com.zg.project.Inventory.domain.vo.InventoryMatchScanVO">-->
<!-- SELECT-->
<!-- id,-->
<!-- device_id AS deviceId,-->
<!-- task_name AS taskName,-->
<!-- pcde,-->
<!-- tme,-->
<!-- scan_type AS scanType,-->
<!-- status,-->
<!-- created_at AS createdAt-->
<!-- FROM-->
<!-- inventory_match_scan-->
<!-- WHERE-->
<!-- task_name LIKE CONCAT('%', #{taskName}, '%')-->
<!-- AND pcde IS NOT NULL-->
<!-- <if test="status != null">-->
<!-- AND status = #{status}-->
<!-- </if>-->
<!-- </select>-->
<select id="getGroupedHistoryList" resultType="com.zg.project.Inventory.domain.vo.InventoryMatchScanSimpleVO">
SELECT
task_name AS taskName,
MAX(created_at) AS createdAt,
MAX(tme) AS tme,
MAX(scan_type) AS scanType
FROM inventory_match_scan
<where>
@@ -113,21 +60,18 @@
AND pcde = #{dto.pcde}
</if>
<if test="dto.tme != null and dto.tme.size() == 2">
AND DATE(created_at) <![CDATA[ >= ]]> #{dto.tme[0]}
AND DATE(created_at) <![CDATA[ <= ]]> #{dto.tme[1]}
AND DATE(tme) <![CDATA[ >= ]]> #{dto.tme[0]}
AND DATE(tme) <![CDATA[ <= ]]> #{dto.tme[1]}
</if>
<if test="dto.scanType != null">
AND scan_type = #{dto.scanType}
</if>
<if test="dto.createdAt != null and dto.createdAt != ''">
AND created_at = #{dto.createdAt}
</if>
<if test="dto.status != null">
AND status = #{dto.status}
</if>
</where>
GROUP BY task_name
ORDER BY MAX(created_at) DESC
ORDER BY MAX(tme) DESC
LIMIT #{limit} OFFSET #{offset}
</select>
@@ -145,15 +89,12 @@
AND pcde = #{dto.pcde}
</if>
<if test="dto.tme != null and dto.tme.size() == 2">
AND DATE(created_at) <![CDATA[ >= ]]> #{dto.tme[0]}
AND DATE(created_at) <![CDATA[ <= ]]> #{dto.tme[1]}
AND DATE(tme) <![CDATA[ >= ]]> #{dto.tme[0]}
AND DATE(tme) <![CDATA[ <= ]]> #{dto.tme[1]}
</if>
<if test="dto.scanType != null">
AND scan_type = #{dto.scanType}
</if>
<if test="dto.createdAt != null and dto.createdAt != ''">
AND created_at = #{dto.createdAt}
</if>
<if test="dto.status != null">
AND status = #{dto.status}
</if>
@@ -170,7 +111,6 @@
i.tme,
i.scan_type AS scanType,
i.status,
i.created_at AS createdAt,
s.mid,
s.des_mat AS desMat,
s.rmn,
@@ -178,12 +118,9 @@
s.des_pro AS desPro,
s.bnum,
s.tcde
FROM
inventory_match_scan i
LEFT JOIN
sod s ON i.pcde = s.fycde_1
WHERE
i.pcde IS NOT NULL
FROM inventory_match_scan i
LEFT JOIN sod s ON i.pcde = s.fycde_1
WHERE i.pcde IS NOT NULL
<if test="taskName != null and taskName != ''">
AND i.task_name LIKE CONCAT('%', #{taskName}, '%')
</if>
@@ -195,4 +132,86 @@
</if>
</select>
<select id="selectInventoryMatchScanList"
resultType="com.zg.project.Inventory.domain.entity.InventoryMatchScan"
parameterType="com.zg.project.Inventory.domain.entity.InventoryMatchScan">
SELECT
i.id AS id,
i.task_id AS taskId,
i.device_id AS deviceId,
i.pcode AS pcode,
i.tme AS tme,
i.scan_type AS scanType,
i.status AS status,
r.pcode AS rkPcode,
t.task_name AS taskName
FROM inventory_match_scan i
LEFT JOIN rk_info r ON i.pcode = r.pcode_id
LEFT JOIN inventory_task t ON i.task_id = t.id
<where>
<if test="taskId != null and taskId != ''">
AND i.task_id = #{taskId}
</if>
<if test="deviceId != null and deviceId != ''">
AND i.device_id = #{deviceId}
</if>
<if test="pcode != null and pcode != ''">
AND i.pcode LIKE CONCAT('%', #{pcode}, '%')
</if>
<if test="status != null and status != ''">
AND i.status = #{status}
</if>
<if test="scanType != null">
AND i.scan_type = #{scanType}
</if>
<if test="tme != null">
AND i.tme >= #{tme}
</if>
</where>
ORDER BY i.tme DESC
</select>
<select id="selectOnlyFromMatchScan"
parameterType="InventoryMatchScan"
resultType="com.zg.project.Inventory.domain.vo.RkInfoMatchVO">
SELECT
i.pcode AS rkPcode,
NULL AS realQty
FROM inventory_match_scan i
<where>
<if test="taskId != null and taskId != ''">
AND i.task_id = #{taskId}
</if>
<if test="deviceId != null and deviceId != ''">
AND i.device_id = #{deviceId}
</if>
<if test="status != null and status != ''">
AND i.status = #{status}
</if>
</where>
ORDER BY i.tme DESC
</select>
<select id="selectJoinRkInfo"
parameterType="InventoryMatchScan"
resultType="com.zg.project.Inventory.domain.vo.RkInfoMatchVO">
SELECT
r.pcode AS rkPcode,
r.real_qty AS realQty
FROM inventory_match_scan i
LEFT JOIN rk_info r ON i.pcode = r.pcode_id
<where>
<if test="taskId != null and taskId != ''">
AND i.task_id = #{taskId}
</if>
<if test="deviceId != null and deviceId != ''">
AND i.device_id = #{deviceId}
</if>
<if test="status != null and status != ''">
AND i.status = #{status}
</if>
</where>
ORDER BY i.tme DESC
</select>
</mapper>

View File

@@ -88,16 +88,5 @@
AND rmn != 0
</select>
<select id="selectPcdeCntByFycde1" resultType="com.zg.project.Inventory.domain.vo.PcdeCntVO">
SELECT pcde,
COUNT(*) AS cnt
FROM sod
WHERE fycde_1 IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
GROUP BY pcde
</select>
</mapper>

View File

@@ -1,51 +1,88 @@
<?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.zg.project.Inventory.Task.mapper.InventoryTaskMapper">
<resultMap type="InventoryTask" id="InventoryTaskResult">
<result property="id" column="id" />
<result property="taskName" column="task_name" />
<result property="warehouseId" column="warehouse_id" />
<result property="sceneId" column="scene_id" />
<result property="userId" column="user_id" />
<result property="requireTime" column="require_time" />
<result property="status" column="status" />
<result property="taskType" column="task_type" />
<result property="remark" column="remark" />
<result property="createdBy" column="created_by" />
<result property="createdAt" column="created_at" />
<result property="updatedBy" column="updated_by" />
<result property="updatedAt" column="updated_at" />
<result property="isDelete" column="is_delete" />
<result property="id" column="id"/>
<result property="taskName" column="task_name"/>
<result property="warehouseId" column="warehouse_id"/>
<result property="warehouseName" column="warehouse_name"/>
<result property="sceneId" column="scene_id"/>
<result property="sceneName" column="scene_name"/>
<result property="userId" column="user_id"/>
<result property="userName" column="user_name"/>
<result property="requireTime" column="require_time"/>
<result property="status" column="status"/>
<result property="taskType" column="task_type"/>
<result property="remark" column="remark"/>
<result property="createdBy" column="created_by"/>
<result property="createdAt" column="created_at"/>
<result property="updatedBy" column="updated_by"/>
<result property="updatedAt" column="updated_at"/>
<result property="isDelete" column="is_delete"/>
</resultMap>
<sql id="selectInventoryTaskVo">
select id, task_name, warehouse_id, scene_id, user_id, require_time, status, task_type, remark, created_by, created_at, updated_by, updated_at, is_delete from inventory_task
SELECT
t.id,
t.task_name,
t.warehouse_id,
w.warehouse_name AS warehouse_name,
t.scene_id,
s.scene_name AS scene_name,
t.user_id,
u.nick_name AS user_name,
t.require_time,
t.status,
t.task_type,
t.remark,
t.created_by,
t.created_at,
t.updated_by,
t.updated_at,
t.is_delete
FROM inventory_task t
LEFT JOIN warehouse_info w ON t.warehouse_id = w.warehouse_code
LEFT JOIN scene_mapping s ON t.scene_id = s.scene_code
LEFT JOIN sys_user u ON t.user_id = u.user_id
</sql>
<select id="selectInventoryTaskList" parameterType="InventoryTask" resultMap="InventoryTaskResult">
<include refid="selectInventoryTaskVo"/>
<where>
<if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="sceneId != null "> and scene_id = #{sceneId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="requireTime != null and requireTime != ''"> and require_time = #{requireTime}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="taskType != null and taskType != ''"> and task_type = #{taskType}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="createdAt != null and createdAt != ''"> and created_at = #{createdAt}</if>
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
<if test="updatedAt != null and updatedAt != ''"> and updated_at = #{updatedAt}</if>
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
<where>
<if test="taskName != null and taskName != ''"> AND t.task_name LIKE concat('%', #{taskName}, '%')</if>
<if test="warehouseId != null"> AND t.warehouse_id = #{warehouseId}</if>
<if test="sceneId != null"> AND t.scene_id = #{sceneId}</if>
<if test="userId != null"> AND t.user_id = #{userId}</if>
<if test="requireTime != null and requireTime != ''"> AND t.require_time = #{requireTime}</if>
<if test="status != null and status != ''"> AND t.status = #{status}</if>
<if test="taskType != null and taskType != ''"> AND t.task_type = #{taskType}</if>
<if test="createdBy != null and createdBy != ''"> AND t.created_by = #{createdBy}</if>
<if test="createdAt != null and createdAt != ''"> AND t.created_at = #{createdAt}</if>
<if test="updatedBy != null and updatedBy != ''"> AND t.updated_by = #{updatedBy}</if>
<if test="updatedAt != null and updatedAt != ''"> AND t.updated_at = #{updatedAt}</if>
<if test="isDelete != null and isDelete != ''"> AND t.is_delete = #{isDelete}</if>
</where>
order by t.created_at desc
</select>
<select id="selectInventoryTaskById" parameterType="Long" resultMap="InventoryTaskResult">
<include refid="selectInventoryTaskVo"/>
where id = #{id}
WHERE t.id = #{id}
</select>
<select id="countPendingTaskByUserId" resultType="java.lang.Integer" parameterType="java.lang.Long">
select count(*) from inventory_task
where user_id = #{userId}
and status = '0'
and is_delete = '0'
</select>
<select id="getWhByTaskId" resultType="java.lang.String" parameterType="java.lang.String">
select warehouse_id from inventory_task
where id = #{taskId}
</select>
<insert id="insertInventoryTask" parameterType="InventoryTask" useGeneratedKeys="true" keyProperty="id">
@@ -64,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updatedBy != null">updated_by,</if>
<if test="updatedAt != null">updated_at,</if>
<if test="isDelete != null">is_delete,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskName != null and taskName != ''">#{taskName},</if>
<if test="warehouseId != null">#{warehouseId},</if>
@@ -79,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedAt != null">#{updatedAt},</if>
<if test="isDelete != null">#{isDelete},</if>
</trim>
</trim>
</insert>
<update id="updateInventoryTask" parameterType="InventoryTask">
@@ -102,12 +139,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<update id="updateStatus" parameterType="map">
UPDATE inventory_task
SET status = #{status},
updated_at = NOW()
WHERE id = #{taskId}
</update>
<delete id="deleteInventoryTaskById" parameterType="Long">
delete from inventory_task where id = #{id}
</delete>
<delete id="deleteInventoryTaskByIds" parameterType="String">
delete from inventory_task where id in
delete from inventory_task where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>

View File

@@ -1,38 +1,57 @@
<?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.zg.project.information.mapper.DeviceInfoMapper">
<resultMap type="DeviceInfo" id="DeviceInfoResult">
<result property="deviceId" column="device_id" />
<result property="ipAddress" column="ip_address" />
<result property="port" column="port" />
<result property="warehouseId" column="warehouse_id" />
<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="isDelete" column="is_delete" />
<result property="deviceId" column="device_id" />
<result property="ipAddress" column="ip_address" />
<result property="port" column="port" />
<result property="warehouseId" column="warehouse_id" />
<result property="sceneId" column="scene_id" />
<result property="warehouseName" column="warehouse_name" />
<result property="sceneName" column="scene_name" />
<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="isDelete" column="is_delete" />
</resultMap>
<sql id="selectDeviceInfoVo">
select device_id, ip_address, port, warehouse_id, create_by, create_time, update_by, update_time, is_delete from device_info
SELECT
d.device_id,
d.ip_address,
d.port,
d.warehouse_id,
d.scene_id,
w.warehouse_name AS warehouse_name,
s.scene_name AS scene_name,
d.create_by,
d.create_time,
d.update_by,
d.update_time,
d.is_delete
FROM device_info d
LEFT JOIN warehouse_info w ON d.warehouse_id = w.warehouse_code
LEFT JOIN scene_mapping s ON d.scene_id = s.scene_code
</sql>
<select id="selectDeviceInfoList" parameterType="DeviceInfo" resultMap="DeviceInfoResult">
<include refid="selectDeviceInfoVo"/>
<where>
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
<if test="port != null "> and port = #{port}</if>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
<where>
<if test="ipAddress != null and ipAddress != ''"> and d.ip_address = #{ipAddress}</if>
<if test="port != null "> and d.port = #{port}</if>
<if test="warehouseId != null "> and d.warehouse_id = #{warehouseId}</if>
<if test="sceneId != null "> and d.scene_id = #{sceneId}</if>
<if test="isDelete != null and isDelete != ''"> and d.is_delete = #{isDelete}</if>
</where>
</select>
<select id="selectDeviceInfoByDeviceId" parameterType="Long" resultMap="DeviceInfoResult">
<include refid="selectDeviceInfoVo"/>
where device_id = #{deviceId}
WHERE d.device_id = #{deviceId}
</select>
<insert id="insertDeviceInfo" parameterType="DeviceInfo">
@@ -42,23 +61,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="ipAddress != null">ip_address,</if>
<if test="port != null">port,</if>
<if test="warehouseId != null">warehouse_id,</if>
<if test="sceneId != null">scene_id,</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="isDelete != null">is_delete,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceId != null">#{deviceId},</if>
<if test="ipAddress != null">#{ipAddress},</if>
<if test="port != null">#{port},</if>
<if test="warehouseId != null">#{warehouseId},</if>
<if test="sceneId != null">#{sceneId},</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="isDelete != null">#{isDelete},</if>
</trim>
</trim>
</insert>
<update id="updateDeviceInfo" parameterType="DeviceInfo">
@@ -67,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="ipAddress != null">ip_address = #{ipAddress},</if>
<if test="port != null">port = #{port},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="sceneId != null">scene_id = #{sceneId},</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>
@@ -81,9 +103,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteDeviceInfoByDeviceIds" parameterType="String">
delete from device_info where device_id in
delete from device_info where device_id in
<foreach item="deviceId" collection="array" open="(" separator="," close=")">
#{deviceId}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -1,27 +1,27 @@
<?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.zg.project.information.mapper.PcdeDetailMapper">
<resultMap type="PcdeDetail" id="PcdeDetailResult">
<result property="id" column="id" />
<result property="locationCode" column="location_code" />
<result property="scene" column="scene" />
<result property="sceneName" column="scene_name" />
<result property="warehouse" column="warehouse" />
<result property="encodedId" column="encoded_id" />
<result property="tag" column="tag" />
<result property="remark" column="remark"/>
<result property="isDelete" column="is_delete" />
<result property="createdBy" column="created_by" />
<result property="createdAt" column="created_at" />
<result property="updatedBy" column="updated_by" />
<result property="updatedAt" column="updated_at" />
<result property="id" column="id"/>
<result property="pcode" column="pcode"/>
<result property="scene" column="scene"/>
<result property="sceneName" column="scene_name"/>
<result property="warehouse" column="warehouse"/>
<result property="encodedId" column="encoded_id"/>
<result property="tag" column="tag"/>
<result property="remark" column="remark"/>
<result property="isDelete" column="is_delete"/>
<result property="createdBy" column="created_by"/>
<result property="createdAt" column="created_at"/>
<result property="updatedBy" column="updated_by"/>
<result property="updatedAt" column="updated_at"/>
</resultMap>
<sql id="selectPcdeDetailVo">
select d.id, d.location_code, d.scene, m.scene_name, d.warehouse,
select d.id, d.pcode, d.scene, m.scene_name, d.warehouse,
d.encoded_id, d.tag, d.remark, d.is_delete,
d.created_by, d.created_at, d.updated_by, d.updated_at
from pcde_detail d
@@ -31,16 +31,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectPcdeDetailList" parameterType="PcdeDetail" resultMap="PcdeDetailResult">
<include refid="selectPcdeDetailVo"/>
<where>
<if test="locationCode != null and locationCode != ''"> and d.location_code = #{locationCode}</if>
<if test="scene != null and scene != ''"> and d.scene = #{scene}</if>
<if test="warehouse != null and warehouse != ''"> and d.warehouse = #{warehouse}</if>
<if test="encodedId != null and encodedId != ''"> and d.encoded_id = #{encodedId}</if>
<if test="tag != null and tag != ''"> and d.tag = #{tag}</if>
<if test="isDelete != null "> and d.is_delete = #{isDelete}</if>
<if test="createdBy != null and createdBy != ''"> and d.created_by = #{createdBy}</if>
<if test="createdAt != null "> and d.created_at = #{createdAt}</if>
<if test="updatedBy != null and updatedBy != ''"> and d.updated_by = #{updatedBy}</if>
<if test="updatedAt != null "> and d.updated_at = #{updatedAt}</if>
<if test="pcode != null and pcode != ''">and d.pcode = #{pcode}</if>
<if test="scene != null and scene != ''">and d.scene = #{scene}</if>
<if test="warehouse != null and warehouse != ''">and d.warehouse = #{warehouse}</if>
<if test="encodedId != null and encodedId != ''">and d.encoded_id = #{encodedId}</if>
<if test="tag != null and tag != ''">and d.tag = #{tag}</if>
<if test="isDelete != null">and d.is_delete = #{isDelete}</if>
<if test="createdBy != null and createdBy != ''">and d.created_by = #{createdBy}</if>
<if test="createdAt != null">and d.created_at = #{createdAt}</if>
<if test="updatedBy != null and updatedBy != ''">and d.updated_by = #{updatedBy}</if>
<if test="updatedAt != null">and d.updated_at = #{updatedAt}</if>
</where>
</select>
@@ -49,18 +49,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where d.id = #{id}
</select>
<select id="selectByLocationCode" resultType="com.zg.project.information.domain.PcdeDetail"
<select id="selectByPcode" resultType="com.zg.project.information.domain.PcdeDetail"
parameterType="java.lang.String">
select id, location_code, scene, warehouse, encoded_id, tag, is_delete,
select id, pcode, scene, warehouse, encoded_id, tag, is_delete,
created_by, created_at, updated_by, updated_at, remark
from pcde_detail
where location_code = #{locationCode}
where pcode = #{pcode}
</select>
<insert id="insertPcdeDetail" parameterType="PcdeDetail" useGeneratedKeys="true" keyProperty="id">
insert into pcde_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="locationCode != null and locationCode != ''">location_code,</if>
<if test="pcode != null and pcode != ''">pcode,</if>
<if test="scene != null and scene != ''">scene,</if>
<if test="warehouse != null and warehouse != ''">warehouse,</if>
<if test="encodedId != null">encoded_id,</if>
@@ -71,9 +71,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdAt != null">created_at,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedAt != null">updated_at,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="locationCode != null and locationCode != ''">#{locationCode},</if>
<if test="pcode != null and pcode != ''">#{pcode},</if>
<if test="scene != null and scene != ''">#{scene},</if>
<if test="warehouse != null and warehouse != ''">#{warehouse},</if>
<if test="encodedId != null">#{encodedId},</if>
@@ -84,13 +84,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedAt != null">#{updatedAt},</if>
</trim>
</trim>
</insert>
<update id="updatePcdeDetail" parameterType="PcdeDetail">
update pcde_detail
<trim prefix="SET" suffixOverrides=",">
<if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
<if test="pcode != null and pcode != ''">pcode = #{pcode},</if>
<if test="scene != null and scene != ''">scene = #{scene},</if>
<if test="warehouse != null and warehouse != ''">warehouse = #{warehouse},</if>
<if test="encodedId != null">encoded_id = #{encodedId},</if>
@@ -110,9 +110,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deletePcdeDetailByIds" parameterType="String">
delete from pcde_detail where id in
delete from pcde_detail where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -0,0 +1,91 @@
<?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.zg.project.wisdom.mapper.AgvTaskResultMapper">
<resultMap id="AgvTaskResultResultMap" type="AgvTaskResult">
<result property="id" column="id"/>
<result property="requestId" column="request_id"/>
<result property="taskNo" column="task_no"/>
<result property="status" column="status"/>
<result property="msg" column="msg"/>
<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="isDelete" column="is_delete"/>
</resultMap>
<sql id="selectAgvTaskResultVo">
id, request_id, task_no, status, msg, create_by, create_time, update_by, update_time, is_delete
</sql>
<select id="selectAgvTaskResultById" resultMap="AgvTaskResultResultMap">
SELECT <include refid="selectAgvTaskResultVo"/> FROM agv_task_result WHERE id = #{id}
</select>
<select id="selectAgvTaskResultList" resultMap="AgvTaskResultResultMap">
SELECT <include refid="selectAgvTaskResultVo"/> FROM agv_task_result
<where>
<if test="taskNo != null and taskNo != ''">AND task_no = #{taskNo}</if>
<if test="status != null">AND status = #{status}</if>
AND is_delete = '0'
</where>
</select>
<select id="selectCountByRequestIdAndStatus" resultType="int">
SELECT COUNT(1)
FROM agv_task_result
WHERE request_id = #{requestId}
AND status = #{status}
AND is_delete = '0'
</select>
<insert id="insertAgvTaskResult" parameterType="AgvTaskResult" useGeneratedKeys="true" keyProperty="id">
INSERT INTO agv_task_result
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="requestId != null">request_id,</if>
<if test="taskNo != null">task_no,</if>
<if test="status != null">status,</if>
<if test="msg != null">msg,</if>
<if test="createBy != null">create_by,</if>
create_time,
is_delete
</trim>
VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="requestId != null">#{requestId},</if>
<if test="taskNo != null">#{taskNo},</if>
<if test="status != null">#{status},</if>
<if test="msg != null">#{msg},</if>
<if test="createBy != null">#{createBy},</if>
NOW(),
'0'
</trim>
</insert>
<update id="updateAgvTaskResult" parameterType="AgvTaskResult">
UPDATE agv_task_result SET
request_id = #{requestId},
task_no = #{taskNo},
status = #{status},
msg = #{msg},
update_by = #{updateBy},
update_time = NOW()
WHERE id = #{id}
</update>
<delete id="deleteAgvTaskResultById">
DELETE FROM agv_task_result WHERE id = #{id}
</delete>
<delete id="deleteAgvTaskResultByIds">
DELETE FROM agv_task_result WHERE id IN
<foreach collection="array" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,100 @@
<?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.zg.project.wisdom.mapper.DdTaskMapper">
<resultMap id="DdTaskResult" type="com.zg.project.wisdom.domain.DdTask">
<result property="id" column="id" />
<result property="taskNo" column="task_no" />
<result property="taskDtl" column="task_dtl" />
<result property="taskType" column="task_type" />
<result property="taskStatus" column="task_status" />
<result property="midStatus" column="mid_status" />
<result property="mid" column="mid" />
<result property="num" column="num" />
<result property="midType" column="mid_type" />
<result property="sourceName" column="source_name" />
<result property="targetName" column="target_name" />
<result property="operator" column="operator" />
<result property="approver" column="approver" />
<result property="rcptim" column="rcptim" />
<result property="rid" column="rid" />
<result property="doCount" column="do_count" />
<result property="prf" column="prf" />
<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="isDelete" column="is_delete" />
</resultMap>
<select id="selectDdTaskList" resultMap="DdTaskResult">
SELECT * FROM dd_task
<where>
<if test="taskNo != null and taskNo != ''">
AND task_no = #{taskNo}
</if>
<if test="taskType != null and taskType != ''">
AND task_type = #{taskType}
</if>
<if test="taskStatus != null">
AND task_status = #{taskStatus}
</if>
<if test="isDelete != null">
AND is_delete = #{isDelete}
</if>
</where>
ORDER BY id DESC
</select>
<select id="selectDdTaskById" resultMap="DdTaskResult">
SELECT * FROM dd_task WHERE id = #{id} AND is_delete = '0'
</select>
<insert id="insertDdTask" parameterType="DdTask">
INSERT INTO dd_task (
task_no, task_dtl, task_type, task_status, mid_status, mid, num, mid_type, source_name,
target_name, operator, approver, rcptim, rid, do_count, prf,
create_by, create_time, update_by, update_time, is_delete
) VALUES (
#{taskNo}, #{taskDtl}, #{taskType}, #{taskStatus}, #{midStatus}, #{mid}, #{num}, #{midType}, #{sourceName},
#{targetName}, #{operator}, #{approver}, #{rcptim}, #{rid}, #{doCount}, #{prf},
#{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{isDelete}
)
</insert>
<update id="updateDdTask" parameterType="DdTask">
UPDATE dd_task
SET task_no = #{taskNo},
task_dtl = #{taskDtl},
task_type = #{taskType},
task_status = #{taskStatus},
mid_status = #{midStatus},
mid = #{mid},
num = #{num},
mid_type = #{midType},
source_name = #{sourceName},
target_name = #{targetName},
operator = #{operator},
approver = #{approver},
rcptim = #{rcptim},
rid = #{rid},
do_count = #{doCount},
prf = #{prf},
update_by = #{updateBy},
update_time = #{updateTime},
is_delete = #{isDelete}
WHERE id = #{id}
</update>
<delete id="deleteDdTaskByIds">
DELETE FROM dd_task WHERE id IN
<foreach collection="array" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteDdTaskById">
DELETE FROM dd_task WHERE id = #{id}
</delete>
</mapper>

View File

@@ -0,0 +1,151 @@
<?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.zg.project.wisdom.mapper.MoveRecordMapper">
<!-- 实体字段映射 -->
<resultMap type="com.zg.project.wisdom.domain.MoveRecord" id="MoveRecordResult">
<result property="id" column="id"/>
<result property="rkId" column="rk_id"/>
<result property="entityId" column="entity_id"/>
<result property="fromCangku" column="from_cangku"/>
<result property="fromPcode" column="from_pcode"/>
<result property="fromTrayCode" column="from_tray_code"/>
<result property="toCangku" column="to_cangku"/>
<result property="toPcode" column="to_pcode"/>
<result property="toTrayCode" column="to_tray_code"/>
<result property="moveReason" column="move_reason"/>
<result property="movedBy" column="moved_by"/>
<result property="movedByName" column="moved_by_name"/>
<result property="movedAt" column="moved_at"/>
<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="isDelete" column="is_delete"/>
<result property="fromCangkuName" column="from_cangku_name"/>
<result property="toCangkuName" column="to_cangku_name"/>
<result property="xmNo" column="xm_no"/>
<result property="xmMs" column="xm_ms"/>
<result property="wlMs" column="wl_ms"/>
<result property="gysMc" column="gys_mc"/>
</resultMap>
<sql id="selectMoveRecordVo">
SELECT id, rk_id, entity_id, from_cangku, from_pcode, from_tray_code,
to_cangku, to_pcode, to_tray_code, move_reason, moved_by, moved_at,
create_by, create_time, update_by, update_time, is_delete
FROM move_record
</sql>
<insert id="insertMoveRecord" parameterType="com.zg.project.wisdom.domain.MoveRecord" useGeneratedKeys="true" keyProperty="id">
INSERT INTO move_record (
rk_id,
entity_id,
from_cangku,
from_pcode,
from_tray_code,
to_cangku,
to_pcode,
to_tray_code,
move_reason,
moved_by,
moved_at,
create_by,
create_time,
update_by,
update_time,
is_delete
) VALUES (
#{rkId},
#{entityId},
#{fromCangku},
#{fromPcode},
#{fromTrayCode},
#{toCangku},
#{toPcode},
#{toTrayCode},
#{moveReason},
#{movedBy},
#{movedAt},
#{createBy},
#{createTime},
#{updateBy},
#{updateTime},
#{isDelete}
)
</insert>
<!-- 分页列表 -->
<select id="selectMoveRecordList" resultMap="MoveRecordResult">
SELECT
mr.*,
su.user_name AS moved_by_name,
rk.xm_no,
rk.xm_ms,
rk.wl_ms,
rk.gys_mc,
wi1.warehouse_name AS from_cangku_name,
wi2.warehouse_name AS to_cangku_name
FROM move_record mr
LEFT JOIN sys_user su ON mr.moved_by = su.user_id
LEFT JOIN rk_info rk ON mr.rk_id = rk.id
LEFT JOIN warehouse_info wi1 ON mr.from_cangku = wi1.warehouse_code
LEFT JOIN warehouse_info wi2 ON mr.to_cangku = wi2.warehouse_code
<where>
<if test="entityId != null and entityId != ''">
AND mr.entity_id = #{entityId}
</if>
<if test="moveReason != null and moveReason != ''">
AND mr.move_reason LIKE concat('%', #{moveReason}, '%')
</if>
</where>
ORDER BY mr.create_time DESC
</select>
<!-- 查询详情 -->
<select id="selectMoveRecordById" parameterType="Long" resultMap="MoveRecordResult">
<include refid="selectMoveRecordVo"/>
WHERE id = #{id}
</select>
<!-- 修改 -->
<update id="updateMoveRecord" parameterType="MoveRecord">
UPDATE move_record
<set>
<if test="rkId != null">rk_id = #{rkId},</if>
<if test="entityId != null">entity_id = #{entityId},</if>
<if test="fromCangku != null">from_cangku = #{fromCangku},</if>
<if test="fromPcode != null">from_pcode = #{fromPcode},</if>
<if test="fromTrayCode != null">from_tray_code = #{fromTrayCode},</if>
<if test="toCangku != null">to_cangku = #{toCangku},</if>
<if test="toPcode != null">to_pcode = #{toPcode},</if>
<if test="toTrayCode != null">to_tray_code = #{toTrayCode},</if>
<if test="moveReason != null">move_reason = #{moveReason},</if>
<if test="movedBy != null">moved_by = #{movedBy},</if>
<if test="movedAt != null">moved_at = #{movedAt},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDelete != null">is_delete = #{isDelete}</if>
</set>
WHERE id = #{id}
</update>
<!-- 删除单个 -->
<delete id="deleteMoveRecordById" parameterType="Long">
DELETE FROM move_record WHERE id = #{id}
</delete>
<!-- 批量删除 -->
<delete id="deleteMoveRecordByIds" parameterType="Long">
DELETE FROM move_record
WHERE id IN
<foreach collection="array" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zg.project.wisdom.mapper.RkInfoMapper">
<resultMap type="RkInfo" id="RkInfoResult">
<result property="id" column="id" />
<result property="rkType" column="rk_type" />
@@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="rkTime" column="rk_time" />
<result property="lihuoY" column="lihuo_y" />
<result property="isChuku" column="is_chuku" />
<result property="isBorrowed" column="is_borrowed"/>
<result property="billNo" column="bill_no"/>
<result property="billNoCk" column="bill_no_ck"/>
<result property="rkTypeName" column="rk_type_name"/>
@@ -21,6 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="xj" column="xj" />
<result property="xmNo" column="xm_no" />
<result property="xmMs" column="xm_ms" />
<result property="xmNoCk" column="xm_no_ck"/>
<result property="xmMsCk" column="xm_ms_ck"/>
<result property="wlNo" column="wl_no" />
<result property="wlMs" column="wl_ms" />
<result property="gysNo" column="gys_no" />
@@ -43,12 +46,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="teamCode" column="team_code"/>
<result property="teamName" column="team_name"/>
<result property="lyTime" column="ly_time"/>
<result property="borrowTime" column="borrow_time"/>
<result property="returnTime" column="return_time"/>
<result property="ckRemark" column="ck_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="isDelete" column="is_delete" />
<result property="hasMoved" column="has_moved"/>
</resultMap>
<sql id="selectRkInfoVo">
@@ -59,12 +65,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ri.rk_type, st.type_name AS rk_type_name,
ri.wl_type, mt.type_name AS wl_type_name,
ri.cangku, wh.warehouse_name AS cangku_name,
ri.rk_time, ri.lihuo_y, ri.is_chuku, ri.remark,
ri.rk_time, ri.lihuo_y, ri.is_chuku, ri.is_borrowed,ri.remark,
ri.ck_lihuo_y, ri.ck_type, sot.type_name AS ck_type_name,
ri.team_code, ct.team_name,
ri.ck_remark,
ri.ly_time,
ri.xj, ri.xm_no, ri.xm_ms, ri.wl_no, ri.wl_ms,
ri.borrow_time, ri.return_time,
ri.xj, ri.xm_no, ri.xm_ms, ri.wl_no, ri.wl_ms,ri.xm_no_ck, ri.xm_ms_ck,
ri.gys_no, ri.gys_mc, ri.jh_amt, ri.ht_dj, ri.sap_no, ri.xh,
ri.jh_qty, ri.ht_qty, ri.dw, ri.real_qty,
ri.pcode, ri.pcode_id, ri.tray_code, ri.entity_id,
@@ -78,26 +85,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<insert id="batchInsertRkInfo" parameterType="java.util.List">
insert into rk_info (
INSERT INTO rk_info (
bill_no,
rk_type, wl_type, cangku, lihuo_y, rk_time,
wl_no, wl_ms, xm_no, xm_ms, xj, sap_no, gys_no, gys_mc,
wl_no, wl_ms, xm_no, xm_ms,
xm_no_ck, xm_ms_ck, xj, sap_no, gys_no, gys_mc,
jh_qty, ht_qty, jh_amt, ht_dj, dw,
borrow_time, return_time,
pcode, pcode_id, tray_code, real_qty, entity_id,
remark, is_chuku, is_delete, create_by, create_time
remark, is_chuku,is_borrowed, is_delete, create_by, create_time
)
values
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.billNo},
#{item.rkType}, #{item.wlType}, #{item.cangku}, #{item.lihuoY}, #{item.rkTime},
#{item.wlNo}, #{item.wlMs}, #{item.xmNo}, #{item.xmMs}, #{item.xj}, #{item.sapNo}, #{item.gysNo}, #{item.gysMc},
#{item.wlNo}, #{item.wlMs}, #{item.xmNo}, #{item.xmMs},
#{item.xmNoCk}, #{item.xmMsCk}, #{item.xj}, #{item.sapNo}, #{item.gysNo}, #{item.gysMc},
#{item.jhQty}, #{item.htQty}, #{item.jhAmt}, #{item.htDj}, #{item.dw},
#{item.borrowTime}, #{item.returnTime},
#{item.pcode}, #{item.pcodeId}, #{item.trayCode}, #{item.realQty}, #{item.entityId},
#{item.remark}, #{item.isChuku}, #{item.isDelete}, #{item.createBy}, #{item.createTime}
#{item.remark}, #{item.isChuku}, #{item.isBorrowed},#{item.isDelete}, #{item.createBy}, #{item.createTime}
)
</foreach>
</insert>
<!--还料入库-->
<insert id="insertRkInfo" parameterType="RkInfo" useGeneratedKeys="true" keyProperty="id">
INSERT INTO rk_info (
rk_type, wl_type, cangku, rk_time, lihuo_y,
is_chuku, remark, bill_no, xj, xm_no, xm_ms,is_borrowed,
wl_no, wl_ms, gys_no, gys_mc, jh_amt, ht_dj,
sap_no, xh, jh_qty, ht_qty, dw, real_qty,
pcode, tray_code, entity_id,
ck_lihuo_y, ck_type, team_code, ck_remark,
ly_time, bill_no_ck, has_moved,
create_by, create_time, update_by, update_time, is_delete
) VALUES (
#{rkType}, #{wlType}, #{cangku}, #{rkTime}, #{lihuoY},
#{isChuku}, #{remark}, #{billNo}, #{xj}, #{xmNo}, #{xmMs},#{isBorrowed},
#{wlNo}, #{wlMs}, #{gysNo}, #{gysMc}, #{jhAmt}, #{htDj},
#{sapNo}, #{xh}, #{jhQty}, #{htQty}, #{dw}, #{realQty},
#{pcode}, #{trayCode}, #{entityId},
#{ckLihuoY}, #{ckType}, #{teamCode}, #{ckRemark},
#{lyTime}, #{billNoCk}, #{hasMoved},
#{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{isDelete}
)
</insert>
<delete id="deleteByBillNo">
DELETE FROM rk_info WHERE bill_no = #{billNo}
@@ -113,6 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
team_code = NULL,
ly_time = NULL,
ck_remark = NULL,
is_borrowed = NULL,
update_time = NOW()
WHERE bill_no_ck = #{billNoCk}
</update>
@@ -120,7 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectRkInfoList" parameterType="RkInfo" resultMap="RkInfoResult">
<include refid="selectRkInfoVo"/>
<where>
<!-- and is_chuku = '0' -->
<if test="isChuku != null and isChuku != ''">
and is_chuku = #{isChuku}
</if>
@@ -141,7 +175,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="rkType != null and rkType != ''"> and rk_type = #{rkType}</if>
<if test="wlType != null and wlType != ''"> and wl_type = #{wlType}</if>
<if test="cangku != null and cangku != ''"> and cangku = #{cangku}</if>
<if test="rkTime != null "> and rk_time = #{rkTime}</if>
<if test="startTime != null">
<![CDATA[ and rk_time >= #{startTime} ]]>
</if>
<if test="endTime != null">
<![CDATA[ and rk_time <= #{endTime} ]]>
</if>
<if test="lihuoY != null and lihuoY != ''"> and lihuo_y = #{lihuoY}</if>
<if test="xj != null and xj != ''"> and xj = #{xj}</if>
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
@@ -161,6 +200,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="realQty != null "> and real_qty = #{realQty}</if>
<if test="pcode != null and pcode != ''"> and pcode = #{pcode}</if>
<if test="lyTime != null"> and ri.ly_time = #{lyTime}</if>
<if test="returnTime != null"> and ri.return_time = #{returnTime}</if>
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
<if test="entityId != null and entityId != ''"> and entity_id = #{entityId}</if>
<if test="ckType != null and ckType != ''"> and ck_type = #{ckType}</if>
@@ -200,7 +240,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="countOverdueStock" resultType="int">
SELECT COUNT(*) FROM rk_info
WHERE ri.is_delete = 0 AND ri.is_chuku = 0
WHERE is_delete = 0 AND is_chuku = 0
<![CDATA[
AND DATE(rk_time) <= DATE_SUB(CURDATE(), INTERVAL 20 DAY)
]]>
@@ -208,7 +248,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTopOverdueStock" resultMap="RkInfoResult">
SELECT * FROM rk_info
WHERE ri.is_delete = 0 AND ri.is_chuku = 0
WHERE is_delete = 0 AND is_chuku = 0
<![CDATA[
AND DATE(rk_time) <= DATE_SUB(CURDATE(), INTERVAL 20 DAY)
]]>
@@ -220,6 +260,84 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE bill_no = #{billNo} AND sap_no IS NOT NULL
</select>
<select id="getByPcodeIdList" parameterType="list" resultMap="RkInfoResult">
SELECT
ri.id, ri.rk_type, ri.wl_type, ri.cangku, ri.rk_time, ri.lihuo_y,
ri.is_chuku, ri.bill_no, ri.bill_no_ck,
ri.remark, ri.xj, ri.xm_no, ri.xm_ms, ri.wl_no, ri.wl_ms,ri.is_borrowed,
ri.gys_no, ri.gys_mc, ri.jh_amt, ri.ht_dj, ri.sap_no, ri.xh,
ri.jh_qty, ri.ht_qty, ri.dw, ri.real_qty,ri.borrow_time, ri.return_time,
ri.pcode, ri.pcode_id, ri.tray_code, ri.entity_id,
ri.ck_lihuo_y, ri.ck_type, ri.team_code, ri.ly_time, ri.ck_remark,
ri.create_by, ri.create_time, ri.update_by, ri.update_time, ri.is_delete
FROM rk_info ri
WHERE ri.is_delete = '0'
AND ri.pcode_id IN
<foreach collection="list" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="getMissedPcodeIds" parameterType="list" resultMap="RkInfoResult">
SELECT
id, rk_type, wl_type, cangku, rk_time, lihuo_y,
is_chuku, bill_no, bill_no_ck,
remark, xj, xm_no, xm_ms, wl_no, wl_ms,is_borrowed,
gys_no, gys_mc, jh_amt, ht_dj, sap_no, xh,
jh_qty, ht_qty, dw, real_qty,
pcode, pcode_id, tray_code, entity_id,
ck_lihuo_y, ck_type, team_code, ly_time, ck_remark,
create_by, create_time, update_by, update_time, is_delete
FROM rk_info
WHERE is_delete = '0'
<if test="list != null and list.size() > 0">
AND pcode_id NOT IN
<foreach collection="list" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</select>
<select id="existsByPcodeId" parameterType="string" resultType="java.lang.Integer">
SELECT COUNT(1)
FROM rk_info
WHERE is_delete = '0'
AND pcode_id = #{pcodeId}
</select>
<select id="countGetByWh" resultType="java.lang.Integer" parameterType="java.lang.String">
SELECT COUNT(1) FROM rk_info
WHERE is_delete = '0'
AND cangku = #{warehouse}
AND is_chuku = '0'
</select>
<select id="getUnscannedPcodeByWh" resultType="com.zg.project.Inventory.domain.vo.RkInfoMatchVO">
SELECT
r.pcode AS rkPcode,
r.real_qty AS realQty
FROM rk_info r
WHERE r.cangku = #{wh}
AND r.pcode_id NOT IN (
SELECT i.pcode
FROM inventory_match_scan i
WHERE i.task_id = #{taskId}
AND i.status = '0' <!-- 过滤掉扫描成功的 -->
)
ORDER BY r.create_time DESC
</select>
<select id="selectPcdeCntFromRkInfo" resultType="com.zg.project.Inventory.domain.vo.PcdeCntVO">
SELECT pcode AS pcde,
COUNT(*) AS cnt
FROM rk_info
WHERE pcode_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
GROUP BY pcode
</select>
<update id="updateRkInfo" parameterType="RkInfo">
update rk_info
<trim prefix="SET" suffixOverrides=",">
@@ -229,11 +347,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="rkTime != null">rk_time = #{rkTime},</if>
<if test="lihuoY != null">lihuo_y = #{lihuoY},</if>
<if test="isChuku != null">is_chuku = #{isChuku},</if>
<if test="isBorrowed != null">is_borrowed = #{isBorrowed},</if>
<if test="billNo != null">bill_no = #{billNo},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="xj != null">xj = #{xj},</if>
<if test="xmNo != null">xm_no = #{xmNo},</if>
<if test="xmMs != null">xm_ms = #{xmMs},</if>
<if test="xmNoCk != null">xm_no_ck = #{xmNoCk},</if>
<if test="xmMsCk != null">xm_ms_ck = #{xmMsCk},</if>
<if test="wlNo != null">wl_no = #{wlNo},</if>
<if test="wlMs != null">wl_ms = #{wlMs},</if>
<if test="gysNo != null">gys_no = #{gysNo},</if>
@@ -251,12 +372,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="entityId != null">entity_id = #{entityId},</if>
<if test="ckLihuoY != null">ck_lihuo_y = #{ckLihuoY},</if>
<if test="ckType != null">ck_type = #{ckType},</if>
<if test="sgdCode != null">sgd_code = #{sgdCode},</if>
<if test="sgdName != null">sgd_name = #{sgdName},</if>
<if test="lyTime != null">ly_time = #{lyTime},</if>
<if test="borrowTime != null">borrow_time = #{borrowTime},</if>
<if test="returnTime != null">return_time = #{returnTime},</if>
<if test="ckRemark != null">ck_remark = #{ckRemark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="hasMoved != null">has_moved = #{hasMoved},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
@@ -266,31 +386,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="deleteRkInfoById" parameterType="Long">
update rk_info
set is_delete = 1
<set>
is_delete = 1
</set>
where id = #{id}
</update>
<update id="deleteRkInfoByIds" parameterType="String">
<update id="deleteRkInfoByIds" parameterType="java.util.List">
update rk_info
set ri.is_delete = 1
set is_delete = 1
where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="updateById" parameterType="RkInfo">
<update id="updateById" parameterType="com.zg.project.wisdom.domain.RkInfo">
UPDATE rk_info
<set>
<if test="isChuku != null">is_chuku = #{isChuku},</if>
<if test="ckRemark != null">ck_remark = #{ckRemark},</if>
<if test="isBorrowed != null">is_borrowed = #{isBorrowed},</if>
<if test="billNoCk != null">bill_no_ck = #{billNoCk},</if>
<if test="ckType != null">ck_type = #{ckType},</if>
<if test="lyTime != null">ly_time = #{lyTime},</if>
<if test="ckLihuoY != null">ck_lihuo_y = #{ckLihuoY},</if>
<if test="teamCode != null">team_code = #{teamCode},</if>
<if test="billNoCk != null">bill_no_ck = #{billNoCk},</if>
<if test="ckRemark != null">ck_remark = #{ckRemark},</if>
<if test="xmNoCk != null">xm_no_ck = #{xmNoCk},</if>
<if test="xmMsCk != null">xm_ms_ck = #{xmMsCk},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime}</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="lyTime != null">ly_time = #{lyTime},</if>
<if test="borrowTime != null">borrow_time = #{borrowTime},</if>
<if test="returnTime != null">return_time = #{returnTime},</if>
</set>
WHERE id = #{id}
</update>