Commit f7186567 authored by KeYong's avatar KeYong

拓补图功能

parent 7d756585
...@@ -135,4 +135,12 @@ public class EquipmentSpecific extends BaseEntity { ...@@ -135,4 +135,12 @@ public class EquipmentSpecific extends BaseEntity {
* 存放位置冗余字段 * 存放位置冗余字段
*/ */
private Long warehouseStructureId; private Long warehouseStructureId;
@ApiModelProperty(value = "告警状态")
@TableField(exist = false)
private Integer status;
@ApiModelProperty(value = "系统名称")
@TableField(exist = false)
private String systemName;
} }
...@@ -125,6 +125,10 @@ public class EquipmentSpecificAlarmLog extends BaseEntity { ...@@ -125,6 +125,10 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
@TableField("equipment_index_id") @TableField("equipment_index_id")
private Long equipmentIndexId; private Long equipmentIndexId;
@ApiModelProperty(value = "报警状态1报警0恢复")
@TableField("status")
private Integer status;
@ApiModelProperty(value = "画布id") @ApiModelProperty(value = "画布id")
@TableField(exist = false) @TableField(exist = false)
private Long sceneId; private Long sceneId;
......
...@@ -109,6 +109,16 @@ public class CommonPageInfoParam extends CommonPageable { ...@@ -109,6 +109,16 @@ public class CommonPageInfoParam extends CommonPageable {
*/ */
private List<String> buildIds; private List<String> buildIds;
private String status;
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public void setWarehouseStructureName(String warehouseStructureName) { public void setWarehouseStructureName(String warehouseStructureName) {
this.warehouseStructureName = warehouseStructureName; this.warehouseStructureName = warehouseStructureName;
} }
......
...@@ -55,6 +55,8 @@ public class CommonPageParamUtil { ...@@ -55,6 +55,8 @@ public class CommonPageParamUtil {
param.setBuildId(toString(queryRequests.get(i).getValue())); param.setBuildId(toString(queryRequests.get(i).getValue()));
} else if("buildIds".equals(name)){ } else if("buildIds".equals(name)){
param.setBuildIds((List<String>)queryRequests.get(i).getValue()); param.setBuildIds((List<String>)queryRequests.get(i).getValue());
} else if("status".equals(name)){
param.setStatus(toString(queryRequests.get(i).getValue()));
} }
} }
if(commonPageable !=null){ if(commonPageable !=null){
......
package com.yeejoin.equipmanage.common.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @author keyong
* @title: TopographyAlarmVo
* <pre>
* @description: TODO
* </pre>
* @date 2021/12/29 18:57
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TopographyAlarmVo {
private Date createDate;
private String fireEquipmentSpecificIndexName;
private String fireEquipmentName;
private String warehouseStructureName;
private String equipmentName;
private String handleStatus;
private String handleType;
private String alarmType;
private String alarmContent;
private String status;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.Data;
/**
* @author keyong
* @title: IotDataVO
* <pre>
* @description: 物联系统发送的增量数据封装VO
* </pre>
* @date 2021/1/7 17:44
*/
@Data
public class TopographyIotDataVO {
private String name;
private Object value;
private String unit;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author keyong
* @title: TopographyAlarmVo
* <pre>
* @description: TODO
* </pre>
* @date 2021/12/29 18:57
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TopographyIotVo {
private Date time;
private List<TopographyIotDataVO> list;
}
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.entity.EquProperty; import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.EquipmentDetail; import com.yeejoin.equipmanage.common.entity.dto.TopographyNodeDetailDTO;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.StockDetail;
import com.yeejoin.equipmanage.common.entity.WarehouseStructure;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailDownloadVO; import com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailDownloadVO;
import com.yeejoin.equipmanage.common.enums.ExcelEnums; import com.yeejoin.equipmanage.common.enums.ExcelEnums;
import com.yeejoin.equipmanage.common.utils.ExcelUtils; import com.yeejoin.equipmanage.common.utils.ExcelUtils;
...@@ -51,18 +17,30 @@ import com.yeejoin.equipmanage.fegin.JcsFeign; ...@@ -51,18 +17,30 @@ import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.mapper.EquipmentDetailMapper; import com.yeejoin.equipmanage.mapper.EquipmentDetailMapper;
import com.yeejoin.equipmanage.mapper.ManufacturerInfoMapper; import com.yeejoin.equipmanage.mapper.ManufacturerInfoMapper;
import com.yeejoin.equipmanage.mapper.StockDetailMapper; import com.yeejoin.equipmanage.mapper.StockDetailMapper;
import com.yeejoin.equipmanage.service.IEquipmentDetailService; import com.yeejoin.equipmanage.service.*;
import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce; import com.yeejoin.equipmanage.service.impl.TopographyNodeDetailService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import com.yeejoin.equipmanage.service.IExcelService;
import com.yeejoin.equipmanage.service.IStockService;
import com.yeejoin.equipmanage.service.ISyncDataService;
import com.yeejoin.equipmanage.service.IWarehouseStructureService;
import com.yeejoin.equipmanage.utils.ExcelUtil; import com.yeejoin.equipmanage.utils.ExcelUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.*;
/** /**
* @author wujiang * @author wujiang
...@@ -219,11 +197,11 @@ public class EquipmentDetailController extends AbstractBaseController { ...@@ -219,11 +197,11 @@ public class EquipmentDetailController extends AbstractBaseController {
} }
/*** /***
* *
* 修改 * 修改
* **/ * **/
@RequestMapping(value = "equipment/updateById", method = RequestMethod.PUT) @RequestMapping(value = "equipment/updateById", method = RequestMethod.PUT)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT", value = "修改", notes = "修改") @ApiOperation(httpMethod = "PUT", value = "修改", notes = "修改")
......
...@@ -185,4 +185,5 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif ...@@ -185,4 +185,5 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
* @return * @return
*/ */
List<EquipmentSpecificAlarm> getEquipListBySpecific(@Param("status") Boolean status, @Param("equipmentSpecificId") Long equipmentSpecificId); List<EquipmentSpecificAlarm> getEquipListBySpecific(@Param("status") Boolean status, @Param("equipmentSpecificId") Long equipmentSpecificId);
} }
...@@ -46,6 +46,8 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif ...@@ -46,6 +46,8 @@ public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecif
*/ */
List<EquipmentSpecificIndex> getEquipmentSpeIndexByIotCode(String iotCode); List<EquipmentSpecificIndex> getEquipmentSpeIndexByIotCode(String iotCode);
List<EquipmentSpecificIndex> getEquipmentSpeIndexDataByIotCode(String iotCode);
/** /**
* 通过设备id查询 * 通过设备id查询
* *
......
...@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.utils.CommonPageInfoParam; ...@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.utils.CommonPageInfoParam;
import com.yeejoin.equipmanage.common.vo.AlarmDataVO; import com.yeejoin.equipmanage.common.vo.AlarmDataVO;
import com.yeejoin.equipmanage.common.vo.AlarmEquipMockDataVO; import com.yeejoin.equipmanage.common.vo.AlarmEquipMockDataVO;
import com.yeejoin.equipmanage.common.vo.AlarmListDataVO; import com.yeejoin.equipmanage.common.vo.AlarmListDataVO;
import com.yeejoin.equipmanage.common.vo.TopographyAlarmVo;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.HashMap; import java.util.HashMap;
...@@ -42,6 +43,9 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif ...@@ -42,6 +43,9 @@ public interface IEquipmentSpecificAlarmService extends IService<EquipmentSpecif
org.springframework.data.domain.Page<AlarmListDataVO> listAlarmsPage(CommonPageInfoParam param); org.springframework.data.domain.Page<AlarmListDataVO> listAlarmsPage(CommonPageInfoParam param);
org.springframework.data.domain.Page<TopographyAlarmVo> listAlarmsPageForTopography(CommonPageInfoParam param);
Map<String, Object> getSpecificInfoById(Long id); Map<String, Object> getSpecificInfoById(Long id);
Map<String, Object> getSpecificInfoByCode(String code); Map<String, Object> getSpecificInfoByCode(String code);
......
...@@ -12,9 +12,11 @@ import java.util.Enumeration; ...@@ -12,9 +12,11 @@ import java.util.Enumeration;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.yeejoin.equipmanage.common.vo.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
...@@ -43,10 +45,6 @@ import com.yeejoin.equipmanage.common.enums.EquipmentDataEnum; ...@@ -43,10 +45,6 @@ import com.yeejoin.equipmanage.common.enums.EquipmentDataEnum;
import com.yeejoin.equipmanage.common.utils.CommonPageInfoParam; import com.yeejoin.equipmanage.common.utils.CommonPageInfoParam;
import com.yeejoin.equipmanage.common.utils.DateUtils; import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.utils.StringUtil; import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.vo.AlarmDataVO;
import com.yeejoin.equipmanage.common.vo.AlarmEquipMockDataVO;
import com.yeejoin.equipmanage.common.vo.AlarmListDataVO;
import com.yeejoin.equipmanage.common.vo.EquipmentAlarmDownloadVO;
import com.yeejoin.equipmanage.mapper.ConfirmAlarmMapper; import com.yeejoin.equipmanage.mapper.ConfirmAlarmMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmLogMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmLogMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper;
...@@ -223,6 +221,39 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -223,6 +221,39 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
} }
@Override @Override
public org.springframework.data.domain.Page<TopographyAlarmVo> listAlarmsPageForTopography(CommonPageInfoParam param) {
Page page = new Page(param.getPageNumber(), param.getPageSize());
Page<Map<String, Object>> mybatisResult = this.baseMapper.pageAlarmsInfo(page, param);
List<TopographyAlarmVo> res = new ArrayList<>();
if (mybatisResult.getSize() > 0) {
mybatisResult.getRecords().forEach(x -> {
TopographyAlarmVo dataVO = new TopographyAlarmVo();
try {
dataVO.setCreateDate(DateUtils.dateParse(String.valueOf(x.get("createDate")),DateUtils.DATE_TIME_T_PATTERN));
} catch (ParseException e) {
e.printStackTrace();
}
dataVO.setFireEquipmentSpecificIndexName(String.valueOf(x.get("fireEquipmentSpecificIndexName")));
dataVO.setFireEquipmentName(String.valueOf(x.get("fireEquipmentName")));
dataVO.setWarehouseStructureName(String.valueOf(x.get("warehouseStructureName")));
dataVO.setEquipmentName(null == x.get("equipmentName") ? null : String.valueOf(x.get("equipmentName")));
dataVO.setHandleStatus(String.valueOf(x.get("handleStatus")));
dataVO.setStatus(String.valueOf(x.get("status")));
Object type = x.get("type");
if (AlarmTypeEnum.HZGJ.getCode().equals(type) || AlarmTypeEnum.GZGJ.getCode().equals(type)
|| AlarmTypeEnum.PB.getCode().equals(type)) {
dataVO.setAlarmType(AlarmTypeEnum.getTypeByCode(String.valueOf(type)));
}
dataVO.setAlarmContent(x.get("fireEquipmentName") + dataVO.getAlarmType());
dataVO.setHandleType(null == x.get("handleType") ? null : String.valueOf(x.get("handleType")));
res.add(dataVO);
});
}
param.setPageNumber(param.getPageNumber() - 1);
return new PageImpl<>(res, param, mybatisResult.getTotal());
}
@Override
public Map<String, Object> getSpecificInfoById(Long id) { public Map<String, Object> getSpecificInfoById(Long id) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
EquipmentSpecificAlarmLog alarm = equipmentSpecificAlarmLogMapper.selectById(id); EquipmentSpecificAlarmLog alarm = equipmentSpecificAlarmLogMapper.selectById(id);
......
...@@ -875,6 +875,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -875,6 +875,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipmentSpecificAlarmLog.setAlarmReason(equipmentSpecificAlarm.getAlamReason()); equipmentSpecificAlarmLog.setAlarmReason(equipmentSpecificAlarm.getAlamReason());
equipmentSpecificAlarmLog.setEquipmentSpecificCode(equipmentSpecificAlarm.getCode()); equipmentSpecificAlarmLog.setEquipmentSpecificCode(equipmentSpecificAlarm.getCode());
equipmentSpecificAlarmLog.setBuildId(equipmentSpecificAlarm.getBuildId()); equipmentSpecificAlarmLog.setBuildId(equipmentSpecificAlarm.getBuildId());
equipmentSpecificAlarmLog.setStatus(equipmentSpecificAlarm.getStatus());
equipmentSpecificAlarmLogService.save(equipmentSpecificAlarmLog); equipmentSpecificAlarmLogService.save(equipmentSpecificAlarmLog);
// 同步告警消息给平台 // 同步告警消息给平台
if (amosSwitch) { if (amosSwitch) {
......
...@@ -2037,4 +2037,16 @@ ...@@ -2037,4 +2037,16 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="keyong" id="1640205688-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment_specific_alarm_log" columnName="status"/>
</not>
</preConditions>
<comment>wl_equipment_specific_alarm_log add column status</comment>
<sql>
alter table `wl_equipment_specific_alarm_log` add column `status` bit(1) COLLATE utf8mb4_general_ci NOT NULL DEFAULT b'1' COMMENT '报警状态:1报警0恢复';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -111,6 +111,7 @@ ...@@ -111,6 +111,7 @@
<select id="getEquipListBySpecific" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm"> <select id="getEquipListBySpecific" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm">
<![CDATA[ <![CDATA[
SELECT SELECT
* *
FROM FROM
...@@ -120,6 +121,7 @@ ...@@ -120,6 +121,7 @@
AND equipment_specific_id = #{equipmentSpecificId} AND equipment_specific_id = #{equipmentSpecificId}
ORDER BY ORDER BY
create_date DESC create_date DESC
]]> ]]>
</select> </select>
...@@ -207,7 +209,8 @@ ...@@ -207,7 +209,8 @@
LEFT JOIN wl_equipment we ON wled.equipment_id = we.id LEFT JOIN wl_equipment we ON wled.equipment_id = we.id
) d ) d
<where> <where>
<if test="param.warehouseStructureName != null and param.warehouseStructureName != ''">and d.warehouseStructureName like <if test="param.warehouseStructureName != null and param.warehouseStructureName != ''">and
d.warehouseStructureName like
concat(concat("%",#{param.warehouseStructureName}),"%") concat(concat("%",#{param.warehouseStructureName}),"%")
</if> </if>
<if test="param.equipCode != null and param.equipCode != ''">AND d.fireEquipmentCode like <if test="param.equipCode != null and param.equipCode != ''">AND d.fireEquipmentCode like
...@@ -219,15 +222,19 @@ ...@@ -219,15 +222,19 @@
<if test="param.alarmType == 'FIREALARM'">AND d.type = #{param.alarmType}</if> <if test="param.alarmType == 'FIREALARM'">AND d.type = #{param.alarmType}</if>
<if test="param.orgCode != null and param.orgCode != ''">AND d.org_code = #{param.orgCode}</if> <if test="param.orgCode != null and param.orgCode != ''">AND d.org_code = #{param.orgCode}</if>
<if test="param.type != null and param.type != ''">AND d.type = #{param.type}</if> <if test="param.type != null and param.type != ''">AND d.type = #{param.type}</if>
<if test="param.handleStatus != null and param.handleStatus != '' and param.handleStatus == 1">AND d.handleStatus = '已处理' </if> <if test="param.handleStatus != null and param.handleStatus != '' and param.handleStatus == 1">AND
<if test="param.handleStatus != null and param.handleStatus != '' and param.handleStatus == 2">AND d.handleStatus = '未处理' </if> d.handleStatus = '已处理'
</if>
<if test="param.handleStatus != null and param.handleStatus != '' and param.handleStatus == 2">AND
d.handleStatus = '未处理'
</if>
<if test="param.system != null and param.system != ''"> <if test="param.system != null and param.system != ''">
AND find_in_set(#{param.system},d.systemId) AND find_in_set(#{param.system},d.systemId)
</if> </if>
<if test="param.buildIds!=null"> <if test="param.buildIds!=null">
AND d.buildId IN AND d.buildId IN
<foreach item="item" collection="param.buildIds" separator="," <foreach item="item" collection="param.buildIds" separator=","
open="(" close=")" index=""> #{item} open="(" close=")" index="">#{item}
</foreach> </foreach>
</if> </if>
</where> </where>
...@@ -266,7 +273,7 @@ ...@@ -266,7 +273,7 @@
<if test="alarmType == 'FIREALARM'">AND d.type = #{alarmType}</if> <if test="alarmType == 'FIREALARM'">AND d.type = #{alarmType}</if>
</where> </where>
</select> </select>
<select id="pageAlarmsInfo" resultType="java.util.HashMap"> <select id="pageAlarmsInfo" resultType="Map">
SELECT SELECT
d.* d.*
FROM FROM
...@@ -302,7 +309,7 @@ ...@@ -302,7 +309,7 @@
wlesal.equipment_specific_index_value wlesal.equipment_specific_index_value
END AS fireEquipmentPointValue, END AS fireEquipmentPointValue,
wlesa.frequency AS frequency, wlesa.frequency AS frequency,
wlesa.status AS status, wlesal.status AS status,
wlesal.type AS type, wlesal.type AS type,
wlesal.create_date AS createDate, wlesal.create_date AS createDate,
wlesal.build_id AS buildId, wlesal.build_id AS buildId,
...@@ -323,7 +330,8 @@ ...@@ -323,7 +330,8 @@
LEFT JOIN wl_equipment_specific_alarm wlesa ON wlesa.id = wlesal.equipment_specific_alarm_id) d LEFT JOIN wl_equipment_specific_alarm wlesa ON wlesa.id = wlesal.equipment_specific_alarm_id) d
WHERE 1=1 WHERE 1=1
AND d.fireEquipmentName IS NOT NULL AND d.fireEquipmentName IS NOT NULL
<if test="param.warehouseStructureName != null and param.warehouseStructureName != ''">and d.warehouseStructureName like <if test="param.warehouseStructureName != null and param.warehouseStructureName != ''">and
d.warehouseStructureName like
concat(concat("%",#{param.warehouseStructureName}),"%") concat(concat("%",#{param.warehouseStructureName}),"%")
</if> </if>
<if test="param.equipCode != null and param.equipCode != ''">AND d.fireEquipmentCode like <if test="param.equipCode != null and param.equipCode != ''">AND d.fireEquipmentCode like
...@@ -345,8 +353,11 @@ ...@@ -345,8 +353,11 @@
</if> </if>
<if test="param.buildId != null and param.buildId != ''"> <if test="param.buildId != null and param.buildId != ''">
and (d.buildId=#{param.buildId} and (d.buildId=#{param.buildId}
or find_in_set(d.fireEquipmentId,(SELECT s.point_in_scene FROM `wl_source_scene` s where s.source_id = #{param.buildId}))) or find_in_set(d.fireEquipmentId,(SELECT s.point_in_scene FROM `wl_source_scene` s where s.source_id =
#{param.buildId})))
</if> </if>
<if test="param.id!=null and param.id!=''">AND d.fireEquipmentId = #{param.id}</if>
<if test="param.status!=null and param.status!=3">AND d.status = #{param.status}</if>
ORDER BY d.createDate DESC ORDER BY d.createDate DESC
</select> </select>
<select id="getAlarmList" resultType="java.util.HashMap"> <select id="getAlarmList" resultType="java.util.HashMap">
...@@ -735,11 +746,13 @@ ...@@ -735,11 +746,13 @@
AND wlesal.create_date LIKE CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d' ), '%' ) AND wlesal.create_date LIKE CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d' ), '%' )
</if> </if>
<if test='dto.createDate != null and dto.createDate == "7"'> <if test='dto.createDate != null and dto.createDate == "7"'>
AND wlesal.create_date BETWEEN CONCAT( DATE_ADD( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), INTERVAL - 7 DAY ), '00:00:00' ) AND wlesal.create_date BETWEEN CONCAT( DATE_ADD( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), INTERVAL - 7 DAY ),
'00:00:00' )
AND CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), '%', '23:59:59' ) AND CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), '%', '23:59:59' )
</if> </if>
<if test='dto.createDate != null and dto.createDate == "30"'> <if test='dto.createDate != null and dto.createDate == "30"'>
AND wlesal.create_date BETWEEN CONCAT( DATE_ADD( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), INTERVAL - 30 DAY ), '00:00:00' ) AND wlesal.create_date BETWEEN CONCAT( DATE_ADD( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), INTERVAL - 30 DAY
), '00:00:00' )
AND CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), '%', '23:59:59' ) AND CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), '%', '23:59:59' )
</if> </if>
<if test="dto.createDate != null and dto.createDate.length() > 7"> <if test="dto.createDate != null and dto.createDate.length() > 7">
...@@ -885,22 +898,26 @@ ...@@ -885,22 +898,26 @@
</if> </if>
<if test='dto.createDate != null and dto.createDate == "3"'> <if test='dto.createDate != null and dto.createDate == "3"'>
AND wlesal.create_date &gt;= subdate(curdate(),date_format(curdate(),'%w')-1) and wlesal.create_date &lt;= subdate(curdate(),date_format(curdate(),'%w')-7) <!--本周--> AND wlesal.create_date &gt;= subdate(curdate(),date_format(curdate(),'%w')-1) and wlesal.create_date
&lt;= subdate(curdate(),date_format(curdate(),'%w')-7) <!--本周-->
</if> </if>
<if test='dto.createDate != null and dto.createDate == "4"'> <if test='dto.createDate != null and dto.createDate == "4"'>
AND wlesal.create_date &gt;= subdate(curdate(),date_format(curdate(),'%w')+6) and wlesal.create_date &lt;= subdate(curdate(),date_format(curdate(),'%w')-0)<!--上周--> AND wlesal.create_date &gt;= subdate(curdate(),date_format(curdate(),'%w')+6) and wlesal.create_date
&lt;= subdate(curdate(),date_format(curdate(),'%w')-0)<!--上周-->
</if> </if>
<if test='dto.createDate != null and dto.createDate == "5"'> <if test='dto.createDate != null and dto.createDate == "5"'>
AND date_format(wlesa.create_date,'%y-%m')=date_format(curdate(),'%y-%m')<!--本月--> AND date_format(wlesa.create_date,'%y-%m')=date_format(curdate(),'%y-%m')<!--本月-->
</if> </if>
<if test='dto.createDate != null and dto.createDate == "6"'> <if test='dto.createDate != null and dto.createDate == "6"'>
AND date_format(wlesa.create_date,'%y-%m')=date_format(date_sub(curdate(), interval 1 month),'%y-%m') <!--上月--> AND date_format(wlesa.create_date,'%y-%m')=date_format(date_sub(curdate(), interval 1
month),'%y-%m') <!--上月-->
</if> </if>
<if test='dto.startDate != null and dto.endDate != null '> <if test='dto.startDate != null and dto.endDate != null '>
AND DATE_FORMAT(wlesa.create_date, '%Y-%m-%d ' ) between DATE_FORMAT(#{dto.startDate}, '%Y-%m-%d ' ) and DATE_FORMAT(#{dto.endDate}, '%Y-%m-%d ' ) AND DATE_FORMAT(wlesa.create_date, '%Y-%m-%d ' ) between DATE_FORMAT(#{dto.startDate}, '%Y-%m-%d ' ) and
DATE_FORMAT(#{dto.endDate}, '%Y-%m-%d ' )
</if> </if>
<if test="dto.isFirm == 'yes'"> <if test="dto.isFirm == 'yes'">
...@@ -945,7 +962,8 @@ ...@@ -945,7 +962,8 @@
b.eqname fireEquipmentName, b.eqname fireEquipmentName,
b.qrcode fireEquipmentCode, b.qrcode fireEquipmentCode,
b.eqimg eqimg, b.eqimg eqimg,
IFNULL(( select DISTINCT wl_equipment_specific_alarm.`status` from wl_equipment_specific_alarm where wl_equipment_specific_alarm.`status`=1 and wl_equipment_specific_alarm.equipment_detail_id=b.eqid ), 0) `status` IFNULL(( select DISTINCT wl_equipment_specific_alarm.`status` from wl_equipment_specific_alarm where
wl_equipment_specific_alarm.`status`=1 and wl_equipment_specific_alarm.equipment_detail_id=b.eqid ), 0) `status`
from from
(select (select
wl_warehouse_structure.full_name address, wl_warehouse_structure.full_name address,
...@@ -956,7 +974,8 @@ ...@@ -956,7 +974,8 @@
wl_equipment_specific.system_id wl_equipment_specific.system_id
from wl_equipment_detail from wl_equipment_detail
LEFT JOIN wl_equipment_specific ON wl_equipment_specific.equipment_detail_id = wl_equipment_detail.id LEFT JOIN wl_equipment_specific ON wl_equipment_specific.equipment_detail_id = wl_equipment_detail.id
LEFT JOIN (select DISTINCT wl_equipment_index.equipment_id from wl_equipment_index where wl_equipment_index.is_iot=1) b on b.equipment_id=wl_equipment_detail.equipment_id LEFT JOIN (select DISTINCT wl_equipment_index.equipment_id from wl_equipment_index where
wl_equipment_index.is_iot=1) b on b.equipment_id=wl_equipment_detail.equipment_id
LEFT JOIN wl_stock_detail on wl_equipment_detail.id =wl_stock_detail.equipment_detail_id LEFT JOIN wl_stock_detail on wl_equipment_detail.id =wl_stock_detail.equipment_detail_id
LEFT JOIN wl_warehouse_structure on wl_stock_detail.warehouse_structure_id = wl_warehouse_structure.id LEFT JOIN wl_warehouse_structure on wl_stock_detail.warehouse_structure_id = wl_warehouse_structure.id
)b )b
...@@ -1023,7 +1042,8 @@ ...@@ -1023,7 +1042,8 @@
count(wl_equipment_specific_alarm.id) num count(wl_equipment_specific_alarm.id) num
from wl_equipment_specific_alarm where wl_equipment_specific_alarm.`status`=1 from wl_equipment_specific_alarm where wl_equipment_specific_alarm.`status`=1
<if test="tyep == 'yes'"> <if test="tyep == 'yes'">
and wl_equipment_specific_alarm.confirm_type <![CDATA[<>]]> '' AND wl_equipment_specific_alarm.confirm_type IS NOT NULL and wl_equipment_specific_alarm.confirm_type <![CDATA[<>]]> '' AND wl_equipment_specific_alarm.confirm_type
IS NOT NULL
</if> </if>
<if test="tyep == 'no'"> <if test="tyep == 'no'">
and wl_equipment_specific_alarm.confirm_type is null and wl_equipment_specific_alarm.confirm_type is null
......
...@@ -78,7 +78,8 @@ ...@@ -78,7 +78,8 @@
wes.org_code AS orgCode, wes.org_code AS orgCode,
wei.type_code AS typeCode, wei.type_code AS typeCode,
wei.name AS indexName, wei.name AS indexName,
wei.unit AS indexUnitName wei.unit AS indexUnitName,
wesi.update_date AS updateDate
FROM FROM
wl_equipment_specific_index AS wesi wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
...@@ -86,6 +87,30 @@ ...@@ -86,6 +87,30 @@
WHERE WHERE
wes.iot_code = #{iotCode} wes.iot_code = #{iotCode}
</select> </select>
<select id="getEquipmentSpeIndexDataByIotCode"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT
wesi.id AS id,
wei.name_key AS nameKey,
IFNULL(si.value_label, si.`value`) AS 'value',
wesi.equipment_specific_id AS equipmentSpecificId,
wesi.equipment_index_id AS equipmentIndexId,
wes.org_code AS code,
wes.iot_code AS iotCode,
wes.org_code AS orgCode,
wei.type_code AS typeCode,
wei.name AS indexName,
wei.unit AS indexUnitName,
wei.value_enum AS valueEnum
FROM
wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
WHERE
wes.iot_code = #{iotCode}
</select>
<select id="getEquipmentSpeIndexByEquipmentSecificId" <select id="getEquipmentSpeIndexByEquipmentSecificId"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex"> resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT SELECT
......
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