| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?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.zksy.property.mapper.ASimplifiedHouseInfoMapper">
- <resultMap id="BaseResultMap" type="com.zksy.property.domain.ASimplifiedHouseInfo">
- <id property="id" column="id" jdbcType="VARCHAR"/>
- <result property="assetType" column="asset_type" jdbcType="VARCHAR"/>
- <result property="building" column="building" jdbcType="VARCHAR"/>
- <result property="floor" column="floor" jdbcType="VARCHAR"/>
- <result property="houseName" column="house_name" jdbcType="VARCHAR"/>
- <result property="address" column="address" jdbcType="VARCHAR"/>
- <result property="status" column="status" jdbcType="VARCHAR"/>
- <result property="rentRange" column="rent_range" jdbcType="DECIMAL"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
- </resultMap>
- <sql id="Base_Column_List">
- id,asset_type,building,
- floor,house_name,address,
- status,rent_range,create_time,
- update_time
- </sql>
- <select id="getListPage" resultType="com.zksy.property.domain.vo.ASimplifiedHouseInfoVo">
- SELECT a.*, b.area
- FROM a_simplified_house_info a
- LEFT JOIN a_house_info_detail b ON a.id = b.simplified_house_id
- <where>
- <if test="entity.assetType != null and entity.assetType != ''">
- AND a.asset_type = #{entity.assetType}
- </if>
- <if test="entity.building != null and entity.building != ''">
- AND a.building = #{entity.building}
- </if>
- <if test="entity.floor != null and entity.floor != ''">
- AND a.floor LIKE CONCAT(#{entity.floor}, '%')
- </if>
- <if test="entity.rentRangeMin != null">
- AND a.rent_range >= COALESCE(#{entity.rentRangeMin}, a.rent_range)
- </if>
- <if test="entity.rentRangeMax != null">
- AND a.rent_range <= COALESCE(#{entity.rentRangeMax}, a.rent_range)
- </if>
- <if test="entity.areaMin != null">
- AND b.area >= COALESCE(#{entity.areaMin}, b.area)
- </if>
- <if test="entity.areaMax != null">
- AND b.area <= COALESCE(#{entity.areaMax}, b.area)
- </if>
- </where>
- <if test="sortClause != null and sortClause != ''">
- ORDER BY ${sortClause}
- </if>
- <!-- 默认排序 -->
- <if test="sortClause == null or sortClause == ''">
- ORDER BY a.create_time DESC
- </if>
- <if test="offset != null and limit != null">
- LIMIT #{offset}, #{limit}
- </if>
- </select>
- <select id="getListPageTotal" resultType="java.lang.Long">
- SELECT count(*)
- FROM a_simplified_house_info a
- LEFT JOIN a_house_info_detail b ON a.id = b.simplified_house_id
- <where>
- <if test="entity.assetType != null and entity.assetType != ''">
- AND a.asset_type = #{entity.assetType}
- </if>
- <if test="entity.building != null and entity.building != ''">
- AND a.building = #{entity.building}
- </if>
- <if test="entity.floor != null and entity.floor != ''">
- AND a.floor LIKE CONCAT(#{entity.floor}, '%')
- </if>
- <if test="entity.rentRangeMin != null">
- AND a.rent_range >= COALESCE(#{entity.rentRangeMin}, a.rent_range)
- </if>
- <if test="entity.rentRangeMax != null">
- AND a.rent_range <= COALESCE(#{entity.rentRangeMax}, a.rent_range)
- </if>
- <if test="entity.areaMin != null">
- AND b.area >= COALESCE(#{entity.areaMin}, b.area)
- </if>
- <if test="entity.areaMax != null">
- AND b.area <= COALESCE(#{entity.areaMax}, b.area)
- </if>
- </where>
- </select>
- </mapper>
|