审核逻辑修改前项目保存
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user