Commit 2c25df06 authored by maoying's avatar maoying

修改预案相关接口

parent aa2d214c
......@@ -31,7 +31,7 @@ public class BuildingVideoVO {
private String token;
@ApiModelProperty("位置")
private String location = "1楼202房间";
private String location = "";
@ApiModelProperty("设备id")
private Long specificId;
......
......@@ -33,8 +33,8 @@ public class EquipmentInfoOnPlanController {
@ApiOperation(httpMethod = "GET", value = "消防炮信息", notes = "消防炮信息")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value ="/monitor", method = RequestMethod.GET)
public ResponseModel getFireMonitorInfo(@RequestParam(required=false) Long fireEquipmentId) {
List<Map<String, Object>> list = equipmentInfoOnPlanService.getFireMonitorInfo(fireEquipmentId);
public ResponseModel getFireMonitorInfo(@RequestParam(required=false) Long equipmentId) {
List<Map<String, Object>> list = equipmentInfoOnPlanService.getFireMonitorInfo(equipmentId);
return ResponseHelper.buildResponse(list);
}
......
......@@ -103,5 +103,7 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
List<EquipmentIndexVO> getEquipIndexBySpecificIdIn(@Param("list") List<String> specificDetails);
List<EquipmentIndexVO> getEquipIndexByIdIn(@Param("list") List<Long> specificIndexIds);
List<Map<String, Object>> getEquipSpecificIndexByUpdateDateDesc();
}
......@@ -203,7 +203,7 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<EquiplistSpecificBySystemVO> getListByWarehouseStructureId(Long floorId);
List<Map<String, Object>> getFireMonitorInfo(@Param("fireEquipmentId") Long fireEquipmentId, @Param("list") String[] strings);
List<Map<String, Object>> getFireMonitorInfo(@Param("equipmentId") Long fireEquipmentId, @Param("list") String[] strings);
List<Map<String, Object>> getFirePumpInfo(@Param("list") String[] strings);
......
......@@ -4,6 +4,7 @@ import com.google.common.collect.Maps;
import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.mapper.CarMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmLogMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificIndexMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.service.IEquipmentInfoOnPlanService;
import org.apache.commons.compress.utils.Lists;
......@@ -31,6 +32,9 @@ public class EquipmentInfoOnPlanServiceImpl implements IEquipmentInfoOnPlanServi
@Autowired
private EquipmentSpecificAlarmLogMapper equipmentSpecificAlarmLogMapper;
@Autowired
EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
@Autowired
private CarMapper carMapper;
......@@ -42,9 +46,9 @@ public class EquipmentInfoOnPlanServiceImpl implements IEquipmentInfoOnPlanServi
String pumpCodes;
@Override
public List<Map<String, Object>> getFireMonitorInfo(Long fireEquipmentId) {
public List<Map<String, Object>> getFireMonitorInfo(Long equipmentId) {
String[] strings = monitorCodes.split(",");
List<Map<String, Object>> list = equipmentSpecificMapper.getFireMonitorInfo(fireEquipmentId, strings);
List<Map<String, Object>> list = equipmentSpecificMapper.getFireMonitorInfo(equipmentId, strings);
return Optional.ofNullable(list).orElse(Lists.newArrayList());
}
......@@ -57,19 +61,7 @@ public class EquipmentInfoOnPlanServiceImpl implements IEquipmentInfoOnPlanServi
@Override
public List<Map<String, Object>> getOtherEquipInfo() {
Map<String, Object> map = equipmentSpecificAlarmLogMapper.getPlanRecord();
Date startTime = null;
Long equipmentId = null;
if (!ValidationUtil.isEmpty(map)) {
try {
startTime = DateUtils.dateParse(String.valueOf(map.get("startTime")), DateUtils.DATE_TIME_T_PATTERN);
equipmentId = Long.valueOf(String.valueOf(map.get("equipmentId")));
} catch (Exception e) {
e.printStackTrace();
}
}
String dateParam = startTime == null ? null : new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(startTime);
List<Map<String, Object>> list = equipmentSpecificAlarmLogMapper.getOtherEquipInfo(dateParam, equipmentId);
List<Map<String, Object>> list = equipmentSpecificIndexMapper.getEquipSpecificIndexByUpdateDateDesc();
return Optional.ofNullable(list).orElse(Lists.newArrayList());
}
......
......@@ -409,5 +409,27 @@ WHERE wles.id=#{id}
</if>
</where>
</select>
<select id="getEquipSpecificIndexByUpdateDateDesc" resultType="java.util.HashMap">
SELECT
esi.id,
es.`name` AS equipmentSpecificName,
esi.equipment_index_name AS equipmentSpecificIndexName,
IF (
esi.value_label = ''
OR esi.value_label IS NULL,
esi.`value`,
esi.value_label
) AS valueLabel,
es.position AS location,
esi.update_date AS createDate
FROM
`wl_equipment_specific_index` esi
LEFT JOIN wl_equipment_specific es ON es.id = esi.equipment_specific_id
WHERE
esi.`value` IS NOT NULL
ORDER BY
esi.update_date DESC
LIMIT 50
</select>
</mapper>
\ No newline at end of file
......@@ -1521,8 +1521,8 @@
wes.equipment_code LIKE <![CDATA[CONCAT(#{item},'%')]]>
</foreach>
</if>
<if test="fireEquipmentId != null and fireEquipmentId != ''">
AND wes.id = #{fireEquipmentId}
<if test="equipmentId != null and equipmentId != ''">
AND fire.equipment_id = #{equipmentId}
</if>
</where>
ORDER BY realtiemIotIndexUpdateDate DESC
......
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