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

92 lines
3.5 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
3 months ago
gysl_basic_information a
LEFT JOIN gysl_plan_information b ON a.id = b.xm_id
LEFT JOIN gysl_building_information c ON a.id = c.xm_id
3 months ago
WHERE
a.id IN
<foreach collection="idList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
3 months ago
<select id="page" resultType="com.ruoyi.gysl.entity.BasicInformation">
SELECT a.*,b.zydmj
3 months ago
FROM gysl_basic_information a left join gysl_plan_information b on a.id = b.xm_id
3 months ago
<where>
<if test="req.name != null and req.name != ''">
AND a.name like concat('%',#{req.name},'%')
</if>
<if test="req.xmfrdwxz != null and req.xmfrdwxz != ''">
AND a.xmfrdwxz like concat('%',#{req.xmfrdwxz},'%')
</if>
<if test="req.name != null and req.name != ''">
3 months ago
AND a.xzfl = #{req.xzfl}
3 months ago
</if>
<if test="req.startTime != null">
AND a.begain_time &gt;= #{req.startTime} <!-- 大于等于 -->
</if>
<if test="req.endTime != null">
AND a.begain_time &lt;= #{req.endTime} <!-- 小于等于 -->
</if>
3 months ago
<if test="req.tyshxydm != null and req.tyshxydm!=''">
AND a.tyshxydm = #{req.tyshxydm}
</if>
3 months ago
<if test="req.isFmqd != null">
AND a.is_fmqd = #{req.isFmqd}
</if>
3 months ago
</where>
</select>
3 months ago
<select id="projectList" resultType="com.ruoyi.gysl.entity.BasicInformation">
SELECT a.*,
ROUND( IFNULL( SUM( b.zjzmj ), 0 ) / 10000, 2 ) AS zjzmj
3 months ago
FROM gysl_basic_information a left join gysl_plan_information b on a.id = b.xm_id
3 months ago
where a.longitude is not null and a.latitude is not null
</select>
3 months ago
</mapper>