You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
424 lines
26 KiB
XML
424 lines
26 KiB
XML
<?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.WmsOdsMateStorageNewsMapper">
|
|
|
|
<resultMap type="WmsOdsMateStorageNews" id="WmsOdsMateStorageNewsResult">
|
|
<result property="storageId" column="storage_id"/>
|
|
<result property="whCode" column="wh_code"/>
|
|
<result property="regionCode" column="region_code"/>
|
|
<result property="waCode" column="wa_code"/>
|
|
<result property="storageType" column="storage_type"/>
|
|
<result property="wlCode" column="wl_code"/>
|
|
<result property="materialCode" column="material_code"/>
|
|
<result property="materialDesc" column="material_desc"/>
|
|
<result property="amount" column="amount"/>
|
|
<result property="storageAmount" column="storage_amount"/>
|
|
<result property="occupyAmount" column="occupy_amount"/>
|
|
<result property="lpn" column="lpn"/>
|
|
<result property="productBatch" column="product_batch"/>
|
|
<result property="receiveDate" column="receive_date"/>
|
|
<result property="productDate" column="product_date"/>
|
|
<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"/>
|
|
<result property="wlName" column="wl_name"/>
|
|
<result property="poNo" column="poNo"/>
|
|
<result property="procureCode" column="procureCode"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectWmsOdsMateStorageNewsVo">
|
|
select storage_id, wh_code, region_code, wa_code, storage_type, wl_code, material_code, material_desc, amount, storage_amount, occupy_amount, lpn, product_batch, receive_date, product_date, 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, wl_name from wms_ods_mate_storage_news
|
|
</sql>
|
|
|
|
<select id="selectWmsOdsMateStorageNewsList" parameterType="WmsOdsMateStorageNews"
|
|
resultMap="WmsOdsMateStorageNewsResult">
|
|
<include refid="selectWmsOdsMateStorageNewsVo"/>
|
|
<where>
|
|
<if test="storageId != null and storageId != ''">and storage_id = #{storageId}</if>
|
|
<if test="whCode != null and whCode != ''">and wh_code = #{whCode}</if>
|
|
<if test="regionCode != null and regionCode != ''">and region_code = #{regionCode}</if>
|
|
<if test="waCode != null and waCode != ''">and wa_code = #{waCode}</if>
|
|
<if test="storageType != null and storageType != ''">and storage_type = #{storageType}</if>
|
|
<if test="wlCode != null and wlCode != ''">and wl_code = #{wlCode}</if>
|
|
<if test="materialCode != null and materialCode != ''">and material_code like concat('%', #{materialCode}, '%')</if>
|
|
<if test="materialDesc != null and materialDesc != ''">and material_desc = #{materialDesc}</if>
|
|
<if test="amount != null ">and amount = #{amount}</if>
|
|
<if test="storageAmount != null ">and storage_amount = #{storageAmount}</if>
|
|
<if test="occupyAmount != null ">and occupy_amount = #{occupyAmount}</if>
|
|
<if test="lpn != null and lpn != ''">and lpn = #{lpn}</if>
|
|
<if test="productBatch != null and productBatch != ''">and product_batch = #{productBatch}</if>
|
|
<if test="receiveDate != null ">and receive_date = #{receiveDate}</if>
|
|
<if test="productDate != null ">and product_date = #{productDate}</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>
|
|
<if test="wlName != null and wlName != ''">and wl_name like concat('%', #{wlName}, '%')</if>
|
|
</where>
|
|
order by gmt_create desc
|
|
</select>
|
|
|
|
|
|
<select id="selectWmsOdsMateStorageNewsNEWSList" parameterType="WmsOdsMateStorageNews"
|
|
resultMap="WmsOdsMateStorageNewsResult">
|
|
SELECT DISTINCT
|
|
wms_ods_mate_storage_news.storage_id,
|
|
wms_ods_mate_storage_news.wh_code,
|
|
wms_ods_mate_storage_news.region_code,
|
|
wms_ods_mate_storage_news.wa_code,
|
|
wms_ods_mate_storage_news.storage_type,
|
|
wms_ods_mate_storage_news.wl_code,
|
|
wms_ods_mate_storage_news.material_code,
|
|
wms_ods_mate_storage_news.material_desc,
|
|
wms_ods_mate_storage_news.amount,
|
|
wms_ods_mate_storage_news.storage_amount,
|
|
wms_ods_mate_storage_news.occupy_amount,
|
|
wms_ods_mate_storage_news.lpn,
|
|
wms_ods_mate_storage_news.product_batch,
|
|
wms_ods_mate_storage_news.receive_date,
|
|
wms_ods_mate_storage_news.product_date,
|
|
wms_ods_mate_storage_news.user_defined1,
|
|
wms_ods_mate_storage_news.user_defined2,
|
|
wms_ods_mate_storage_news.user_defined3,
|
|
wms_ods_mate_storage_news.user_defined4,
|
|
wms_ods_mate_storage_news.user_defined5,
|
|
wms_ods_mate_storage_news.user_defined6,
|
|
wms_ods_mate_storage_news.user_defined7,
|
|
wms_ods_mate_storage_news.user_defined8,
|
|
wms_ods_mate_storage_news.user_defined9,
|
|
wms_ods_mate_storage_news.user_defined10,
|
|
wms_ods_mate_storage_news.create_by,
|
|
wms_ods_mate_storage_news.gmt_create,
|
|
wms_ods_mate_storage_news.last_modified_by,
|
|
wms_ods_mate_storage_news.gmt_modified,
|
|
wms_ods_mate_storage_news.active_flag,
|
|
wms_ods_mate_storage_news.factory_code,
|
|
wms_ods_mate_storage_news.sap_factory_code,
|
|
wms_ods_mate_storage_news.wl_name ,
|
|
ods_procure_order.Procure_Code procureCode,
|
|
ods_procure_order.User_Defined5 poNo
|
|
FROM
|
|
wms_ods_mate_storage_news
|
|
LEFT JOIN ods_procure_order_card on ods_procure_order_card.User_Defined1=wms_ods_mate_storage_news.wl_code
|
|
LEFT JOIN ods_procure_order ON CAST(ods_procure_order.ID AS NVARCHAR) = ods_procure_order_card.User_Defined4
|
|
<where>
|
|
<if test="storageId != null and storageId != ''">and wms_ods_mate_storage_news.storage_id = #{storageId}</if>
|
|
<if test="whCode != null and whCode != ''">and wms_ods_mate_storage_news.wh_code = #{whCode}</if>
|
|
<if test="regionCode != null and regionCode != ''">and wms_ods_mate_storage_news.region_code = #{regionCode}</if>
|
|
<if test="waCode != null and waCode != ''">and wms_ods_mate_storage_news.wa_code = #{waCode}</if>
|
|
<if test="storageType != null and storageType != ''">and wms_ods_mate_storage_news.storage_type = #{storageType}</if>
|
|
<if test="wlCode != null and wlCode != ''">and wms_ods_mate_storage_news.wl_code = #{wlCode}</if>
|
|
<if test="materialCode != null and materialCode != ''">and wms_ods_mate_storage_news.material_code like concat('%', #{materialCode}, '%')</if>
|
|
<if test="materialDesc != null and materialDesc != ''">and wms_ods_mate_storage_news.material_desc = #{materialDesc}</if>
|
|
<if test="amount != null ">and wms_ods_mate_storage_news.amount = #{amount}</if>
|
|
<if test="storageAmount != null ">and wms_ods_mate_storage_news.storage_amount = #{storageAmount}</if>
|
|
<if test="occupyAmount != null ">and wms_ods_mate_storage_news.occupy_amount = #{occupyAmount}</if>
|
|
<if test="lpn != null and lpn != ''">and wms_ods_mate_storage_news.lpn = #{lpn}</if>
|
|
<if test="productBatch != null and productBatch != ''">and wms_ods_mate_storage_news.product_batch = #{productBatch}</if>
|
|
<if test="receiveDate != null ">and wms_ods_mate_storage_news.receive_date = #{receiveDate}</if>
|
|
<if test="productDate != null ">and wms_ods_mate_storage_news.product_date = #{productDate}</if>
|
|
<if test="userDefined1 != null and userDefined1 != ''">and wms_ods_mate_storage_news.user_defined1 = #{userDefined1}</if>
|
|
<if test="userDefined2 != null and userDefined2 != ''">and wms_ods_mate_storage_news.user_defined2 = #{userDefined2}</if>
|
|
<if test="userDefined3 != null and userDefined3 != ''">and wms_ods_mate_storage_news.user_defined3 = #{userDefined3}</if>
|
|
<if test="userDefined4 != null and userDefined4 != ''">and wms_ods_mate_storage_news.user_defined4 = #{userDefined4}</if>
|
|
<if test="userDefined5 != null and userDefined5 != ''">and wms_ods_mate_storage_news.user_defined5 = #{userDefined5}</if>
|
|
<if test="userDefined6 != null and userDefined6 != ''">and wms_ods_mate_storage_news.user_defined6 = #{userDefined6}</if>
|
|
<if test="userDefined7 != null and userDefined7 != ''">and wms_ods_mate_storage_news.user_defined7 = #{userDefined7}</if>
|
|
<if test="userDefined8 != null and userDefined8 != ''">and wms_ods_mate_storage_news.user_defined8 = #{userDefined8}</if>
|
|
<if test="userDefined9 != null and userDefined9 != ''">and wms_ods_mate_storage_news.user_defined9 = #{userDefined9}</if>
|
|
<if test="userDefined10 != null and userDefined10 != ''">and wms_ods_mate_storage_news.user_defined10 = #{userDefined10}</if>
|
|
<if test="gmtCreate != null ">and wms_ods_mate_storage_news.gmt_create = #{gmtCreate}</if>
|
|
<if test="lastModifiedBy != null and lastModifiedBy != ''">and wms_ods_mate_storage_news.last_modified_by = #{lastModifiedBy}</if>
|
|
<if test="gmtModified != null ">and wms_ods_mate_storage_news.gmt_modified = #{gmtModified}</if>
|
|
<if test="activeFlag != null and activeFlag != ''">and wms_ods_mate_storage_news.active_flag = #{activeFlag}</if>
|
|
<if test="factoryCode != null and factoryCode != ''">and wms_ods_mate_storage_news.factory_code = #{factoryCode}</if>
|
|
<if test="sapFactoryCode != null and sapFactoryCode != ''">and wms_ods_mate_storage_news.sap_factory_code = #{sapFactoryCode}</if>
|
|
<if test="wlName != null and wlName != ''">and wms_ods_mate_storage_news.wl_name like concat('%', #{wlName}, '%')</if>
|
|
</where>
|
|
order by wms_ods_mate_storage_news.gmt_create desc
|
|
</select>
|
|
<select id="selectWmsOdsMateStorageNewslsList" parameterType="WmsOdsMateStorageNews"
|
|
resultMap="WmsOdsMateStorageNewsResult">
|
|
|
|
SELECT
|
|
storage_id,
|
|
wh_code,
|
|
region_code,
|
|
wa_code,
|
|
storage_type,
|
|
wl_code,
|
|
material_code,
|
|
material_desc,
|
|
amount,
|
|
storage_amount,
|
|
occupy_amount,
|
|
lpn,
|
|
product_batch,
|
|
receive_date,
|
|
product_date,
|
|
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,
|
|
wl_name
|
|
FROM
|
|
wms_ods_mate_storage_news_copy1
|
|
<where>
|
|
<if test="storageId != null and storageId != ''">and storage_id = #{storageId}</if>
|
|
<if test="whCode != null and whCode != ''">and wh_code = #{whCode}</if>
|
|
<if test="regionCode != null and regionCode != ''">and region_code = #{regionCode}</if>
|
|
<if test="waCode != null and waCode != ''">and wa_code = #{waCode}</if>
|
|
<if test="storageType != null and storageType != ''">and storage_type = #{storageType}</if>
|
|
<if test="wlCode != null and wlCode != ''">and wl_code = #{wlCode}</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="amount != null ">and amount = #{amount}</if>
|
|
<if test="storageAmount != null ">and storage_amount = #{storageAmount}</if>
|
|
<if test="occupyAmount != null ">and occupy_amount = #{occupyAmount}</if>
|
|
<if test="lpn != null and lpn != ''">and lpn = #{lpn}</if>
|
|
<if test="productBatch != null and productBatch != ''">and product_batch = #{productBatch}</if>
|
|
<if test="receiveDate != null ">and receive_date = #{receiveDate}</if>
|
|
<if test="productDate != null ">and product_date = #{productDate}</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>
|
|
<if test="wlName != null and wlName != ''">and wl_name like concat('%', #{wlName}, '%')</if>
|
|
</where>
|
|
</select>
|
|
<select id="selectWmsOdsMateStorageNewsByStorageId" parameterType="String" resultMap="WmsOdsMateStorageNewsResult">
|
|
<include refid="selectWmsOdsMateStorageNewsVo"/>
|
|
where storage_id = #{storageId}
|
|
</select>
|
|
<select id="selectWmsOdsMateStorageNewsLSByStorageId" parameterType="String" resultMap="WmsOdsMateStorageNewsResult">
|
|
SELECT
|
|
storage_id,
|
|
wh_code,
|
|
region_code,
|
|
wa_code,
|
|
storage_type,
|
|
wl_code,
|
|
material_code,
|
|
material_desc,
|
|
amount,
|
|
storage_amount,
|
|
occupy_amount,
|
|
lpn,
|
|
product_batch,
|
|
receive_date,
|
|
product_date,
|
|
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,
|
|
wl_name
|
|
FROM
|
|
wms_ods_mate_storage_news_copy1
|
|
where storage_id = #{storageId}
|
|
</select>
|
|
<insert id="insertWmsOdsMateStorageNews" parameterType="WmsOdsMateStorageNews">
|
|
insert into wms_ods_mate_storage_news
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="storageId != null and storageId != ''">storage_id,</if>
|
|
<if test="whCode != null">wh_code,</if>
|
|
<if test="regionCode != null">region_code,</if>
|
|
<if test="waCode != null">wa_code,</if>
|
|
<if test="storageType != null">storage_type,</if>
|
|
<if test="wlCode != null">wl_code,</if>
|
|
<if test="materialCode != null">material_code,</if>
|
|
<if test="materialDesc != null">material_desc,</if>
|
|
<if test="amount != null">amount,</if>
|
|
<if test="storageAmount != null">storage_amount,</if>
|
|
<if test="occupyAmount != null">occupy_amount,</if>
|
|
<if test="lpn != null">lpn,</if>
|
|
<if test="productBatch != null">product_batch,</if>
|
|
<if test="receiveDate != null">receive_date,</if>
|
|
<if test="productDate != null">product_date,</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>
|
|
<if test="wlName != null">wl_name,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="storageId != null and storageId != ''">#{storageId},</if>
|
|
<if test="whCode != null">#{whCode},</if>
|
|
<if test="regionCode != null">#{regionCode},</if>
|
|
<if test="waCode != null">#{waCode},</if>
|
|
<if test="storageType != null">#{storageType},</if>
|
|
<if test="wlCode != null">#{wlCode},</if>
|
|
<if test="materialCode != null">#{materialCode},</if>
|
|
<if test="materialDesc != null">#{materialDesc},</if>
|
|
<if test="amount != null">#{amount},</if>
|
|
<if test="storageAmount != null">#{storageAmount},</if>
|
|
<if test="occupyAmount != null">#{occupyAmount},</if>
|
|
<if test="lpn != null">#{lpn},</if>
|
|
<if test="productBatch != null">#{productBatch},</if>
|
|
<if test="receiveDate != null">#{receiveDate},</if>
|
|
<if test="productDate != null">#{productDate},</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>
|
|
<if test="wlName != null">#{wlName},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateWmsOdsMateStorageNews" parameterType="WmsOdsMateStorageNews">
|
|
update wms_ods_mate_storage_news
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="whCode != null">wh_code = #{whCode},</if>
|
|
<if test="regionCode != null">region_code = #{regionCode},</if>
|
|
<if test="waCode != null">wa_code = #{waCode},</if>
|
|
<if test="storageType != null">storage_type = #{storageType},</if>
|
|
<if test="wlCode != null">wl_code = #{wlCode},</if>
|
|
<if test="materialCode != null">material_code = #{materialCode},</if>
|
|
<if test="materialDesc != null">material_desc = #{materialDesc},</if>
|
|
<if test="amount != null">amount = #{amount},</if>
|
|
<if test="storageAmount != null">storage_amount = #{storageAmount},</if>
|
|
<if test="occupyAmount != null">occupy_amount = #{occupyAmount},</if>
|
|
<if test="lpn != null">lpn = #{lpn},</if>
|
|
<if test="productBatch != null">product_batch = #{productBatch},</if>
|
|
<if test="receiveDate != null">receive_date = #{receiveDate},</if>
|
|
<if test="productDate != null">product_date = #{productDate},</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>
|
|
<if test="wlName != null">wl_name = #{wlName},</if>
|
|
</trim>
|
|
where storage_id = #{storageId}
|
|
</update>
|
|
|
|
<delete id="deleteWmsOdsMateStorageNewsByStorageId" parameterType="String">
|
|
delete from wms_ods_mate_storage_news where storage_id = #{storageId}
|
|
</delete>
|
|
|
|
<delete id="deleteWmsOdsMateStorageNewsByStorageIds" parameterType="String">
|
|
delete from wms_ods_mate_storage_news where storage_id in
|
|
<foreach item="storageId" collection="array" open="(" separator="," close=")">
|
|
#{storageId}
|
|
</foreach>
|
|
</delete>
|
|
<select id="selectByWhCodeAndMate" resultMap="WmsOdsMateStorageNewsResult">
|
|
select storage_id, wh_code, region_code, wa_code, storage_type, wl_code, material_code, material_desc, amount, storage_amount, occupy_amount, lpn, product_batch, receive_date, product_date, 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, wl_name from wms_ods_mate_storage_news
|
|
where wh_code=#{whCode} and wl_code=#{wlCode} and wa_code=#{waCode} and material_code=#{materialCode}
|
|
<if test="userDefined2 != null">and user_defined2 = #{userDefined2}</if>
|
|
</select>
|
|
<select id="selectBaseProductByCode" resultMap="WmsOdsMateStorageNewsResult">
|
|
select DISTINCT material_desc,user_defined1
|
|
from wms_ods_mate_storage_news where material_code=#{sku}
|
|
</select>
|
|
<update id="updateWmsOdsMateStorageNewsUpdateStorageAmount" >
|
|
update wms_ods_mate_storage_news
|
|
set storage_amount = ISNULL(storage_amount, 0) - #{storageAmount},
|
|
gmt_modified=GETDATE()
|
|
where wh_code=#{whCode} and wl_code=#{wlCode} and wa_code=#{waCode} and material_code=#{materialCode}
|
|
</update>
|
|
</mapper>
|