Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
9a2793c5ec
|
|
@ -76,6 +76,9 @@ public class ParamSecureHandler implements AsyncHandlerInterceptor {
|
|||
"/largeScreen/deviceEnergyAnalysis/selectEnergyStatsByDateRange",
|
||||
"/largeScreen/deviceEnergyAnalysis/selectDeviceEnergyByDateRange",
|
||||
"/largeScreen/deviceEnergyAnalysis/selectAnomalyByDateRange",
|
||||
"/largeScreen/deviceEnergyAnalysis/selectLatestAll",
|
||||
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.securitycontrol.screen.controller;
|
|||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.screen.domain.DeviceEnergyAnalysis;
|
||||
import com.securitycontrol.screen.domain.EnergySavingMeasure;
|
||||
import com.securitycontrol.screen.service.DeviceEnergyAnalysisService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -63,4 +64,31 @@ public class DeviceEnergyAnalysisController {
|
|||
public AjaxResult selectAnomalyByDateRange(@RequestBody DeviceEnergyAnalysis entity) {
|
||||
return service.selectAnomalyByDateRange(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询最新统计日期下的所有节能减排措施数据。
|
||||
* <p>
|
||||
* 功能说明:
|
||||
* 本接口接收客户端传入的查询条件(封装在 EnergySavingMeasure 实体中),
|
||||
* 并调用 service 层方法,从数据库中获取“最新统计日期”对应的节能减排措施记录列表。
|
||||
* 通常用于前端页面展示最近一期的节能数据概览。
|
||||
* <p>
|
||||
* 请求方式:
|
||||
* POST /selectLatestAll
|
||||
* <p>
|
||||
* 请求参数:
|
||||
*
|
||||
* @return AjaxResult 封装的查询结果:
|
||||
* @RequestBody EnergySavingMeasure entity
|
||||
* - 可选字段示例:
|
||||
* - measureName: 节能措施名称(用于精确筛选)
|
||||
* - siteId / projectId: 工地或项目编号(如表中定义)
|
||||
* <p>
|
||||
* 响应结果:
|
||||
*/
|
||||
@PostMapping("selectLatestAll")
|
||||
public AjaxResult selectLatestAll(@RequestBody EnergySavingMeasure entity) {
|
||||
return service.selectLatestAll(entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ public class ProjectProgressNewController extends BaseController {
|
|||
ProjectProgressNew projectProgress4 = new ProjectProgressNew();
|
||||
ProjectProgressNew projectProgress5 = new ProjectProgressNew();
|
||||
ProjectProgressNew projectProgress6 = new ProjectProgressNew();
|
||||
ProjectProgressNew projectProgress7 = new ProjectProgressNew();
|
||||
projectProgress1.setMonth("一月");
|
||||
projectProgress1.setMonthValue("60");
|
||||
projectProgress1.setMonthValue2("80");
|
||||
|
|
@ -74,12 +75,16 @@ public class ProjectProgressNewController extends BaseController {
|
|||
projectProgress6.setMonth("六月");
|
||||
projectProgress6.setMonthValue("75");
|
||||
projectProgress6.setMonthValue2("88");
|
||||
projectProgress7.setMonth("七月");
|
||||
projectProgress7.setMonthValue("85");
|
||||
projectProgress7.setMonthValue2("98");
|
||||
list.add(projectProgress1);
|
||||
list.add(projectProgress2);
|
||||
list.add(projectProgress3);
|
||||
list.add(projectProgress4);
|
||||
list.add(projectProgress5);
|
||||
list.add(projectProgress6);
|
||||
list.add(projectProgress7);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
package com.securitycontrol.screen.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* EnergySavingMeasure 类表示某个统计周期下的节能减排措施信息。
|
||||
* 用于记录措施名称、覆盖率、统计日期等信息,并追踪创建与更新时间。
|
||||
* 可用于节能数据展示、趋势分析、覆盖率评估等场景。
|
||||
*/
|
||||
@Data
|
||||
public class EnergySavingMeasure {
|
||||
|
||||
/**
|
||||
* 主键ID,自增唯一标识符。
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 节能减排措施名称,例如 "照明节能"、"空调温控"、"智能设备管控" 等。
|
||||
* 用于识别该措施的类型。
|
||||
*/
|
||||
private String measureName;
|
||||
|
||||
/**
|
||||
* 覆盖率(coverage rate),表示该措施在工地范围内的实施比例。
|
||||
* 取值范围为 0~1,通常以百分比展示(例如 0.85 表示 85%)。
|
||||
*/
|
||||
private BigDecimal coverageRate;
|
||||
|
||||
/**
|
||||
* 统计日期,表示该数据记录对应的时间周期(如某天、某周、某月)。
|
||||
* 一般按日为单位进行统计。
|
||||
*/
|
||||
private LocalDate statDate;
|
||||
|
||||
/**
|
||||
* 创建时间,表示该数据记录的创建时间戳。
|
||||
* 由系统自动生成,用于数据追踪。
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
/**
|
||||
* 更新时间,表示该数据记录的最近一次更新时间戳。
|
||||
* 由系统自动维护,用于记录数据变动历史。
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
/**
|
||||
* 查询条件:开始时间(非数据库字段)
|
||||
* 用于按时间段筛选数据
|
||||
*/
|
||||
private String startDate;
|
||||
|
||||
/**
|
||||
* 查询条件:结束时间(非数据库字段)
|
||||
* 用于按时间段筛选数据
|
||||
*/
|
||||
private String endDate;
|
||||
/**
|
||||
* 工程ID(项目标识)
|
||||
* 用于区分所属工程,可作为查询过滤条件
|
||||
*/
|
||||
private String proId;
|
||||
}
|
||||
|
|
@ -76,4 +76,16 @@ public class EngineeringSafetyAnalysis extends BaseEntity {
|
|||
@ApiModelProperty(value = "数量")
|
||||
private String count;
|
||||
|
||||
/** 工程名称 */
|
||||
@ApiModelProperty(value = "工程名称")
|
||||
private String proName;
|
||||
|
||||
/** 作业地点 */
|
||||
@ApiModelProperty(value = "作业地点")
|
||||
private String workLocation;
|
||||
|
||||
/** 分析原因 */
|
||||
@ApiModelProperty(value = "分析原因")
|
||||
private String analysisReason;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,6 +82,10 @@ public class ProjectProgressNew extends BaseEntity {
|
|||
/** 关键路径任务标识(是 / 否) */
|
||||
private String keyPathFlag;
|
||||
|
||||
private String delayStatus;
|
||||
|
||||
private String delayPolicy;
|
||||
|
||||
private String month;
|
||||
|
||||
private String monthValue;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.securitycontrol.screen.mapper;
|
||||
|
||||
import com.securitycontrol.screen.domain.DeviceEnergyAnalysis;
|
||||
import com.securitycontrol.screen.domain.EnergySavingMeasure;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
|
@ -74,4 +75,31 @@ public interface DeviceEnergyAnalysisMapper {
|
|||
* @return List<DeviceEnergyAnalysis> 查询到的异常能耗记录列表
|
||||
*/
|
||||
List<DeviceEnergyAnalysis> selectAnomalyByDateRange(DeviceEnergyAnalysis entity);
|
||||
|
||||
/**
|
||||
* 查询最新统计日期下的所有节能减排措施记录。
|
||||
* <p>
|
||||
* 功能说明:
|
||||
* 该方法根据传入的查询条件(如项目编号、设备类型等),从 energy_saving_measures 表中查询
|
||||
* 最新统计日期(stat_date 最大值)对应的全部数据记录,用于展示当前工地节能措施覆盖情况。
|
||||
* <p>
|
||||
* 查询逻辑:
|
||||
* 1. 确定当前表中最大的 stat_date(即最新的数据日期);
|
||||
* 2. 在该日期下筛选所有匹配查询条件的记录;
|
||||
* 3. 返回按条件过滤的所有记录列表。
|
||||
* <p>
|
||||
* 示例用途:
|
||||
* - 首页或概览页展示最近的节能覆盖数据;
|
||||
* - 周期性报表数据展示;
|
||||
* <p>
|
||||
* 参数:
|
||||
*
|
||||
* @param entity 查询条件封装实体,可包含以下字段(可选):
|
||||
* - measureName: 按措施名称过滤;
|
||||
* - projectId / siteId(如果扩展了这些字段):按项目或施工地过滤;
|
||||
* <p>
|
||||
* 返回值:
|
||||
* @return List<EnergySavingMeasure> 最新日期下的所有匹配节能措施记录列表。
|
||||
*/
|
||||
List<EnergySavingMeasure> selectLatestAll(EnergySavingMeasure entity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.securitycontrol.screen.service;
|
|||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.screen.domain.DeviceEnergyAnalysis;
|
||||
import com.securitycontrol.screen.domain.EnergySavingMeasure;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -44,4 +45,31 @@ public interface DeviceEnergyAnalysisService {
|
|||
* @return AjaxResult 封装的查询结果:
|
||||
*/
|
||||
AjaxResult selectAnomalyByDateRange(DeviceEnergyAnalysis entity);
|
||||
|
||||
/**
|
||||
* 查询最新统计日期下的所有节能减排措施记录。
|
||||
* <p>
|
||||
* 功能说明:
|
||||
* 该方法根据传入的查询条件(如项目编号、设备类型等),从 energy_saving_measures 表中查询
|
||||
* 最新统计日期(stat_date 最大值)对应的全部数据记录,用于展示当前工地节能措施覆盖情况。
|
||||
* <p>
|
||||
* 查询逻辑:
|
||||
* 1. 确定当前表中最大的 stat_date(即最新的数据日期);
|
||||
* 2. 在该日期下筛选所有匹配查询条件的记录;
|
||||
* 3. 返回按条件过滤的所有记录列表。
|
||||
* <p>
|
||||
* 示例用途:
|
||||
* - 首页或概览页展示最近的节能覆盖数据;
|
||||
* - 周期性报表数据展示;
|
||||
* <p>
|
||||
* 参数:
|
||||
*
|
||||
* @param entity 查询条件封装实体,可包含以下字段(可选):
|
||||
* - measureName: 按措施名称过滤;
|
||||
* - projectId / siteId(如果扩展了这些字段):按项目或施工地过滤;
|
||||
* <p>
|
||||
* 返回值:
|
||||
* @return AjaxResult 封装的查询结果:
|
||||
*/
|
||||
AjaxResult selectLatestAll(EnergySavingMeasure entity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.securitycontrol.screen.service.impl;
|
|||
|
||||
import com.securitycontrol.common.core.web.domain.AjaxResult;
|
||||
import com.securitycontrol.screen.domain.DeviceEnergyAnalysis;
|
||||
import com.securitycontrol.screen.domain.EnergySavingMeasure;
|
||||
import com.securitycontrol.screen.mapper.DeviceEnergyAnalysisMapper;
|
||||
import com.securitycontrol.screen.service.DeviceEnergyAnalysisService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -80,4 +81,40 @@ public class DeviceEnergyAnalysisServiceImpl implements DeviceEnergyAnalysisServ
|
|||
return AjaxResult.error("查询能耗异常分析失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询最新统计日期下的所有节能减排措施记录。
|
||||
* <p>
|
||||
* 功能说明:
|
||||
* 该方法根据传入的查询条件(如项目编号、设备类型等),从 energy_saving_measures 表中查询
|
||||
* 最新统计日期(stat_date 最大值)对应的全部数据记录,用于展示当前工地节能措施覆盖情况。
|
||||
* <p>
|
||||
* 查询逻辑:
|
||||
* 1. 确定当前表中最大的 stat_date(即最新的数据日期);
|
||||
* 2. 在该日期下筛选所有匹配查询条件的记录;
|
||||
* 3. 返回按条件过滤的所有记录列表。
|
||||
* <p>
|
||||
* 示例用途:
|
||||
* - 首页或概览页展示最近的节能覆盖数据;
|
||||
* - 周期性报表数据展示;
|
||||
* <p>
|
||||
* 参数:
|
||||
*
|
||||
* @param entity 查询条件封装实体,可包含以下字段(可选):
|
||||
* - measureName: 按措施名称过滤;
|
||||
* - projectId / siteId(如果扩展了这些字段):按项目或施工地过滤;
|
||||
* <p>
|
||||
* 返回值:
|
||||
* @return AjaxResult 封装的查询结果:
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult selectLatestAll(EnergySavingMeasure entity) {
|
||||
try {
|
||||
List<EnergySavingMeasure> maps = mapper.selectLatestAll(entity);
|
||||
return AjaxResult.success(maps);
|
||||
} catch (Exception e) {
|
||||
log.error("查询失败: {}", e.getMessage(), e);
|
||||
return AjaxResult.error("查询失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,26 @@
|
|||
stat_date ASC;
|
||||
</select>
|
||||
|
||||
<select id="selectLatestAll" resultType="com.securitycontrol.screen.domain.EnergySavingMeasure">
|
||||
SELECT esm.id AS id,
|
||||
esm.measure_name AS measureName,
|
||||
esm.coverage_rate AS coverageRate,
|
||||
esm.stat_date AS statDate
|
||||
FROM energy_saving_measures esm
|
||||
INNER JOIN (SELECT measure_name,
|
||||
MAX(stat_date) AS max_date,
|
||||
pro_id
|
||||
FROM energy_saving_measures
|
||||
WHERE pro_id = #{proId}
|
||||
AND stat_date BETWEEN #{startDate} AND #{endDate}
|
||||
GROUP BY measure_name, pro_id) t ON esm.measure_name = t.measure_name
|
||||
AND esm.stat_date = t.max_date
|
||||
AND esm.pro_id = t.pro_id
|
||||
WHERE esm.pro_id = #{proId}
|
||||
AND esm.stat_date BETWEEN #{startDate} AND #{endDate};
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="level" column="level" />
|
||||
<result property="timestamp" column="timestamp" />
|
||||
<result property="name" column="name" />
|
||||
<result property="proName" column="pro_name" />
|
||||
<result property="workLocation" column="work_location" />
|
||||
<result property="analysisReason" column="analysis_reason" />
|
||||
</resultMap>
|
||||
|
||||
<!--查询安全隐患集合列表-->
|
||||
|
|
@ -34,9 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
COALESCE(ale.avg_temperature, '-') AS temperature,
|
||||
COALESCE(ale.avg_humidity, '-') AS humidity,
|
||||
COALESCE(ale.avg_wind_speed, '-') AS wind_speed,
|
||||
COALESCE(ale.avg_gas_value, '-') AS gas_value
|
||||
COALESCE(ale.avg_gas_value, '-') AS gas_value,
|
||||
pro.pro_name ,
|
||||
h.work_location,
|
||||
h.analysis_reason
|
||||
FROM
|
||||
hazards h
|
||||
LEFT JOIN tb_project_new pro on h.bid_code = pro.bid_code
|
||||
LEFT JOIN
|
||||
monitoring_points mp ON h.bid_code = mp.bid_code
|
||||
LEFT JOIN
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="delayActor" column="delay_actor" />
|
||||
<result property="resourceMatchStatus" column="resource_match_status" />
|
||||
<result property="keyPathFlag" column="key_path_flag" />
|
||||
<result property="delayStatus" column="delay_status" />
|
||||
<result property="delayPolicy" column="delay_policy" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
|
|
@ -26,7 +28,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectProjectProgressNewVo">
|
||||
select id, project_id, project_name, task_code, task_name, plan_start_time, plan_end_time, actual_start_time, actual_end_time, process_diff, total_effort, complete_effort, delay_actor, resource_match_status, key_path_flag, create_by, create_time, update_by, update_time from tb_project_progress_new
|
||||
select id, project_id, project_name, task_code, task_name, plan_start_time,
|
||||
plan_end_time, actual_start_time, actual_end_time, process_diff, total_effort,
|
||||
complete_effort, delay_actor, resource_match_status, key_path_flag,
|
||||
create_by, create_time, update_by, update_time, delay_status, delay_policy
|
||||
from tb_project_progress_new
|
||||
</sql>
|
||||
|
||||
<select id="selectProjectProgressNewList" parameterType="com.securitycontrol.screen.domain.ProjectProgressNew" resultMap="ProjectProgressNewResult">
|
||||
|
|
@ -44,6 +50,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="totalEffort != null and totalEffort != ''"> and total_effort = #{totalEffort}</if>
|
||||
<if test="completeEffort != null and completeEffort != ''"> and complete_effort = #{completeEffort}</if>
|
||||
<if test="delayActor != null and delayActor != ''"> and delay_actor = #{delayActor}</if>
|
||||
<if test="delayStatus != null and delayStatus != ''"> and delay_status = #{delayStatus}</if>
|
||||
<if test="delayPolicy != null and delayPolicy != ''"> and delay_policy = #{delayPolicy}</if>
|
||||
<if test="resourceMatchStatus != null and resourceMatchStatus != ''"> and resource_match_status = #{resourceMatchStatus}</if>
|
||||
<if test="keyPathFlag != null and keyPathFlag != ''"> and key_path_flag = #{keyPathFlag}</if>
|
||||
</where>
|
||||
|
|
|
|||
Loading…
Reference in New Issue