Browse Source

Merge remote-tracking branch 'origin/master'

hym 4 years ago
parent
commit
3621c93eae

+ 3 - 1
src/main/java/com/zoniot/ccrc/controller/system/CommunityManagerController.java

@@ -43,7 +43,8 @@ public class CommunityManagerController {
 			@ApiParam(value = "省", required = false) @RequestParam(required = false) Integer province,
 			@ApiParam(value = "市", required = false) @RequestParam(required = false) Integer city,
 			@ApiParam(value = "区", required = false) @RequestParam(required = false) Integer region,
-			@ApiParam(value = "小区", required = false) @RequestParam(required = false) Integer communityId) {
+			@ApiParam(value = "小区", required = false) @RequestParam(required = false) Integer communityId,
+			@ApiParam(value = "机构", required = false) @RequestParam(required = false) Integer orgId) {
 		// 1,判断用户的站点信息
         LoginUser loginUser = UserUtil.getCurrentUser();
         Community param = new Community();
@@ -57,6 +58,7 @@ public class CommunityManagerController {
         if(StringUtils.isNotBlank(name)) {
         	param.setName("%"+name+"%");
         }
+		param.setOrgId(orgId);
         List<CommunityDto> list = communityService.queryCommunity(param);
         
         return new AjaxMessage<>(ResultStatus.OK, list);

+ 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);
 

+ 2 - 0
src/main/java/com/zoniot/ccrc/entity/Community.java

@@ -64,4 +64,6 @@ public class Community implements Serializable {
 
     @ApiModelProperty(value="更新人", hidden = true)
     private String updateBy;
+
+    private Integer orgId;
 }

+ 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">

+ 1 - 0
src/main/resources/mapper/CommunityMapper.xml

@@ -392,6 +392,7 @@
         <if test="param.city != null"> and sc.city = #{param.city} </if>
         <if test="param.region != null"> and sc.region = #{param.region} </if>
         <if test="param.id != null"> and sc.id = #{param.id}</if>
+        <if test="param.orgId != null"> and sc.org_id = #{param.orgId}</if>
         <if test="param.name != null and param.name != '' "> and sc.name like #{param.name}</if>
         <if test="customerIds != null and customerIds.size() != 0">
             and sc.customer_id in <foreach collection="customerIds" item="item" open="(" separator="," close=")">#{item}</foreach>