Browse Source

增加customerId过滤条件

master
lzh 4 years ago
parent
commit
27d64c41cc
  1. 6
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java
  2. 22
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java
  3. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java
  4. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java
  5. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java
  6. 38
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java
  7. 14
      epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml

6
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java

@ -134,10 +134,11 @@ public class ResiCategoryStatsConfigController {
}
@PostMapping("resicategorystatslistshowd")
public Result<List<IcResiCategoryStatsConfigDTO>> resiCategoryStatsListShowd(){
public Result<List<IcResiCategoryStatsConfigDTO>> resiCategoryStatsListShowd(@LoginUser TokenDto tokenDTO){
//获取预警配置列表
List<IcResiCategoryStatsConfigEntity> statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper<IcResiCategoryStatsConfigEntity>()
.lambda()
.eq(IcResiCategoryStatsConfigEntity::getCustomerId,tokenDTO.getCustomerId())
.eq(IcResiCategoryStatsConfigEntity::getStatus,"show")
.orderByAsc(IcResiCategoryStatsConfigEntity::getSort));
@ -145,10 +146,11 @@ public class ResiCategoryStatsConfigController {
}
@PostMapping("resicategorywarnlist")
public Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(){
public Result<List<IcResiCategoryWarnConfigDTO>> resiCategoryWarnList(@LoginUser TokenDto tokenDTO){
//获取预警配置列表
List<IcResiCategoryWarnConfigEntity> warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper<IcResiCategoryWarnConfigEntity>()
.lambda()
.eq(IcResiCategoryWarnConfigEntity::getCustomerId,tokenDTO.getCustomerId())
.orderByAsc(IcResiCategoryWarnConfigEntity::getSort));
return new Result<List<IcResiCategoryWarnConfigDTO>>().ok(ConvertUtils.sourceToTarget(warnConfigEntityList, IcResiCategoryWarnConfigDTO.class));

22
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java

@ -49,14 +49,14 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
@Transactional(rollbackFor = Exception.class)
public List<IcResiCategoryStatsConfigResultDTO> list(String customerId) {
//1.获取IC_FORM_ITEM 中 用于数据分析字段的 id 和label
List<IcFormItemEntity> icFormItemEntityList = icFormItemDao.selectList(new QueryWrapper<IcFormItemEntity>().lambda().eq(IcFormItemEntity::getDataAnalyse, 1));
List<IcFormItemEntity> icFormItemEntityList = icFormItemDao.selectList(new QueryWrapper<IcFormItemEntity>().lambda().eq(IcFormItemEntity::getCustomerId,customerId).eq(IcFormItemEntity::getDataAnalyse, 1));
if(CollectionUtils.isEmpty(icFormItemEntityList)){
return new ArrayList<>();
}
Set<String> groupIds = icFormItemEntityList.stream().filter(item-> !"0".equals(item.getItemGroupId())).map(item->item.getItemGroupId()).collect(Collectors.toSet());
List<IcFormItemGroupEntity> icFormItemGroupEntityList = new ArrayList<>();
if(!CollectionUtils.isEmpty(groupIds)){
icFormItemGroupEntityList.addAll(icFormItemGroupDao.selectList(new QueryWrapper<IcFormItemGroupEntity>().lambda().in(IcFormItemGroupEntity::getId, groupIds)));
icFormItemGroupEntityList.addAll(icFormItemGroupDao.selectList(new QueryWrapper<IcFormItemGroupEntity>().lambda().eq(IcFormItemGroupEntity::getCustomerId,customerId).in(IcFormItemGroupEntity::getId, groupIds)));
}
//获取tableName和COLUMN_NAME
Map<String,IcFormItemEntity> tableColumnMap = new HashMap<>();
@ -75,8 +75,8 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
});
//2.获取ic_resi_category_stats_config 和 ic_resi_category_warn_config 表中的数据
List<IcResiCategoryStatsConfigEntity> statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(null);
List<IcResiCategoryWarnConfigEntity> warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(null);
List<IcResiCategoryStatsConfigEntity> statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper<IcResiCategoryStatsConfigEntity>().lambda().eq(IcResiCategoryStatsConfigEntity::getCustomerId,customerId));
List<IcResiCategoryWarnConfigEntity> warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda().eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId));
//3.新增不存在的,删除不在tableColumnMap的
Map<String,IcResiCategoryStatsConfigEntity> statsTableColumnMap = new HashMap<>();
@ -129,8 +129,11 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
}
//4.返回数据
List<IcResiCategoryStatsConfigEntity> statsConfigList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper<IcResiCategoryStatsConfigEntity>().lambda().orderByAsc(IcResiCategoryStatsConfigEntity::getSort));
List<IcResiCategoryWarnConfigEntity> warnConfigList = icResiCategoryWarnConfigDao.selectList(null);
List<IcResiCategoryStatsConfigEntity> statsConfigList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper<IcResiCategoryStatsConfigEntity>().lambda()
.eq(IcResiCategoryStatsConfigEntity::getCustomerId,customerId)
.orderByAsc(IcResiCategoryStatsConfigEntity::getSort));
List<IcResiCategoryWarnConfigEntity> warnConfigList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda()
.eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId));
Map<String,IcResiCategoryWarnConfigEntity> warnMap =new HashMap<>();
warnConfigList.forEach(item->{
warnMap.put(item.getTableName()+"-"+item.getColumnName(),item);
@ -169,6 +172,7 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
return result;
}
IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = icResiCategoryWarnConfigDao.selectOne(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda()
.eq(IcResiCategoryWarnConfigEntity::getCustomerId, icResiCategoryStatsConfigDTO.getCustomerId())
.eq(IcResiCategoryWarnConfigEntity::getTableName, icResiCategoryStatsConfigDTO.getTableName())
.eq(IcResiCategoryWarnConfigEntity::getColumnName, icResiCategoryStatsConfigDTO.getColumnName()));
@ -207,6 +211,7 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
if(IcResiCategoryStatsConfigConstant.WARN_YES.equals(formDTO.getWarn())){
//更新
IcResiCategoryWarnConfigEntity icResiCategoryWarnConfigEntity = icResiCategoryWarnConfigDao.selectOne(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda()
.eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId)
.eq(IcResiCategoryWarnConfigEntity::getTableName, icResiCategoryStatsConfigDTO.getTableName())
.eq(IcResiCategoryWarnConfigEntity::getColumnName, icResiCategoryStatsConfigDTO.getColumnName()));
if(null == icResiCategoryWarnConfigEntity){
@ -234,6 +239,7 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
}else if(IcResiCategoryStatsConfigConstant.WARN_NO.equals(formDTO.getWarn())){
//删除
icResiCategoryWarnConfigDao.delete(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda()
.eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId)
.eq(IcResiCategoryWarnConfigEntity::getTableName,icResiCategoryStatsConfigDTO.getTableName())
.eq(IcResiCategoryWarnConfigEntity::getColumnName,icResiCategoryStatsConfigDTO.getColumnName()));
}
@ -267,8 +273,8 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf
}
icResiCategoryStatsConfigService.updateBatchById(entityList);
//排序更新预警的
List<IcResiCategoryStatsConfigEntity> statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(null);
List<IcResiCategoryWarnConfigEntity> warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(null);
List<IcResiCategoryStatsConfigEntity> statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper<IcResiCategoryStatsConfigEntity>().lambda().eq(IcResiCategoryStatsConfigEntity::getCustomerId,customerId));
List<IcResiCategoryWarnConfigEntity> warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper<IcResiCategoryWarnConfigEntity>().lambda().eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId));
if(CollectionUtils.isEmpty(warnConfigEntityList)){
return ;
}

