From 99c3d7ccf9d518d441fc1af09f792f703f8f01de Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期三, 27 十一月 2024 02:38:54 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- business/src/main/resources/mapper/ProjectPlanExamineRecordMapper.xml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/business/src/main/resources/mapper/ProjectPlanExamineRecordMapper.xml b/business/src/main/resources/mapper/ProjectPlanExamineRecordMapper.xml index 32dc202..14a03c2 100644 --- a/business/src/main/resources/mapper/ProjectPlanExamineRecordMapper.xml +++ b/business/src/main/resources/mapper/ProjectPlanExamineRecordMapper.xml @@ -20,6 +20,19 @@ <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> + <insert id="insertOne"> insert into t_project_plan_examine_record ( project_plan_record_id, @@ -55,6 +68,14 @@ #{gmtUpdate} ) </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"> @@ -103,5 +124,42 @@ WHERE TPPER.deleted = 0 </select> + <select id="selectInfo" resultType="com.ycl.domain.vo.DepartmentApprovalResponseVO"> + SELECT + ranked.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 + 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 + WHERE rn = 1; + </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} + ORDER BY gmt_update DESC + </select> </mapper> -- Gitblit v1.8.0