tuqin
11 小时以前 2c4bc1808f272b7d7282d1b8ba416d606ebc7df5
src/main/resources/mapper/production/ProductionCostingMapper.xml
@@ -9,7 +9,7 @@
            date_format(ppm.create_time, '%Y-%m')    as yearMonth,
            too.id                                   as processId,
            too.name                                 as processName,
            cd.dept_type                             as deptType,
            cp.dept_type                             as deptType,
            ppo.product_model_id                     as productModelId,
            p.product_name                           as productName,
            pm.model                                 as modelName,
@@ -18,7 +18,7 @@
        inner join production_operation_task pot on pot.id = ppm.production_operation_task_id
        inner join production_order_routing_operation poro on poro.id = pot.production_order_routing_operation_id
        inner join technology_operation too on too.id = poro.technology_operation_id
        inner join production_costing_dept cd on cd.dept_id = too.dept_id
        inner join production_costing_process cp on cp.process_id = too.id
        inner join production_product_output ppo on ppo.production_product_main_id = ppm.id
        left join product_model pm on pm.id = ppo.product_model_id
        left join product p on p.id = pm.product_id
@@ -27,7 +27,7 @@
            and ppm.report_type in (0, 1)
            <if test="c != null">
                <if test="c.deptType != null">
                    and cd.dept_type = #{c.deptType}
                    and cp.dept_type = #{c.deptType}
                </if>
                <if test="c.yearMonth != null and c.yearMonth != ''">
                    and date_format(ppm.create_time, '%Y-%m') = #{c.yearMonth}
@@ -40,7 +40,7 @@
                </if>
            </if>
        </where>
        group by ppm.user_id, ppm.user_name, yearMonth, too.id, too.name, cd.dept_type, ppo.product_model_id, p.product_name, pm.model
        group by ppm.user_id, ppm.user_name, yearMonth, too.id, too.name, cp.dept_type, ppo.product_model_id, p.product_name, pm.model
        order by yearMonth desc, ppm.user_id, too.id
    </select>