liyong
2026-05-11 d6388d041cc58b9f2be3ddcddfb6042e7af094f7
src/main/resources/mapper/production/ProductionProductMainMapper.xml
@@ -34,11 +34,14 @@
               date(ppm.create_time) as schedulingDate,
               su.nick_name as schedulingUserName,
               po_sales.customerName,
               poro.operation_name as process
               poro.operation_name as process,
               t5.id as workshop_id,
               t5.name as workshop_name
        from production_product_main ppm
                 left join production_operation_task pot on ppm.production_operation_task_id = pot.id
                 left join production_order po on pot.production_order_id = po.id
                 left join production_order_routing_operation poro on pot.production_order_routing_operation_id = poro.id
                 left join workshop as t5 on po.workshop_id = t5.id
                 left join (
            select po2.id as orderId,
                   group_concat(distinct sl2.sales_contract_no order by sl2.sales_contract_no separator ',') as salesContractNo,
@@ -100,16 +103,22 @@
               ifnull(ppo.scrap_qty, 0) as scrapQty,
               date(pa.scheduling_date) as schedulingDate,
               pa.scheduling_user_name as schedulingUserName,
               cast(ifnull(ppm.work_hour, 0) as decimal(18,4)) as workHour,
               cast(ifnull(pa.work_hours, 0) as decimal(18,4)) as workHours,
               cast(
                   ifnull(pa.work_hours, 0) * ifnull(pa.finished_num, 0) *
                   case
                       when substring_index(pm.model, '*', -1) regexp '^[0-9]+(\\.[0-9]+)?$'
                       then cast(substring_index(pm.model, '*', -1) as decimal(18,4))
                       else 1
                       when poro.type = 0 then ifnull(pa.work_hours, 0) * ifnull(ppm.work_hour, 0)
                       else ifnull(pa.work_hours, 0) * ifnull(pa.finished_num, 0) *
                            case
                                when substring_index(pm.model, '*', -1) regexp '^[0-9]+(\\.[0-9]+)?$'
                                then cast(substring_index(pm.model, '*', -1) as decimal(18,4))
                                else 1
                            end
                   end
                   as decimal(18,4)
               ) as wages
               ) as wages,
                t10.id as workshop_id,
                t10.name as workshop_name
        from production_account pa
                 left join production_product_main ppm on ppm.id = pa.production_product_main_id
                 left join production_operation_task pot on ppm.production_operation_task_id = pot.id
@@ -119,6 +128,7 @@
                 left join product p on pm.product_id = p.id
                 left join product p_parent on p_parent.id = p.parent_id
                 left join production_product_output ppo on ppo.production_product_main_id = ppm.id
                 left join workshop as t10 on po.workshop_id = t10.id
        <where>
            <if test="c != null">
                <if test="c.productCategory != null and c.productCategory != ''">