|
|
@@ -452,4 +452,55 @@
|
|
|
WHERE ittn.id = ${nodeId};
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getProduct" resultType="com.github.zuihou.business.centralToolMagazine.dto.ChfTwoDatas">
|
|
|
+ select oo.order_name as orderName,
|
|
|
+ oo.product_num as productNum,
|
|
|
+ ifnull(oo.produce_num,0) as produceNum,
|
|
|
+ oo.delivery_time as deliveryTime,
|
|
|
+ tp.online_status as onlineStatus,
|
|
|
+ CASE
|
|
|
+
|
|
|
+ WHEN timestampdiff( MINUTE, now(), a.repair_end_time ) > 0 THEN
|
|
|
+ CONCAT(
|
|
|
+ TRUNCATE ( timestampdiff( MINUTE, now(), a.repair_end_time ) / 1440, 0 ),
|
|
|
+ '天',
|
|
|
+ TRUNCATE ( MOD ( timestampdiff( MINUTE, now(), a.repair_end_time ), 1440 ) / 60, 0 ),
|
|
|
+ '小时',
|
|
|
+ MOD ( MOD ( timestampdiff( MINUTE, now(), a.repair_end_time ), 1440 ), 60 ),
|
|
|
+ '分钟'
|
|
|
+ ) ELSE '已到维保时间'
|
|
|
+ END AS downTime,
|
|
|
+ tp.name
|
|
|
+ <if test="planStatus==null">
|
|
|
+ ,ROUND((TIMESTAMPDIFF(MINUTE, ttn.start_time, NOW()) / bbp.rated_workHours), 3) AS point
|
|
|
+ </if>
|
|
|
+ from imcs_o_order oo
|
|
|
+ INNER JOIN imcs_p_plan pp on oo.id=pp.order_id
|
|
|
+ INNER JOIN imcs_o_order_product oop on oo.id=oop.order_id
|
|
|
+ INNER JOIN imcs_t_task tt on pp.id=tt.plan_id
|
|
|
+ INNER JOIN imcs_tenant_productionresource tp on tt.resource_id=tp.id
|
|
|
+ INNER join imcs_tenant_repair a on a.productionresource_id=tp.id
|
|
|
+ <if test="planStatus==null">
|
|
|
+ left join imcs_t_task_node ttn on ttn.order_id=pp.order_id and ttn.node_name='启动程序' and ttn.exe_status='2'
|
|
|
+ left join imcs_b_bom_procedure bbp on bbp.bom_id=oop.bom_id and bbp.no='OP10'
|
|
|
+ </if>
|
|
|
+ <if test="planStatus!=null">
|
|
|
+ inner join imcs_t_task_node ttn on ttn.order_id=pp.order_id and ttn.node_name='启动程序' and ttn.exe_status!='3'
|
|
|
+ </if>
|
|
|
+ where
|
|
|
+ pp.scheduling_status='1'
|
|
|
+ and pp.produce_status='2'
|
|
|
+ and pp.plan_status='2'
|
|
|
+ and tp.mode_specification='GMU800AVI'
|
|
|
+
|
|
|
+ and
|
|
|
+ <if test="planStatus!=null">
|
|
|
+ NOT
|
|
|
+ </if>
|
|
|
+ EXISTS(
|
|
|
+ select * from imcs_t_task_node where order_id=pp.order_id and node_name='启动程序' and exe_status='2'
|
|
|
+ )
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|