|
|
|
@ -394,6 +394,91 @@
|
|
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertWmsSellOutEmbryoOrder" parameterType="WmsSellOutEmbryo">
|
|
|
|
|
insert into wms_sell_out_embryo_order
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">id,</if>
|
|
|
|
|
<if test="deliveryOrder != null">delivery_order,</if>
|
|
|
|
|
<if test="itemNumber != null">Item_number,</if>
|
|
|
|
|
<if test="factoryCode != null">factory_code,</if>
|
|
|
|
|
<if test="whCode != null">wh_code,</if>
|
|
|
|
|
<if test="waCode != null">wa_code,</if>
|
|
|
|
|
<if test="wlCode != null">wl_code,</if>
|
|
|
|
|
<if test="deliveryPlace != null">delivery_place,</if>
|
|
|
|
|
<if test="productName != null">product_name,</if>
|
|
|
|
|
<if test="productCode != null">product_code,</if>
|
|
|
|
|
<if test="productSort != null">product_sort,</if>
|
|
|
|
|
<if test="specification != null">specification,</if>
|
|
|
|
|
<if test="unitOfMeasure != null">unit_of_measure,</if>
|
|
|
|
|
<if test="lotNumber != null">lot_number,</if>
|
|
|
|
|
<if test="planQuantity != null">plan_quantity,</if>
|
|
|
|
|
<if test="outQuantity != null">out_quantity,</if>
|
|
|
|
|
<if test="status != null">status,</if>
|
|
|
|
|
<if test="sapStatus != null">SAP_status,</if>
|
|
|
|
|
<if test="sapProof != null">SAP_proof,</if>
|
|
|
|
|
<if test="sapMessage != null">SAP_message,</if>
|
|
|
|
|
<if test="outDate != null">out_date,</if>
|
|
|
|
|
<if test="attr1 != null">attr1,</if>
|
|
|
|
|
<if test="attr2 != null">attr2,</if>
|
|
|
|
|
<if test="attr3 != null">attr3,</if>
|
|
|
|
|
<if test="attr4 != null">attr4,</if>
|
|
|
|
|
<if test="attr5 != null">attr5,</if>
|
|
|
|
|
<if test="attr6 != null">attr6,</if>
|
|
|
|
|
<if test="attr7 != null">attr7,</if>
|
|
|
|
|
<if test="attr8 != null">attr8,</if>
|
|
|
|
|
<if test="attr9 != null">attr9,</if>
|
|
|
|
|
<if test="attr10 != null">attr10,</if>
|
|
|
|
|
<if test="attr11 != null">attr11,</if>
|
|
|
|
|
<if test="attr12 != null">attr12,</if>
|
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
<if test="remark != null">remark,</if>
|
|
|
|
|
<if test="stockOrder != null">stock_order,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">#{id},</if>
|
|
|
|
|
<if test="deliveryOrder != null">#{deliveryOrder},</if>
|
|
|
|
|
<if test="itemNumber != null">#{itemNumber},</if>
|
|
|
|
|
<if test="factoryCode != null">#{factoryCode},</if>
|
|
|
|
|
<if test="whCode != null">#{whCode},</if>
|
|
|
|
|
<if test="waCode != null">#{waCode},</if>
|
|
|
|
|
<if test="wlCode != null">#{wlCode},</if>
|
|
|
|
|
<if test="deliveryPlace != null">#{deliveryPlace},</if>
|
|
|
|
|
<if test="productName != null">#{productName},</if>
|
|
|
|
|
<if test="productCode != null">#{productCode},</if>
|
|
|
|
|
<if test="productSort != null">#{productSort},</if>
|
|
|
|
|
<if test="specification != null">#{specification},</if>
|
|
|
|
|
<if test="unitOfMeasure != null">#{unitOfMeasure},</if>
|
|
|
|
|
<if test="lotNumber != null">#{lotNumber},</if>
|
|
|
|
|
<if test="planQuantity != null">#{planQuantity},</if>
|
|
|
|
|
<if test="outQuantity != null">#{outQuantity},</if>
|
|
|
|
|
<if test="status != null">#{status},</if>
|
|
|
|
|
<if test="sapStatus != null">#{sapStatus},</if>
|
|
|
|
|
<if test="sapProof != null">#{sapProof},</if>
|
|
|
|
|
<if test="sapMessage != null">#{sapMessage},</if>
|
|
|
|
|
<if test="outDate != null">#{outDate},</if>
|
|
|
|
|
<if test="attr1 != null">#{attr1},</if>
|
|
|
|
|
<if test="attr2 != null">#{attr2},</if>
|
|
|
|
|
<if test="attr3 != null">#{attr3},</if>
|
|
|
|
|
<if test="attr4 != null">#{attr4},</if>
|
|
|
|
|
<if test="attr5 != null">#{attr5},</if>
|
|
|
|
|
<if test="attr6 != null">#{attr6},</if>
|
|
|
|
|
<if test="attr7 != null">#{attr7},</if>
|
|
|
|
|
<if test="attr8 != null">#{attr8},</if>
|
|
|
|
|
<if test="attr9 != null">#{attr9},</if>
|
|
|
|
|
<if test="attr10 != null">#{attr10},</if>
|
|
|
|
|
<if test="attr11 != null">#{attr11},</if>
|
|
|
|
|
<if test="attr12 != null">#{attr12},</if>
|
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
|
<if test="stockOrder != null">#{stockOrder},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertWmsSellOutEmbryoSpecial" parameterType="WmsSellOutEmbryo">
|
|
|
|
|
insert into wms_sell_out_embryo_special
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
@ -810,5 +895,18 @@
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectwmsFpStorageNewsTS" resultType="java.lang.String">
|
|
|
|
|
-- 优化后的 SQL 查询
|
|
|
|
|
SELECT
|
|
|
|
|
COALESCE(
|
|
|
|
|
MAX(TRY_CAST(SUBSTRING(stock_order, 3, 12) AS BIGINT)), -- 提取数字部分并尝试转换为 BIGINT
|
|
|
|
|
CAST(CONCAT(#{formattedDate}, '0001') AS BIGINT) -- 使用 BIGINT 来避免溢出
|
|
|
|
|
) + 1 AS Result_Value -- 将 +1 移到外层
|
|
|
|
|
FROM
|
|
|
|
|
wms_sell_out_embryo_order
|
|
|
|
|
WHERE
|
|
|
|
|
stock_order LIKE CONCAT('%', #{formattedDate}, '%');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|