diff --git a/src/main/resources/mapper/pms/EamMapper.xml b/src/main/resources/mapper/pms/EamMapper.xml
index 8c30f8f2..dd778960 100644
--- a/src/main/resources/mapper/pms/EamMapper.xml
+++ b/src/main/resources/mapper/pms/EamMapper.xml
@@ -446,7 +446,7 @@
FROM eam_properties_model_detail a
left join eam_properties_item b on a.function_type = b.itemType and a.properties_item_no = b.itemNo and a.site = b.site and a.bu_no = b.bu_no and a.check_type = b.check_type
where a.function_type = #{functionType} and a.code_no = #{codeNo} and a.site = #{site} and a.bu_no = #{buNo} and a.check_type = #{checkType}
- order by order_id
+ order by a.order_id
@@ -1398,15 +1398,17 @@
a.ItemType,
a.image_flag,
a.produce_control_flag,
- CASE WHEN b.id is null THEN 'N'
+ CASE WHEN d.id is null THEN 'N'
ELSE 'Y'
END as uploadFlag,
a.item_notes
from eam_workPlan_item as a
left join eam_workOrder as c on a.site = c.site and a.PlanID = c.PlanID and a.bu_no = c.bu_no
- left join (SELECT MAX (id) as id, order_ref1, order_ref2, order_ref3, order_ref4 FROM sys_oss GROUP BY order_ref1, order_ref2, order_ref3, order_ref4) as b
- on b.order_ref1 = a.site and b.order_ref2 = c.OrderNo and b.order_ref3 = a.ItemNo and order_ref4 = a.bu_no
+ left join eam_properties_model_detail pmd on a.Site = pmd.site and a.ItemType = pmd.function_type and a.ItemNo = pmd.properties_item_no and a.bu_no = pmd.bu_no and pmd.code_no = c.PropertiesCode
+ left join (SELECT MAX (id) as id, order_ref1, order_ref2, order_ref3, order_ref4 FROM sys_oss GROUP BY order_ref1, order_ref2, order_ref3, order_ref4) as d
+ on d.order_ref1 = a.site and d.order_ref2 = c.OrderNo and d.order_ref3 = a.ItemNo and d.order_ref4 = a.bu_no
where a.site = #{site} and c.orderNo = #{orderNo} and a.ObjectID = #{objectID} and a.bu_no = #{buNo}
+ order by pmd.order_id
@@ -1524,28 +1526,31 @@
SELECT
- Site,
- bu_no,
- OrderNo,
- ItemNo,
- ItemDesc,
- DefaultValue,
- ValueType,
- ValueType_DB,
- ValueChooseFlag,
- MaxValue,
- MinValue,
- ItemRemark,
- ItemType,
- TextValue,
- NumberValue,
- CreatedDate,
- CreatedBy,
- FinishFlag,
- itemResult,
- item_notes
- from eam_workOrder_item
- where site = #{site} and orderNo = #{orderNo} and bu_no = #{buNo}
+ a.Site,
+ a.bu_no,
+ a.OrderNo,
+ a.ItemNo,
+ a.ItemDesc,
+ a.DefaultValue,
+ a.ValueType,
+ a.ValueType_DB,
+ a.ValueChooseFlag,
+ a.MaxValue,
+ a.MinValue,
+ a.ItemRemark,
+ a.ItemType,
+ a.TextValue,
+ a.NumberValue,
+ a.CreatedDate,
+ a.CreatedBy,
+ a.FinishFlag,
+ a.itemResult,
+ a.item_notes
+ from eam_workOrder_item a
+ left join eam_workOrder c on a.site = c.site and a.orderNo = c.orderNo and a.bu_no = c.bu_no
+ left join eam_properties_model_detail pmd on a.site = pmd.site and a.ItemType = pmd.function_type and a.ItemNo = pmd.properties_item_no and a.bu_no = pmd.bu_no and pmd.code_no = c.PropertiesCode
+ where a.site = #{site} and a.orderNo = #{orderNo} and a.bu_no = #{buNo}
+ order by pmd.order_id
@@ -2609,6 +2614,7 @@
left join eam_properties_model_detail b on a.ItemType = b.function_type and a.ItemNo = b.properties_item_no and a.site = b.site and a.bu_no = b.bu_no
left join eam_object_item c on a.ItemType = c.ItemType and a.ItemNo = c.ItemNo and c.objectID = #{objectID}
where a.ItemType = #{itemType} and b.code_no = #{propertiesCode} and a.site = #{site} and a.bu_no = #{buNo}
+ order by b.order_id