出入库逻辑修改
This commit is contained in:
@@ -22,6 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="htQty" column="ht_qty" />
|
||||
<result property="dw" column="dw" />
|
||||
<result property="status" column="status" />
|
||||
<result property="entityId" column="entity_id" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@@ -31,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGysJhVo">
|
||||
select id, index_no, xj, xm_no, xm_ms, wl_no, wl_ms, gys_no, gys_mc, jh_amt, ht_dj, sap_no, xh, jh_qty, ht_qty, dw, status, remark, create_by, create_time, update_by, update_time, is_delete from gys_jh
|
||||
select id, index_no, xj, xm_no, xm_ms, wl_no, wl_ms, gys_no, gys_mc, jh_amt, ht_dj, sap_no, xh, jh_qty, ht_qty, dw, status,entity_id, remark, create_by, create_time, update_by, update_time, is_delete from gys_jh
|
||||
</sql>
|
||||
|
||||
<select id="selectGysJhList" parameterType="GysJh" resultMap="GysJhResult">
|
||||
@@ -54,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="getBySapNo" parameterType="java.lang.String" resultMap="GysJhResult">
|
||||
<include refid="selectGysJhVo"/>
|
||||
WHERE sap_no = #{sapNo}
|
||||
AND status = '0'
|
||||
AND status != '1'
|
||||
</select>
|
||||
|
||||
<select id="existsByUniqueKeys" resultType="boolean">
|
||||
@@ -63,7 +64,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
WHERE sap_no = #{sapNo}
|
||||
AND xm_no = #{xmNo}
|
||||
AND wl_no = #{wlNo}
|
||||
AND is_delete = '0'
|
||||
AND is_delete != '1'
|
||||
</select>
|
||||
|
||||
<select id="selectByIds" resultMap="GysJhResult">
|
||||
SELECT * FROM gys_jh
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<insert id="insertGysJh" parameterType="GysJh" useGeneratedKeys="true" keyProperty="id">
|
||||
@@ -85,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="htQty != null">ht_qty,</if>
|
||||
<if test="dw != null">dw,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="entityId != null">entity_id,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
@@ -109,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="htQty != null">#{htQty},</if>
|
||||
<if test="dw != null">#{dw},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="entityId != null">#{entityId},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
@@ -137,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="htQty != null">ht_qty = #{htQty},</if>
|
||||
<if test="dw != null">dw = #{dw},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="entityId != null">entity_id = #{entityId},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
@@ -164,13 +176,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<update id="batchUpdateStatusByIds">
|
||||
UPDATE gys_jh
|
||||
SET status = '1'
|
||||
SET status = '2'
|
||||
WHERE id IN
|
||||
<foreach collection="idSet" item="id" open="(" separator="," close=")">
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="decreaseJhQtyById">
|
||||
UPDATE gys_jh
|
||||
SET jh_qty = jh_qty - #{realQty}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteGysJhById" parameterType="Long">
|
||||
delete from gys_jh where id = #{id}
|
||||
</delete>
|
||||
|
||||
@@ -166,10 +166,10 @@ 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>
|
||||
|
||||
<if test="keyword != null and keyword != ''">
|
||||
and (
|
||||
xm_no like concat('%', #{keyword}, '%')
|
||||
@@ -180,48 +180,112 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
or gys_mc like concat('%', #{keyword}, '%')
|
||||
or sap_no like concat('%', #{keyword}, '%')
|
||||
or bill_no like concat('%', #{keyword}, '%')
|
||||
or bill_no_ck like concat('%', #{keyword}, '%')
|
||||
or ck_type like concat('%', #{keyword}, '%')
|
||||
or pcode like concat('%', #{keyword}, '%')
|
||||
)
|
||||
</if>
|
||||
<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="rkType != null and rkType != ''">
|
||||
and rk_type like concat('%', #{rkType}, '%')
|
||||
</if>
|
||||
<if test="wlType != null and wlType != ''">
|
||||
and wl_type like concat('%', #{wlType}, '%')
|
||||
</if>
|
||||
<if test="cangku != null and cangku != ''">
|
||||
and cangku like concat('%', #{cangku}, '%')
|
||||
</if>
|
||||
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND ri.id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</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>
|
||||
<if test="xmNo != null and xmNo != ''"> and xm_no = #{xmNo}</if>
|
||||
<if test="xmMs != null and xmMs != ''"> and xm_ms = #{xmMs}</if>
|
||||
<if test="wlNo != null and wlNo != ''"> and wl_no = #{wlNo}</if>
|
||||
<if test="wlMs != null and wlMs != ''"> and wl_ms = #{wlMs}</if>
|
||||
<if test="gysNo != null and gysNo != ''"> and gys_no = #{gysNo}</if>
|
||||
<if test="gysMc != null and gysMc != ''"> and gys_mc = #{gysMc}</if>
|
||||
<if test="jhAmt != null "> and jh_amt = #{jhAmt}</if>
|
||||
<if test="htDj != null "> and ht_dj = #{htDj}</if>
|
||||
<if test="sapNo != null and sapNo != ''"> and sap_no = #{sapNo}</if>
|
||||
<if test="xh != null and xh != ''"> and xh = #{xh}</if>
|
||||
<if test="jhQty != null "> and jh_qty = #{jhQty}</if>
|
||||
<if test="htQty != null "> and ht_qty = #{htQty}</if>
|
||||
<if test="dw != null and dw != ''"> and dw = #{dw}</if>
|
||||
<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>
|
||||
|
||||
<if test="lihuoY != null and lihuoY != ''">
|
||||
and lihuo_y like concat('%', #{lihuoY}, '%')
|
||||
</if>
|
||||
<if test="xj != null and xj != ''">
|
||||
and xj like concat('%', #{xj}, '%')
|
||||
</if>
|
||||
<if test="billNo != null and billNo != ''">
|
||||
and bill_no like concat('%', #{billNo}, '%')
|
||||
</if>
|
||||
<if test="billNoCk != null and billNoCk != ''">
|
||||
and bill_no_ck like concat('%', #{billNoCk}, '%')
|
||||
</if>
|
||||
<if test="xmNo != null and xmNo != ''">
|
||||
and xm_no like concat('%', #{xmNo}, '%')
|
||||
</if>
|
||||
<if test="xmMs != null and xmMs != ''">
|
||||
and xm_ms like concat('%', #{xmMs}, '%')
|
||||
</if>
|
||||
<if test="wlNo != null and wlNo != ''">
|
||||
and wl_no like concat('%', #{wlNo}, '%')
|
||||
</if>
|
||||
<if test="wlMs != null and wlMs != ''">
|
||||
and wl_ms like concat('%', #{wlMs}, '%')
|
||||
</if>
|
||||
<if test="gysNo != null and gysNo != ''">
|
||||
and gys_no like concat('%', #{gysNo}, '%')
|
||||
</if>
|
||||
<if test="gysMc != null and gysMc != ''">
|
||||
and gys_mc like concat('%', #{gysMc}, '%')
|
||||
</if>
|
||||
|
||||
<if test="jhAmt != null">
|
||||
and jh_amt = #{jhAmt}
|
||||
</if>
|
||||
<if test="htDj != null">
|
||||
and ht_dj = #{htDj}
|
||||
</if>
|
||||
|
||||
<if test="sapNo != null and sapNo != ''">
|
||||
and sap_no like concat('%', #{sapNo}, '%')
|
||||
</if>
|
||||
<if test="xh != null and xh != ''">
|
||||
and xh like concat('%', #{xh}, '%')
|
||||
</if>
|
||||
<if test="jhQty != null">
|
||||
and jh_qty = #{jhQty}
|
||||
</if>
|
||||
<if test="htQty != null">
|
||||
and ht_qty = #{htQty}
|
||||
</if>
|
||||
<if test="dw != null and dw != ''">
|
||||
and dw like concat('%', #{dw}, '%')
|
||||
</if>
|
||||
<if test="realQty != null">
|
||||
and real_qty = #{realQty}
|
||||
</if>
|
||||
|
||||
<if test="pcode != null and pcode != ''">
|
||||
and pcode like concat('%', #{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 like concat('%', #{trayCode}, '%')
|
||||
</if>
|
||||
<if test="entityId != null and entityId != ''">
|
||||
and entity_id like concat('%', #{entityId}, '%')
|
||||
</if>
|
||||
<if test="ckType != null and ckType != ''">
|
||||
and ck_type like concat('%', #{ckType}, '%')
|
||||
</if>
|
||||
|
||||
<if test="isDelete != null and isDelete != ''">
|
||||
and ri.is_delete = #{isDelete}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user