|
|
|
@ -3733,8 +3733,7 @@ |
|
|
|
dbo.eam_Get_eamObjectDesc(a.Site, a.bu_no, a.ObjectID) as objectDesc, |
|
|
|
b.reach_date as createdDate, |
|
|
|
b.reach_operator_name as createdBy, |
|
|
|
'' as feedbackBy, |
|
|
|
b.repair_type |
|
|
|
'' as feedbackBy |
|
|
|
from eam_defect_feedBack as a |
|
|
|
left join eam_workOrder as b on a.site = b.site and a.bu_no = b.bu_no and b.PlanID = a.feedBackID |
|
|
|
<where> |
|
|
|
@ -3790,8 +3789,7 @@ |
|
|
|
a.confirm_assessment, |
|
|
|
a.confirm_remark, |
|
|
|
b.CreatedDate, |
|
|
|
dbo.getOperatorDesc(b.site, b.CreatedBy) as createdBy, |
|
|
|
a.repair_type |
|
|
|
dbo.getOperatorDesc(b.site, b.CreatedBy) as createdBy |
|
|
|
FROM eam_workOrder as a |
|
|
|
left join eam_defect_feedBack as b on a.site = b.site and a.bu_no = b.bu_no and a.PlanID = b.feedBackID |
|
|
|
where a.Site = #{site} and a.bu_no = #{buNo} and a.OrderNo = #{orderNo} and a.FunctionType = #{functionType} |
|
|
|
@ -4150,52 +4148,153 @@ |
|
|
|
select site, component_part_no as componentPartNo, notify_no as notifyNo |
|
|
|
from sound_box_email_log |
|
|
|
</select> |
|
|
|
<select id="getEamPropertiesItemByItemNo" resultType="com.xujie.sys.modules.pms.data.QcItemData"> |
|
|
|
<select id="eamWorkOrderSearchList" resultType="com.xujie.sys.modules.pms.data.EamMaintainOrderExportData"> |
|
|
|
SELECT |
|
|
|
epi.site, |
|
|
|
epi.bu_no, |
|
|
|
dbo.get_bu_desc(epi.site, epi.bu_no) as buDesc, |
|
|
|
epi.ItemNo, |
|
|
|
epi.ItemDesc, |
|
|
|
epi.DefaultValue, |
|
|
|
epi.ValueType, |
|
|
|
epi.ValueType_DB as valueTypeDb, |
|
|
|
epi.ValueChooseFlag, |
|
|
|
epi.CreatedDate, |
|
|
|
epi.CreatedBy, |
|
|
|
dbo.getOperatorDesc(epi.site, epi.CreatedBy) as createdByDesc, |
|
|
|
epi.MaxValue, |
|
|
|
epi.MinValue, |
|
|
|
epi.ItemRemark, |
|
|
|
epi.ItemType, |
|
|
|
epi.update_date, |
|
|
|
epi.update_by, |
|
|
|
dbo.getOperatorDesc(epi.site, epi.update_by) as updateByDesc, |
|
|
|
qm.method_no, |
|
|
|
qm.method_name, |
|
|
|
qm.method_remark, |
|
|
|
epi.inspection_type_no, |
|
|
|
epi.item_sampling_quantity, |
|
|
|
epi.sampling_programme_no, |
|
|
|
epi.sampling_level_no, |
|
|
|
epi.default_sampling_proportion, |
|
|
|
epi.collection_flag, |
|
|
|
epi.collection_source, |
|
|
|
epi.collection_method, |
|
|
|
CASE WHEN epi.collection_method = 'plc' THEN 'PLC' |
|
|
|
WHEN epi.collection_method = 'file' THEN '文件' |
|
|
|
WHEN epi.collection_method = 'image' THEN '图片' |
|
|
|
else '' end as collectionMethodDesc, |
|
|
|
epi.collection_condition, |
|
|
|
epi.collection_data_content |
|
|
|
FROM eam_properties_item as epi |
|
|
|
LEFT JOIN qc_method_item as qmi on epi.ItemNo = qmi.ItemNo and epi.site = qmi.site and epi.bu_no = qmi.bu_no |
|
|
|
LEFT JOIN qc_method as qm on qmi.method_no = qm.method_no and qmi.site = qm.site and qmi.bu_no = qm.bu_no |
|
|
|
a.Site, |
|
|
|
a.bu_no, |
|
|
|
dbo.get_bu_desc(a.site, a.bu_no) as buDesc, |
|
|
|
a.OrderNo, |
|
|
|
a.PlanID, |
|
|
|
a.PlanDesc, |
|
|
|
a.PropertiesCode, |
|
|
|
a.ObjectID, |
|
|
|
a.Status, |
|
|
|
a.PlanOperator, |
|
|
|
a.checker, |
|
|
|
a.ActualOperator, |
|
|
|
a.PlanDate, |
|
|
|
a.ActualDate, |
|
|
|
a.FunctionType, |
|
|
|
a.CreateDate, |
|
|
|
a.Remark, |
|
|
|
a.StartTime, |
|
|
|
a.EndTime, |
|
|
|
a.WorkTime, |
|
|
|
a.PlanOperatorName, |
|
|
|
a.checkerName, |
|
|
|
dbo.eam_Get_eamAdminName_TPM(a.Site, a.ActualOperator) as actualOperatorName, |
|
|
|
eo.ObjectDesc as objectDesc, |
|
|
|
dbo.eam_Get_eam_properties_CodeDesc(a.site, a.bu_no, a.FunctionType, a.PropertiesCode) as codeDesc, |
|
|
|
a.result, |
|
|
|
a.checkResult, |
|
|
|
a.disposal_measures, |
|
|
|
a.check_work_plan_id, |
|
|
|
a.check_item_no, |
|
|
|
a.reach_date, |
|
|
|
a.reach_operator, |
|
|
|
a.reach_operator_name, |
|
|
|
dbo.joint_id(a.Site, a.bu_no, a.OrderNo, a.FunctionType) as adminID, |
|
|
|
dbo.joint_name(a.Site, a.bu_no, a.OrderNo, a.FunctionType) as operator, |
|
|
|
a.check_remark, |
|
|
|
a.document_source, |
|
|
|
a.last_execution_date, |
|
|
|
a.handling_method, |
|
|
|
a.fault_reason, |
|
|
|
a.preventive_measure, |
|
|
|
a.repair_reporting_type, |
|
|
|
a.repair_type, |
|
|
|
CASE WHEN (DATEDIFF(SECOND, a.CreateDate, a.reach_date) <![CDATA[<]]> 60) THEN DATEDIFF(SECOND, a.CreateDate, a.reach_date) / 60.0 |
|
|
|
ELSE DATEDIFF(MINUTE, a.CreateDate, a.reach_date) |
|
|
|
END AS responseTime, |
|
|
|
a.check_type, |
|
|
|
a.is_return, |
|
|
|
ewo.plan_period, |
|
|
|
ewo.plan_cycle, |
|
|
|
CASE |
|
|
|
when ewo.plan_cycle = '时' then a.PlanDate |
|
|
|
else ewo.task_start_date |
|
|
|
end as taskStartDate |
|
|
|
FROM eam_workOrder a |
|
|
|
left join eam_object as eo on eo.site = a.site and eo.ObjectID = a.ObjectID and eo.bu_no = a.bu_no |
|
|
|
left join sys_department as sd ON eo.site = sd.site and eo.dept_id = sd.department_id and eo.bu_no = sd.bu_no |
|
|
|
left join Access_dept as ead ON ead.site = sd.site and ead.department_id = sd.department_id and ead.bu_no = sd.bu_no |
|
|
|
left join sys_user as ea on ead.username = ea.username |
|
|
|
left join eam_workPlan_overview as ewo on a.site = ewo.site and a.PlanID = ewo.plan_id and a.bu_no = ewo.bu_no |
|
|
|
<where> |
|
|
|
epi.site = #{data.site} and epi.ItemNo = #{data.itemNo} and epi.bu_no = #{data.buNo} |
|
|
|
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})) |
|
|
|
and a.check_type in (select role_no from access_role where username = #{query.userName}) |
|
|
|
and ea.username = #{query.userName} |
|
|
|
AND a.FunctionType = #{query.functionType} |
|
|
|
<if test="query.buDesc != null and query.buDesc != ''"> |
|
|
|
AND dbo.get_bu_desc (a.site, a.bu_no) = #{query.buDesc} |
|
|
|
</if> |
|
|
|
<if test="query.isReturn != null and query.isReturn != ''"> |
|
|
|
AND a.is_return = #{query.isReturn} |
|
|
|
</if> |
|
|
|
<if test="query.orderNo != null and query.orderNo != ''"> |
|
|
|
AND a.OrderNo like '%' + #{query.orderNo} + '%' |
|
|
|
</if> |
|
|
|
<if test="query.planID != null and query.planID != ''"> |
|
|
|
AND a.PlanID like '%' + #{query.planID} + '%' |
|
|
|
</if> |
|
|
|
<if test="query.planDesc != null and query.planDesc != ''"> |
|
|
|
AND a.PlanDesc like '%' + #{query.planDesc} + '%' |
|
|
|
</if> |
|
|
|
<if test="query.objectID != null and query.objectID != ''"> |
|
|
|
AND a.ObjectID like '%' + #{query.objectID} + '%' |
|
|
|
</if> |
|
|
|
<if test="query.planOperatorName != null and query.planOperatorName != ''"> |
|
|
|
AND a.PlanOperatorName like '%' + #{query.planOperatorName} + '%' |
|
|
|
</if> |
|
|
|
<if test="query.actualOperatorName != null and query.actualOperatorName != ''"> |
|
|
|
AND dbo.eam_Get_eamAdminName_TPM(a.Site, a.ActualOperator) like '%' + #{query.actualOperatorName} + '%' |
|
|
|
</if> |
|
|
|
<if test='(query.status == null || query.status == "") and query.functionType == "A" and query.searchType == "checkOrder" '> |
|
|
|
AND a.status != '已取消' |
|
|
|
</if> |
|
|
|
<if test='query.status != null and query.status != "" and query.functionType == "A" and query.searchType == "checkOrder" '> |
|
|
|
AND a.status = #{query.status} |
|
|
|
</if> |
|
|
|
<if test='query.functionType == "A" and query.searchType == "reportCheck" '> |
|
|
|
AND a.status = '未开工' |
|
|
|
</if> |
|
|
|
<if test='(query.status == null || query.status == "") and query.functionType == "B" and query.searchType == "maintenanceOrder" '> |
|
|
|
AND a.status != '已取消' |
|
|
|
</if> |
|
|
|
<if test='query.status != null and query.status != "" and query.functionType == "B" and query.searchType == "maintenanceOrder" '> |
|
|
|
AND a.status = #{query.status} |
|
|
|
</if> |
|
|
|
<if test='query.functionType == "B" and query.searchType == "reportMaintenance" '> |
|
|
|
AND (a.status = '未开工' or a.status = '已到达') |
|
|
|
</if> |
|
|
|
<if test='(query.status == null || query.status == "") and query.functionType == "C" and query.searchType == "reportDefect" '> |
|
|
|
AND (a.status = '未开工' or a.status = '已到达') |
|
|
|
</if> |
|
|
|
<if test='query.status != null and query.status != "" and query.functionType == "C" and query.searchType == "reportDefect" '> |
|
|
|
AND a.status = #{query.status} |
|
|
|
</if> |
|
|
|
<if test='query.documentSource != null and query.documentSource != "" and query.functionType == "C" and query.searchType == "reportDefect" '> |
|
|
|
AND a.document_source = #{query.documentSource} |
|
|
|
</if> |
|
|
|
<if test="query.planDate != null"> |
|
|
|
AND a.PlanDate = #{query.planDate} |
|
|
|
</if> |
|
|
|
<if test="query.startDate != null "> |
|
|
|
AND a.PlanDate >= #{query.startDate} |
|
|
|
</if> |
|
|
|
<if test="query.endDate != null "> |
|
|
|
AND #{query.endDate} >= a.PlanDate |
|
|
|
</if> |
|
|
|
<if test="query.endDate == null "> |
|
|
|
AND getDate() >= a.PlanDate |
|
|
|
</if> |
|
|
|
<if test='query.functionType == "A" and query.searchType == "reportCheck"'> |
|
|
|
and getDate() >= dbo.compare_date(ewo.task_start_date) |
|
|
|
</if> |
|
|
|
<if test="query.repairReportingType != null and query.repairReportingType != ''"> |
|
|
|
AND a.repair_reporting_type = #{query.repairReportingType} |
|
|
|
</if> |
|
|
|
<if test="query.repairType != null and query.repairType != ''"> |
|
|
|
AND a.repair_type = #{query.repairType} |
|
|
|
</if> |
|
|
|
<if test="query.checkType != null and query.checkType != ''"> |
|
|
|
AND a.check_type = #{query.checkType} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
|
|
|
|
ORDER BY a.CreateDate |
|
|
|
</select> |
|
|
|
|
|
|
|
<insert id="saveSoundBoxEmailLog" parameterType="com.xujie.sys.modules.pms.entity.SoundBoxEmailLog"> |
|
|
|
insert into sound_box_email_log (site, component_part_no, notify_no, request_data, response_data, email, created_at, user_id, username) |
|
|
|
values (#{site}, #{componentPartNo}, #{notifyNo}, #{requestData}, #{responseData}, #{email}, #{createdAt}, #{userId}, #{username}) |
|
|
|
|