Commit c5471235 authored by lizehua's avatar lizehua

修改指标查询列表

parent 868da7b6
...@@ -9,7 +9,7 @@ public interface AlarmMapper extends BaseMapper { ...@@ -9,7 +9,7 @@ public interface AlarmMapper extends BaseMapper {
long countPageData(CommonPageInfoParam param); long countPageData(CommonPageInfoParam param);
long countAlarmData(); long countAlarmData(CommonPageInfoParam param);
List<HashMap<String, Object>> getAlarmMapperPage(CommonPageInfoParam param); List<HashMap<String, Object>> getAlarmMapperPage(CommonPageInfoParam param);
......
...@@ -21,15 +21,9 @@ public class AlarmServiceImpl implements IAlarmService { ...@@ -21,15 +21,9 @@ public class AlarmServiceImpl implements IAlarmService {
@Override @Override
public Page<HashMap<String, Object>> queryAlarmPage(CommonPageInfoParam param) { public Page<HashMap<String, Object>> queryAlarmPage(CommonPageInfoParam param) {
if(StringUtil.isNotEmpty(param.getBeginDate())){ long total = alarmMapper.countAlarmData(param);
param.setBeginDate(param.getBeginDate()+" "+"00:00:00");
}
if(StringUtil.isNotEmpty(param.getEndDate())){
param.setEndDate(param.getEndDate()+" "+"23:59:59");
}
long total = alarmMapper.countAlarmData();
List<HashMap<String, Object>> content = alarmMapper.getAlarmSingleMapperPage(param); List<HashMap<String, Object>> content = alarmMapper.getAlarmSingleMapperPage(param);
Page<HashMap<String, Object>> result = new PageImpl<HashMap<String, Object>>(content, param, total); Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total);
return result; return result;
} }
......
...@@ -27,8 +27,14 @@ ...@@ -27,8 +27,14 @@
<select id="countAlarmData" resultType="long"> <select id="countAlarmData" resultType="long">
SELECT SELECT
count(a.id) AS total_num count(wlesa.id) AS total_num
FROM f_alarm a FROM wl_equipment_specific_alarm wlesa
left join wl_equipment_specific wles on wlesa.equipment_specific_id = wles.id
left join wl_equipment_detail wled on wles.equipment_detail_id = wled.id
where wled.`name` is not null
<if test="protectObj !=null and protectObj != '' "> and wled.`name` like concat(concat("%",#{protectObj}),"%") </if>
<if test="beginDate!=null"> and wlesa.create_date >= #{beginDate} </if>
<if test="endDate!=null"> and wlesa.create_date <![CDATA[<=]]> #{endDate} </if>
</select> </select>
<!--分页查询 --> <!--分页查询 -->
<select id="getAlarmMapperPage" resultType="java.util.HashMap"> <select id="getAlarmMapperPage" resultType="java.util.HashMap">
...@@ -73,24 +79,35 @@ ...@@ -73,24 +79,35 @@
<select id="getAlarmSingleMapperPage" resultType="java.util.HashMap"> <select id="getAlarmSingleMapperPage" resultType="java.util.HashMap">
SELECT SELECT
f.id, wlesa.id,
f.fire_equipment_id as fireEquipmentId, wlesa.equipment_specific_id as fireEquipmentId,
f.fire_equipment_code as fireEquipmentCode, wles.code as fireEquipmentCode,
f.fire_equipment_name as fireEquipmentName, wled.`name` as fireEquipmentName,
f.fire_equipment_point_id as fireEquipmentPointId, wlesa.equipment_index_id as fireEquipmentPointId,
f.fire_equipment_point_code as fireEquipmentPointCode, wlesa.equipment_specific_index_key as fireEquipmentPointCode,
f.fire_equipment_point_name as fireEquipmentPointName, wlesa.equipment_specific_index_name as fireEquipmentPointName,
f.fire_equipment_point_value as fireEquipmentPointValue, CASE
f.frequency as frequency, wlesa.equipment_specific_index_value
f.status as status, WHEN 'true' then '是'
f.type as type, WHEN 'false' then '否'
f.create_date as createDate, ELSE wlesa.equipment_specific_index_value end
f.recovery_date as recoveryDate as fireEquipmentPointValue,
FROM f_alarm f wlesa.frequency as frequency,
WHERE 1=1 wlesa.status as status,
<if test="protectObj !=null and protectObj != '' "> and f.fire_equipment_name like concat(concat("%",#{protectObj}),"%") </if> CASE
<if test="beginDate!=null"> and f.create_date >= #{beginDate} </if> wlesa.type
<if test="endDate!=null"> and f.create_date <![CDATA[<=]]> #{endDate} </if> WHEN 'FIREALARM' THEN '火灾报警'
WHEN 'BREAKDOWN' THEN '故障告警' ELSE wlesa.type
END AS type,
wlesa.create_date as createDate,
wlesa.recovery_date as recoveryDate
FROM wl_equipment_specific_alarm wlesa
left join wl_equipment_specific wles on wlesa.equipment_specific_id = wles.id
left join wl_equipment_detail wled on wles.equipment_detail_id = wled.id
WHERE wled.`name` is not null
<if test="protectObj !=null and protectObj != '' "> and wled.`name` like concat(concat("%",#{protectObj}),"%") </if>
<if test="beginDate!=null"> and wlesa.create_date >= #{beginDate} </if>
<if test="endDate!=null"> and wlesa.create_date <![CDATA[<=]]> #{endDate} </if>
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
......
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