From caf2acbee7e25afde41c169a0eba471e5b08b523 Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: 星期四, 28 八月 2025 13:02:09 +0800
Subject: [PATCH] 版本改造

---
 expert-system/src/main/resources/mapper/system/ProjectManagementMapper.xml |   83 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 75 insertions(+), 8 deletions(-)

diff --git a/expert-system/src/main/resources/mapper/system/ProjectManagementMapper.xml b/expert-system/src/main/resources/mapper/system/ProjectManagementMapper.xml
index 7795254..838b11e 100644
--- a/expert-system/src/main/resources/mapper/system/ProjectManagementMapper.xml
+++ b/expert-system/src/main/resources/mapper/system/ProjectManagementMapper.xml
@@ -50,7 +50,15 @@
         <result property="projectDateStart"    column="project_date_start"    />
         <result property="projectDateEnd"    column="project_date_end"    />
         <result property="projectCheckTime"    column="project_check_time"    />
-        <collection  property="projectExpertCheckResp"   javaType="java.util.List"  resultMap="ExpertCheck" />
+        <result property="createTime" column="create_time"/>
+<!--        <collection  property="projectExpertCheckResp"   javaType="java.util.List"  resultMap="ExpertCheck" />-->
+        <collection property="projectExpertCheckResp"
+                    javaType="java.util.List"
+                    ofType="com.gkhy.system.domain.vo.response.ProjectExpertCheckResp"
+                    select="selectExpertsByProjectId"
+                    column="id">
+        </collection>
+
     </resultMap>
     <resultMap id="ExpertCheck" type="com.gkhy.system.domain.vo.response.ProjectExpertCheckResp">
         <result  property="id"       column="project_expert_id"        />
@@ -66,6 +74,7 @@
         <result property="phone"       column="phone"    />
         <result property="selectionTime"       column="selection_time"    />
         <result property="expertRemark"       column="expert_remark"    />
+        <result property="expertType"       column="expert_type"    />
     </resultMap>
 
     <sql id="selectProjectManagementVo">
@@ -123,8 +132,50 @@
         </if>
         <if test="projectDateStart != null "> and date_format(a.project_date_start,'%Y%m%d') &gt;= date_format(#{projectDateStart},'%Y%m%d')</if>
         <if test="projectDateEnd != null "> and date_format(a.project_date_end,'%Y%m%d') &lt;= date_format(#{projectDateEnd},'%Y%m%d')</if>
-        order BY a.dept_name asc ,c.`name` desc
+
+        UNION ALL
+
+        select  a.dept_name deptName,b.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 out_project_expert b on a.id = b.project_id and b.del_flag = 0 and b.evaluation_state = 1
+        where a.del_flag = 0 and a.state = 4 and a.evaluation_state = 1
+        <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') &gt;= date_format(#{projectDateStart},'%Y%m%d')</if>
+        <if test="projectDateEnd != null "> and date_format(a.project_date_end,'%Y%m%d') &lt;= date_format(#{projectDateEnd},'%Y%m%d')</if>
+
+
+        order BY deptName asc ,expertName desc
     </select>
+
+    <select id="selectProjectDataOut" parameterType="ProjectManagement" resultType="com.gkhy.system.domain.vo.response.ProjectDataResp">
+        select  a.dept_name deptName,b.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 out_project_expert b on a.id = b.project_id and b.del_flag = 0 and b.evaluation_state = 1
+        where a.del_flag = 0 and a.state = 4 and a.evaluation_state = 1
+        <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') &gt;= date_format(#{projectDateStart},'%Y%m%d')</if>
+        <if test="projectDateEnd != null "> and date_format(a.project_date_end,'%Y%m%d') &lt;= date_format(#{projectDateEnd},'%Y%m%d')</if>
+        order BY a.dept_name asc ,b.`name` desc
+    </select>
+
 
     
     <select id="selectProjectManagementById" parameterType="Long" resultMap="ProjectManagementResult">
@@ -206,6 +257,7 @@
             <if test="expertNum != null">expert_num = #{expertNum},</if>
             <if test="expertId != null">expert_id = #{expertId},</if>
             <if test="expertName != null">expert_name = #{expertName},</if>
+            <if test="expertType != null">expert_type = #{expertType},</if>
             <if test="projectEndTime != null">project_end_time = #{projectEndTime},</if>
             <if test="desc != null and desc != ''">`desc` = #{desc},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>
@@ -229,15 +281,30 @@
     </update>
 
     <select id="projectExpertCheckInfo" parameterType="Long" resultMap="ProjectManagementInfoResult">
-        select a.id,a.step, a.project_name, a.dept_name, a.job_category, a.project_address, a.project_date_start, a.project_date_end, a.remark,a.project_check_time,a.state,
-            b.id project_expert_id,b.expert_id expert_id_info,c.name,c.sex,c.id_card,c.domain,c.rating_level,b.selection_mode,b.team_leader,
-            c.company_name,c.phone,a.create_time selection_time,c.remark expert_remark,a.project_code,a.expert_num
+        select a.id,a.step, a.project_name, a.dept_name, a.job_category, a.project_address, a.project_date_start,
+               a.project_date_end, a.remark,a.project_check_time,a.state,
+           a.project_code,a.expert_num,a.create_time
         from project_management a
-        left join project_expert b on a.id = b.project_id and b.del_flag = 0
-        left join sys_expert_info c on b.expert_id = c.id
          where a.id = #{id}
-        order by b.team_leader desc , b.create_time desc
+
     </select>
+
+    <select id="selectExpertsByProjectId" parameterType="long" resultMap="ExpertCheck">
+        select  b.id project_expert_id,b.expert_id expert_id_info,c.name,c.sex,c.id_card,c.domain,c.rating_level,b.selection_mode,b.team_leader,
+               c.company_name,c.phone,null selection_time,c.remark expert_remark, 1 as expert_type
+        from  project_expert b
+                 left join sys_expert_info c on b.expert_id = c.id
+        where b.project_id = #{id} and b.del_flag = 0
+        union all
+        select b.id project_expert_id,b.id expert_id_info,b.name,b.sex,b.id_card,b.domain,b.rating_level,b.selection_mode,b.team_leader,
+               b.company_name,'' as phone,null selection_time,'' as expert_remark, 2 as expert_type
+        from  out_project_expert b
+        where b.project_id = #{id} and b.del_flag = 0
+        order by team_leader desc
+    </select>
+
+
+
     <select id="getProjectExpertSate" parameterType="com.gkhy.system.domain.vo.request.ProjectExpertStateReq" resultType="com.gkhy.system.domain.vo.response.ProjectExpertStateResp">
         select a.id, a.project_name, a.evaluation_state, a.project_check_time, a.project_end_time, a.dept_name, a.expert_num
         from project_management a

--
Gitblit v1.9.2