| | |
| | | |
| | | <select id="getMaterialPropTable" resultType="com.ruoyi.inspect.dto.MaterialPropTableDTO"> |
| | | SELECT |
| | | iiq.update_batch_no AS updateBatchNo, -- 修改后批次号 |
| | | iiq.qty_arrived AS qtyArrived, -- 抵达的采购数量 |
| | | iiq.part_desc AS partDesc, -- 零件描述 |
| | | iiq.inspect_status AS inspectStatus, -- 合格状态 |
| | | io1.send_time AS sendTime -- 下发时间 |
| | | iiq.supplier_name AS supplierName, |
| | | COUNT(*) AS totalBatch, |
| | | SUM(CASE WHEN iiq.inspect_status = 2 THEN 1 ELSE 0 END) AS unqualifiedBatch, |
| | | ROUND(SUM(CASE WHEN iiq.inspect_status = 1 THEN 1 ELSE 0 END) / COUNT(*)* 100, 2 ) AS passRate |
| | | |
| | | FROM ifs_inventory_quantity iiq |
| | | INNER JOIN ins_order io1 |
| | | ON io1.ifs_inventory_id = iiq.id |
| | | AND io1.order_type = #{dto.orderType} |
| | | AND io1.state != -1 |
| | | AND io1.send_time BETWEEN #{dto.beginDate} AND #{dto.endDate} |
| | | |
| | | LEFT JOIN ( |
| | | SELECT |
| | | ins_order_id, |
| | |
| | | FROM ins_sample |
| | | GROUP BY ins_order_id |
| | | ) ins ON ins.ins_order_id = io1.id |
| | | |
| | | WHERE |
| | | iiq.is_finish = 1 |
| | | AND iiq.inspect_status IN (1,2) |
| | |
| | | AND IFNULL(iiq.supplier_name,'') LIKE CONCAT('%',#{dto.supplierName},'%') |
| | | </if> |
| | | |
| | | ORDER BY io1.send_time DESC |
| | | GROUP BY |
| | | iiq.supplier_name |
| | | |
| | | ORDER BY |
| | | passRate DESC; |
| | | |
| | | </select> |
| | | |
| | | <select id="getRawProductAnalysisAllSample" resultType="com.ruoyi.basic.dto.IfsInventoryQuantitySupplierDto"> |