|
|
|
<?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.op.wms.mapper.WmsRawOrderInSnMapper">
|
|
|
|
|
|
|
|
<resultMap type="WmsRawOrderInSn" id="WmsRawOrderInSnResult">
|
|
|
|
<result property="rawOrderInSnId" column="raw_order_in_sn_id"/>
|
|
|
|
<result property="whCode" column="wh_code"/>
|
|
|
|
<result property="waCode" column="wa_code"/>
|
|
|
|
<result property="wlCode" column="wl_code"/>
|
|
|
|
<result property="orderNo" column="order_no"/>
|
|
|
|
<result property="poNo" column="po_no"/>
|
|
|
|
<result property="poLine" column="po_line"/>
|
|
|
|
<result property="materialCode" column="material_code"/>
|
|
|
|
<result property="materialDesc" column="material_desc"/>
|
|
|
|
<result property="sn" column="sn"/>
|
|
|
|
<result property="amount" column="amount"/>
|
|
|
|
<result property="userDefined1" column="user_defined1"/>
|
|
|
|
<result property="userDefined2" column="user_defined2"/>
|
|
|
|
<result property="userDefined3" column="user_defined3"/>
|
|
|
|
<result property="userDefined4" column="user_defined4"/>
|
|
|
|
<result property="userDefined5" column="user_defined5"/>
|
|
|
|
<result property="userDefined6" column="user_defined6"/>
|
|
|
|
<result property="userDefined7" column="user_defined7"/>
|
|
|
|
<result property="userDefined8" column="user_defined8"/>
|
|
|
|
<result property="userDefined9" column="user_defined9"/>
|
|
|
|
<result property="userDefined10" column="user_defined10"/>
|
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
|
<result property="gmtCreate" column="gmt_create"/>
|
|
|
|
<result property="lastModifiedBy" column="last_modified_by"/>
|
|
|
|
<result property="gmtModified" column="gmt_modified"/>
|
|
|
|
<result property="activeFlag" column="active_flag"/>
|
|
|
|
<result property="factoryCode" column="factory_code"/>
|
|
|
|
<result property="sapFactoryCode" column="sap_factory_code"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectWmsRawOrderInSnVo">
|
|
|
|
select raw_order_in_sn_id, wh_code, wa_code, wl_code, order_no, po_no, po_line, material_code, material_desc, sn, amount, user_defined1, user_defined2, user_defined3, user_defined4, user_defined5, user_defined6, user_defined7, user_defined8, user_defined9, user_defined10, create_by, gmt_create, last_modified_by, gmt_modified, active_flag, factory_code, sap_factory_code from wms_raw_order_in_sn
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectWmsRawOrderInSnList" parameterType="WmsRawOrderInSn" resultMap="WmsRawOrderInSnResult">
|
|
|
|
<include refid="selectWmsRawOrderInSnVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="rawOrderInSnId != null and rawOrderInSnId != ''">and raw_order_in_sn_id = #{rawOrderInSnId}</if>
|
|
|
|
<if test="whCode != null and whCode != ''">and wh_code = #{whCode}</if>
|
|
|
|
<if test="waCode != null and waCode != ''">and wa_code = #{waCode}</if>
|
|
|
|
<if test="wlCode != null and wlCode != ''">and wl_code = #{wlCode}</if>
|
|
|
|
<if test="orderNo != null and orderNo != ''">and order_no = #{orderNo}</if>
|
|
|
|
<if test="poNo != null and poNo != ''">and po_no = #{poNo}</if>
|
|
|
|
<if test="poLine != null and poLine != ''">and po_line = #{poLine}</if>
|
|
|
|
<if test="materialCode != null and materialCode != ''">and material_code = #{materialCode}</if>
|
|
|
|
<if test="materialDesc != null and materialDesc != ''">and material_desc = #{materialDesc}</if>
|
|
|
|
<if test="sn != null and sn != ''">and sn = #{sn}</if>
|
|
|
|
<if test="amount != null ">and amount = #{amount}</if>
|
|
|
|
<if test="userDefined1 != null and userDefined1 != ''">and user_defined1 = #{userDefined1}</if>
|
|
|
|
<if test="userDefined2 != null and userDefined2 != ''">and user_defined2 = #{userDefined2}</if>
|
|
|
|
<if test="userDefined3 != null and userDefined3 != ''">and user_defined3 = #{userDefined3}</if>
|
|
|
|
<if test="userDefined4 != null and userDefined4 != ''">and user_defined4 = #{userDefined4}</if>
|
|
|
|
<if test="userDefined5 != null and userDefined5 != ''">and user_defined5 = #{userDefined5}</if>
|
|
|
|
<if test="userDefined6 != null and userDefined6 != ''">and user_defined6 = #{userDefined6}</if>
|
|
|
|
<if test="userDefined7 != null and userDefined7 != ''">and user_defined7 = #{userDefined7}</if>
|
|
|
|
<if test="userDefined8 != null and userDefined8 != ''">and user_defined8 = #{userDefined8}</if>
|
|
|
|
<if test="userDefined9 != null and userDefined9 != ''">and user_defined9 = #{userDefined9}</if>
|
|
|
|
<if test="userDefined10 != null and userDefined10 != ''">and user_defined10 = #{userDefined10}</if>
|
|
|
|
<if test="gmtCreate != null ">and gmt_create = #{gmtCreate}</if>
|
|
|
|
<if test="lastModifiedBy != null and lastModifiedBy != ''">and last_modified_by = #{lastModifiedBy}</if>
|
|
|
|
<if test="gmtModified != null ">and gmt_modified = #{gmtModified}</if>
|
|
|
|
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if>
|
|
|
|
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
|
|
|
|
<if test="sapFactoryCode != null and sapFactoryCode != ''">and sap_factory_code = #{sapFactoryCode}</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectWmsRawOrderInSnByRawOrderInSnId" parameterType="Long" resultMap="WmsRawOrderInSnResult">
|
|
|
|
<include refid="selectWmsRawOrderInSnVo"/>
|
|
|
|
where raw_order_in_sn_id = #{rawOrderInSnId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertWmsRawOrderInSn" parameterType="WmsRawOrderInSn" useGeneratedKeys="true"
|
|
|
|
keyProperty="rawOrderInSnId">
|
|
|
|
insert into wms_raw_order_in_sn
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="whCode != null">raw_order_in_sn_id,</if>
|
|
|
|
<if test="whCode != null">wh_code,</if>
|
|
|
|
<if test="waCode != null">wa_code,</if>
|
|
|
|
<if test="wlCode != null">wl_code,</if>
|
|
|
|
<if test="orderNo != null">order_no,</if>
|
|
|
|
<if test="poNo != null">po_no,</if>
|
|
|
|
<if test="poLine != null">po_line,</if>
|
|
|
|
<if test="materialCode != null">material_code,</if>
|
|
|
|
<if test="materialDesc != null">material_desc,</if>
|
|
|
|
<if test="sn != null">sn,</if>
|
|
|
|
<if test="amount != null">amount,</if>
|
|
|
|
<if test="userDefined1 != null">user_defined1,</if>
|
|
|
|
<if test="userDefined2 != null">user_defined2,</if>
|
|
|
|
<if test="userDefined3 != null">user_defined3,</if>
|
|
|
|
<if test="userDefined4 != null">user_defined4,</if>
|
|
|
|
<if test="userDefined5 != null">user_defined5,</if>
|
|
|
|
<if test="userDefined6 != null">user_defined6,</if>
|
|
|
|
<if test="userDefined7 != null">user_defined7,</if>
|
|
|
|
<if test="userDefined8 != null">user_defined8,</if>
|
|
|
|
<if test="userDefined9 != null">user_defined9,</if>
|
|
|
|
<if test="userDefined10 != null">user_defined10,</if>
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
<if test="gmtCreate != null">gmt_create,</if>
|
|
|
|
<if test="lastModifiedBy != null">last_modified_by,</if>
|
|
|
|
<if test="gmtModified != null">gmt_modified,</if>
|
|
|
|
<if test="activeFlag != null">active_flag,</if>
|
|
|
|
<if test="factoryCode != null">factory_code,</if>
|
|
|
|
<if test="sapFactoryCode != null">sap_factory_code,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="whCode != null">#{rawOrderInSnId},</if>
|
|
|
|
<if test="whCode != null">#{whCode},</if>
|
|
|
|
<if test="waCode != null">#{waCode},</if>
|
|
|
|
<if test="wlCode != null">#{wlCode},</if>
|
|
|
|
<if test="orderNo != null">#{orderNo},</if>
|
|
|
|
<if test="poNo != null">#{poNo},</if>
|
|
|
|
<if test="poLine != null">#{poLine},</if>
|
|
|
|
<if test="materialCode != null">#{materialCode},</if>
|
|
|
|
<if test="materialDesc != null">#{materialDesc},</if>
|
|
|
|
<if test="sn != null">#{sn},</if>
|
|
|
|
<if test="amount != null">#{amount},</if>
|
|
|
|
<if test="userDefined1 != null">#{userDefined1},</if>
|
|
|
|
<if test="userDefined2 != null">#{userDefined2},</if>
|
|
|
|
<if test="userDefined3 != null">#{userDefined3},</if>
|
|
|
|
<if test="userDefined4 != null">#{userDefined4},</if>
|
|
|
|
<if test="userDefined5 != null">#{userDefined5},</if>
|
|
|
|
<if test="userDefined6 != null">#{userDefined6},</if>
|
|
|
|
<if test="userDefined7 != null">#{userDefined7},</if>
|
|
|
|
<if test="userDefined8 != null">#{userDefined8},</if>
|
|
|
|
<if test="userDefined9 != null">#{userDefined9},</if>
|
|
|
|
<if test="userDefined10 != null">#{userDefined10},</if>
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
<if test="gmtCreate != null">#{gmtCreate},</if>
|
|
|
|
<if test="lastModifiedBy != null">#{lastModifiedBy},</if>
|
|
|
|
<if test="gmtModified != null">#{gmtModified},</if>
|
|
|
|
<if test="activeFlag != null">#{activeFlag},</if>
|
|
|
|
<if test="factoryCode != null">#{factoryCode},</if>
|
|
|
|
<if test="sapFactoryCode != null">#{sapFactoryCode},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateWmsRawOrderInSn" parameterType="WmsRawOrderInSn">
|
|
|
|
update wms_raw_order_in_sn
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="whCode != null">wh_code = #{whCode},</if>
|
|
|
|
<if test="waCode != null">wa_code = #{waCode},</if>
|
|
|
|
<if test="wlCode != null">wl_code = #{wlCode},</if>
|
|
|
|
<if test="orderNo != null">order_no = #{orderNo},</if>
|
|
|
|
<if test="poNo != null">po_no = #{poNo},</if>
|
|
|
|
<if test="poLine != null">po_line = #{poLine},</if>
|
|
|
|
<if test="materialCode != null">material_code = #{materialCode},</if>
|
|
|
|
<if test="materialDesc != null">material_desc = #{materialDesc},</if>
|
|
|
|
<if test="sn != null">sn = #{sn},</if>
|
|
|
|
<if test="amount != null">amount = #{amount},</if>
|
|
|
|
<if test="userDefined1 != null">user_defined1 = #{userDefined1},</if>
|
|
|
|
<if test="userDefined2 != null">user_defined2 = #{userDefined2},</if>
|
|
|
|
<if test="userDefined3 != null">user_defined3 = #{userDefined3},</if>
|
|
|
|
<if test="userDefined4 != null">user_defined4 = #{userDefined4},</if>
|
|
|
|
<if test="userDefined5 != null">user_defined5 = #{userDefined5},</if>
|
|
|
|
<if test="userDefined6 != null">user_defined6 = #{userDefined6},</if>
|
|
|
|
<if test="userDefined7 != null">user_defined7 = #{userDefined7},</if>
|
|
|
|
<if test="userDefined8 != null">user_defined8 = #{userDefined8},</if>
|
|
|
|
<if test="userDefined9 != null">user_defined9 = #{userDefined9},</if>
|
|
|
|
<if test="userDefined10 != null">user_defined10 = #{userDefined10},</if>
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
|
|
|
<if test="lastModifiedBy != null">last_modified_by = #{lastModifiedBy},</if>
|
|
|
|
<if test="gmtModified != null">gmt_modified = #{gmtModified},</if>
|
|
|
|
<if test="activeFlag != null">active_flag = #{activeFlag},</if>
|
|
|
|
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
|
|
|
<if test="sapFactoryCode != null">sap_factory_code = #{sapFactoryCode},</if>
|
|
|
|
</trim>
|
|
|
|
where raw_order_in_sn_id = #{rawOrderInSnId}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteWmsRawOrderInSnByRawOrderInSnId" parameterType="Long">
|
|
|
|
delete from wms_raw_order_in_sn where raw_order_in_sn_id = #{rawOrderInSnId}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteWmsRawOrderInSnByRawOrderInSnIds" parameterType="String">
|
|
|
|
delete from wms_raw_order_in_sn where raw_order_in_sn_id in
|
|
|
|
<foreach item="rawOrderInSnId" collection="array" open="(" separator="," close=")">
|
|
|
|
#{rawOrderInSnId}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
<select id="selectwmsRfidNo" parameterType="com.op.wms.domain.WmsToWCSDTO" resultMap="WmsRawOrderInSnResult">
|
|
|
|
<include refid="selectWmsRawOrderInSnVo"/>
|
|
|
|
where
|
|
|
|
sn=#{rfidNo}
|
|
|
|
and
|
|
|
|
active_flag='1'
|
|
|
|
and user_defined1='1'
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<update id="updateU1Byid">
|
|
|
|
update wms_raw_order_in_sn
|
|
|
|
set
|
|
|
|
user_defined1 = '2'
|
|
|
|
where raw_order_in_sn_id=#{rawOrderInSnId}
|
|
|
|
</update>
|
|
|
|
<select id="selecPurchaseOrderdeliPdaList" parameterType="com.op.wms.domain.OdsProcureOrder" resultMap="WmsRawOrderInSnResult">
|
|
|
|
SELECT
|
|
|
|
wh_code,
|
|
|
|
po_no,
|
|
|
|
material_code,
|
|
|
|
material_desc,
|
|
|
|
sum ( amount ),
|
|
|
|
user_defined2,
|
|
|
|
user_defined3
|
|
|
|
FROM
|
|
|
|
wms_raw_order_in_sn
|
|
|
|
WHERE
|
|
|
|
user_defined5 = ${receiptNoCode}
|
|
|
|
AND active_flag='1'
|
|
|
|
GROUP BY
|
|
|
|
wh_code,
|
|
|
|
po_no,
|
|
|
|
material_code,
|
|
|
|
material_desc,
|
|
|
|
user_defined2,
|
|
|
|
user_defined3,
|
|
|
|
user_defined4;
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</mapper>
|