|
@@ -41,7 +41,8 @@
|
|
|
fwdl.del_flag = '0'
|
|
|
AND fws.final_state = '3'
|
|
|
AND date_format( fws.final_time, #{dateString} ) = DATE_FORMAT( now( ), #{dateString} )-->
|
|
|
- SELECT
|
|
|
+
|
|
|
+ <!-- SELECT
|
|
|
CONVERT
|
|
|
(sum( fws.working_hours ), DECIMAL ( 15, 2 ) ) AS '生产',
|
|
|
(
|
|
@@ -122,16 +123,59 @@
|
|
|
<if test="dateString=='%Y-%m'">
|
|
|
and DATE_FORMAT(now(),#{dateString}) <![CDATA[ >= ]]> DATE_FORMAT(fws.final_time,#{dateString})
|
|
|
and DATE_FORMAT(now(),#{dateString}) <![CDATA[ <= ]]> DATE_FORMAT(fws.final_time,#{dateString})
|
|
|
+ </if>-->
|
|
|
+
|
|
|
+
|
|
|
+ SELECT
|
|
|
+ CONVERT
|
|
|
+ (sum( fws.working_hours ), DECIMAL ( 15, 2 ) ) AS '生产工时',
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ IFNULL(sum( train ),0) + IFNULL(sum( meeting ),0) + IFNULL(sum( five_s ),0) + IFNULL(sum( research_and_development ),0)+ IFNULL(sum( other ),0)
|
|
|
+ FROM
|
|
|
+ fbs_abnormal_working_hours
|
|
|
+ WHERE
|
|
|
+ del_flag = '0'
|
|
|
+ <if test="dateString=='%Y-%m-%d'">
|
|
|
+ AND date_format(
|
|
|
+ date, #{dateString} ) = DATE_FORMAT( date_sub(curdate(),interval 1 day), #{dateString} )
|
|
|
+ </if>
|
|
|
+ <if test="dateString=='%Y-%m'">
|
|
|
+ AND date_format(
|
|
|
+ date, #{dateString} ) = DATE_FORMAT( now(), #{dateString} )
|
|
|
+ </if>
|
|
|
+
|
|
|
+ )
|
|
|
+ AS '无效工时',
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ IFNULL(sum( fawhd.abnormal_working_hours ),0)
|
|
|
+ FROM
|
|
|
+ fbs_abnormal_working_hours fawh
|
|
|
+ left join fbs_abnormal_working_hours_describe fawhd on fawh.id=fawhd.abnormal_working_hours_id and fawhd.del_flag='0'
|
|
|
+ WHERE
|
|
|
+ fawh.del_flag = '0'
|
|
|
+ <if test="dateString=='%Y-%m-%d'">
|
|
|
+ AND date_format(
|
|
|
+ fawh.date, #{dateString} ) = DATE_FORMAT( date_sub(curdate(),interval 1 day), #{dateString} )
|
|
|
+ </if>
|
|
|
+ <if test="dateString=='%Y-%m'">
|
|
|
+ AND date_format(
|
|
|
+ fawh.date, #{dateString} ) = DATE_FORMAT( now(), #{dateString} )
|
|
|
</if>
|
|
|
- <!--
|
|
|
+ ) as '异常工时'
|
|
|
+ FROM
|
|
|
+ fbs_working_statistics fws
|
|
|
+ WHERE
|
|
|
+ fws.del_flag = '0'
|
|
|
<if test="dateString=='%Y-%m-%d'">
|
|
|
- and DATE_FORMAT(date_sub(curdate(),interval 1 day),#{dateString}) <![CDATA[ >= ]]> DATE_FORMAT(fwdl.planned_start_time,#{dateString})
|
|
|
- and DATE_FORMAT(date_sub(curdate(),interval 1 day),#{dateString}) <![CDATA[ <= ]]> DATE_FORMAT(fwdl.planned_end_time,#{dateString})
|
|
|
+ and DATE_FORMAT(date_sub(curdate(),interval 1 day),#{dateString}) <![CDATA[ >= ]]> DATE_FORMAT(fws.final_time,#{dateString})
|
|
|
+ and DATE_FORMAT(date_sub(curdate(),interval 1 day),#{dateString}) <![CDATA[ <= ]]> DATE_FORMAT(fws.final_time,#{dateString})
|
|
|
</if>
|
|
|
<if test="dateString=='%Y-%m'">
|
|
|
- and DATE_FORMAT(now(),#{dateString}) <![CDATA[ >= ]]> DATE_FORMAT(fwdl.planned_start_time,#{dateString})
|
|
|
- and DATE_FORMAT(now(),#{dateString}) <![CDATA[ <= ]]> DATE_FORMAT(fwdl.planned_end_time,#{dateString})
|
|
|
- </if>-->
|
|
|
+ and DATE_FORMAT(now(),#{dateString}) <![CDATA[ >= ]]> DATE_FORMAT(fws.final_time,#{dateString})
|
|
|
+ and DATE_FORMAT(now(),#{dateString}) <![CDATA[ <= ]]> DATE_FORMAT(fws.final_time,#{dateString})
|
|
|
+ </if>
|
|
|
|
|
|
</select>
|
|
|
|
|
@@ -181,11 +225,12 @@
|
|
|
fws.materiel_name,
|
|
|
fws.fbs_technological_process_item_id,
|
|
|
fws.fbs_technological_process_item_name,
|
|
|
- fws.personnel_code,
|
|
|
- fws.personnel_name,
|
|
|
+ group_concat(fws.personnel_code separator ',') as personnelCode,
|
|
|
+ group_concat(fws.personnel_name separator ',') as personnelName,
|
|
|
min( fws.first_time ) as firstTime,
|
|
|
max( fws.final_time ) as finalTime,
|
|
|
sum( fws.working_hours ) as workingHours,
|
|
|
+ fwdl.number_of_tasks,
|
|
|
(fwdl.number_of_tasks * IFNULL( ftpi.standard_working_hours, 0 )) AS standardWorkingHoursProcess,
|
|
|
ROUND((fwdl.number_of_tasks * IFNULL( ftpi.standard_working_hours, 0 ))/sum( fws.working_hours )*100,0) AS efficiency
|
|
|
FROM
|