feat(oa): 新增设计项目汇报功能

- 添加汇报详情和汇报概述的接口和服务实现
- 创建相关的实体类、BO、VO和Mapper
- 实现汇报列表查询、详情查询、新增、修改和删除功能
- 优化汇报列表展示,加入最近更新时间字段
This commit is contained in:
2025-08-08 17:31:34 +08:00
parent b3feb0d1c7
commit 4ec4c9d173
17 changed files with 1129 additions and 1 deletions

View File

@@ -0,0 +1,67 @@
<?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.gear.oa.mapper.OaReportDetailMapper">
<resultMap type="com.gear.oa.domain.OaReportDetail" id="OaReportDetailResult">
<result property="detailId" column="detail_id"/>
<result property="summaryId" column="summary_id"/>
<result property="deviceCode" column="device_code"/>
<result property="category" column="category"/>
<result property="deviceDescription" column="device_description"/>
<result property="reportDetail" column="report_detail"/>
<result property="ossIds" column="oss_ids"/>
<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"/>
</resultMap>
<select id="selectVoByIdPlus" parameterType="Long" resultType="com.gear.oa.domain.vo.OaReportDetailVo">
select ord.detail_id,
summary_id,
device_code,
category,
device_description,
report_detail,
oss_ids,
create_by,
create_time,
update_by,
update_time,
del_flag,
remark,
(
SELECT GROUP_CONCAT(so.url SEPARATOR ',')
FROM sys_oss so
WHERE FIND_IN_SET(so.oss_id, ord.oss_ids) > 0
) AS images
from oa_report_detail ord
where ord.detail_id = #{id}
</select>
<select id="queryByProjectId" resultType="com.gear.oa.domain.vo.OaReportDetailVo">
select ord.detail_id,
ord.summary_id,
ord.device_code,
ord.category,
ord.device_description,
ord.report_detail,
ord.oss_ids,
ord.create_by,
ord.create_time,
ord.update_by,
ord.update_time,
ord.del_flag,
ord.remark
from oa_report_detail ord
left join oa_report_summary ors on ors.summary_id = ord.summary_id
where project_id = #{projectId}
</select>
</mapper>

View File

@@ -0,0 +1,59 @@
<?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.gear.oa.mapper.OaReportSummaryMapper">
<resultMap type="com.gear.oa.domain.OaReportSummary" id="OaReportSummaryResult">
<result property="summaryId" column="summary_id"/>
<result property="reportTitle" column="report_title"/>
<result property="reportDate" column="report_date"/>
<result property="reporter" column="reporter"/>
<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"/>
<result property="type" column="type"/>
</resultMap>
<select id="selectVoPageWithProject" resultType="com.gear.oa.domain.vo.OaReportSummaryVo">
SELECT
s.summary_id as summaryId,
s.report_title AS reportTitle,
s.report_date AS reportDate,
s.reporter,
s.remark,
s.type,
d.latest_create_time AS lastUpdateTime
FROM oa_report_summary s
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
<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.type != null">
AND s.type = #{bo.type}
</if>
AND s.del_flag = 0
</where>
ORDER BY
COALESCE(d.latest_create_time, s.report_date) DESC,
s.report_date DESC
</select>
</mapper>