select *
from (
select aowh.id,
aowh.inspection_item_class,
aowh.inspection_item,
aowh.inspection_item_subclass,
aowh.overtime_order_no,
aowh.overtime_work_time,
aowh.overtime_amount,
aowh.order_no,
aowh.work_time,
aowh.amount,
aowh.output_work_time,
aowh.date_time,
aowh.week,
aowh.week_day,
user.name,
aowh.sample,
aowh.price,
aowh.man_hour_group,
ip.cable_tag
FROM auxiliary_output_working_hours aowh
left join ins_product ip on ip.id = aowh.ins_product_id
left join user on user.id=aowh.`check`
WHERE 1=1
and `check` in
#{val}
) A
${ew.customSqlSegment}
select aowh.*, name, ip.cable_tag cableTag
FROM auxiliary_output_working_hours aowh
left join ins_product ip on ip.id = aowh.ins_product_id
left join user on user.id = aowh.`check`
WHERE 1 = 1
and `check` in
#{val}
select A.name,
A.month,
FORMAT(SUM(A.manHours), 4) manHours
from(
select user.name,
date_time as month,
order_no,
sample,
man_hour_group,
case when #{type}='加班工时' then case when overtime_work_time is null then 0 else overtime_work_time end
else case when work_time is null then 0 else work_time end end as manHours
-- FORMAT(SUM(output_work_time), 4) as manHours
from auxiliary_output_working_hours aowh
left join user on user.id=aowh.`check`
left join department_lims dl on depart_lims_id=dl.id
where date_time LIKE CONCAT('%', #{month}, '%')
and `check` in
#{val}
group by user.name,date_time,order_no,
sample,
man_hour_group
order by user.name,date_time,order_no,
sample,
man_hour_group
)A
group by A.name,
A.month
order by A.name,
A.month
select * from auxiliary_output_working_hours
where 1=1
and `check` in
#{val}
select * from(select * from auxiliary_output_working_hours
WHERE 1=1
and `check` in
#{val}
) A
${ew.customSqlSegment}
select sum(aowh.work_time) yieldHour,
u.name userName,
aowh.`check` userId,
#{dto.month} month
from (SELECT *
FROM auxiliary_output_working_hours
GROUP BY CASE
WHEN man_hour_group IS NOT NULL AND man_hour_group != '' THEN man_hour_group
ELSE id
END
, CASE
WHEN man_hour_group IS NOT NULL AND man_hour_group != '' THEN order_id
ELSE id
END) aowh
left join user u on u.id = aowh.`check`
where aowh.date_time between #{dto.beginDate} and #{dto.endDate}
and aowh.`check` in
#{val}
group by aowh.`check`
select sum(awhd.reviewer_nonproductive_time) subsidiaryHour,
u.name userName,
awhd.name_user userId,
#{dto.month} month
from auxiliary_working_hours_day awhd
left join user u on u.id = awhd.name_user
where awhd.date_time between #{dto.beginDate} and #{dto.endDate}
and awhd.state = '已批准'
and awhd.name_user in
#{val}
group by awhd.name_user