dbo.joint_name(a.Site, a.bu_no, (select OrderNo from eam_workOrder where PlanID = a.FeedBackID and site = a.site and Result = '维修完成' and bu_no = a.bu_no),a.FunctionType) as actualOperatorName,
a.repair_reporting_type,
a.repair_type
a.repair_type,
f.department_name as department,
g.LocationName
from eam_defect_feedBack a
left join eam_defect b on a.DefectID = b.DefectID
left join operator as c on a.site = c.site and a.CreatedBy = c.operator_id
@ -1663,6 +1665,7 @@
left join sys_department as f on e.site = f.site and e.dept_id = f.department_id and e.bu_no = f.bu_no
left join Access_dept as ead ON ead.site = f.site and ead.department_id = f.department_id and ead.bu_no = f.bu_no
left join sys_user as ea on ead.username = ea.username
left join eam_location as g on e.site = g.site and e.LocationID = g.LocationID and e.bu_no = g.bu_no
<where>
a.site in (select site from eam_access_site where username = #{query.userName})
and (a.site + '-' + a.bu_no) in (select * from dbo.query_bu(#{query.userName}))
@ -1700,6 +1703,12 @@
<iftest="query.repairType != null and query.repairType != ''">
AND a.repair_type = #{query.repairType}
</if>
<iftest="query.department != null and query.department != ''">
AND f.department_name like '%' + #{query.department} + '%'
</if>
<iftest="query.locationName != null and query.locationName != ''">
AND g.LocationName like '%' + #{query.locationName} + '%'