From 44e8e5f551af469f7ffd65918120e769d36eecda Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 26 二月 2025 16:46:53 +0800
Subject: [PATCH] 项目审核bug
---
business/src/main/resources/mapper/ProjectPlanExamineRecordMapper.xml | 128 +++++++++++++++++++++++++++++++++++++++++-
1 files changed, 124 insertions(+), 4 deletions(-)
diff --git a/business/src/main/resources/mapper/ProjectPlanExamineRecordMapper.xml b/business/src/main/resources/mapper/ProjectPlanExamineRecordMapper.xml
index b9469a5..bac2ea6 100644
--- a/business/src/main/resources/mapper/ProjectPlanExamineRecordMapper.xml
+++ b/business/src/main/resources/mapper/ProjectPlanExamineRecordMapper.xml
@@ -5,6 +5,7 @@
<!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
<resultMap id="BaseResultMap" type="com.ycl.domain.vo.ProjectPlanExamineRecordVO">
<result column="project_plan_record_id" property="projectPlanRecordId" />
+ <result column="project_plan_info_id" property="projectPlanInfoId" />
<result column="department_user_id" property="departmentUserId" />
<result column="manager_user_id" property="managerUserId" />
<result column="department_examine" property="departmentExamine" />
@@ -16,14 +17,81 @@
<result column="event_type" property="eventType" />
<result column="delay_start_time" property="delayStartTime" />
<result column="delay_end_time" property="delayEndTime" />
- <result column="gmt_create_time" property="gmtCreateTime" />
- <result column="gmt_update_time" property="gmtUpdateTime" />
+ <result column="gmt_create" property="gmtCreate" />
+ <result column="gmt_update" property="gmtUpdate" />
</resultMap>
+ <resultMap id="selectInfoResultMap" type="com.ycl.domain.vo.DepartmentApprovalResponseVO">
+ <id property="id" column="id" />
+ <result property="title" column="title" />
+ <result property="departmentExamine" column="department_examine" />
+ <result property="departmentApproval" column="department_approval" />
+ <result property="departmentApprovalReply" column="department_approval_reply" />
+ <result property="manageExamine" column="manage_examine" />
+ <result property="manageApproval" column="manage_approval" />
+ <result property="manageApprovalReply" column="manage_approval_reply" />
+ <result property="gmtCreate" column="gmt_create" />
+ </resultMap>
+ <resultMap id="selectToDoResultMap" type="com.ycl.domain.vo.ProjectProcessToDoVo">
+ <result column="plan_id" property="planId"/>
+ <result column="project_info_id" property="projectInfoId"></result>
+ <result column="project_name" property="projectName"></result>
+ <result column="project_plan_info_id" property="projectPlanInfoId"></result>
+ <result column="project_plan_record_id" property="projectPlanRecordId"></result>
+ <result column="project_plan_examine_record_id" property="projectPlanExamineRecordId"></result>
+ <result column="title" property="projectPlanInfoTitle"></result>
+ <result column="start_time" property="startTime"></result>
+ <result column="end_time" property="endTime"></result>
+ <result column="progress_status" property="progressStatus"></result>
+ <result column="assignee_name" property="assigneeName"/>
+ </resultMap>
-
-
+ <insert id="insertOne">
+ insert into t_project_plan_examine_record (
+ project_plan_record_id,
+ project_plan_info_id,
+ department_user_id,
+ manager_user_id,
+ department_examine,
+ department_approval,
+ department_approval_reply,
+ manage_examine,
+ manage_approval,
+ manage_approval_reply,
+ event_type,
+ delay_start_time,
+ delay_end_time,
+ gmt_create,
+ gmt_update,
+ deleted
+ ) values (
+ #{projectPlanRecordId},
+ #{projectPlanInfoId},
+ #{departmentUserId},
+ #{managerUserId},
+ #{departmentExamine},
+ #{departmentApproval},
+ #{departmentApprovalReply},
+ #{manageExamine},
+ #{manageApproval},
+ #{manageApprovalReply},
+ #{eventType},
+ #{delayStartTime},
+ #{delayEndTime},
+ #{gmtCreate},
+ #{gmtUpdate},
+ #{deleted}
+ )
+ </insert>
+ <update id="updateByForm">
+ update t_project_plan_examine_record
+ set
+ department_approval_reply = #{form.departmentApprovalReply},
+ manage_approval_reply = #{form.manageApprovalReply}
+ where
+ id = #{form.id}
+ </update>
<select id="getById" resultMap="BaseResultMap">
@@ -72,5 +140,57 @@
WHERE
TPPER.deleted = 0
</select>
+ <select id="selectInfo" resultType="com.ycl.domain.vo.DepartmentApprovalResponseVO">
+ SELECT
+ ranked.id,
+ ppi.id AS project_plan_info_id,
+ (SELECT title FROM t_project_plan_info WHERE id = ranked.project_plan_info_id) as title,
+ ranked.department_examine,
+ ranked.department_approval,
+ ranked.department_approval_reply,
+ ranked.manage_examine,
+ ranked.manage_approval,
+ ranked.manage_approval_reply,
+ ranked.gmt_create,
+ ppi.plan_status
+ FROM (
+ SELECT
+ *,
+ ROW_NUMBER() OVER (PARTITION BY project_plan_info_id ORDER BY gmt_update DESC) AS rn
+ FROM t_project_plan_examine_record AS pper
+ WHERE project_plan_record_id = #{projectPlanRecordId}
+ ) AS ranked
+ LEFT JOIN t_project_plan_info ppi ON ranked.project_plan_info_id = ppi.id
+ WHERE rn = 1 AND ranked.deleted = 0
+ Order by gmt_create DESC
+ </select>
+
+ <select id="getPlanLog" resultType="com.ycl.domain.vo.DepartmentApprovalResponseVO">
+ SELECT
+ pper.id,
+ (SELECT title FROM t_project_plan_info WHERE id = pper.project_plan_info_id) as title,
+ pper.department_examine,
+ pper.department_approval,
+ pper.department_approval_reply,
+ pper.manage_examine,
+ pper.manage_approval,
+ pper.manage_approval_reply,
+ pper.gmt_create
+ FROM t_project_plan_examine_record AS pper
+ WHERE
+ pper.project_plan_record_id = #{projectPlanRecordId}
+ AND pper.event_type != 2
+ AND pper.deleted = 0
+ ORDER BY gmt_update DESC
+ </select>
+ <select id="todoList" resultMap="selectToDoResultMap">
+ SELECT ppe.id project_plan_examine_record_id,ppi.title ,ppr.project_info_id,pi.project_name,ppi.start_time,ppi.end_time,ppi.progress_status,ppe.project_plan_info_id,ppe.project_plan_record_id,ppr.plan_id,
+ (SELECT user_name from sys_user WHERE user_id = #{userId}) as assignee_name
+ from t_project_plan_examine_record ppe
+ LEFT JOIN t_project_plan_info ppi on ppe.project_plan_info_id = ppi.id
+ LEFT JOIN t_project_plan_record ppr on ppe.project_plan_record_id = ppr.id
+ Left JOIN t_project_info pi on ppr.project_info_id = pi.id AND pi.deleted = 0
+ WHERE ppe.department_user_id = #{userId} or manager_user_id = #{userId}
+ </select>
</mapper>
--
Gitblit v1.8.0