15
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java

@ -57,29 +57,32 @@ public class StatsResiWarnController {
private StatsResiWarnService statsResiWarnService;
@PostMapping("list")
public Result list(@RequestBody StatsResiListFormDTO formDTO){
public Result list(@LoginUser TokenDto tokenDto,@RequestBody StatsResiListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
List<IcStatsResiResultDTO> icStatsResiResultDTOList = statsResiWarnService.list(formDTO.getId(),formDTO.getLevel());
String customerId = tokenDto.getCustomerId();
List<IcStatsResiResultDTO> icStatsResiResultDTOList = statsResiWarnService.list(customerId,formDTO.getId(),formDTO.getLevel());
return new Result().ok(icStatsResiResultDTOList);
}
@PostMapping("buildingwarnlist")
public Result buildingWarnList(@RequestBody StatsResiWarnFormDTO formDTO){
public Result buildingWarnList(@LoginUser TokenDto tokenDto,@RequestBody StatsResiWarnFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, StatsResiWarnFormDTO.ListSelectedBuilding.class);
String customerId = tokenDto.getCustomerId();
String agencyID = formDTO.getAgencyId();
List<IcStatsResiWarnBuildingResultDTO> icStatsResiWarnBuildingResultDTOS = statsResiWarnService.buildingwWarnList(agencyID);
List<IcStatsResiWarnBuildingResultDTO> icStatsResiWarnBuildingResultDTOS = statsResiWarnService.buildingwWarnList(customerId,agencyID);
return new Result().ok(icStatsResiWarnBuildingResultDTOS);
}
@PostMapping("userwarnlist")
public Result userWarnList(@RequestBody StatsResiWarnFormDTO formDTO){
public Result userWarnList(@LoginUser TokenDto tokenDto,@RequestBody StatsResiWarnFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, StatsResiWarnFormDTO.ListSelectedUser.class);
String customerId = tokenDto.getCustomerId();
List<String> buildingIdList = formDTO.getBuildingIdList();
if(CollectionUtils.isEmpty(buildingIdList)){
return new Result();
}
List<IcStatsResiWarnUserResultDTO> icStatsResiWarnUserResultDTOS = statsResiWarnService.userWarnList(formDTO.getConfigId(), formDTO.getBuildingIdList());
List<IcStatsResiWarnUserResultDTO> icStatsResiWarnUserResultDTOS = statsResiWarnService.userWarnList(customerId,formDTO.getConfigId(), formDTO.getBuildingIdList());
return new Result().ok(icStatsResiWarnUserResultDTOS);
}

18
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java

@ -35,17 +35,27 @@ import java.util.Map;
@Mapper
public interface IcStatsResiWarnDao extends BaseDao<IcStatsResiWarnEntity> {
List<IcStatsResiWarnEntity> selectResiWarnByAgencyId(@Param("agencyId") String agencyId);
List<IcStatsResiWarnEntity> selectResiWarnByAgencyId(@Param("customerId") String customerId,@Param("agencyId") String agencyId);
List<Map<String,String>> userWarnList(@Param("buildingIdList") List<String> buildingIdList, @Param("tableName") String tableName, @Param("columnName") String columnName);
List<Map<String,String>> userWarnList(@Param("customerId") String customerId,
@Param("buildingIdList") List<String> buildingIdList,
@Param("tableName") String tableName,
@Param("columnName") String columnName);
Integer countListByLevelAndCol(
@Param("customerId") String customerId,
@Param("tableName") String tableName,
@Param("columnName") String columnName,
@Param("id")String id,
@Param("level")String level);
List<IcStatsResiWarnEntity> resiWarn(@Param("tableName") String tableName,@Param("columnName") String columnName);
IcStatsResiWarnEntity resiWarnById(@Param("tableName") String tableName,@Param("columnName") String columnName,@Param("icStatsResiWarn") IcStatsResiWarnEntity icStatsResiWarn);
List<IcStatsResiWarnEntity> resiWarn(@Param("customerId") String customerId,
@Param("tableName") String tableName,
@Param("columnName") String columnName);
IcStatsResiWarnEntity resiWarnById(@Param("customerId") String customerId,
@Param("tableName") String tableName,
@Param("columnName") String columnName,
@Param("icStatsResiWarn") IcStatsResiWarnEntity icStatsResiWarn);
}

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java

@ -31,11 +31,11 @@ import java.util.List;
*/
public interface StatsResiWarnService{
List<IcStatsResiWarnBuildingResultDTO> buildingwWarnList(String agencyID);
List<IcStatsResiWarnBuildingResultDTO> buildingwWarnList(String customerId,String agencyID);
List<IcStatsResiWarnUserResultDTO> userWarnList(String configId, List<String> buildingIdList);
List<IcStatsResiWarnUserResultDTO> userWarnList(String customerId,String configId, List<String> buildingIdList);
List<IcStatsResiResultDTO> list(String id, String level);
List<IcStatsResiResultDTO> list(String customerId,String id, String level);
void resiWarn(String customerId);

38
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java

@ -52,7 +52,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
private IcResiUserDao icResiUserDao;
@Override
public List<IcStatsResiWarnBuildingResultDTO> buildingwWarnList(String agencyID) {
public List<IcStatsResiWarnBuildingResultDTO> buildingwWarnList(String customerId,String agencyID) {
List<IcStatsResiWarnBuildingResultDTO> result = new ArrayList<>();
//feign获取当前需要预警的配置信息以及阈值
Result<List<IcResiCategoryWarnConfigDTO>> warnResult = operCustomizeOpenFeignClient.resiCategoryWarnList();
@ -81,7 +81,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
return resiWarnBuildingResultDTO;
}).collect(Collectors.toList());
//统计数量
List<IcStatsResiWarnEntity> icStatsResiWarnEntityList = icStatsResiWarnDao.selectResiWarnByAgencyId(agencyID);
List<IcStatsResiWarnEntity> icStatsResiWarnEntityList = icStatsResiWarnDao.selectResiWarnByAgencyId(customerId,agencyID);
if(CollectionUtils.isEmpty(icStatsResiWarnEntityList )){
return result;
}
@ -115,7 +115,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
}
@Override
public List<IcStatsResiWarnUserResultDTO> userWarnList(String configId, List<String> buildingIdList) {
public List<IcStatsResiWarnUserResultDTO> userWarnList(String customerId,String configId, List<String> buildingIdList) {
//feign根据buildingIdList 获取网格,小区,楼宇 信息
Result<List<BuildingResultDTO>> buildingList = govOrgOpenFeignClient.buildingListByIds(buildingIdList);
if (!buildingList.success() || null == buildingList.getData()) {
@ -137,7 +137,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
IcResiCategoryWarnConfigDTO icResiCategoryWarnConfigDTO = warnResult.getData();
//根据buildingID,tableName he columnName获取名字
List<Map<String, String>> maps = icStatsResiWarnDao.userWarnList(buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName());
List<Map<String, String>> maps = icStatsResiWarnDao.userWarnList(customerId,buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName());
result.forEach(item->{
item.setConfigId(configId);
List<Map<String, String>> buildingIds = maps.stream().filter(map -> item.getBuildingId().equals(map.get("buildingId"))).collect(Collectors.toList());
@ -147,7 +147,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
}
@Override
public List<IcStatsResiResultDTO> list(String id, String level) {
public List<IcStatsResiResultDTO> list(String customerId,String id, String level) {
//获取所有配置类项 getshow
Result<List<IcResiCategoryStatsConfigDTO>> statsResult = operCustomizeOpenFeignClient.resiCategoryStatsListShowd();
if (!statsResult.success() || null == statsResult.getData()) {
@ -164,7 +164,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
resultDTO.setHouseShowIcon(item.getHouseShowIcon());
resultDTO.setManagementIcon(item.getManagementIcon());
//根据id ,level 获取count
Integer count = icStatsResiWarnDao.countListByLevelAndCol(item.getTableName(),item.getColumnName(),id,level);
Integer count = icStatsResiWarnDao.countListByLevelAndCol(customerId,item.getTableName(),item.getColumnName(),id,level);
resultDTO.setCount(count);
result.add(resultDTO);
});
@ -187,10 +187,10 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
//保存数据
List<IcStatsResiWarnEntity> icStatsResiWarnEntities = new ArrayList<>();
for (IcResiCategoryWarnConfigDTO item : icResiCategoryWarnConfigDTOList) {
icStatsResiWarnDao.delete(new QueryWrapper<IcStatsResiWarnEntity>().lambda().eq(IcStatsResiWarnEntity::getConfigId,item.getId()));
List<IcStatsResiWarnEntity> maps = icStatsResiWarnDao.resiWarn(item.getTableName(), item.getColumnName());
icStatsResiWarnDao.delete(new QueryWrapper<IcStatsResiWarnEntity>().lambda().eq(IcStatsResiWarnEntity::getConfigId,item.getId()).eq(IcStatsResiWarnEntity::getCustomerId,customerId));
List<IcStatsResiWarnEntity> maps = icStatsResiWarnDao.resiWarn(customerId,item.getTableName(), item.getColumnName());
if(CollectionUtils.isEmpty(maps)){
continue;
}
@ -226,6 +226,11 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
if(null == icResiUserEntity){
return ;
}
IcStatsResiWarnEntity query = new IcStatsResiWarnEntity();
query.setAgencyId(icResiUserEntity.getAgencyId());
query.setGridId(icResiUserEntity.getGridId());
query.setNeighborHoodId(icResiUserEntity.getVillageId());
query.setBuildingId(icResiUserEntity.getBuildId());
//保存数据
for (IcResiCategoryWarnConfigDTO item : icResiCategoryWarnConfigDTOList) {
@ -233,11 +238,13 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
IcStatsResiWarnEntity icStatsResiWarn = icStatsResiWarnDao.selectOne(new QueryWrapper<IcStatsResiWarnEntity>().lambda()
.eq(IcStatsResiWarnEntity::getConfigId,item.getId())
.eq(IcStatsResiWarnEntity::getCustomerId,customerId)
.eq(IcStatsResiWarnEntity::getAgencyId, icResiUserEntity.getAgencyId())
.eq(IcStatsResiWarnEntity::getGridId, icResiUserEntity.getGridId())
.eq(IcStatsResiWarnEntity::getNeighborHoodId, icResiUserEntity.getVillageId())
.eq(IcStatsResiWarnEntity::getBuildingId, icResiUserEntity.getBuildId()));
//统计数量
IcStatsResiWarnEntity resiWarnEntity = icStatsResiWarnDao.resiWarnById(customerId,item.getTableName(), item.getColumnName(),query);
if(null == icStatsResiWarn){
//如果不存在,新增统计数量
icStatsResiWarn = new IcStatsResiWarnEntity();
@ -248,18 +255,23 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService {
icStatsResiWarn.setBuildingId(icResiUserEntity.getBuildId());
icStatsResiWarn.setConfigId(item.getId());
icStatsResiWarn.setCustomerId(customerId);
IcStatsResiWarnEntity resiWarnEntity = icStatsResiWarnDao.resiWarnById(item.getTableName(), item.getColumnName(),icStatsResiWarn);
if(null == resiWarnEntity){
continue;
}
icStatsResiWarn.setCount(0);
}else{
icStatsResiWarn.setCount(resiWarnEntity.getCount());
}
icStatsResiWarnDao.insert(icStatsResiWarn);
}else{
//如果存在,更新统计数量
IcStatsResiWarnEntity resiWarnEntity = icStatsResiWarnDao.resiWarnById(item.getTableName(), item.getColumnName(),icStatsResiWarn);
if(null == resiWarnEntity){
icStatsResiWarn.setCount(0);
}else{
icStatsResiWarn.setCount(resiWarnEntity.getCount());
}
icStatsResiWarn.setCustomerId(customerId);
icStatsResiWarnDao.updateById(icStatsResiWarn);
}

14
epmet-user/epmet-user-server/src/main/resources/mapper/IcStatsResiWarnDao.xml

@ -29,6 +29,7 @@
<if test="agencyId != null and agencyId.trim() != ''">
AND (AGENCY_ID = #{agencyId} or CONCAT(':',AGENCY_PIDS, ':') like CONCAT('%:',#{agencyId},':%'))
</if>
and CUSTOMER_ID = #{customerId}
</select>
<select id="userWarnList" resultType="map">
@ -46,10 +47,12 @@
</if>
<if test="tableName!='ic_resi_user'">
and ID in (
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and DEL_FLAG = '0'
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and CUSTOMER_ID = #{customerId} and DEL_FLAG = '0'
)
</if>
and CUSTOMER_ID = #{customerId}
and DEL_FLAG = '0'
group by BUILD_ID
</select>
@ -63,7 +66,7 @@
</if>
<if test="tableName!='ic_resi_user'">
and ID in (
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and DEL_FLAG = '0'
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and CUSTOMER_ID = #{customerId} and DEL_FLAG = '0'
)
</if>
<if test="level=='agency'">
@ -78,6 +81,7 @@
<if test="level=='building'">
AND BUILD_ID = #{id}
</if>
and CUSTOMER_ID = #{customerId}
and DEL_FLAG = '0'
</select>
@ -97,9 +101,10 @@
</if>
<if test="tableName!='ic_resi_user'">
and ID in (
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and DEL_FLAG = '0'
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and CUSTOMER_ID = #{customerId} and DEL_FLAG = '0'
)
</if>
and CUSTOMER_ID = #{customerId}
and DEL_FLAG = '0'
group by AGENCY_ID,GRID_ID,VILLAGE_ID,BUILD_ID
</select>
@ -118,9 +123,10 @@
</if>
<if test="tableName!='ic_resi_user'">
and ID in (
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and DEL_FLAG = '0'
select IC_RESI_USER from ${tableName} where ${columnName} = '1' and CUSTOMER_ID = #{customerId} and DEL_FLAG = '0'
)
</if>
and CUSTOMER_ID = #{customerId}
and DEL_FLAG = '0'
and AGENCY_ID = #{icStatsResiWarn.agencyId} and GRID_ID =#{icStatsResiWarn.gridId} and VILLAGE_ID=#{icStatsResiWarn.neighborHoodId} and BUILD_ID=#{icStatsResiWarn.buildingId}
group by AGENCY_ID,GRID_ID,VILLAGE_ID,BUILD_ID

Loading…
Cancel
Save