zouyu
2026-01-30 5bd1e846de7587f39d3edacfed58bfa8325c8758
inspect-server/src/main/resources/mapper/InsUnqualifiedHandlerMapper.xml
@@ -12,34 +12,111 @@
        unqualified_desc,inventory_quantity_id
    </sql>
    <select id="selectPageList" resultType="com.ruoyi.inspect.vo.UnqualifiedHandlerVO">
        select * from (select
            iiq.*,
            iuh.id as handler_id,
            iuh.no,
            iuh.material_name,
            iuh.production_batch,
            iuh.cargo_quantity,
            iuh.specs_models,
            iuh.inspect_time,
            iuh.feedback_user,
            iuh.feedback_time,
            iuh.classification,
            iuh.off_grade_ascription,
            iuh.unqualified_desc,
            iuh.inventory_quantity_id,
            iuh.oa_state,
            iuh.request_id,
            iuh.file_url,
            iuh.headline
        from
            ins_unqualified_handler iuh
        inner join
            ifs_inventory_quantity iiq
        on
            iuh.inventory_quantity_id = iiq.id)tempA
        select
            *
        from (
            select
                iiq.contract,
                iiq.order_no,
                iiq.order_type,
                iiq.material_prop,
                iiq.line_no,
                iiq.release_no,
                iiq.receipt_no,
                iiq.part_no,
                iiq.part_desc,
                iiq.status,
                iiq.status_db,
                iiq.qty_arrived,
                iiq.qty_inspected,
                iiq.qty_to_inspect,
                iiq.supplier_id,
                iiq.supplier_name,
                iiq.inv_qty_in_store,
                iiq.pur_qty_in_store,
                iiq.configuration_id,
                iiq.lot_batch_no,
                iiq.waiv_dev_rej_no,
                iiq.activity_seq,
                iiq.serial_no,
                iiq.location_no,
                iiq.eng_chg_level,
                iiq.receiver,
                iiq.receiver_name,
                iiq.buyer_code,
                iiq.buyer_name,
                iiq.arrive_date,
                iiq.delivery_date,
                iiq.product_date,
                iiq.invalid_date,
                iiq.approved_date,
                iiq.req_ceater,
                iiq.req_ceater_name,
                iiq.line_remarks,
                iiq.buy_unit_meas,
                iiq.is_source,
                iiq.number,
                iiq.state,
                iiq.receiver_date,
                iiq.is_first,
                iiq.to_location,
                iiq.is_inspect,
                iiq.declare_user,
                iiq.declare_user_id,
                iiq.part_unit,
                iiq.industry_chain,
                iiq.declare_date,
                iiq.is_quarter,
                iiq.is_copper,
                iiq.update_batch_no,
                iiq.is_finish,
                iiq.inspect_status,
                iiq.is_register,
                iiq.is_update_batch,
                iiq.is_expire,
                iiq.is_split_order,
                iuh.id,
                iuh.id as handler_id,
                iuh.no,
                iuh.material_name,
                iuh.production_batch,
                iuh.cargo_quantity,
                iuh.specs_models,
                iuh.inspect_time,
                iuh.feedback_user,
                iuh.feedback_time,
                iuh.classification,
                iuh.off_grade_ascription,
                iuh.unqualified_desc,
                iuh.inventory_quantity_id,
                iuh.oa_state,
                iuh.request_id,
                iuh.file_url,
                iuh.headline,
                coa.operation
            from
                ins_unqualified_handler iuh
            inner join
                ifs_inventory_quantity iiq
            on
                iuh.inventory_quantity_id = iiq.id
            LEFT JOIN (
            SELECT
            *,
            ROW_NUMBER() OVER (PARTITION BY workflow_id ORDER BY approval_date DESC,approval_time DESC, id DESC) AS rn
            FROM
            common_oa
            ) AS coa ON iuh.request_id = coa.workflow_id AND coa.rn = 1
        )tempA
        <where>
            <if test="feedbackStartDate!=null and feedbackEndDate !=null">
                AND feedback_time between #{feedbackStartDate} AND #{feedbackEndDate}
            </if>
        </where>
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>
        order by id desc
    </select>
    <select id="findById" resultType="com.ruoyi.inspect.vo.UnqualifiedHandlerVO">
        select * from (select