| | |
| | | <result column="dept_id" property="deptId" /> |
| | | </resultMap> |
| | | |
| | | <select id="selectProgressOrders" resultType="com.ruoyi.home.dto.ProductionProgressOrderDto"> |
| | | select po.nps_no, |
| | | sl.sales_contract_no, |
| | | sl.project_name, |
| | | sl.customer_name, |
| | | p.product_name as productCategory, |
| | | pm.model as specificationModel, |
| | | tr.process_route_code as processRouteCode, |
| | | po.quantity, |
| | | ifnull(po.complete_quantity, 0) as completeQuantity, |
| | | round(ifnull(po.complete_quantity, 0) / nullif(po.quantity, 0) * 100, 2) as completionStatus, |
| | | tb.bom_no, |
| | | datediff(sl.delivery_date, curdate()) as deliveryDaysDiff, |
| | | sl.delivery_date, |
| | | false as isFh |
| | | from production_order po |
| | | left join sales_ledger sl on po.sales_ledger_id = sl.id |
| | | left join product_model pm on po.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join technology_routing tr on po.technology_routing_id = tr.id |
| | | left join technology_bom tb on tr.bom_id = tb.id |
| | | where po.create_time between #{startTime} and #{endTime} |
| | | order by po.create_time desc |
| | | </select> |
| | | |
| | | <select id="countCreated" resultType="java.lang.Integer"> |
| | | select count(1) |
| | | from production_order |
| | | where create_time >= #{startDate} |
| | | and create_time <= #{endDate} |
| | | </select> |
| | | |
| | | <select id="countCompleted" resultType="java.lang.Integer"> |
| | | select count(1) |
| | | from production_order |
| | | where end_time >= #{startDate} |
| | | and end_time <= #{endDate} |
| | | and ifnull(complete_quantity, 0) >= quantity |
| | | </select> |
| | | |
| | | <select id="countPending" resultType="java.lang.Integer"> |
| | | select count(1) |
| | | from production_order |
| | | where create_time >= #{startDate} |
| | | and create_time <= #{endDate} |
| | | and ifnull(complete_quantity, 0) < quantity |
| | | </select> |
| | | |
| | | </mapper> |