@ -16,6 +16,7 @@
<result property= "barCode" column= "bar_code" />
<result property= "barCode" column= "bar_code" />
<result property= "amount" column= "amount" />
<result property= "amount" column= "amount" />
<result property= "batchNumber" column= "batch_number" />
<result property= "batchNumber" column= "batch_number" />
<result property= "userDefined1" column= "user_defined1" />
<result property= "userDefined2" column= "user_defined2" />
<result property= "userDefined2" column= "user_defined2" />
<result property= "userDefined3" column= "user_defined3" />
<result property= "userDefined3" column= "user_defined3" />
<result property= "userDefined4" column= "user_defined4" />
<result property= "userDefined4" column= "user_defined4" />
@ -267,7 +268,67 @@
<if test= "sapFactoryCode != null" > #{sapFactoryCode},</if>
<if test= "sapFactoryCode != null" > #{sapFactoryCode},</if>
</trim>
</trim>
</insert>
</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 id= "updateWmsFpStorageNewsSn" parameterType= "WmsFpStorageNewsSn" >
update wms_fp_storage_news_sn
update wms_fp_storage_news_sn
<trim prefix= "SET" suffixOverrides= "," >
<trim prefix= "SET" suffixOverrides= "," >
@ -312,9 +373,10 @@
</foreach>
</foreach>
</delete>
</delete>
<update id= "updateWmsFpStorageNewsSnOut" >
<update id= "updateWmsFpStorageNewsSnOut" >
update wms_fp_storage_news_sn
UPDATE wms_fp_storage_news_sn
set user_defined2 = #{userDefined2} + 1
SET user_defined2 = COALESCE(user_defined2, 0) + #{userDefined2} -- 如果user_defined2为NULL, 则先将其设置为0再进行加法
where storage_id=#{storageId} and active_flag='1'
WHERE storage_id = #{storageId}
AND active_flag = '1';
</update>
</update>
<select id= "selectwmsFpStorageNews" resultType= "java.lang.String" >
<select id= "selectwmsFpStorageNews" resultType= "java.lang.String" >
select DISTINCT user_defined1 from wms_fp_storage_news where product_code=#{productCode} and active_flag='1'
select DISTINCT user_defined1 from wms_fp_storage_news where product_code=#{productCode} and active_flag='1'
@ -437,5 +499,67 @@
</trim>
</trim>
</foreach>
</foreach>
</insert>
</insert>
<select id= "selectWmsFpStorageNewsSnSTList" >
SELECT
storage_id,
wh_code,
wa_code,
wl_code,
order_no,
product_name,
product_code,
sn,
bar_code,
COALESCE(amount, 0) ,
batch_number,
COALESCE(user_defined1, 0) AS user_defined1, -- 如果为空则返回0
COALESCE(user_defined2, 0) AS user_defined2, -- 如果为空则返回0
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_fp_storage_news_sn
<where >
<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= "productName != null and productName != ''" > and product_name like concat('%', #{productName},
'%')
</if>
<if test= "productCode != null and productCode != ''" > and product_code like concat('%',#{productCode} ,
'%')</if>
<if test= "sn != null and sn != ''" > and sn = #{sn}</if>
<if test= "barCode != null and barCode != ''" > and bar_code = #{barCode}</if>
<if test= "amount != null " > and amount = #{amount}</if>
<if test= "batchNumber != null and batchNumber != ''" > and batch_number = #{batchNumber}</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>
</mapper>
</mapper>