Commit c5471235 authored by lizehua's avatar lizehua

修改指标查询列表

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