From 1519a7c81e6566dd0cbc6acfb1b5e92c3aaba7df Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期日, 02 三月 2025 10:53:57 +0800
Subject: [PATCH] 赋码定时任务只判断超时,且用红码时间判断

---
 business/src/main/resources/mapper/ProjectProcessMapper.xml |   78 +++++++++++++++++++++++++++++++--------
 1 files changed, 62 insertions(+), 16 deletions(-)

diff --git a/business/src/main/resources/mapper/ProjectProcessMapper.xml b/business/src/main/resources/mapper/ProjectProcessMapper.xml
index 5ce1bb6..c51819b 100644
--- a/business/src/main/resources/mapper/ProjectProcessMapper.xml
+++ b/business/src/main/resources/mapper/ProjectProcessMapper.xml
@@ -9,45 +9,70 @@
         <result column="project_code" property="projectCode" />
         <result column="content" property="content" />
         <result column="project_type" property="projectType" />
+        <result column="investmentAmount" property="investmentAmount" />
         <result column="project_status" property="projectStatus" />
         <result column="fund_type" property="fundType" />
         <result column="invest_type" property="investType" />
         <result column="project_phase" property="projectPhase" />
         <result column="tag" property="tag" />
-<!--        <result column="competent_department" property="competentDepartment" />-->
-        <result column="area_code" property="areaCode" />
-<!--        <result column="management_centralization" property="managementCentralization" />-->
         <result column="project_approval_type" property="projectApprovalType" />
         <result column="importance_type" property="importanceType" />
-        <result column="year" property="year" />
-        <result column="year_invest_amount" property="yearInvestAmount" />
         <result column="create_project_time" property="createProjectTime" />
         <result column="plan_start_time" property="planStartTime" />
         <result column="plan_complete_time" property="planCompleteTime" />
-        <result column="win_unit" property="winUnit" />
-        <result column="win_amount" property="winAmount" />
-        <result column="win_time" property="winTime" />
         <result column="project_address" property="projectAddress" />
         <result column="longitude" property="longitude" />
         <result column="latitude" property="latitude" />
         <result column="project_owner_unit" property="projectOwnerUnit" />
+        <result column="project_owner_unit_name" property="projectOwnerUnitName" />
         <result column="project_contact_person" property="projectContactPerson" />
         <result column="contact" property="contact" />
-        <result column="gmt_create_time" property="gmtCreateTime" />
-        <result column="gmt_update_time" property="gmtUpdateTime" />
         <result column="update_by" property="updateBy" />
         <result column="create_by" property="createBy" />
-        <result column="flowable_process_id" property="flowableProcessId" />
-<!--        <association property="id" column=""-->
+        <result column="process_def_id" property="processDefId" />
+        <result column="process_ins_id" property="processInsId" />
     </resultMap>
 
+    <resultMap id="PageResultMap" type="com.ycl.domain.vo.ProjectProcessVO">
+        <id column="id" property="id"/>
+        <result column="project_name" property="projectName" />
+        <result column="project_code" property="projectCode" />
+        <result column="content" property="content" />
+        <result column="project_type" property="projectType" />
+        <result column="investmentAmount" property="investmentAmount" />
+        <result column="project_status" property="projectStatus" />
+        <result column="fund_type" property="fundType" />
+        <result column="invest_type" property="investType" />
+        <result column="project_phase" property="projectPhase" />
+        <result column="tag" property="tag" />
+        <result column="project_approval_type" property="projectApprovalType" />
+        <result column="importance_type" property="importanceType" />
+        <result column="create_project_time" property="createProjectTime" />
+        <result column="plan_start_time" property="planStartTime" />
+        <result column="plan_complete_time" property="planCompleteTime" />
+        <result column="project_address" property="projectAddress" />
+        <result column="longitude" property="longitude" />
+        <result column="latitude" property="latitude" />
+        <result column="project_owner_unit" property="projectOwnerUnit" />
+        <result column="project_owner_unit_name" property="projectOwnerUnitName" />
+        <result column="project_contact_person" property="projectContactPerson" />
+        <result column="contact" property="contact" />
+        <result column="update_by" property="updateBy" />
+        <result column="create_by" property="createBy" />
+        <result column="process_def_id" property="processDefId" />
+        <result column="process_ins_id" property="processInsId" />
+        <collection property="children" ofType="com.ycl.domain.vo.ProjectEngineeringVO" select="getProjectEngineering" column="id"></collection>
+    </resultMap>
 
+    <select id="getProjectEngineering" parameterType="long" resultMap="com.ycl.mapper.ProjectEngineeringMapper.BaseResultMap">
+        SELECT * FROM t_project_engineering WHERE project_info_id = #{id} and deleted = 0 ORDER BY gmt_create
+    </select>
 
 
     <select id="getById" resultMap="BaseResultMap">
         SELECT
             TPP.project_id,
-            TPP.flowable_process_id,
+            TPP.process_def_id,
             TPP.id
         FROM
             t_project_process TPP
@@ -56,22 +81,43 @@
     </select>
 
 
-    <select id="getPage" resultMap="BaseResultMap">
+    <select id="getPage" resultMap="PageResultMap">
         SELECT
             PI.*,
-            TPP.flowable_process_id
+            TPP.process_def_id,
+            TPP.process_ins_id,
+            TPIF.total_investment as investmentAmount,
+            d.dept_name as project_owner_unit_name
         FROM
             t_project_info PI
-                LEFT JOIN t_project_process TPP ON TPP.project_id = PI.id AND TPP.deleted = 0 AND PI.deleted = 0
+                LEFT JOIN t_project_investment_funding TPIF ON TPIF.project_id = PI.id AND TPIF.deleted = 0
+                LEFT JOIN t_project_process TPP ON TPP.project_id = PI.id AND TPP.deleted = 0
+                LEFT JOIN sys_dept d ON d.dept_id = PI.project_owner_unit
         <where>
+            AND PI.used_status = 2 AND PI.deleted = 0
             <if test="query.projectName != null and query.projectName != ''">
                 AND PI.project_name like concat('%', #{query.projectName}, '%')
             </if>
             <if test="query.projectCode != null and query.projectCode != ''">
                 AND PI.project_code like concat('%', #{query.projectCode}, '%')
             </if>
+            ${query.params.dataScope}
         </where>
 
     </select>
 
+
+    <select id="getProjectInfo" parameterType="string" resultType="com.ycl.domain.entity.ProjectInfo">
+        SELECT
+               PI.id, PI.project_name
+        FROM
+             t_project_process PP
+                 INNER JOIN t_project_info PI ON PP.project_id = PI.id AND PI.deleted = 0 AND PP.process_ins_id = #{processInsId}
+    </select>
+
+
+    <select id="getNormalInsIds" resultType="string">
+        SELECT TPP.process_ins_id FROM t_project_info TPI INNER JOIN t_project_process TPP ON TPI.id = TPP.project_id AND TPI.deleted = 0
+    </select>
+
 </mapper>

--
Gitblit v1.8.0