| | |
| | | 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 |
| | |
| | | <if test="endDateTime != null"> |
| | | and ppo.create_time <= #{endDateTime} |
| | | </if> |
| | | <if test="userId != null"> |
| | | and ppm.create_user = #{userId} |
| | | </if> |
| | | <!-- <if test="userId != null">--> |
| | | <!-- and ppm.create_user = #{userId}--> |
| | | <!-- </if>--> |
| | | <if test="processIds != null and processIds.size() > 0"> |
| | | and poro.technology_operation_id in |
| | | <foreach collection="processIds" item="id" open="(" separator="," close=")"> |