Files
fad_oa/ruoyi-oa/src/main/resources/mapper/oa/OaProjectReportMapper.xml

95 lines
3.5 KiB
XML
Raw Normal View History

2025-06-16 13:25:00 +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.OaProjectReportMapper">
<resultMap type="com.ruoyi.oa.domain.OaProjectReport" id="OaProjectReportResult">
<result property="reportId" column="report_id"/>
<result property="userId" column="user_id"/>
<result property="workPlace" column="work_place"/>
<result property="projectId" column="project_id"/>
<result property="content" column="content"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="delFlag" column="del_flag"/>
<result property="remark" column="remark"/>
</resultMap>
2025-06-16 15:59:23 +08:00
2025-06-16 13:25:00 +08:00
<select id="selectVoPagePlus" resultType="com.ruoyi.oa.domain.vo.OaProjectReportVo">
select opr.report_id,
opr.user_id,
is_trip,
work_place,
opr.project_id,
content,
opr.create_time,
opr.create_by,
opr.update_time,
opr.update_by,
opr.del_flag,
opr.remark,
op.project_name,
op.project_num,
op.project_code,
su.nick_name,
sd.dept_name
from oa_project_report opr
left join sys_oa_project op on opr.project_id = op.project_id
left join sys_user su on su.user_id = opr.user_id
left join sys_dept sd on su.dept_id = sd.dept_id
${ew.getCustomSqlSegment}
</select>
<select id="selectVoByIdPlus" resultType="com.ruoyi.oa.domain.vo.OaProjectReportVo">
select opr.report_id,
opr.user_id,
is_trip,
work_place,
opr.project_id,
content,
opr.create_time,
opr.create_by,
opr.update_time,
opr.update_by,
opr.del_flag,
opr.remark,
op.project_name,
op.project_num,
op.project_code,
su.nick_name,
sd.dept_name
from oa_project_report opr
left join sys_oa_project op on opr.project_id = op.project_id
left join sys_user su on su.user_id = opr.user_id
left join sys_dept sd on su.dept_id = sd.dept_id
where report_id = #{reportId}
</select>
2025-06-16 15:59:23 +08:00
<!-- 查询 content 中包含 “完成” 的记录数,按时间过滤 -->
<select id="countWithCompleted" parameterType="java.util.Date" resultType="Long">
SELECT COUNT(*)
FROM oa_project_report
WHERE del_flag = 0
AND content LIKE CONCAT('%', '完成', '%')
AND create_time &gt;= #{createTime}
</select>
<!-- 查询 content 中包含 “未完成” 或 “等待” 或 “待” 的记录数,按时间过滤 -->
<select id="countWithPending" parameterType="java.util.Date" resultType="Long">
SELECT COUNT(*)
FROM oa_project_report
WHERE del_flag = 0
AND (
content LIKE CONCAT('%', '未完成', '%')
OR content LIKE CONCAT('%', '等待', '%')
OR content LIKE CONCAT('%', '待', '%')
)
AND create_time &gt;= #{createTime}
</select>
2025-06-16 13:25:00 +08:00
</mapper>