廖井涛
2025-08-25 fec9f42e00f2df68a2a20cbf132b17bdeed8e63a
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -435,9 +435,9 @@
            ifnull(f.completed_quantity,0) as thisQuantitySum ,-- 本工序完工和
            if(c.quantity-f.completed_quantity = 0 ,true,false) as saveFlag,
            e.other_columns,
        if(ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'')!='',
        ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),''),
        od.building_number) as s01Value
        if(ifnull(JSON_UNQUOTE(JSON_EXTRACT(e.other_columns, '$.S01')),'')!='',
        ifnull(JSON_UNQUOTE(JSON_EXTRACT(e.other_columns, '$.S01')),''),
        e.building_number) as s01Value,
        IF(count(pl.id)>0,'已补片','') as patchStatusOther,
            <if test="nextProcess != null and nextProcess != ''">  -- 非最后一道工序
@@ -452,13 +452,13 @@
                    )  as minQuantity -- 修改最小数
            </if>
            <if test="nextProcess == null or nextProcess == ''">  -- 最后一道工序
#               c.received_quantity, -- 已入库数量
#               c.inventory_quantity, --   库存数量
               c.received_quantity, -- 已入库数量
               c.inventory_quantity, --   库存数量
              if(ifnull(inventory_quantity,0)
                 -ifnull(c.received_quantity,0)
                 &gt;= a.completed_quantity,0,
                (a.completed_quantity-(ifnull(c.inventory_quantity,0)
                    -ifnull(c.received_quantity,0)))
                 &gt;= a.completed_quantity,a.completed_quantity,
                (ifnull(c.inventory_quantity,0)
                -ifnull(c.received_quantity,0))
                )
                as minQuantity -- 修改最小数
            </if>
@@ -930,6 +930,11 @@
                          SELECT * FROM sd.basic_data
                          WHERE basic_type='product' AND basic_category='process' AND basic_name='钢化'
                          UNION
                          SELECT * FROM sd.basic_data
                          WHERE basic_type='product' AND basic_category='process' AND basic_name='热弯'
                      ) AS combined_results;
    </select>