Sfoglia il codice sorgente

小区按机构查询

lin 4 anni fa
parent
commit
7c0905d53b

+ 8 - 1
src/main/java/com/zoniot/ccrc/dao/BuildingMapper.java

@@ -23,7 +23,14 @@ public interface BuildingMapper {
 
     int findByNameUnique(@Param("id") Integer id, @Param("siteId") Integer siteId, @Param("community") Integer community, @Param("name") String name);
 
-    List<BuildingDto> getBuildingList(@Param("siteId") Integer siteId, @Param("sysId") Integer sysId, @Param("buildingName") String buildingName, @Param("province") Integer province, @Param("city") Integer city, @Param("region") Integer region, @Param("communityId") Integer communityId);
+    List<BuildingDto> getBuildingList(
+            @Param("siteId") Integer siteId,
+            @Param("sysId") Integer sysId,
+            @Param("buildingName") String buildingName,
+            @Param("province") Integer province,
+            @Param("city") Integer city,
+            @Param("region") Integer region,
+            @Param("communityId") Integer communityId);
 
     BuildingDto getById(@Param("buildingId") Integer buildingId);
 

+ 6 - 0
src/main/resources/mapper/BuildingMapper.xml

@@ -214,6 +214,12 @@
         from sc_building sb
         left join sc_community sc on(sc.id = sb.community_id)
         where sb.status = 1
+        <if test="siteId != null"> and sb.site_id = #{siteId}</if>
+        <if test="buildingName != null and buildingName != ''"> AND sb.name LIKE concat('%',#{buildingName},'%')</if>
+        <if test="province != null"> AND sb.province = #{province}</if>
+        <if test="city != null"> AND sb.city = #{city}</if>
+        <if test="region != null"> AND sb.region = #{region}</if>
+        <if test="communityId != null"> AND sb.community_id = #{communityId}</if>
     </select>
 
     <select id="getById" resultType="com.zoniot.ccrc.dto.BuildingDto">