select A.*
from (
select awhd.*,name
FROM auxiliary_working_hours_day awhd
left join user on name_user=user.id
WHERE 1=1
and name_user in
#{val}
) A
${ew.customSqlSegment}
select awhd.*,name
FROM auxiliary_working_hours_day awhd
left join user on name_user=user.id
WHERE 1=1
and name_user in
#{val}
select * from auxiliary_working_hours_day
where state='已审核'
and name_user in
#{val}
select A.name,
A.month,
FORMAT(SUM(manHour), 4)as manHours
from(
select user.name,
case when reviewer_nonproductive_time is null then nonproductive_time
else reviewer_nonproductive_time end as manHour,
date_time as month
from auxiliary_working_hours_day awhd
left join user on user.id=awhd.name_user
left join department_lims dl on depart_lims_id=dl.id
where date_time LIKE CONCAT('%', #{month}, '%')
and awhd.state='已批准'
and name_user in
#{val}
order by month,user.name
)A
group by A.name,A.month
order by A.name,A.month
select * from(select * from auxiliary_working_hours_day
WHERE 1=1
and name_user in
#{val}
) A
${ew.customSqlSegment}