| | |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="tenant_id" property="tenantId"/> |
| | | </resultMap> |
| | | <select id="processPage" resultType="com.ruoyi.quality.dto.ProcessPageDto"> |
| | | select ppri.id productionProductRouteItemId, |
| | | ppri.create_time, |
| | | ppm.product_no, |
| | | po.nps_no, |
| | | pp.name process, |
| | | ppri.post_name, |
| | | ppm.schedule, |
| | | pms.material_code, |
| | | pm.product_name, |
| | | pms.model, |
| | | po.strength, |
| | | ppo.quantity qualifiedQuantity, |
| | | ppo.scrap_qty unqualifiedQuantity, |
| | | ppo.quantity + ppo.scrap_qty quantity |
| | | from production_product_route_item ppri |
| | | left join production_product_main ppm on ppri.product_main_id = ppm.id |
| | | left join production_product_output ppo on ppo.product_main_id = ppm.id |
| | | left join product_order po on ppm.product_order_id = po.id |
| | | left join product_process pp on ppri.process_id = pp.id |
| | | left join product_material_sku pms on pms.id = po.product_material_sku_id |
| | | left join product_material pm on pm.id = pms.product_id |
| | | where 1=1 |
| | | <if test="c.npsNo != null and c.npsNo != ''"> |
| | | AND po.nps_no LIKE CONCAT('%', #{c.npsNo}, '%') |
| | | </if> |
| | | <if test="c.process != null and c.process != ''"> |
| | | AND pp.name LIKE CONCAT('%', #{c.process}, '%') |
| | | </if> |
| | | <if test="c.productNo != null and c.productNo != ''"> |
| | | AND ppm.product_no LIKE CONCAT('%', #{c.productNo}, '%') |
| | | </if> |
| | | <if test="c.productName != null and c.productName != ''"> |
| | | AND pm.product_name LIKE CONCAT('%', #{c.productName}, '%') |
| | | </if> |
| | | <if test="c.materialCode != null and c.materialCode != ''"> |
| | | AND pms.material_code LIKE CONCAT('%', #{c.materialCode}, '%') |
| | | </if> |
| | | <if test="c.model != null and c.model != ''"> |
| | | AND pms.model LIKE CONCAT('%', #{c.model}, '%') |
| | | </if> |
| | | <if test="c.strength != null and c.strength != ''"> |
| | | AND po.strength = #{c.strength} |
| | | </if> |
| | | <if test="c.startTime != null and c.endTime != null"> |
| | | AND ppri.create_time BETWEEN #{c.startTime} AND #{c.endTime} + INTERVAL 1 DAY - INTERVAL 1 MICROSECOND |
| | | </if> |
| | | order by ppri.id desc |
| | | </select> |
| | | |
| | | </mapper> |