Browse Source

refactor(pms): 重构工作计划数据查询逻辑

- 修改 getWorkPlanDataWithObjectID 查询语句以使用新的视图表 eam_workPlan_overview
- 更新字段映射关系并使用别名优化查询结果
- 更改表连接逻辑以支持新的数据库结构
- 调整删除标志和状态过滤条件
- 优化查询性能并保持相同的业务逻辑功能
master
qiankanghui 2 weeks ago
parent
commit
427e1abce6
  1. 48
      src/main/resources/mapper/pms/EamMapper.xml

48
src/main/resources/mapper/pms/EamMapper.xml

@ -1679,15 +1679,45 @@
</insert>
<select id="getWorkPlanDataWithObjectID" resultType="com.xujie.sys.modules.pms.data.EamWorkPlanInData">
SELECT a.Site,a.PlanID,a.PlanDesc,a.ObjectID,a.FunctionType,a.PropertiesCode,a.Operator,a.PlanPeriod,a.Status,
a.PlanStartDate,a.PlanEndDate,a.CreatedDate,a.CreatedBy,a.UpdateDate,a.UpdateBy,a.Version,a.Remark
,a.NextWorkDate,b.ObjectDesc,c.adminName,d.code_desc
FROM eam_workPlan a
left join eam_object b on a.Site=b.Site and a.ObjectID=b.ObjectID
left join eam_admin c on a.Site=c.Site and a.operator=c.AdminID
left join eam_properties_model_header d on a.FunctionType=d.function_type and a.PropertiesCode=d.code_no
where a.site=#{site} and a.ObjectID=#{objectID} and a.FunctionType=#{functionType} and a.DeleteFlag='N'
and status in ('已计划','进行中')
SELECT
a.site AS site,
a.plan_id AS planID,
a.plan_desc AS planDesc,
wp.ObjectID AS objectID,
a.function_type AS functionType,
a.properties_code AS propertiesCode,
a.operator AS operator,
a.plan_period AS planPeriod,
a.status AS status,
a.plan_start_date AS planStartDate,
a.plan_end_date AS planEndDate,
a.created_date AS createdDate,
a.created_by AS createdBy,
a.update_date AS updateDate,
a.update_by AS updateBy,
a.remark AS remark,
a.next_work_date AS nextWorkDate,
b.ObjectDesc AS objectDesc,
a.operator_name AS adminName,
d.code_desc AS codeDesc
FROM eam_workPlan_overview a
LEFT JOIN eam_workPlan wp
ON a.site = wp.Site
AND a.bu_no = wp.bu_no
AND a.plan_id = wp.PlanID
AND wp.deleteFlag = 'N'
LEFT JOIN eam_object b
ON wp.Site = b.Site
AND wp.ObjectID = b.ObjectID
LEFT JOIN eam_properties_model_header d
ON a.function_type = d.function_type
AND a.properties_code = d.code_no
WHERE a.site = #{site}
AND wp.ObjectID = #{objectID}
AND a.function_type = #{functionType}
AND a.delete_flag = 'N'
AND a.status IN ('已计划','进行中')
</select>
<select id="getObjectItemList" resultType="com.xujie.sys.modules.pms.data.EamObjectItemInData">

Loading…
Cancel
Save