Browse Source

物业列表按照管理小区数量降序

master
yinzuomei 2 years ago
parent
commit
3b6c6202e1
  1. 18
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml

18
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml

@ -71,7 +71,20 @@
</select> </select>
<select id="queryList" parameterType="map" resultType="com.epmet.dto.IcPropertyManagementDTO"> <select id="queryList" parameterType="map" resultType="com.epmet.dto.IcPropertyManagementDTO">
select m.* select * from (
select m.*,
(
SELECT
count(p.NEIGHBOR_HOOD_ID)
FROM
ic_neighbor_hood_property p
INNER JOIN ic_neighbor_hood h
ON ( p.NEIGHBOR_HOOD_ID = h.ID )
WHERE p.DEL_FLAG = '0'
and p.PROPERTY_ID =m.id
AND (h.AGENCY_ID = #{agencyId} or h.AGENCY_PIDS like concat('%',#{agencyId},'%') )
AND h.DEL_FLAG = '0'
)as totalNeighborHood
from ic_property_management m from ic_property_management m
where m.del_flag='0' where m.del_flag='0'
and m.customer_id=#{customerId} and m.customer_id=#{customerId}
@ -84,6 +97,7 @@
<if test="contactMobile != null and contactMobile != ''"> <if test="contactMobile != null and contactMobile != ''">
and m.CONTACT_MOBILE like concat('%',#{contactMobile},'%') and m.CONTACT_MOBILE like concat('%',#{contactMobile},'%')
</if> </if>
order by m.CREATED_TIME desc )t
order by t.totalNeighborHood desc,t.CREATED_TIME desc
</select> </select>
</mapper> </mapper>
Loading…
Cancel
Save