|
@@ -107,7 +107,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getAttendance" resultType="java.util.HashMap">
|
|
|
- SELECT
|
|
|
+ <!--SELECT
|
|
|
(
|
|
|
SELECT
|
|
|
count( personnel_code )
|
|
@@ -121,14 +121,46 @@
|
|
|
date_format( start_date, '%Y-%m' )
|
|
|
) as sum1,
|
|
|
count( personnel_id_u8 ) as sum2,
|
|
|
- date_format( fwdl.planned_start_time, '%Y-%m' ) as label
|
|
|
+ date_format( fwdl.planned_start_time, '%m' ) as label
|
|
|
FROM
|
|
|
fbs_workshop_dispatch_list fwdl
|
|
|
WHERE
|
|
|
del_flag = '0'
|
|
|
AND date_format( planned_start_time, '%Y' ) = date_format( now( ), '%Y' )
|
|
|
GROUP BY
|
|
|
- date_format( planned_start_time, '%Y-%m' )
|
|
|
+ date_format( planned_start_time, '%Y-%m' )-->
|
|
|
+ SELECT
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ count( * )
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ count( personnel_code ),
|
|
|
+ personnel_code,
|
|
|
+ start_date
|
|
|
+ FROM
|
|
|
+ fbs_working_statistics
|
|
|
+ WHERE
|
|
|
+ del_flag = '0'
|
|
|
+ AND date_format( start_date, '%Y' ) = date_format( now( ), '%Y' )
|
|
|
+ GROUP BY
|
|
|
+ personnel_code
|
|
|
+ ) fws
|
|
|
+ WHERE
|
|
|
+ date_format( fwdl.planned_start_time, '%Y-%m' ) = date_format( start_date, '%Y-%m' )
|
|
|
+ GROUP BY
|
|
|
+ date_format( start_date, '%Y-%m' )
|
|
|
+ ) AS sum1,
|
|
|
+ count( personnel_id_u8 ) AS sum2,
|
|
|
+ date_format( fwdl.planned_start_time, '%m' ) AS label
|
|
|
+ FROM
|
|
|
+ fbs_workshop_dispatch_list fwdl
|
|
|
+ WHERE
|
|
|
+ del_flag = '0'
|
|
|
+ AND date_format( planned_start_time, '%Y' ) = date_format( now( ), '%Y' )
|
|
|
+ GROUP BY
|
|
|
+ date_format( planned_start_time, '%Y-%m' )
|
|
|
</select>
|
|
|
|
|
|
<select id="getWorkingHoursContrast" resultType="org.jeecg.modules.fbsWorkshopDispatchList.entity.FbsWorkshopDispatchList">
|
|
@@ -157,7 +189,8 @@
|
|
|
LEFT JOIN ( SELECT pk_workshop_dispatch_list FROM fbs_working_statistics WHERE del_flag = '0' GROUP BY pk_workshop_dispatch_list ) fws ON fwdl.id = fws.pk_workshop_dispatch_list
|
|
|
WHERE
|
|
|
fwdl.del_flag = '0'
|
|
|
-
|
|
|
+ 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})
|
|
|
</select>
|
|
|
|
|
|
<select id="getAchievementRate" resultType="java.util.HashMap">
|
|
@@ -173,7 +206,6 @@
|
|
|
fwd.del_flag = '0'
|
|
|
and DATE_FORMAT(now( ),'%Y-%m-%d') <![CDATA[ >= ]]> DATE_FORMAT(fwd.planned_start_time,'%Y-%m-%d')
|
|
|
and DATE_FORMAT(now( ),'%Y-%m-%d') <![CDATA[ <= ]]> DATE_FORMAT(fwd.planned_end_time,'%Y-%m-%d')
|
|
|
- <!-- 需要加入单日时间判断 派工单根据计划时间 现场单根据完工时间 -->
|
|
|
</select>
|
|
|
|
|
|
<select id="getAttendanceOfTheDay" resultType="java.util.HashMap">
|
|
@@ -211,5 +243,47 @@
|
|
|
fwdl.date DESC
|
|
|
LIMIT 6
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getProjectScheduleCompletion" resultType="org.jeecg.modules.fbsWorkshopDispatchList.entity.FbsWorkshopDispatchList">
|
|
|
+ <!-- SELECT
|
|
|
+ fwdl.project_name,
|
|
|
+ fwdl.standard_working_hours,
|
|
|
+ fws.working_hours as manHoursCompleted
|
|
|
+ FROM
|
|
|
+ fbs_workshop_dispatch_list fwdl
|
|
|
+ LEFT JOIN ( SELECT sum( working_hours ) working_hours, pk_workshop_dispatch_list FROM fbs_working_statistics WHERE del_flag = '0' AND final_state <> '3' GROUP BY pk_workshop_dispatch_list ) fws ON fwdl.id = fws.pk_workshop_dispatch_list
|
|
|
+ WHERE
|
|
|
+ fwdl.del_flag = '0'
|
|
|
+ AND fwdl.state <![CDATA[ <> ]]>'3' UNION ALL
|
|
|
+ SELECT
|
|
|
+ fwdl.project_name,
|
|
|
+ fwdl.standard_working_hours,
|
|
|
+ fwdl.man_hours_completed
|
|
|
+ FROM
|
|
|
+ fbs_workshop_dispatch_list fwdl
|
|
|
+ LEFT JOIN fbs_working_statistics fws ON fwdl.id = fws.pk_workshop_dispatch_list
|
|
|
+ WHERE
|
|
|
+ fwdl.del_flag = '0'
|
|
|
+ AND fws.del_flag = '0'
|
|
|
+ AND fwdl.state = '3'
|
|
|
+ AND fws.final_state = '3' -->
|
|
|
+ SELECT
|
|
|
+ fwdl.project_name,
|
|
|
+ fwdl.production_order_number_name,
|
|
|
+ sum( fwdl.standard_working_hours ) as standard_working_hours,
|
|
|
+ sum( fwdl.man_hours_completed ) as man_hours_completed,
|
|
|
+ sum( fwdl.number_of_tasks ) as number_of_tasks,
|
|
|
+ sum( fws.qualified_number ) as qualified_number
|
|
|
+ FROM
|
|
|
+ fbs_workshop_dispatch_list fwdl
|
|
|
+ LEFT JOIN fbs_working_statistics fws ON fwdl.id = fws.pk_workshop_dispatch_list
|
|
|
+ AND fws.del_flag = '0'
|
|
|
+ AND fws.final_state = '3'
|
|
|
+ WHERE
|
|
|
+ fwdl.del_flag = '0'
|
|
|
+ GROUP BY
|
|
|
+ fwdl.production_order_number_id
|
|
|
+ ORDER BY fwdl.production_order_number_name
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|