123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?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.huiju.estateagents.mapper.TaBuildingMapper">
- <select id="buildingList" resultType="com.huiju.estateagents.entity.TaBuilding">
- SELECT * FROM ta_building
- <where>
- status > -1
- <if test="Name != null and Name != ''">
- and (ta_building.name like concat('%',#{Name,jdbcType=VARCHAR},'%') or ta_building.building_name like concat('%',#{Name,jdbcType=VARCHAR},'%'))
- </if>
- <if test="Code != null and Code != ''">
- and ta_building.code like concat('%',#{Code,jdbcType=VARCHAR},'%')
- </if>
- <if test="startDate != null">
- and TO_DAYS(ta_building.opening_date ) = TO_DAYS(#{startDate})
- </if>
- <if test="buildingStatus != null and buildingStatus != ''">
- and ta_building.building_status = #{buildingStatus}
- </if>
- <if test="marketStatus != null and marketStatus != ''">
- and ta_building.market_status =#{marketStatus}
- </if>
- <if test="cityId != null and cityId != ''">
- and ta_building.city_id =#{cityId}
- </if>
- <if test="isMain != null and isMain != ''">
- and ta_building.is_main = #{isMain}
- </if>
- </where>
- ORDER BY create_date DESC
- </select>
-
- <select id="buildingListSelect" resultType="com.huiju.estateagents.entity.TaBuilding">
- SELECT * FROM ta_building
- <where>
- status =1
- <if test="Name != null and Name != ''">
- and (ta_building.name like concat('%',#{Name,jdbcType=VARCHAR},'%') or ta_building.building_name like concat('%',#{Name,jdbcType=VARCHAR},'%'))
- </if>
- <if test="Code != null and Code != ''">
- and ta_building.code like concat('%',#{Code,jdbcType=VARCHAR},'%')
- </if>
- <if test="startDate != null">
- and TO_DAYS(ta_building.opening_date ) = TO_DAYS(#{startDate})
- </if>
- <if test="marketStatus != null and marketStatus != ''">
- and ta_building.market_status =#{marketStatus}
- </if>
- <if test="cityId != null and cityId != ''">
- and ta_building.city_id =#{cityId}
- </if>
- <if test="isMain != null and isMain != ''">
- and ta_building.is_main = #{isMain}
- </if>
- </where>
- ORDER BY create_date DESC
- </select>
-
- <select id="buildingAll" resultType="com.huiju.estateagents.entity.TaBuilding">
- SELECT * FROM ta_building
- where status > -1
- </select>
-
- <select id="selectBuilding" resultType="com.huiju.estateagents.entity.TaBuilding">
- SELECT * FROM ta_building
- where building_id = #{buildingId}
- </select>
-
- <select id="selectBuildingStatistical" resultType="map">
- select
- IFNULL(sum(pv_num), 0) as pvNum,
- <if test="saveOrShare == 'save'">
- IFNULL(sum(save_num),0) as saveNum
- </if>
- <if test="saveOrShare == 'share'">
- IFNULL(sum(share_num),0) as shareNum
- </if>
- from ta_building
- </select>
-
- </mapper>
|