huminmin
21 小时以前 441dfbd1908affc1accc52006a2fe81a5067052d
废品库存的批号如果有多个,则需要展示多个
已修改1个文件
34 ■■■■ 文件已修改
src/main/resources/mapper/stock/StockUninventoryMapper.xml 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/stock/StockUninventoryMapper.xml
@@ -150,7 +150,22 @@
    <select id="pageWasteQuery" resultType="com.ruoyi.stock.dto.StockUninventoryDto">
        <include refid="WasteQueryRecursiveTree" />
        select
        <include refid="WastePageColumns" />
        max(su.id) as id,
        sum(su.qualitity) as qualitity,
        su.type,
        sum(COALESCE(su.locked_quantity, 0)) as locked_quantity,
        su.product_model_id,
        p.id as product_id,
        GROUP_CONCAT(DISTINCT su.batch_no ORDER BY su.batch_no SEPARATOR ',') as batch_no,
        min(su.create_time) as create_time,
        max(su.update_time) as update_time,
        max(su.version) as version,
        (sum(su.qualitity) - sum(COALESCE(su.locked_quantity, 0))) as un_locked_quantity,
        pm.model,
        pm.unit,
        p.product_name,
        m.name as manufacturer_name,
        su.source
        <include refid="BaseWasteFromClause" />
        <where>
            and su.type = 'waste'
@@ -167,8 +182,8 @@
                and p.id in (select id from product_tree)
            </if>
        </where>
        order by su.update_time desc, su.id desc
        group by su.product_model_id
        order by max(su.update_time) desc, su.product_model_id desc
    </select>
    <select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockUnInventoryExportData">
@@ -192,12 +207,18 @@
    <select id="listWasteQueryExportData" resultType="com.ruoyi.stock.execl.StockUnInventoryExportData">
        <include refid="WasteQueryRecursiveTree" />
        select
        su.*,
        pm.model,
        pm.unit,
        p.product_name,
        m.name as manufacturer_name,
        (su.qualitity - COALESCE(su.locked_quantity, 0)) as un_locked_quantity
        su.source,
        su.type,
        GROUP_CONCAT(DISTINCT su.batch_no ORDER BY su.batch_no SEPARATOR ',') as batch_no,
        sum(su.qualitity) as qualitity,
        sum(COALESCE(su.locked_quantity, 0)) as locked_quantity,
        (sum(su.qualitity) - sum(COALESCE(su.locked_quantity, 0))) as un_locked_quantity,
        GROUP_CONCAT(DISTINCT su.remark ORDER BY su.batch_no SEPARATOR ';') as remark,
        max(su.update_time) as update_time
        <include refid="BaseWasteFromClause" />
        <where>
            and su.type = 'waste'
@@ -214,7 +235,8 @@
                and p.id in (select id from product_tree)
            </if>
        </where>
        order by su.update_time desc, su.id desc
        group by su.product_model_id, su.type, pm.model, pm.unit, p.id, p.product_name, m.name, su.source
        order by max(su.update_time) desc, su.product_model_id desc
    </select>
    <select id="getWasteBatchNoQty" resultType="com.ruoyi.stock.dto.StockUninventoryDto">