sum.working_turn_compen_leave as workingturncompenleave,
sum.rest_turn_compen_leave as restturncompenleave,
sum.holiday_turn_compen_leave as holidayturncompenleave,
sum.working_transfer_overtime as workingtransferovertime,
sum.rest_transfer_overtime as resttransferovertime,
sum.holiday_transfer_overtime as holidaytransferovertime
(select SUM(su.duration) as duration from kqgl_asso_relation_summary su where su.user_id = sum.num and su.approval_type = 1 and su.overtime_type_id = 1
and su.app_time = #{param.times}) as totalovertimehours,
(select SUM(su.duration) as duration from kqgl_asso_relation_summary su where su.user_id = sum.num and su.approval_type = 1
and (su.compensate_id = 1 or su.compensate_id = 3) and su.overtime_type_id = 1 and su.app_time = #{param.times}) as workingturncompenleave,
(select SUM(su.duration) as duration from kqgl_asso_relation_summary su where su.user_id = sum.num and su.approval_type = 1
and (su.compensate_id = 1 or su.compensate_id = 3) and su.overtime_type_id = 2 and su.app_time = #{param.times}) as restturncompenleave,
(select SUM(su.duration) as duration from kqgl_asso_relation_summary su where su.user_id = sum.num and su.approval_type = 1
and (su.compensate_id = 1 or su.compensate_id = 3) and su.overtime_type_id = 3 and su.app_time = #{param.times}) as holidayturncompenleave,
(select SUM(su.duration) as duration from kqgl_asso_relation_summary su where su.user_id = sum.num and su.approval_type = 1
and (su.compensate_id = 2 or su.compensate_id = 4) and su.overtime_type_id = 1 and su.app_time = #{param.times}) as workingtransferovertime,
(select SUM(su.duration) as duration from kqgl_asso_relation_summary su where su.user_id = sum.num and su.approval_type = 1
and (su.compensate_id = 2 or su.compensate_id = 4) and su.overtime_type_id = 2 and su.app_time = #{param.times}) as resttransferovertime,
(select SUM(su.duration) as duration from kqgl_asso_relation_summary su where su.user_id = sum.num and su.approval_type = 1
and (su.compensate_id = 2 or su.compensate_id = 4) and su.overtime_type_id = 3 and su.app_time = #{param.times}) as holidaytransferovertime
from kqgl_asso_month_punch_summary sum
LEFT JOIN (
select DISTINCT info.`name` as username ,
...
...
@@ -427,6 +452,15 @@
<!-- LEFT JOIN kqgl_asso_leave_employee_balance as mrtj on mrtj.userid = sum.num
IFNULL(mrtj.leave_rules_id,'') as leaverulesid,
IFNULL(mrtj.balance_days,'') as balancedays-->
<!--
sum.total_overtime_hours as totalovertimehours,
sum.working_turn_compen_leave as workingturncompenleave,
sum.rest_turn_compen_leave as restturncompenleave,
sum.holiday_turn_compen_leave as holidayturncompenleave,
sum.working_transfer_overtime as workingtransferovertime,
sum.rest_transfer_overtime as resttransferovertime,
sum.holiday_transfer_overtime as holidaytransferovertime -->