Commit 3cf5fb39 authored by 张森's avatar 张森

自动化需求开发 bug

parent 08dce405
...@@ -365,4 +365,26 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -365,4 +365,26 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<Map<String, String>> getIndexKeyByIotCode(@Param("list") Set<String> list); List<Map<String, String>> getIndexKeyByIotCode(@Param("list") Set<String> list);
List<Map<String, String>> getIndexKeyByIotCodeWaterTank(@Param("list") Set<String> list); List<Map<String, String>> getIndexKeyByIotCodeWaterTank(@Param("list") Set<String> list);
long queryForFireEquipmentHistoryCount(@Param("fireEquipmentName") String fireEquipmentName,
@Param("equipmentName") String equipmentName,
@Param("startTime") String startTime,
@Param("endTime") String endTime,
@Param("equipmentCode") String equipmentCode);
//查询 消防设备历史数据
List<Map> queryForFireEquipmentHistory(
@Param("fireEquipmentName") String fireEquipmentName,
@Param("equipmentName") String equipmentName,
@Param("startTime") String startTime,
@Param("endTime") String endTime,
@Param("start") long start,
@Param("length") int length,
@Param("equipmentCode") String equipmentCode
);
List<Map<String, Object>> getPumpInfoList();
List<Map<String, Object>> getFireInfoList();
List<Map<String, Object>> getConInfoList();
} }
...@@ -16,6 +16,7 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex; ...@@ -16,6 +16,7 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipTypeAmountPageDTO;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.vo.*; import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.utils.CommonPageable;
import com.yeejoin.equipmanage.common.vo.*; import com.yeejoin.equipmanage.common.vo.*;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -332,8 +333,15 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> { ...@@ -332,8 +333,15 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
void updateCarStatus(String status, String carId); void updateCarStatus(String status, String carId);
EquipTrendResultVo operatingTrendIot(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey); EquipTrendResultVo operatingTrendIot(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey);
org.springframework.data.domain.Page queryForFireEquipmentHistory(String fireEquipmentName,
String equipmentName,
String startTime,
String endTime,
CommonPageable commonPageable,
String equipmentCode);
EquipTrendResultVo operatingTrendPressurePump(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey) throws ParseException; EquipTrendResultVo operatingTrendPressurePump(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey) throws ParseException;
EquipTrendResultVo operatingTrendWater(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey) throws ParseException; EquipTrendResultVo operatingTrendWater(String startTime, String endTime, String bizOrgCode, String equipCode, String indexKey) throws ParseException;
List<Map<String, Object>> queryOperationMonitoring();
} }
...@@ -2932,6 +2932,217 @@ ...@@ -2932,6 +2932,217 @@
</if> </if>
</select> </select>
<select id="queryForFireEquipmentHistoryCount" resultType="long">
SELECT
COUNT(1)
FROM
(
SELECT
det.`name` as fireEquipmentName,
spe.`code` as fireEquipmentCode,
(
SELECT
group_concat(DISTINCT f.`name`)
FROM
f_equipment_fire_equipment efe
JOIN f_equipment f ON efe.equipment_id = f.id
WHERE
efe.fire_equipment_id = ind.equipment_specific_id
) equipmentName,
ind.update_date
FROM
wl_equipment_specific_index as ind
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
WHERE ind.`value` IS NOT NULL AND ind.`value` != ''
<if test="equipmentCode != null and equipmentCode != ''">
AND det.code LIKE concat(#{equipmentCode}, '%')
</if>
) d
<where>
<if test="fireEquipmentName!=null">
AND d.fireEquipmentName LIKE '%${fireEquipmentName}%'
</if>
<if test="equipmentName!=null">
AND d.equipmentName LIKE '%${equipmentName}%'
</if>
<if test="startTime != null and startTime != ''">
AND d.update_date &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND d.update_date &lt;= #{endTime}
</if>
</where>
</select>
<select id="queryForFireEquipmentHistory" resultType="map">
SELECT
d.*
FROM
(
SELECT
det.`name` as fireEquipmentName,
spe.`code` as fireEquipmentCode,
ein.name as eq_point_name,
CASE ind.value WHEN 'true' THEN '是'
WHEN 'false' THEN '否'
ELSE FORMAT(IFNULL(ind.value, 0), 2) END 'e_value',
ein.unit as eq_point_unit,
CONCAT(IFNULL(str.full_name,''),' ',IFNULL(sto.description,'')) as source_name,
(
SELECT
group_concat(DISTINCT f.`name`)
FROM
f_equipment_fire_equipment efe
JOIN f_equipment f ON efe.equipment_id = f.id
WHERE
efe.fire_equipment_id = ind.equipment_specific_id
) equipmentName,
ind.update_date as create_date,
( SELECT
IFNULL(GROUP_CONCAT( temp.name SEPARATOR ','),'') AS systemName
FROM
( SELECT NAME FROM f_fire_fighting_system fs WHERE FIND_IN_SET( fs.id, spe.system_id ) ) temp
) AS systemName
FROM
wl_equipment_specific_index as ind
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
left join wl_equipment_index as ein on ind.equipment_index_id = ein.id
left join wl_stock_detail as sto on sto.equipment_specific_id = spe.id
left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.source_id
WHERE ind.`value` IS NOT NULL AND ind.`value` != '' AND ein.is_iot = 1
<if test="equipmentCode != null and equipmentCode != ''">
AND det.code LIKE concat(#{equipmentCode}, '%')
</if>
) d
<where>
<if test="fireEquipmentName!=null">
AND d.fireEquipmentName LIKE '%${fireEquipmentName}%'
</if>
<if test="equipmentName!=null">
AND d.equipmentName LIKE '%${equipmentName}%'
</if>
<if test="startTime != null and startTime != ''">
AND d.create_date &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND d.create_date &lt;= #{endTime}
</if>
</where>
ORDER BY d.create_date desc
LIMIT ${start},${length}
</select>
<select id="getPumpInfoList" resultType="java.util.Map">
SELECT COALESCE
( a.id, '' ) AS id,
COALESCE ( a.iot_code, '' ) AS iotCode,
COALESCE ( a.code, '' ) AS code,
COALESCE ( a.name, '' ) AS name,
COALESCE ( a.warehouse_structure_id, '' ) AS buildId,
COALESCE ( b.name, '' ) AS buildName,
esi.equipment_index_key as equipmentIndexKey,
esi.`value` as indexValue
FROM
wl_equipment_specific a
LEFT JOIN wl_warehouse_structure b ON a.warehouse_structure_id = b.id
LEFT JOIN (
SELECT
equipment_specific_id,
equipment_index_key,
`value`,
update_date
FROM
(
SELECT
*,
ROW_NUMBER() OVER ( PARTITION BY equipment_specific_id ORDER BY update_date DESC ) AS rn
FROM
wl_equipment_specific_index
WHERE
( equipment_index_key IN ( 'FHS_PressurePump_Start', 'FHS_PressurePump_Stop' ) AND `value` = 'true' )
OR ( equipment_index_key = 'FHS_PressurePump_ManualAutomaticSignal' AND `value` IS NOT NULL AND `value` != '' )
) esi_with_rn
WHERE
esi_with_rn.rn = 1
) esi ON a.id = esi.equipment_specific_id
WHERE
a.equipment_code LIKE '92010800%'
</select>
<select id="getFireInfoList" resultType="java.util.Map">
SELECT COALESCE
( a.id, '' ) AS id,
COALESCE ( a.iot_code, '' ) AS iotCode,
COALESCE ( a.CODE, '' ) AS code,
COALESCE ( a.NAME, '' ) AS name,
COALESCE ( a.warehouse_structure_id, '' ) AS buildId,
COALESCE ( b.NAME, '' ) AS buildName,
ifnull( esi.equipment_index_key, 'FHS_FirePump_Stop' ) AS equipmentIndexKey,
'true' AS indexValue
FROM
wl_equipment_specific a
LEFT JOIN wl_warehouse_structure b ON a.warehouse_structure_id = b.id
LEFT JOIN (
SELECT
equipment_specific_id,
equipment_index_key,
`value`,
update_date
FROM
(
SELECT
*,
ROW_NUMBER() OVER ( PARTITION BY equipment_specific_id ORDER BY update_date DESC ) AS rn
FROM
wl_equipment_specific_index
WHERE
( equipment_index_key IN ( 'FHS_FirePump_Start', 'FHS_FirePump_Stop' ) AND `value` = 'true' )
) esi_with_rn
WHERE
esi_with_rn.rn = 1
) esi ON a.id = esi.equipment_specific_id
WHERE
a.equipment_code LIKE '920106007%'
</select>
<select id="getConInfoList" resultType="java.util.Map">
SELECT COALESCE
( a.id, '' ) AS id,
COALESCE ( a.iot_code, '' ) AS iotCode,
COALESCE ( a.code, '' ) AS code,
COALESCE ( a.name, '' ) AS name,
COALESCE ( a.warehouse_structure_id, '' ) AS buildId,
COALESCE ( b.name, '' ) AS buildName,
esi.equipment_index_key as equipmentIndexKey,
esi.`value` as indexValue
FROM
wl_equipment_specific a
LEFT JOIN wl_warehouse_structure b ON a.warehouse_structure_id = b.id
LEFT JOIN (
SELECT
equipment_specific_id,
equipment_index_key,
`value`,
update_date
FROM
(
SELECT
*,
ROW_NUMBER() OVER ( PARTITION BY equipment_specific_id ORDER BY update_date DESC ) AS rn
FROM
wl_equipment_specific_index
WHERE
equipment_index_key = 'FHS_PressurePump_ManualAutomaticSignal' AND `value` IS NOT NULL AND `value` != ''
) esi_with_rn
WHERE
esi_with_rn.rn = 1
) esi ON a.id = esi.equipment_specific_id
WHERE
a.equipment_code LIKE '92010500%'
</select>
<select id="getFireEquipStatistic" resultType="Map"> <select id="getFireEquipStatistic" resultType="Map">
SELECT SELECT
a.`name` AS `name`, a.`name` AS `name`,
......
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