| | |
| | | <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, |
| | |
| | | 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> |