From 37325b5b629a296230e87d41187742f843c7494c Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期二, 15 七月 2025 18:08:23 +0800 Subject: [PATCH] 文件ip迁移兼容 --- business/src/main/resources/mapper/ProjectEngineeringMapper.xml | 53 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 46 insertions(+), 7 deletions(-) diff --git a/business/src/main/resources/mapper/ProjectEngineeringMapper.xml b/business/src/main/resources/mapper/ProjectEngineeringMapper.xml index 5b9b9b5..798b67a 100644 --- a/business/src/main/resources/mapper/ProjectEngineeringMapper.xml +++ b/business/src/main/resources/mapper/ProjectEngineeringMapper.xml @@ -4,18 +4,44 @@ <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 --> <resultMap id="BaseResultMap" type="com.ycl.domain.vo.ProjectEngineeringVO"> + <id column="id" property="id"/> <result column="project_info_id" property="projectInfoId" /> <result column="projectInfoName" property="projectInfoName" /> <result column="project_name" property="projectName" /> <result column="project_type" property="projectType" /> <result column="investment_amount" property="investmentAmount" /> <result column="status" property="status" /> + <result column="unit" property="unit" /> + <result column="department" property="department" /> + <result column="parent_id" property="parent" /> + <result column="year" property="year" /> + <result column="unit_name" property="unitName" /> + <result column="department_name" property="departmentName" /> + <result column="build_content" property="buildContent"/> + <collection property="children" ofType="com.ycl.domain.vo.ProjectEngineeringVO" select="getProjectEngineering" column="id"></collection> + </resultMap> - - + <select id="getProjectEngineering" parameterType="String" resultMap="com.ycl.mapper.ProjectEngineeringMapper.BaseResultMap"> + SELECT TPE.project_info_id, + TPE.project_name, + TPE.project_type, + TPE.investment_amount, + TPE.status, + TPE.id, + TPE.unit, + TPE.department, + TPE.parent_id, + TPE.year, + TPE.build_content, + (SELECT SD.dept_name FROM sys_dept SD WHERE SD.dept_id = TPE.unit) AS unit_name, + (SELECT SD.dept_name FROM sys_dept SD WHERE SD.dept_id = TPE.department) AS department_name + FROM t_project_engineering TPE + INNER JOIN t_project_info TPI ON TPI.id = TPE.project_info_id AND TPI.deleted = 0 + WHERE TPE.parent_id = #{id} and TPE.deleted = 0 ORDER BY TPE.gmt_create + </select> <select id="getById" resultMap="BaseResultMap"> @@ -25,7 +51,12 @@ TPE.project_type, TPE.investment_amount, TPE.status, - TPE.id + TPE.id, + TPE.unit, + TPE.department, + TPE.parent_id, + TPE.year, + TPE.build_content FROM t_project_engineering TPE WHERE @@ -36,17 +67,23 @@ <select id="getPage" resultMap="BaseResultMap"> SELECT TPE.project_info_id, - TPE.project_name, TPE.project_type, TPE.investment_amount, TPE.status, TPE.id, - TPI.project_name as projectInfoName + TPE.unit, + TPE.department, + TPE.parent_id, + TPE.year, + TPI.project_name, + TPE.build_content, + (SELECT SD.dept_name FROM sys_dept SD WHERE SD.dept_id = TPE.unit) AS unit_name, + (SELECT SD.dept_name FROM sys_dept SD WHERE SD.dept_id = TPE.department) AS department_name FROM t_project_engineering TPE - INNER JOIN t_project_info TPI ON TPI.id = TPE.project_info_id AND TPI.deleted = 0 + Left JOIN t_project_info TPI ON TPI.id = TPE.project_info_id AND TPI.deleted = 0 WHERE - TPE.deleted = 0 + TPE.deleted = 0 AND TPE.parent_id = '0' <if test="query.projectName != null and query.projectName != ''"> AND TPE.project_name LIKE concat('%', #{query.projectName}, '%') </if> @@ -59,6 +96,8 @@ <if test="query.projectType != null and query.projectType != ''"> AND TPE.project_type = #{query.projectType} </if> + ORDER BY TPE.gmt_create DESC + </select> </mapper> -- Gitblit v1.8.0