|
@@ -151,11 +151,11 @@
|
|
|
<select id="findByPage" resultType="org.jeecg.modules.fbsAbnormalWorkingHours.entity.FbsAbnormalWorkingHours">
|
|
|
SELECT
|
|
|
IFNULL(fawh.train,0)+IFNULL(fawh.meeting,0)+IFNULL(fawh.research_and_development,0)+IFNULL(fawh.five_s,0)+IFNULL(fawh.other,0) as invalidWork,
|
|
|
- (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='1' AND (fawhdd.cost_item_code=fawhd.cost_item_code or fawhd.cost_item_code is null) AND (fawhdd.project_name=fawhd.project_name or fawhd.project_name is null) AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification1,
|
|
|
- (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='2' AND (fawhdd.cost_item_code=fawhd.cost_item_code or fawhd.cost_item_code is null) AND (fawhdd.project_name=fawhd.project_name or fawhd.project_name is null) AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification2,
|
|
|
- (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='3' AND (fawhdd.cost_item_code=fawhd.cost_item_code or fawhd.cost_item_code is null) AND (fawhdd.project_name=fawhd.project_name or fawhd.project_name is null) AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification3,
|
|
|
- (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='4' AND (fawhdd.cost_item_code=fawhd.cost_item_code or fawhd.cost_item_code is null) AND (fawhdd.project_name=fawhd.project_name or fawhd.project_name is null) AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification4,
|
|
|
- (select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.abnormal_working_hours_id=fawh.id AND fawhdd.anomaly_classification='5' AND (fawhdd.cost_item_code=fawhd.cost_item_code or fawhd.cost_item_code is null) AND (fawhdd.project_name=fawhd.project_name or fawhd.project_name is null) AND fawhdd.production_order_number_name=fawhd.production_order_number_name AND fawhdd.product_id=fawhd.product_id AND fawhdd.product=fawhd.product) as anomalyClassification5,
|
|
|
+ sum((select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.id=fawhd.id AND fawhdd.anomaly_classification='1')) as anomalyClassification1,
|
|
|
+ sum((select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.id=fawhd.id AND fawhdd.anomaly_classification='2')) as anomalyClassification2,
|
|
|
+ sum((select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.id=fawhd.id AND fawhdd.anomaly_classification='3')) as anomalyClassification3,
|
|
|
+ sum((select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.id=fawhd.id AND fawhdd.anomaly_classification='4')) as anomalyClassification4,
|
|
|
+ sum((select sum(IFNULL(fawhdd.abnormal_working_hours,0)) from fbs_abnormal_working_hours_describe fawhdd where fawhdd.id=fawhd.id AND fawhdd.anomaly_classification='5')) as anomalyClassification5,
|
|
|
fawh.*
|
|
|
FROM
|
|
|
fbs_abnormal_working_hours fawh
|