You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gysl/ruoyi-admin/src/main/resources/mapper/BasicInformationMapper.xml

59 lines
2.0 KiB

3 months ago
<?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.gysl.mapper.BasicInformationMapper">
<resultMap id="ProjectExcelInfoResult" type="com.ruoyi.gysl.entity.response.ProjectExcelInfo">
<!-- 基础信息字段 -->
<id property="id" column="id"/>
<result property="name" column="name"/>
<result property="xmfrdwxz" column="xmfrdwxz"/>
<result property="nature" column="nature"/>
<!-- 规划信息字段 -->
<result property="zydmj" column="zydmj"/>
<result property="rjl" column="rjl"/>
<result property="zjzmj" column="zjzmj"/>
<result property="bzcjzmj" column="bzcjzmj"/>
<!-- 嵌套集合:建筑信息(一对多) -->
<collection
property="xmjzxx"
ofType="com.ruoyi.gysl.entity.response.ProjectBuildingExcel"
javaType="java.util.List">
<result property="floor" column="floor"/>
<result property="totalBuildingHeight" column="total_building_height"/>
<result property="scgd" column="scgd"/>
<result property="twoAndFourCg" column="two_and_four_cg"/>
<result property="fourYscg" column="four_yscg"/>
</collection>
</resultMap>
<select id="selectList" resultMap="ProjectExcelInfoResult">
SELECT
a.id,
a.name,
a.xmfrdwxz,
a.nature,
b.zydmj,
b.rjl,
b.zjzmj,
b.bzcjzmj,
<!-- 建筑信息字段添加 c_ 前缀 -->
c.floor,
c.total_building_height,
c.scgd,
c.two_and_four_cg,
c.four_yscg
FROM
basic_information a
LEFT JOIN plan_information b ON a.id = b.xm_id
LEFT JOIN building_information c ON a.id = c.xm_id
WHERE
a.id IN
<foreach collection="idList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>