From 334ae6d3ba9992f5f081c6800af486a19c019c38 Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: Thu, 21 Aug 2025 16:38:19 +0800
Subject: [PATCH] 查询统计优化
---
expert-system/src/main/resources/mapper/system/ProjectManagementMapper.xml | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/expert-system/src/main/resources/mapper/system/ProjectManagementMapper.xml b/expert-system/src/main/resources/mapper/system/ProjectManagementMapper.xml
index 2eeb029..7795254 100644
--- a/expert-system/src/main/resources/mapper/system/ProjectManagementMapper.xml
+++ b/expert-system/src/main/resources/mapper/system/ProjectManagementMapper.xml
@@ -83,6 +83,12 @@
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
<if test="projectCode != null and projectCode != ''"> and project_code like concat('%', #{projectCode}, '%')</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
+ <if test="deptIds != null and deptIds.size() > 0">
+ AND dept_id IN
+ <foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
+ #{deptId}
+ </foreach>
+ </if>
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
<if test="jobCategory != null and jobCategory != ''"> and job_category like concat('%', #{jobCategory}, '%')</if>
<if test="projectAddress != null and projectAddress != ''"> and project_address = #{projectAddress}</if>
@@ -100,7 +106,8 @@
</select>
<select id="selectProjectData" parameterType="ProjectManagement" resultType="com.gkhy.system.domain.vo.response.ProjectDataResp">
- select a.dept_name deptName,c.name expertName,b.tax_expert_fee expertFee,a.create_time createTime,a.project_name projectName,b.major_dangers majorDangers,b.general_hazards generalHazards
+ select a.dept_name deptName,c.name expertName,b.tax_expert_fee expertFee,a.create_time createTime,a.project_name projectName,
+ b.major_dangers majorDangers,b.general_hazards generalHazards,b.travel_expenses travelExpenses,b.accommodation_fee accommodationFee
from project_management a
left join project_expert b on a.id = b.project_id and b.del_flag = 0 and b.evaluation_state = 1
left join sys_expert_info c on b.expert_id = c.id
@@ -108,6 +115,12 @@
<if test="projectName != null and projectName != ''"> and a.project_name like concat('%', #{projectName}, '%')</if>
<if test="projectCode != null and projectCode != ''"> and a.project_code like concat('%', #{projectCode}, '%')</if>
<if test="deptId != null "> and a.dept_id = #{deptId}</if>
+ <if test="deptIds != null and deptIds.size() > 0">
+ AND a.dept_id IN
+ <foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
+ #{deptId}
+ </foreach>
+ </if>
<if test="projectDateStart != null "> and date_format(a.project_date_start,'%Y%m%d') >= date_format(#{projectDateStart},'%Y%m%d')</if>
<if test="projectDateEnd != null "> and date_format(a.project_date_end,'%Y%m%d') <= date_format(#{projectDateEnd},'%Y%m%d')</if>
order BY a.dept_name asc ,c.`name` desc
--
Gitblit v1.9.2