|
|
|
@ -268,7 +268,67 @@
|
|
|
|
|
<if test="sapFactoryCode != null">#{sapFactoryCode},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<insert id="insertWmsFpStorageNewsSnRecords" parameterType="WmsFpStorageNewsSn">
|
|
|
|
|
insert into wms_fp_storage_news_sn_records
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="storageId != null">storage_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="productName != null">product_name,</if>
|
|
|
|
|
<if test="productCode != null">product_code,</if>
|
|
|
|
|
<if test="sn != null">sn,</if>
|
|
|
|
|
<if test="barCode != null">bar_code,</if>
|
|
|
|
|
<if test="amount != null">amount,</if>
|
|
|
|
|
<if test="batchNumber != null">batch_number,</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="storageId != null">#{storageId},</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="productName != null">#{productName},</if>
|
|
|
|
|
<if test="productCode != null">#{productCode},</if>
|
|
|
|
|
<if test="sn != null">#{sn},</if>
|
|
|
|
|
<if test="barCode != null">#{barCode},</if>
|
|
|
|
|
<if test="amount != null">#{amount},</if>
|
|
|
|
|
<if test="batchNumber != null">#{batchNumber},</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="updateWmsFpStorageNewsSn" parameterType="WmsFpStorageNewsSn">
|
|
|
|
|
update wms_fp_storage_news_sn
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
@ -313,9 +373,10 @@
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
<update id="updateWmsFpStorageNewsSnOut">
|
|
|
|
|
update wms_fp_storage_news_sn
|
|
|
|
|
set user_defined2 =user_defined2+ #{userDefined2}
|
|
|
|
|
where storage_id=#{storageId} and active_flag='1'
|
|
|
|
|
UPDATE wms_fp_storage_news_sn
|
|
|
|
|
SET user_defined2 = COALESCE(user_defined2, 0) + #{userDefined2} -- 如果user_defined2为NULL,则先将其设置为0再进行加法
|
|
|
|
|
WHERE storage_id = #{storageId}
|
|
|
|
|
AND active_flag = '1';
|
|
|
|
|
</update>
|
|
|
|
|
<select id="selectwmsFpStorageNews" resultType="java.lang.String">
|
|
|
|
|
select DISTINCT user_defined1 from wms_fp_storage_news where product_code=#{productCode} and active_flag='1'
|
|
|
|
@ -449,7 +510,7 @@
|
|
|
|
|
product_code,
|
|
|
|
|
sn,
|
|
|
|
|
bar_code,
|
|
|
|
|
amount,
|
|
|
|
|
COALESCE(amount, 0) ,
|
|
|
|
|
batch_number,
|
|
|
|
|
COALESCE(user_defined1, 0) AS user_defined1, -- 如果为空则返回0
|
|
|
|
|
COALESCE(user_defined2, 0) AS user_defined2, -- 如果为空则返回0
|
|
|
|
|