| | |
| | | pm.model as model, |
| | | pm.unit as unit, |
| | | poro.operation_name as operationName, |
| | | poro.type as type, |
| | | IFNULL(scrapStat.scrapQty, 0) AS scrapQty, |
| | | ROUND(IFNULL(pot.complete_quantity, 0) / NULLIF(pot.plan_quantity, 0) * 100, 2) AS completionStatus, |
| | | CASE |
| | |
| | | <if test="c != null and c.status != null"> |
| | | and pot.status = #{c.status} |
| | | </if> |
| | | <if test="c != null and c.isProduction != null"> |
| | | and poro.is_production = #{c.isProduction} |
| | | </if> |
| | | <if test="c != null and c.workOrderNo != null and c.workOrderNo != ''"> |
| | | and pot.work_order_no like concat('%', #{c.workOrderNo}, '%') |
| | | </if> |
| | | </where> |
| | | order by pot.id desc |
| | | order by pot.production_order_id desc, poro.drag_sort |
| | | </select> |
| | | |
| | | <select id="selectTaskStatisticsByDate" resultType="com.ruoyi.home.dto.ProductionTaskStatisticsDto"> |
| | |
| | | select poro.operation_name as processName, |
| | | sum(ifnull(ppi.input_quantity, 0)) as totalInput, |
| | | sum(ifnull(ppo.scrap_qty, 0)) as totalScrap, |
| | | sum(ifnull(ppo.quantity, 0) - ifnull(ppo.scrap_qty, 0)) as totalOutput |
| | | sum(greatest(ifnull(ppo.quantity, 0) - ifnull(ppo.scrap_qty, 0), 0)) as totalOutput |
| | | from production_product_output ppo |
| | | inner join production_product_main ppm on ppo.production_product_main_id = ppm.id |
| | | inner join production_operation_task pot on ppm.production_operation_task_id = pot.id |
| | |
| | | |
| | | <select id="getOperation" resultType="com.ruoyi.production.bean.vo.ProductionOperationTaskVo"> |
| | | select poro.operation_name as operationName, |
| | | max(poro.type) as type, |
| | | count(pot.id) as productionTaskCount, |
| | | sum(ifnull(pot.plan_quantity, 0)) as planQuantity, |
| | | sum(ifnull(pot.complete_quantity, 0)) as completeQuantity, |