Commit 944d8c92 authored by yf's avatar yf

大屏相关接口修改

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