feat: add shadow export MCP tooling

This commit is contained in:
zgw
2026-08-28 11:14:26 +08:00
parent 2868cb85fa
commit da5a0a1561
13 changed files with 469 additions and 25 deletions

View File

@@ -81,6 +81,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectFlatProductAndStockList" parameterType="ViewProductAndStock" resultMap="ViewProductAndStockResult">
select row_number() over (order by bs.product_id, bs.stock_id) as only_identity,
bs.product_id,
bs.lot_no,
bs.product_name,
isnull(bs.quantity, 0) - isnull(bs.out_quantity, 0) as quantity,
bs.warehouse_id,
bs.stacking_id,
bs.spare1,
bs.spare2,
bs.spare3,
bs.spare4,
bs.spare5,
bs.spare6,
bs.voltage,
bs.power,
bs.phase
from bas_stock_hc bs
<where>
<!-- try_convert(int, bs.warehouse_id) = 2-->
<!-- and isnull(bs.quantity, 0) - isnull(bs.out_quantity, 0) > 0-->
bs.quantity>0
and bs.out_quantity =0
<if test="productId != null and productId != ''">and bs.product_id like concat('%', #{productId}, '%')</if>
<if test="lotNo != null and lotNo != ''">and bs.lot_no like concat('%', #{lotNo}, '%')</if>
<if test="productName != null and productName != ''">and bs.product_name like concat('%', #{productName}, '%')</if>
<if test="spare1 != null and spare1 != ''">and bs.spare1 like concat('%', #{spare1}, '%')</if>
<if test="spare2 != null and spare2 != ''">and bs.spare2 like concat('%', #{spare2}, '%')</if>
<if test="spare3 != null and spare3 != ''">and bs.spare3 like concat('%', #{spare3}, '%')</if>
<if test="spare4 != null and spare4 != ''">
and (bs.spare4 like concat('%', #{spare4}, '%')
or bs.order_id like concat('%', #{spare4}, '%')
or bs.job_id like concat('%', #{spare4}, '%'))
</if>
<if test="spare5 != null and spare5 != ''">and bs.spare5 like concat('%', #{spare5}, '%')</if>
<if test="spare6 != null and spare6 != ''">and bs.spare6 like concat('%', #{spare6}, '%')</if>
<if test="voltage != null and voltage != ''">and bs.voltage like concat('%', #{voltage}, '%')</if>
<if test="power != null and power != ''">and bs.power like concat('%', #{power}, '%')</if>
<if test="phase != null and phase != ''">and bs.phase like concat('%', #{phase}, '%')</if>
</where>
</select>
<insert id="insertViewProductAndStock" parameterType="ViewProductAndStock">
insert into view_product_and_stock
<trim prefix="(" suffix=")" suffixOverrides=",">