|
@ -124,6 +124,12 @@ |
|
|
a.OWNER_ID_CARD as ownerIdCard, |
|
|
a.OWNER_ID_CARD as ownerIdCard, |
|
|
b.BUILDING_NAME as buildingName, |
|
|
b.BUILDING_NAME as buildingName, |
|
|
CONCAT(d.UNIT_NUM,'单元') as unitNum, |
|
|
CONCAT(d.UNIT_NUM,'单元') as unitNum, |
|
|
|
|
|
<select id="searchHouseByPage" resultType="map"> |
|
|
|
|
|
select |
|
|
|
|
|
a.HOUSE_NAME as houseName, |
|
|
|
|
|
c.NEIGHBOR_HOOD_NAME as neighborHoodName, |
|
|
|
|
|
b.BUILDING_NAME as buildingName, |
|
|
|
|
|
d.UNIT_NUM as unitNum, |
|
|
a.DOOR_NAME as doorName, |
|
|
a.DOOR_NAME as doorName, |
|
|
(case when a.RENT_FLAG = '0' then '自住' |
|
|
(case when a.RENT_FLAG = '0' then '自住' |
|
|
when a.RENT_FLAG = '1' then '出租' |
|
|
when a.RENT_FLAG = '1' then '出租' |
|
@ -183,6 +189,57 @@ |
|
|
<if test="buildingName != null and buildingName.trim() != ''"> |
|
|
<if test="buildingName != null and buildingName.trim() != ''"> |
|
|
AND b.BUILDING_NAME like CONCAT('%',#{buildingName},'%') |
|
|
AND b.BUILDING_NAME like CONCAT('%',#{buildingName},'%') |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
</where> |
|
|
|
|
|
/*排序规则:如果是社区查询则根据小区、楼栋、单元、房屋名字分别升序排序*/ |
|
|
|
|
|
<choose> |
|
|
|
|
|
<when test="queryScene == 'community_search'"> |
|
|
|
|
|
ORDER BY CONVERT(c.NEIGHBOR_HOOD_NAME using gbk) ASC, |
|
|
|
|
|
CONVERT(b.BUILDING_NAME USING gbk) ASC, |
|
|
|
|
|
CONVERT(d.UNIT_NAME USING gbk) ASC, |
|
|
|
|
|
CONVERT(a.HOUSE_NAME using gbk) ASC |
|
|
|
|
|
</when> |
|
|
|
|
|
<when test="queryScene == 'house_manage'"> |
|
|
|
|
|
ORDER BY CAST(d.UNIT_NUM AS SIGNED), a.DOOR_NAME |
|
|
|
|
|
</when> |
|
|
|
|
|
<otherwise> |
|
|
|
|
|
ORDER BY CAST(d.UNIT_NUM AS SIGNED), a.DOOR_NAME |
|
|
|
|
|
</otherwise> |
|
|
|
|
|
</choose> |
|
|
|
|
|
</select> |
|
|
|
|
|
<select id="searchAllHouse" resultType="com.epmet.excel.IcHouseExcel"> |
|
|
|
|
|
select |
|
|
|
|
|
a.HOUSE_NAME as houseName, |
|
|
|
|
|
a.DOOR_NAME as doorName, |
|
|
|
|
|
a.HOUSE_TYPE as houseType, |
|
|
|
|
|
a.PURPOSE as purpose, |
|
|
|
|
|
if(a.RENT_FLAG=1,'是','否') as rentFlag, |
|
|
|
|
|
a.OWNER_NAME as ownerName, |
|
|
|
|
|
a.OWNER_PHONE as ownerPhone, |
|
|
|
|
|
a.OWNER_ID_CARD as ownerIdCard, |
|
|
|
|
|
b.BUILDING_NAME as buildingName, |
|
|
|
|
|
c.NEIGHBOR_HOOD_NAME as neighborHoodName, |
|
|
|
|
|
d.UNIT_NUM as buildingUnit |
|
|
|
|
|
from ic_house a |
|
|
|
|
|
INNER JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0' |
|
|
|
|
|
INNER JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0' |
|
|
|
|
|
LEFT JOIN ic_building_unit d on a.BUILDING_UNIT_ID = d.ID and d.DEL_FLAG = '0' |
|
|
|
|
|
<where> |
|
|
|
|
|
<if test="house.buildingId != null and house.buildingId.trim() != ''"> |
|
|
|
|
|
AND a.BUILDING_ID = #{house.buildingId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="house.ownerName != null and house.ownerName.trim() != ''"> |
|
|
|
|
|
AND a.OWNER_NAME like concat('%',#{house.ownerName},'%') |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="house.ownerPhone != null and house.ownerPhone.trim() != ''"> |
|
|
|
|
|
AND a.OWNER_PHONE like concat('%',#{house.ownerPhone},'%') |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="house.delFlag != null and house.delFlag.trim() != ''"> |
|
|
|
|
|
AND a.DEL_FLAG = #{house.delFlag} |
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
</where> |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
<if test="rentFlag != null and rentFlag.trim() != ''"> |
|
|
<if test="rentFlag != null and rentFlag.trim() != ''"> |
|
|
AND a.rent_flag = #{rentFlag} |
|
|
AND a.rent_flag = #{rentFlag} |
|
|
</if> |
|
|
</if> |
|
|