Commit 944d8c92 authored by yf's avatar yf

大屏相关接口修改

parent 02cd9be3
...@@ -93,6 +93,8 @@ public class LedgerBuilding extends BaseEntityClean ...@@ -93,6 +93,8 @@ public class LedgerBuilding extends BaseEntityClean
* 楼栋风险指数 * 楼栋风险指数
*/ */
private BigDecimal riskIndex; private BigDecimal riskIndex;
private String riskLevel;
private String riskColor;
......
...@@ -5,6 +5,8 @@ import com.ruoyi.common.annotation.Excel; ...@@ -5,6 +5,8 @@ import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntityClean; import com.ruoyi.common.core.domain.BaseEntityClean;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
/** /**
* 基础数据-项目对象 ledger_project * 基础数据-项目对象 ledger_project
* *
...@@ -92,7 +94,12 @@ public class LedgerProject extends BaseEntityClean ...@@ -92,7 +94,12 @@ public class LedgerProject extends BaseEntityClean
@TableField(exist = false) @TableField(exist = false)
private String num; private String num;
/**
* 楼栋风险指数
*/
private BigDecimal riskIndex;
private String riskLevel;
private String riskColor;
} }
...@@ -17,6 +17,8 @@ import java.math.BigDecimal; ...@@ -17,6 +17,8 @@ import java.math.BigDecimal;
@Data @Data
public class RiskExistingListSaveDto { public class RiskExistingListSaveDto {
@TableField(exist = false)
private Long buildingId;
/** /**
* id * id
*/ */
...@@ -61,6 +63,7 @@ public class RiskExistingListSaveDto { ...@@ -61,6 +63,7 @@ public class RiskExistingListSaveDto {
* 风险等级 * 风险等级
*/ */
private String level; private String level;
private String riskColor;
/** /**
* 风险等级 * 风险等级
......
...@@ -3,25 +3,23 @@ package com.censoft.censoftrongtong.domain.dto.statistics; ...@@ -3,25 +3,23 @@ package com.censoft.censoftrongtong.domain.dto.statistics;
import jdk.nashorn.internal.ir.annotations.Ignore; import jdk.nashorn.internal.ir.annotations.Ignore;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.Random; import java.util.Random;
@Data @Data
public class MapLedgerProjectDto { public class MapLedgerProjectDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Ignore
String[] color = new String[]{"red", "green", "yellow", "blue"};
private Long projectId; private Long projectId;
private String projectName; private String projectName;
private BigDecimal riskIndex;
private String lat; private String lat;
private String lng; private String lng;
private String riskColor; private String riskColor;
private String riskLevel;
public String getRiskColor() { private String province;
Random r = new Random(); private String city;
return color[r.nextInt(4)]; private String district;
}
/** /**
* 风险总数量 * 风险总数量
*/ */
......
...@@ -25,19 +25,16 @@ public class MapStatisticsQueryDto { ...@@ -25,19 +25,16 @@ public class MapStatisticsQueryDto {
if (this.level == null) if (this.level == null)
return levelName; return levelName;
switch (this.level) { switch (this.level) {
case 1: case 0:
levelName = "province"; levelName = "province";
break; break;
case 2: case 1:
if (this.getAreaName().contains("北京") || this.getAreaName().contains("重庆") || this.getAreaName().contains("上海") || this.getAreaName().contains("天津"))
levelName = "district";
else
levelName = "city"; levelName = "city";
break; break;
case 3: case 2:
levelName = "district"; levelName = "district";
break; break;
case 4: case 3:
levelName = "street"; levelName = "street";
break; break;
...@@ -50,16 +47,16 @@ public class MapStatisticsQueryDto { ...@@ -50,16 +47,16 @@ public class MapStatisticsQueryDto {
if (this.level == null) if (this.level == null)
return levelName; return levelName;
switch (this.level) { switch (this.level) {
case 2: case 1:
if (this.getAreaName().contains("北京") || this.getAreaName().contains("重庆") || this.getAreaName().contains("上海") || this.getAreaName().contains("天津")) if (this.getAreaName().contains("北京") || this.getAreaName().contains("重庆") || this.getAreaName().contains("上海") || this.getAreaName().contains("天津"))
levelName = "city"; levelName = "city";
else else
levelName = "province"; levelName = "province";
break; break;
case 3: case 2:
levelName = "city"; levelName = "city";
break; break;
case 4: case 3:
levelName = "district"; levelName = "district";
break; break;
} }
......
...@@ -9,8 +9,6 @@ import java.util.Random; ...@@ -9,8 +9,6 @@ import java.util.Random;
@Data @Data
public class RiskMapStatisticsDto { public class RiskMapStatisticsDto {
@Ignore
String[] color = new String[]{"red", "green", "yellow", "blue"};
/** /**
* 地区名称 * 地区名称
*/ */
...@@ -26,10 +24,5 @@ public class RiskMapStatisticsDto { ...@@ -26,10 +24,5 @@ public class RiskMapStatisticsDto {
*/ */
private String areaColor; private String areaColor;
public String getAreaColor() {
Random r = new Random();
return color[r.nextInt(4)];
}
private List<MapLedgerProjectDto> projectList; private List<MapLedgerProjectDto> projectList;
} }
package com.censoft.censoftrongtong.mapper; package com.censoft.censoftrongtong.mapper;
import com.censoft.censoftrongtong.domain.LedgerProject; import com.censoft.censoftrongtong.domain.LedgerProject;
import com.censoft.censoftrongtong.domain.dto.statistics.MapLedgerProjectDto;
import com.github.yulichang.base.MPJBaseMapper; import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -30,10 +31,13 @@ public interface LedgerProjectMapper extends MPJBaseMapper<LedgerProject> ...@@ -30,10 +31,13 @@ public interface LedgerProjectMapper extends MPJBaseMapper<LedgerProject>
* @return 基础数据-项目集合 * @return 基础数据-项目集合
*/ */
public List<LedgerProject> selectLedgerProjectList(LedgerProject ledgerProject); public List<LedgerProject> selectLedgerProjectList(LedgerProject ledgerProject);
public List<LedgerProject> getLedgerProjectList(@Param("name")String name,@Param("areaName") String areaName); public List<LedgerProject> getLedgerProjectList(@Param("name")String name,@Param("level") Integer level,@Param("areaName") String areaName);
public Long getProjectCount(@Param("areaName") String areaName);
public Long getBuildingCount(@Param("areaName") String areaName,@Param("projectId") Long projectId); public List<MapLedgerProjectDto> getProjectListAndCount( @Param("level") Integer level, @Param("areaName") String areaName);
public Long getFloorCount(@Param("areaName") String areaName,@Param("projectId") Long projectId);
public Long getProjectCount(@Param("level") Integer level,@Param("areaName") String areaName);
public Long getBuildingCount(@Param("level") Integer level,@Param("areaName") String areaName,@Param("projectId") Long projectId);
public Long getFloorCount(@Param("level") Integer level,@Param("areaName") String areaName,@Param("projectId") Long projectId);
/** /**
......
...@@ -24,7 +24,7 @@ public interface RiskPlanExistingListMapper extends MPJBaseMapper<RiskPlanExisti ...@@ -24,7 +24,7 @@ public interface RiskPlanExistingListMapper extends MPJBaseMapper<RiskPlanExisti
* @param beginTime * @param beginTime
* @return * @return
*/ */
public Long getNationalRiskNum(@Param("areaName") String areaName, @Param("beginTime") Date beginTime,@Param("projectId")Long projectId); public Long getNationalRiskNum(@Param("level")Integer level,@Param("areaName") String areaName, @Param("beginTime") Date beginTime,@Param("projectId")Long projectId);
/** /**
* 总体风险指数排名 * 总体风险指数排名
...@@ -32,7 +32,7 @@ public interface RiskPlanExistingListMapper extends MPJBaseMapper<RiskPlanExisti ...@@ -32,7 +32,7 @@ public interface RiskPlanExistingListMapper extends MPJBaseMapper<RiskPlanExisti
* @param areaName * @param areaName
* @return * @return
*/ */
public List<RiskIndexRankingDto> getRiskIndexRanking(String areaName); public List<RiskIndexRankingDto> getRiskIndexRanking(@Param("level")Integer level,@Param("areaName")String areaName);
/** /**
* 年度风险数量统计 * 年度风险数量统计
...@@ -40,13 +40,13 @@ public interface RiskPlanExistingListMapper extends MPJBaseMapper<RiskPlanExisti ...@@ -40,13 +40,13 @@ public interface RiskPlanExistingListMapper extends MPJBaseMapper<RiskPlanExisti
* @param areaName * @param areaName
* @return * @return
*/ */
public LinkedHashMap<String, Long> getAnnualRiskStatistics(String areaName); public LinkedHashMap<String, Long> getAnnualRiskStatistics(@Param("level")Integer level,@Param("areaName")String areaName);
public List<RiskLevelStatisticsDto> getRiskLevelStatistics(@Param("areaName") String areaName,@Param("projectId")Long projectId); public List<RiskLevelStatisticsDto> getRiskLevelStatistics(@Param("level")Integer level,@Param("areaName") String areaName,@Param("projectId")Long projectId);
public List<AccidentTypeStatisticsDto> getAccidentTypeStatistics(String areaName); public List<AccidentTypeStatisticsDto> getAccidentTypeStatistics(@Param("level")Integer level,@Param("areaName")String areaName);
public List<RiskProjectRankingDto> getRiskProjectRanking(@Param("areaName") String areaName, @Param("level") String level); public List<RiskProjectRankingDto> getRiskProjectRanking(@Param("level")Integer level,@Param("areaName") String areaName);
public List<RiskMapStatisticsDto> getRiskMapStatistics(MapStatisticsQueryDto queryDto); public List<RiskMapStatisticsDto> getRiskMapStatistics(MapStatisticsQueryDto queryDto);
......
...@@ -24,7 +24,7 @@ public interface RiskPlanInherentListMapper extends MPJBaseMapper<RiskPlanInhere ...@@ -24,7 +24,7 @@ public interface RiskPlanInherentListMapper extends MPJBaseMapper<RiskPlanInhere
* @param beginTime * @param beginTime
* @return * @return
*/ */
public Long getNationalRiskNum(@Param("areaName") String areaName, @Param("beginTime") Date beginTime, @Param("projectId") Long projectId); public Long getNationalRiskNum(@Param("level") Integer level,@Param("areaName") String areaName, @Param("beginTime") Date beginTime, @Param("projectId") Long projectId);
/** /**
...@@ -33,7 +33,7 @@ public interface RiskPlanInherentListMapper extends MPJBaseMapper<RiskPlanInhere ...@@ -33,7 +33,7 @@ public interface RiskPlanInherentListMapper extends MPJBaseMapper<RiskPlanInhere
* @param areaName * @param areaName
* @return * @return
*/ */
public List<RiskIndexRankingDto> getRiskIndexRanking(String areaName); public List<RiskIndexRankingDto> getRiskIndexRanking(@Param("level") Integer level,@Param("areaName") String areaName);
/** /**
* 年度风险数量统计 * 年度风险数量统计
...@@ -41,13 +41,13 @@ public interface RiskPlanInherentListMapper extends MPJBaseMapper<RiskPlanInhere ...@@ -41,13 +41,13 @@ public interface RiskPlanInherentListMapper extends MPJBaseMapper<RiskPlanInhere
* @param areaName * @param areaName
* @return * @return
*/ */
public LinkedHashMap<String, Long> getAnnualRiskStatistics(String areaName); public LinkedHashMap<String, Long> getAnnualRiskStatistics(@Param("level") Integer level,@Param("areaName") String areaName);
public List<RiskLevelStatisticsDto> getRiskLevelStatistics(@Param("areaName") String areaName, @Param("projectId") Long projectId); public List<RiskLevelStatisticsDto> getRiskLevelStatistics(@Param("level") Integer level,@Param("areaName") String areaName, @Param("projectId") Long projectId);
public List<AccidentTypeStatisticsDto> getAccidentTypeStatistics(String areaName); public List<AccidentTypeStatisticsDto> getAccidentTypeStatistics( @Param("level") Integer level,@Param("areaName") String areaName);
public List<RiskProjectRankingDto> getRiskProjectRanking(@Param("areaName") String areaName, @Param("level") String level); public List<RiskProjectRankingDto> getRiskProjectRanking( @Param("level") Integer level,@Param("areaName") String areaName);
public List<ProjectRiskInfoDto> getProjectRiskInfo(@Param("projectId") Long projectId, @Param("buildingId") Long buildingId, @Param("floorId") Long floorId,@Param("level")String level); public List<ProjectRiskInfoDto> getProjectRiskInfo(@Param("projectId") Long projectId, @Param("buildingId") Long buildingId, @Param("floorId") Long floorId,@Param("level")String level);
......
package com.censoft.censoftrongtong.service; package com.censoft.censoftrongtong.service;
import com.censoft.censoftrongtong.domain.LedgerProject; import com.censoft.censoftrongtong.domain.LedgerProject;
import com.censoft.censoftrongtong.domain.dto.statistics.MapLedgerProjectDto;
import com.github.yulichang.base.MPJBaseService; import com.github.yulichang.base.MPJBaseService;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
...@@ -29,11 +30,12 @@ public interface ILedgerProjectService extends MPJBaseService<LedgerProject> ...@@ -29,11 +30,12 @@ public interface ILedgerProjectService extends MPJBaseService<LedgerProject>
* @return 基础数据-项目集合 * @return 基础数据-项目集合
*/ */
public List<LedgerProject> selectLedgerProjectList(LedgerProject ledgerProject); public List<LedgerProject> selectLedgerProjectList(LedgerProject ledgerProject);
public List<LedgerProject> getLedgerProjectList(String name,String areaName); public List<LedgerProject> getLedgerProjectList(String name,Integer level,String areaName);
public List<MapLedgerProjectDto> getProjectListAndCount( Integer level, String areaName);
public Long getProjectCount(String areaName); public Long getProjectCount(Integer level,String areaName);
public Long getBuildingCount(String areaName,Long projectId); public Long getBuildingCount(Integer level,String areaName,Long projectId);
public Long getFloorCount(String areaName,Long projectId); public Long getFloorCount(Integer level,String areaName,Long projectId);
/** /**
* 新增基础数据-项目 * 新增基础数据-项目
......
...@@ -26,7 +26,7 @@ public interface IRiskPlanExistingListService extends MPJBaseService<RiskPlanExi ...@@ -26,7 +26,7 @@ public interface IRiskPlanExistingListService extends MPJBaseService<RiskPlanExi
* @param beginTime * @param beginTime
* @return * @return
*/ */
public Long getNationalRiskNum(String areaName, Date beginTime,Long peojectId); public Long getNationalRiskNum(Integer level,String areaName, Date beginTime,Long peojectId);
/** /**
* 总体风险指数排名 * 总体风险指数排名
...@@ -34,14 +34,14 @@ public interface IRiskPlanExistingListService extends MPJBaseService<RiskPlanExi ...@@ -34,14 +34,14 @@ public interface IRiskPlanExistingListService extends MPJBaseService<RiskPlanExi
* @param areaName * @param areaName
* @return * @return
*/ */
public List<RiskIndexRankingDto> getRiskIndexRanking(String areaName); public List<RiskIndexRankingDto> getRiskIndexRanking(Integer level,String areaName);
public LinkedHashMap<String, Long> getAnnualRiskStatistics(String areaName); public LinkedHashMap<String, Long> getAnnualRiskStatistics(Integer level,String areaName);
public List<RiskLevelStatisticsDto> getRiskLevelStatistics(String areaName,Long projectId); public List<RiskLevelStatisticsDto> getRiskLevelStatistics(Integer level,String areaName,Long projectId);
public List<AccidentTypeStatisticsDto> getAccidentTypeStatistics(String areaName); public List<AccidentTypeStatisticsDto> getAccidentTypeStatistics(Integer level,String areaName);
public List<RiskProjectRankingDto> getRiskProjectRanking(String areaName,String level); public List<RiskProjectRankingDto> getRiskProjectRanking(Integer level,String areaName);
public List<RiskMapStatisticsDto> getRiskMapStatistics(MapStatisticsQueryDto queryDto); public List<RiskMapStatisticsDto> getRiskMapStatistics(MapStatisticsQueryDto queryDto);
...@@ -110,6 +110,7 @@ public interface IRiskPlanExistingListService extends MPJBaseService<RiskPlanExi ...@@ -110,6 +110,7 @@ public interface IRiskPlanExistingListService extends MPJBaseService<RiskPlanExi
* @return * @return
*/ */
Map<String, String> getRiskLevelByScore(Long buildingId, BigDecimal score); Map<String, String> getRiskLevelByScore(Long buildingId, BigDecimal score);
Map<String, String> getRiskLevelByScoreAndUpd(Long buildingId, BigDecimal score);
/** /**
......
...@@ -27,7 +27,7 @@ public interface IRiskPlanInherentListService extends MPJBaseService<RiskPlanInh ...@@ -27,7 +27,7 @@ public interface IRiskPlanInherentListService extends MPJBaseService<RiskPlanInh
* @param beginTime * @param beginTime
* @return * @return
*/ */
public Long getNationalRiskNum(String areaName, Date beginTime, Long peojectId); public Long getNationalRiskNum(Integer level,String areaName, Date beginTime, Long peojectId);
/** /**
* 总体风险指数排名 * 总体风险指数排名
...@@ -35,14 +35,14 @@ public interface IRiskPlanInherentListService extends MPJBaseService<RiskPlanInh ...@@ -35,14 +35,14 @@ public interface IRiskPlanInherentListService extends MPJBaseService<RiskPlanInh
* @param areaName * @param areaName
* @return * @return
*/ */
public List<RiskIndexRankingDto> getRiskIndexRanking(String areaName); public List<RiskIndexRankingDto> getRiskIndexRanking(Integer level,String areaName);
public LinkedHashMap<String, Long> getAnnualRiskStatistics(String areaName); public LinkedHashMap<String, Long> getAnnualRiskStatistics(Integer level,String areaName);
public List<RiskLevelStatisticsDto> getRiskLevelStatistics(String areaName,Long projectId); public List<RiskLevelStatisticsDto> getRiskLevelStatistics(Integer level,String areaName,Long projectId);
public List<AccidentTypeStatisticsDto> getAccidentTypeStatistics(String areaName); public List<AccidentTypeStatisticsDto> getAccidentTypeStatistics(Integer level,String areaName);
public List<RiskProjectRankingDto> getRiskProjectRanking(String areaName, String level); public List<RiskProjectRankingDto> getRiskProjectRanking(Integer level,String areaName);
public List<ProjectRiskInfoDto> getProjectRiskInfo(Long projectId, Long buildingId, Long floorId,String level); public List<ProjectRiskInfoDto> getProjectRiskInfo(Long projectId, Long buildingId, Long floorId,String level);
......
package com.censoft.censoftrongtong.service.impl; package com.censoft.censoftrongtong.service.impl;
import com.censoft.censoftrongtong.domain.LedgerProject; import com.censoft.censoftrongtong.domain.LedgerProject;
import com.censoft.censoftrongtong.domain.dto.statistics.MapLedgerProjectDto;
import com.censoft.censoftrongtong.mapper.LedgerProjectMapper; import com.censoft.censoftrongtong.mapper.LedgerProjectMapper;
import com.censoft.censoftrongtong.service.ILedgerProjectService; import com.censoft.censoftrongtong.service.ILedgerProjectService;
import com.github.yulichang.base.MPJBaseServiceImpl; import com.github.yulichang.base.MPJBaseServiceImpl;
...@@ -58,25 +59,31 @@ public class LedgerProjectServiceImpl extends MPJBaseServiceImpl<LedgerProjectMa ...@@ -58,25 +59,31 @@ public class LedgerProjectServiceImpl extends MPJBaseServiceImpl<LedgerProjectMa
* @return 基础数据-项目 * @return 基础数据-项目
*/ */
@Override @Override
public List<LedgerProject> getLedgerProjectList(String name,String areaName) public List<LedgerProject> getLedgerProjectList(String name, Integer level, String areaName)
{ {
return ledgerProjectMapper.getLedgerProjectList(name,areaName); return ledgerProjectMapper.getLedgerProjectList(name,level,areaName);
} }
@Override @Override
public Long getBuildingCount(String areaName,Long projectId) public List<MapLedgerProjectDto> getProjectListAndCount( Integer level, String areaName)
{ {
return ledgerProjectMapper.getBuildingCount(areaName,projectId); return ledgerProjectMapper.getProjectListAndCount(level,areaName);
}
@Override
public Long getBuildingCount(Integer level,String areaName,Long projectId)
{
return ledgerProjectMapper.getBuildingCount(level,areaName,projectId);
} }
@Override @Override
public Long getProjectCount(String areaName) public Long getProjectCount(Integer level,String areaName)
{ {
return ledgerProjectMapper.getProjectCount(areaName); return ledgerProjectMapper.getProjectCount(level,areaName);
} }
@Override @Override
public Long getFloorCount(String areaName,Long projectId) public Long getFloorCount(Integer level,String areaName,Long projectId)
{ {
return ledgerProjectMapper.getFloorCount(areaName,projectId); return ledgerProjectMapper.getFloorCount(level,areaName,projectId);
} }
/** /**
......
...@@ -60,35 +60,35 @@ public class RiskPlanInherentListServiceImpl ...@@ -60,35 +60,35 @@ public class RiskPlanInherentListServiceImpl
@Override @Override
public Long getNationalRiskNum(String areaName, Date beginTime,Long peojectId) { public Long getNationalRiskNum(Integer level,String areaName, Date beginTime,Long peojectId) {
return riskPlanInherentListMapper.getNationalRiskNum(areaName, beginTime,peojectId); return riskPlanInherentListMapper.getNationalRiskNum(level,areaName, beginTime,peojectId);
} }
@Override @Override
public List<RiskIndexRankingDto> getRiskIndexRanking(String areaName) { public List<RiskIndexRankingDto> getRiskIndexRanking(Integer level,String areaName) {
return riskPlanInherentListMapper.getRiskIndexRanking(areaName); return riskPlanInherentListMapper.getRiskIndexRanking(level,areaName);
} }
@Override @Override
public LinkedHashMap<String, Long> getAnnualRiskStatistics(String areaName) { public LinkedHashMap<String, Long> getAnnualRiskStatistics(Integer level,String areaName) {
return riskPlanInherentListMapper.getAnnualRiskStatistics(areaName); return riskPlanInherentListMapper.getAnnualRiskStatistics(level,areaName);
} }
@Override @Override
public List<RiskLevelStatisticsDto> getRiskLevelStatistics(String areaName,Long projectId) { public List<RiskLevelStatisticsDto> getRiskLevelStatistics(Integer level,String areaName,Long projectId) {
return riskPlanInherentListMapper.getRiskLevelStatistics(areaName,projectId); return riskPlanInherentListMapper.getRiskLevelStatistics(level,areaName,projectId);
} }
@Override @Override
public List<AccidentTypeStatisticsDto> getAccidentTypeStatistics(String areaName) { public List<AccidentTypeStatisticsDto> getAccidentTypeStatistics(Integer level,String areaName) {
return riskPlanInherentListMapper.getAccidentTypeStatistics(areaName); return riskPlanInherentListMapper.getAccidentTypeStatistics(level,areaName);
} }
@Override @Override
public List<RiskProjectRankingDto> getRiskProjectRanking(String areaName, String level) { public List<RiskProjectRankingDto> getRiskProjectRanking(Integer level,String areaName) {
return riskPlanInherentListMapper.getRiskProjectRanking(areaName,level); return riskPlanInherentListMapper.getRiskProjectRanking(level,areaName);
} }
@Override @Override
public List<ProjectRiskInfoDto> getProjectRiskInfo( Long projectId, Long buildingId, Long floorId,String level) { public List<ProjectRiskInfoDto> getProjectRiskInfo( Long projectId, Long buildingId, Long floorId,String level) {
......
...@@ -35,6 +35,14 @@ public class RiskLevelProportion extends BaseEntity ...@@ -35,6 +35,14 @@ public class RiskLevelProportion extends BaseEntity
@Excel(name = "风险等级占比", readConverterExp = "大=") @Excel(name = "风险等级占比", readConverterExp = "大=")
private BigDecimal levelScaleMax; private BigDecimal levelScaleMax;
/** 风险等级取值范围(小) */
@Excel(name = "风险等级取值范围", readConverterExp = "小=")
private BigDecimal levelValMin;
/** 风险等级取值范围(大) */
@Excel(name = "风险等级取值范围", readConverterExp = "大=")
private BigDecimal levelValMax;
/** 风险等级系数 */ /** 风险等级系数 */
@Excel(name = "风险等级系数") @Excel(name = "风险等级系数")
private BigDecimal riskGradeIndex; private BigDecimal riskGradeIndex;
......
...@@ -61,11 +61,9 @@ ...@@ -61,11 +61,9 @@
<where> <where>
AND del_flag = '0' and status =0 AND del_flag = '0' and status =0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and province like concat('%', #{areaName}, '%')</if>
province = #{areaName} <if test="level != null and level == 2 ">and city like concat('%', #{areaName}, '%')</if>
or city = #{areaName} <if test="level != null and level == 3 ">and district like concat('%', #{areaName}, '%')</if>
or district = #{areaName}
)
</if> </if>
</where> </where>
</select> </select>
...@@ -76,11 +74,9 @@ ...@@ -76,11 +74,9 @@
<where> <where>
AND b.del_flag = '0' and b.status =0 AND b.del_flag = '0' and b.status =0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province = #{areaName} <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city = #{areaName} <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district = #{areaName}
)
</if> </if>
<if test="projectId != null"> <if test="projectId != null">
and p.id=#{projectId} and p.id=#{projectId}
...@@ -95,11 +91,9 @@ ...@@ -95,11 +91,9 @@
<where> <where>
AND f.del_flag = '0' and f.status =0 AND f.del_flag = '0' and f.status =0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province = #{areaName} <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city = #{areaName} <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district = #{areaName}
)
</if> </if>
<if test="projectId != null"> <if test="projectId != null">
and p.id=#{projectId} and p.id=#{projectId}
...@@ -142,14 +136,46 @@ ...@@ -142,14 +136,46 @@
) )
</if> </if>
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province like concat('%', #{areaName}, '%') <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city like concat('%', #{areaName}, '%') <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district like concat('%', #{areaName}, '%') </if>
) AND p.del_flag = '0'
</where>
</select>
<select id="getProjectListAndCount" resultType="com.censoft.censoftrongtong.domain.dto.statistics.MapLedgerProjectDto">
SELECT
p.id projectId,
p.NAME projectName,
p.lat,
p.lng,
p.province,
p.city,
p.district,
p.risk_index riskIndex,
p.risk_level riskLevel,
p.risk_color riskColor,
count( rpil.id ) existingNum,
count( rpel.id ) inherentNum,
count( rpil.id )+ count( rpel.id ) riskSumNum
FROM
ledger_project p
LEFT JOIN ledger_building lb ON p.id = lb.project_id
LEFT JOIN ledger_floor lf ON lb.id = lf.building_id
LEFT JOIN ledger_room lr ON lf.id = lr.floor_id
LEFT JOIN risk_plan_existing_list rpel ON lr.id = rpel.room_id
LEFT JOIN risk_plan_inherent_list rpil ON lr.id = rpil.room_id
<where>
<if test="areaName != null and areaName != ''">
<if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
<if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
<if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
</if> </if>
AND p.del_flag = '0' AND p.del_flag = '0'
</where> </where>
GROUP BY p.id
</select> </select>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<result property="factor" column="factor"/> <result property="factor" column="factor"/>
<result property="type" column="type"/> <result property="type" column="type"/>
<result property="level" column="level"/> <result property="level" column="level"/>
<result property="levelScore" column="level_score"/>
<result property="presenceLocation" column="presence_location"/> <result property="presenceLocation" column="presence_location"/>
<result property="pictureFileIds" column="picture_file_ids"/> <result property="pictureFileIds" column="picture_file_ids"/>
<result property="measuresProject" column="measures_project"/> <result property="measuresProject" column="measures_project"/>
...@@ -91,11 +92,9 @@ ...@@ -91,11 +92,9 @@
<where> <where>
and rpil.del_flag=0 and rpil.del_flag=0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province = #{areaName} <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city = #{areaName} <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district = #{areaName}
)
</if> </if>
</where> </where>
</select> </select>
...@@ -110,11 +109,9 @@ ...@@ -110,11 +109,9 @@
<where> <where>
and rpil.del_flag=0 and rpil.del_flag=0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province = #{areaName} <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city = #{areaName} <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district = #{areaName}
)
</if> </if>
</where> </where>
group by p.id,p.name ORDER BY RiskScore desc group by p.id,p.name ORDER BY RiskScore desc
...@@ -134,11 +131,9 @@ ...@@ -134,11 +131,9 @@
<where> <where>
and rpil.del_flag=0 and rpil.del_flag=0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province = #{areaName} <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city = #{areaName} <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district = #{areaName}
)
</if> </if>
</where> </where>
GROUP BY dict_label GROUP BY dict_label
...@@ -156,11 +151,9 @@ ...@@ -156,11 +151,9 @@
<where> <where>
and rpil.del_flag=0 and rpil.del_flag=0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province = #{areaName} <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city = #{areaName} <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district = #{areaName}
)
</if> </if>
<if test="projectId != null"> <if test="projectId != null">
and p.id=#{projectId} and p.id=#{projectId}
...@@ -179,11 +172,9 @@ ...@@ -179,11 +172,9 @@
<where> <where>
and rpil.del_flag=0 and rpil.del_flag=0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province = #{areaName} <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city = #{areaName} <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district = #{areaName}
)
</if> </if>
</where> </where>
group by p.id,p.name ORDER BY RiskNum desc group by p.id,p.name ORDER BY RiskNum desc
...@@ -198,11 +189,9 @@ ...@@ -198,11 +189,9 @@
<where> <where>
and rpil.del_flag=0 and rpil.del_flag=0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province = #{areaName} <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city = #{areaName} <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district = #{areaName}
)
</if> </if>
<if test="beginTime != null"> <if test="beginTime != null">
and ( and (
...@@ -245,19 +234,12 @@ ...@@ -245,19 +234,12 @@
resultType="com.censoft.censoftrongtong.domain.dto.statistics.RiskMapStatisticsDto"> resultType="com.censoft.censoftrongtong.domain.dto.statistics.RiskMapStatisticsDto">
SELECT p.${levelName} areaName, SELECT p.${levelName} areaName,
COUNT(1) riskNum COUNT(1) riskNum
FROM risk_plan_existing_list rpil FROM ledger_project p
INNER JOIN ledger_room lr ON lr.id = rpil.room_id LEFT JOIN ledger_building lb ON p.id = lb.project_id AND lb.del_flag = '0' AND lb.`status` = '0'
INNER JOIN ledger_floor lf ON lf.id = floor_id LEFT JOIN ledger_floor lf ON lb.id = lf.building_id AND lf.del_flag = '0' AND lf.`status` = '0'
INNER JOIN ledger_building lb ON lb.id = lf.building_id LEFT JOIN ledger_room lr ON lf.id = lr.floor_id AND lr.del_flag = '0' AND lr.`status` = '0'
INNER JOIN ledger_project p ON p.id = lb.project_id LEFT JOIN risk_plan_existing_list rpel ON lr.id = rpel.room_id AND rpel.del_flag = '0'
<where> <where>
AND rpil.del_flag = '0'
AND lr.del_flag = '0'
AND lr.`status` = '0'
AND lf.del_flag = '0'
AND lf.`status` = '0'
AND lb.del_flag = '0'
AND lb.`status` = '0'
<if test="areaName != null and areaName != '' and level != 1"> <if test="areaName != null and areaName != '' and level != 1">
AND p.${parentLevel} like concat('%', #{areaName}, '%') AND p.${parentLevel} like concat('%', #{areaName}, '%')
</if> </if>
...@@ -286,6 +268,7 @@ ...@@ -286,6 +268,7 @@
rpil.factor, rpil.factor,
rpil.type, rpil.type,
rpil.LEVEL, rpil.LEVEL,
rpil.level_score,
rpil.presence_location, rpil.presence_location,
rpil.picture_file_ids, rpil.picture_file_ids,
rpil.measures_project, rpil.measures_project,
...@@ -317,6 +300,7 @@ ...@@ -317,6 +300,7 @@
<where> <where>
<if test="userId != null ">and rpil.user_id = #{userId}</if> <if test="userId != null ">and rpil.user_id = #{userId}</if>
<if test="roomId != null ">and rpil.room_id = #{roomId}</if> <if test="roomId != null ">and rpil.room_id = #{roomId}</if>
<if test="buildingId != null and buildingId != ''">and lb.id = #{buildingId}</if>
<if test="inherentId != null ">and rpil.inherent_id = #{inherentId}</if> <if test="inherentId != null ">and rpil.inherent_id = #{inherentId}</if>
<if test="planId != null ">and rpil.plan_id = #{planId}</if> <if test="planId != null ">and rpil.plan_id = #{planId}</if>
<if test="name != null and name != ''">and rpil.name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''">and rpil.name like concat('%', #{name}, '%')</if>
......
...@@ -102,11 +102,9 @@ ...@@ -102,11 +102,9 @@
<where> <where>
and rpil.del_flag=0 and rpil.del_flag=0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province = #{areaName} <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city = #{areaName} <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district = #{areaName}
)
</if> </if>
</where> </where>
</select> </select>
...@@ -121,11 +119,9 @@ ...@@ -121,11 +119,9 @@
<where> <where>
and rpil.del_flag=0 and rpil.del_flag=0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province = #{areaName} <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city = #{areaName} <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district = #{areaName}
)
</if> </if>
</where> </where>
group by p.id,p.name ORDER BY RiskScore desc group by p.id,p.name ORDER BY RiskScore desc
...@@ -145,11 +141,9 @@ ...@@ -145,11 +141,9 @@
<where> <where>
and rpil.del_flag=0 and rpil.del_flag=0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province = #{areaName} <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city = #{areaName} <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district = #{areaName}
)
</if> </if>
</where> </where>
GROUP BY dict_label GROUP BY dict_label
...@@ -167,11 +161,9 @@ ...@@ -167,11 +161,9 @@
<where> <where>
and rpil.del_flag=0 and rpil.del_flag=0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province = #{areaName} <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city = #{areaName} <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district = #{areaName}
)
</if> </if>
<if test="projectId != null"> <if test="projectId != null">
and p.id=#{projectId} and p.id=#{projectId}
...@@ -190,11 +182,9 @@ ...@@ -190,11 +182,9 @@
<where> <where>
and rpil.del_flag=0 and rpil.del_flag=0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province = #{areaName} <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city = #{areaName} <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district = #{areaName}
)
</if> </if>
</where> </where>
group by p.id,p.name ORDER BY RiskNum desc group by p.id,p.name ORDER BY RiskNum desc
...@@ -209,11 +199,9 @@ ...@@ -209,11 +199,9 @@
<where> <where>
and rpil.del_flag=0 and rpil.del_flag=0
<if test="areaName != null and areaName != ''"> <if test="areaName != null and areaName != ''">
and ( <if test="level != null and level == 1 ">and p.province like concat('%', #{areaName}, '%')</if>
p.province = #{areaName} <if test="level != null and level == 2 ">and p.city like concat('%', #{areaName}, '%')</if>
or p.city = #{areaName} <if test="level != null and level == 3 ">and p.district like concat('%', #{areaName}, '%')</if>
or p.district = #{areaName}
)
</if> </if>
<if test="beginTime != null"> <if test="beginTime != null">
and ( and (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment