2025-05-13 21:21:20 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
<!DOCTYPE mapper
|
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
<mapper namespace="com.ruoyi.oa.mapper.OaReportSummaryMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="com.ruoyi.oa.domain.OaReportSummary" id="OaReportSummaryResult">
|
2025-05-15 21:35:16 +08:00
|
|
|
<result property="summaryId" column="summary_id"/>
|
2025-05-13 21:21:20 +08:00
|
|
|
<result property="reportTitle" column="report_title"/>
|
|
|
|
|
<result property="reportDate" column="report_date"/>
|
|
|
|
|
<result property="reporter" column="reporter"/>
|
|
|
|
|
<result property="projectId" column="project_id"/>
|
|
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
|
<result property="delFlag" column="del_flag"/>
|
|
|
|
|
<result property="remark" column="remark"/>
|
2025-05-15 21:35:16 +08:00
|
|
|
<result property="type" column="type"/>
|
2025-05-13 21:21:20 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<select id="selectVoPageWithProject" resultType="com.ruoyi.oa.domain.vo.OaReportSummaryVo">
|
|
|
|
|
SELECT
|
2025-05-15 21:35:16 +08:00
|
|
|
s.summary_id as summaryId,
|
2025-05-13 21:21:20 +08:00
|
|
|
s.report_title AS reportTitle,
|
|
|
|
|
s.report_date AS reportDate,
|
|
|
|
|
s.reporter,
|
|
|
|
|
s.project_id AS projectId,
|
|
|
|
|
s.remark,
|
2025-05-20 09:11:45 +08:00
|
|
|
s.type,
|
2025-06-09 10:32:37 +08:00
|
|
|
p.project_name AS projectName,
|
|
|
|
|
d.latest_create_time AS lastUpdateTime
|
2025-05-13 21:21:20 +08:00
|
|
|
FROM oa_report_summary s
|
|
|
|
|
LEFT JOIN sys_oa_project p ON s.project_id = p.project_id
|
2025-06-09 10:32:37 +08:00
|
|
|
LEFT JOIN (
|
|
|
|
|
SELECT
|
|
|
|
|
summary_id,
|
|
|
|
|
create_time AS latest_create_time,
|
|
|
|
|
ROW_NUMBER() OVER (PARTITION BY summary_id ORDER BY create_time DESC) AS rn
|
|
|
|
|
FROM oa_report_detail
|
|
|
|
|
) d ON s.summary_id = d.summary_id AND d.rn = 1
|
2025-05-13 21:21:20 +08:00
|
|
|
<where>
|
|
|
|
|
<if test="bo.reportTitle != null and bo.reportTitle != ''">
|
|
|
|
|
AND s.report_title LIKE CONCAT('%', #{bo.reportTitle}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="bo.reportDate != null">
|
|
|
|
|
AND s.report_date = #{bo.reportDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="bo.reporter != null and bo.reporter != ''">
|
|
|
|
|
AND s.reporter LIKE CONCAT('%', #{bo.reporter}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="bo.projectId != null">
|
|
|
|
|
AND s.project_id = #{bo.projectId}
|
2025-05-20 09:11:45 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="bo.type != null">
|
|
|
|
|
AND s.type = #{bo.type}
|
2025-05-13 21:21:20 +08:00
|
|
|
</if>
|
|
|
|
|
AND s.del_flag = 0
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|