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
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}
where a.function_type = #{functionType} and a.code_no = #{codeNo} and a.site = #{site} and a.bu_no = #{buNo} and a.check_type = #{checkType}
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 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}
where a.site = #{site} and c.orderNo = #{orderNo} and a.ObjectID = #{objectID} and a.bu_no = #{buNo}
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}