Commit aa89ba54 authored by zhengjiawei's avatar zhengjiawei

注 无用库相关代码

parent 2ad73325
package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
* The persistent class for the fire_equipment database table.
*
*/
@Entity
@Table(name="f_fire_equipment_data")
@NamedQuery(name="FireEquipmentData.findAll", query="SELECT f FROM FireEquipmentData f")
public class FireEquipmentData extends BasicEntity {
private static final long serialVersionUID = 1L;
@Column(name="fire_equipment_id")
private Long fireEquipmentId;
@Column(name="fire_equipment_point_id")
private Long fireEquipmentPointId;
@Column(name="eq_point_name")
private String eqPointName;
@Column(name="eq_point_unit")
private String eqPointUnit;
@Column(name="eq_point_code")
private String eqPointCode;
private String type="alarm";
/**
* 信息地址
*/
@Column(name="information_address")
private String informationAddress;
/**
* 值
*/
@Column(name="e_value")
private String eValue;
private int soe;
@Column(name="is_invalid")
private int isInvalid; // 是否有效
/**
* 机构
*/
@Column(name="org_code")
private String orgCode;
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public FireEquipmentData() {
}
public Long getFireEquipmentId() {
return fireEquipmentId;
}
public void setFireEquipmentId(Long fireEquipmentId) {
this.fireEquipmentId = fireEquipmentId;
}
public Long getFireEquipmentPointId() {
return fireEquipmentPointId;
}
public void setFireEquipmentPointId(Long fireEquipmentPointId) {
this.fireEquipmentPointId = fireEquipmentPointId;
}
public String getEqPointName() {
return eqPointName;
}
public void setEqPointName(String eqPointName) {
this.eqPointName = eqPointName;
}
public String getEqPointUnit() {
return eqPointUnit;
}
public void setEqPointUnit(String eqPointUnit) {
this.eqPointUnit = eqPointUnit;
}
public String getEqPointCode() {
return eqPointCode;
}
public void setEqPointCode(String eqPointCode) {
this.eqPointCode = eqPointCode;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getInformationAddress() {
return informationAddress;
}
public void setInformationAddress(String informationAddress) {
this.informationAddress = informationAddress;
}
public String geteValue() {
return eValue;
}
public void seteValue(String eValue) {
this.eValue = eValue;
}
public int getSoe() {
return soe;
}
public void setSoe(int soe) {
this.soe = soe;
}
public int getIsInvalid() {
return isInvalid;
}
public void setIsInvalid(int isInvalid) {
this.isInvalid = isInvalid;
}
}
\ No newline at end of file
//package com.yeejoin.amos.fas.dao.entity;
//
//import javax.persistence.Column;
//import javax.persistence.Entity;
//import javax.persistence.NamedQuery;
//import javax.persistence.Table;
//
//
///**
// * The persistent class for the fire_equipment database table.
// *
// */
//@Entity
//@Table(name="f_fire_equipment_data")
//@NamedQuery(name="FireEquipmentData.findAll", query="SELECT f FROM FireEquipmentData f")
//public class FireEquipmentData extends BasicEntity {
// private static final long serialVersionUID = 1L;
//
// @Column(name="fire_equipment_id")
// private Long fireEquipmentId;
//
// @Column(name="fire_equipment_point_id")
// private Long fireEquipmentPointId;
//
// @Column(name="eq_point_name")
// private String eqPointName;
//
// @Column(name="eq_point_unit")
// private String eqPointUnit;
//
// @Column(name="eq_point_code")
// private String eqPointCode;
//
// private String type="alarm";
//
// /**
// * 信息地址
// */
// @Column(name="information_address")
// private String informationAddress;
// /**
// * 值
// */
// @Column(name="e_value")
// private String eValue;
//
// private int soe;
//
// @Column(name="is_invalid")
// private int isInvalid; // 是否有效
//
// /**
// * 机构
// */
// @Column(name="org_code")
// private String orgCode;
//
// public String getOrgCode() {
// return orgCode;
// }
//
// public void setOrgCode(String orgCode) {
// this.orgCode = orgCode;
// }
//
// public FireEquipmentData() {
// }
//
// public Long getFireEquipmentId() {
// return fireEquipmentId;
// }
//
// public void setFireEquipmentId(Long fireEquipmentId) {
// this.fireEquipmentId = fireEquipmentId;
// }
//
// public Long getFireEquipmentPointId() {
// return fireEquipmentPointId;
// }
//
// public void setFireEquipmentPointId(Long fireEquipmentPointId) {
// this.fireEquipmentPointId = fireEquipmentPointId;
// }
//
// public String getEqPointName() {
// return eqPointName;
// }
//
// public void setEqPointName(String eqPointName) {
// this.eqPointName = eqPointName;
// }
//
// public String getEqPointUnit() {
// return eqPointUnit;
// }
//
// public void setEqPointUnit(String eqPointUnit) {
// this.eqPointUnit = eqPointUnit;
// }
//
// public String getEqPointCode() {
// return eqPointCode;
// }
//
// public void setEqPointCode(String eqPointCode) {
// this.eqPointCode = eqPointCode;
// }
//
// public String getType() {
// return type;
// }
//
// public void setType(String type) {
// this.type = type;
// }
//
// public String getInformationAddress() {
// return informationAddress;
// }
//
// public void setInformationAddress(String informationAddress) {
// this.informationAddress = informationAddress;
// }
//
// public String geteValue() {
// return eValue;
// }
//
// public void seteValue(String eValue) {
// this.eValue = eValue;
// }
//
// public int getSoe() {
// return soe;
// }
//
// public void setSoe(int soe) {
// this.soe = soe;
// }
//
// public int getIsInvalid() {
// return isInvalid;
// }
//
// public void setIsInvalid(int isInvalid) {
// this.isInvalid = isInvalid;
// }
//
//
//
//}
\ No newline at end of file
package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import org.springframework.data.annotation.Transient;
/**
* The persistent class for the f_fire_equipment_point database table.
*
*/
@Entity
@Table(name="f_fire_equipment_point")
@NamedQuery(name="FireEquipmentPoint.findAll", query="SELECT f FROM FireEquipmentPoint f")
public class FireEquipmentPoint extends BasicEntity {
private static final long serialVersionUID = 1L;
@Column(name="code")
private String code;
@Column(name="create_by")
private String createBy;
@Column(name="fire_equipment_id")
private Long fireEquipmentId;
@Column(name="name")
private String name;
@Column(name="remark")
private String remark;
@Column(name="type")
private String type;
@Column(name="value")
private String value;
private String unit;
@Column(name="alarm_type")
private Long alarmType;
@Column(name="org_code")
private String orgCode;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Long getFireEquipmentId() {
return fireEquipmentId;
}
public void setFireEquipmentId(Long fireEquipmentId) {
this.fireEquipmentId = fireEquipmentId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public Long getAlarmType() {
return alarmType;
}
public void setAlarmType(Long alarmType) {
this.alarmType = alarmType;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
}
\ No newline at end of file
//package com.yeejoin.amos.fas.dao.entity;
//
//import javax.persistence.Column;
//import javax.persistence.Entity;
//import javax.persistence.NamedQuery;
//import javax.persistence.Table;
//
//import org.springframework.data.annotation.Transient;
//
//
///**
// * The persistent class for the f_fire_equipment_point database table.
// *
// */
//@Entity
//@Table(name="f_fire_equipment_point")
//@NamedQuery(name="FireEquipmentPoint.findAll", query="SELECT f FROM FireEquipmentPoint f")
//public class FireEquipmentPoint extends BasicEntity {
// private static final long serialVersionUID = 1L;
// @Column(name="code")
// private String code;
//
// @Column(name="create_by")
// private String createBy;
//
// @Column(name="fire_equipment_id")
// private Long fireEquipmentId;
//
// @Column(name="name")
// private String name;
//
// @Column(name="remark")
// private String remark;
//
// @Column(name="type")
// private String type;
//
// @Column(name="value")
// private String value;
//
// private String unit;
// @Column(name="alarm_type")
// private Long alarmType;
//
// @Column(name="org_code")
// private String orgCode;
// public String getCode() {
// return code;
// }
//
// public void setCode(String code) {
// this.code = code;
// }
//
// public String getCreateBy() {
// return createBy;
// }
//
// public void setCreateBy(String createBy) {
// this.createBy = createBy;
// }
//
// public Long getFireEquipmentId() {
// return fireEquipmentId;
// }
//
// public void setFireEquipmentId(Long fireEquipmentId) {
// this.fireEquipmentId = fireEquipmentId;
// }
//
// public String getName() {
// return name;
// }
//
// public void setName(String name) {
// this.name = name;
// }
//
// public String getRemark() {
// return remark;
// }
//
// public void setRemark(String remark) {
// this.remark = remark;
// }
//
// public String getType() {
// return type;
// }
//
// public void setType(String type) {
// this.type = type;
// }
//
// public String getValue() {
// return value;
// }
//
// public void setValue(String value) {
// this.value = value;
// }
//
// public String getUnit() {
// return unit;
// }
//
// public void setUnit(String unit) {
// this.unit = unit;
// }
//
// public Long getAlarmType() {
// return alarmType;
// }
//
// public void setAlarmType(Long alarmType) {
// this.alarmType = alarmType;
// }
//
// public String getOrgCode() {
// return orgCode;
// }
//
// public void setOrgCode(String orgCode) {
// this.orgCode = orgCode;
// }
//}
\ No newline at end of file
package com.yeejoin.amos.fas.dao.entity;
import java.util.List;
import java.util.Map;
import javax.persistence.*;
/**
* 消防站点
* @author Administrator
*
*/
@Entity
@Table(name="f_fire_station")
@NamedQuery(name="FireStation.findAll", query="SELECT f FROM FireStation f")
public class FireStation extends BasicEntity{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 名称
*/
private String name;
/**
* 编号
*/
private String code;
/**
* 类型 1:消防小室,2:消防泡沫间
*/
private String type;
/**
* 所属风险区域id
*/
@Column(name="risk_source_id")
private Long riskSourceId;
/**
* 位置
*/
private String address;
/**
* 3纬坐标
*/
private String position3d;
/**
* 3维楼层
*/
private String floor3d;
/**
* 是否室内
*/
@Column(name="is_indoor")
private Boolean isIndoor=true;
/**
* 组织
*/
@Column(name="org_code")
private String orgCode;
/**
* 创建人
*/
@Column(name="create_by")
private String createBy;
@Column(name="picture")
private String picture;
private List<Map> fireEquipmentInfo;
/**
* ue4位置
*/
@Lob
private String ue4Location;
/**
* ue4旋转
*/
@Lob
private String ue4Rotation;
@Transient
public List<Map> getFireEquipmentInfo() {
return fireEquipmentInfo;
}
public void setFireEquipmentInfo(List<Map> fireEquipmentInfo) {
this.fireEquipmentInfo = fireEquipmentInfo;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getPosition3d() {
return position3d;
}
public void setPosition3d(String position3d) {
this.position3d = position3d;
}
public String getFloor3d() {
return floor3d;
}
public void setFloor3d(String floor3d) {
this.floor3d = floor3d;
}
public Boolean getIsIndoor() {
return isIndoor;
}
public void setIsIndoor(Boolean isIndoor) {
this.isIndoor = isIndoor;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public String getPicture() {
return picture;
}
public void setPicture(String picture) {
this.picture = picture;
}
public Long getRiskSourceId() {
return riskSourceId;
}
public void setRiskSourceId(Long riskSourceId) {
this.riskSourceId = riskSourceId;
}
@Column(name = "ue4_location")
public String getUe4Location() {
return ue4Location;
}
public void setUe4Location(String ue4Location) {
this.ue4Location = ue4Location;
}
@Column(name = "ue4_rotation")
public String getUe4Rotation() {
return ue4Rotation;
}
public void setUe4Rotation(String ue4Rotation) {
this.ue4Rotation = ue4Rotation;
}
}
//package com.yeejoin.amos.fas.dao.entity;
//
//import java.util.List;
//import java.util.Map;
//
//import javax.persistence.*;
//
///**
// * 消防站点
// * @author Administrator
// *
// */
//@Entity
//@Table(name="f_fire_station")
//@NamedQuery(name="FireStation.findAll", query="SELECT f FROM FireStation f")
//public class FireStation extends BasicEntity{
//
// /**
// *
// */
// private static final long serialVersionUID = 1L;
//
// /**
// * 名称
// */
// private String name;
// /**
// * 编号
// */
// private String code;
//
// /**
// * 类型 1:消防小室,2:消防泡沫间
// */
// private String type;
//
// /**
// * 所属风险区域id
// */
// @Column(name="risk_source_id")
// private Long riskSourceId;
//
//
// /**
// * 位置
// */
// private String address;
//
// /**
// * 3纬坐标
// */
// private String position3d;
//
// /**
// * 3维楼层
// */
// private String floor3d;
//
// /**
// * 是否室内
// */
// @Column(name="is_indoor")
// private Boolean isIndoor=true;
//
// /**
// * 组织
// */
// @Column(name="org_code")
// private String orgCode;
//
// /**
// * 创建人
// */
// @Column(name="create_by")
// private String createBy;
//
//
// @Column(name="picture")
// private String picture;
//
// private List<Map> fireEquipmentInfo;
//
// /**
// * ue4位置
// */
// @Lob
// private String ue4Location;
//
// /**
// * ue4旋转
// */
// @Lob
// private String ue4Rotation;
//
// @Transient
// public List<Map> getFireEquipmentInfo() {
// return fireEquipmentInfo;
// }
//
// public void setFireEquipmentInfo(List<Map> fireEquipmentInfo) {
// this.fireEquipmentInfo = fireEquipmentInfo;
// }
//
// public String getName() {
// return name;
// }
//
// public void setName(String name) {
// this.name = name;
// }
//
// public String getCode() {
// return code;
// }
//
// public void setCode(String code) {
// this.code = code;
// }
//
// public String getType() {
// return type;
// }
//
// public void setType(String type) {
// this.type = type;
// }
//
// public String getAddress() {
// return address;
// }
//
// public void setAddress(String address) {
// this.address = address;
// }
//
// public String getPosition3d() {
// return position3d;
// }
//
// public void setPosition3d(String position3d) {
// this.position3d = position3d;
// }
//
// public String getFloor3d() {
// return floor3d;
// }
//
// public void setFloor3d(String floor3d) {
// this.floor3d = floor3d;
// }
//
// public Boolean getIsIndoor() {
// return isIndoor;
// }
//
// public void setIsIndoor(Boolean isIndoor) {
// this.isIndoor = isIndoor;
// }
//
// public String getOrgCode() {
// return orgCode;
// }
//
// public void setOrgCode(String orgCode) {
// this.orgCode = orgCode;
// }
//
// public String getCreateBy() {
// return createBy;
// }
//
// public void setCreateBy(String createBy) {
// this.createBy = createBy;
// }
//
// public String getPicture() {
// return picture;
// }
//
// public void setPicture(String picture) {
// this.picture = picture;
// }
//
// public Long getRiskSourceId() {
// return riskSourceId;
// }
//
// public void setRiskSourceId(Long riskSourceId) {
// this.riskSourceId = riskSourceId;
// }
//
// @Column(name = "ue4_location")
// public String getUe4Location() {
// return ue4Location;
// }
//
// public void setUe4Location(String ue4Location) {
// this.ue4Location = ue4Location;
// }
//
// @Column(name = "ue4_rotation")
// public String getUe4Rotation() {
// return ue4Rotation;
// }
//
// public void setUe4Rotation(String ue4Rotation) {
// this.ue4Rotation = ue4Rotation;
// }
//}
package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
* 消防站关联物资
* @author Administrator
*
*/
@Entity
@Table(name="f_fire_station_equipment")
@NamedQuery(name="FireStationFireEquipment.findAll", query="SELECT f FROM FireStationFireEquipment f")
public class FireStationFireEquipment extends BasicEntity{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 消防站id
*/
@Column(name="fire_station_id")
private Long fireStationId;
/**
* 消防资源
*/
@Column(name="fire_equipment_id")
private Long fireEquipmentId;
/**
* 个数
*/
private Double number;
/**
* 单位
*/
private String unit;
/**
* 创建人
*/
@Column(name="create_by")
private String createBy;
public Long getFireStationId() {
return fireStationId;
}
public void setFireStationId(Long fireStationId) {
this.fireStationId = fireStationId;
}
public Long getFireEquipmentId() {
return fireEquipmentId;
}
public void setFireEquipmentId(Long fireEquipmentId) {
this.fireEquipmentId = fireEquipmentId;
}
public Double getNumber() {
return number;
}
public void setNumber(Double number) {
this.number = number;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
}
//package com.yeejoin.amos.fas.dao.entity;
//
//import javax.persistence.Column;
//import javax.persistence.Entity;
//import javax.persistence.NamedQuery;
//import javax.persistence.Table;
///**
// * 消防站关联物资
// * @author Administrator
// *
// */
//@Entity
//@Table(name="f_fire_station_equipment")
//@NamedQuery(name="FireStationFireEquipment.findAll", query="SELECT f FROM FireStationFireEquipment f")
//public class FireStationFireEquipment extends BasicEntity{
//
// /**
// *
// */
// private static final long serialVersionUID = 1L;
//
// /**
// * 消防站id
// */
// @Column(name="fire_station_id")
// private Long fireStationId;
//
// /**
// * 消防资源
// */
// @Column(name="fire_equipment_id")
// private Long fireEquipmentId;
//
// /**
// * 个数
// */
// private Double number;
//
// /**
// * 单位
// */
// private String unit;
//
// /**
// * 创建人
// */
// @Column(name="create_by")
// private String createBy;
//
// public Long getFireStationId() {
// return fireStationId;
// }
//
// public void setFireStationId(Long fireStationId) {
// this.fireStationId = fireStationId;
// }
//
// public Long getFireEquipmentId() {
// return fireEquipmentId;
// }
//
// public void setFireEquipmentId(Long fireEquipmentId) {
// this.fireEquipmentId = fireEquipmentId;
// }
//
// public Double getNumber() {
// return number;
// }
//
// public void setNumber(Double number) {
// this.number = number;
// }
//
// public String getUnit() {
// return unit;
// }
//
// public void setUnit(String unit) {
// this.unit = unit;
// }
//
// public String getCreateBy() {
// return createBy;
// }
//
// public void setCreateBy(String createBy) {
// this.createBy = createBy;
// }
//
//}
package com.yeejoin.amos.fas.dao.entity;
import java.sql.Time;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
* 消防力量
* @author Administrator
*
*/
@Entity
@Table(name="f_fire_strength")
@NamedQuery(name="FireStrength.findAll", query="SELECT f FROM FireStrength f")
public class FireStrength extends BasicEntity{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 编号
*/
private String code;
/**
* 姓名
*/
private String username;
/**
* 职位
*/
private String position;
/**
* 固话
*/
private String tel;
/**
* 开始时间
*/
@Column(name="day_begin")
private Time dayBegin;
/**
* 结束时间
*/
@Column(name="day_end")
private Time dayEnd;
/**
* 手机
*/
@Column(name="phone_num")
private String phoneNum;
/**
* 工作描述
*/
@Column(name="job_des")
private String jobDes;
/**
* 备注
*/
private String remark;
/**
* 组织
*/
@Column(name="org_code")
private String orgCode;
/**
* 创建人
*/
@Column(name="create_by")
private String createBy;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getPhoneNum() {
return phoneNum;
}
public void setPhoneNum(String phoneNum) {
this.phoneNum = phoneNum;
}
public String getJobDes() {
return jobDes;
}
public void setJobDes(String jobDes) {
this.jobDes = jobDes;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Time getDayBegin() {
return dayBegin;
}
public void setDayBegin(Time dayBegin) {
this.dayBegin = dayBegin;
}
public Time getDayEnd() {
return dayEnd;
}
public void setDayEnd(Time dayEnd) {
this.dayEnd = dayEnd;
}
}
//package com.yeejoin.amos.fas.dao.entity;
//
//import java.sql.Time;
//
//import javax.persistence.Column;
//import javax.persistence.Entity;
//import javax.persistence.NamedQuery;
//import javax.persistence.Table;
///**
// * 消防力量
// * @author Administrator
// *
// */
//@Entity
//@Table(name="f_fire_strength")
//@NamedQuery(name="FireStrength.findAll", query="SELECT f FROM FireStrength f")
//public class FireStrength extends BasicEntity{
//
// /**
// *
// */
// private static final long serialVersionUID = 1L;
//
// /**
// * 编号
// */
// private String code;
//
// /**
// * 姓名
// */
// private String username;
//
// /**
// * 职位
// */
// private String position;
//
// /**
// * 固话
// */
// private String tel;
//
// /**
// * 开始时间
// */
// @Column(name="day_begin")
// private Time dayBegin;
// /**
// * 结束时间
// */
// @Column(name="day_end")
// private Time dayEnd;
// /**
// * 手机
// */
// @Column(name="phone_num")
// private String phoneNum;
//
// /**
// * 工作描述
// */
// @Column(name="job_des")
// private String jobDes;
//
// /**
// * 备注
// */
// private String remark;
//
// /**
// * 组织
// */
// @Column(name="org_code")
// private String orgCode;
//
// /**
// * 创建人
// */
// @Column(name="create_by")
// private String createBy;
//
// public String getCode() {
// return code;
// }
//
// public void setCode(String code) {
// this.code = code;
// }
//
// public String getUsername() {
// return username;
// }
//
// public void setUsername(String username) {
// this.username = username;
// }
//
// public String getPosition() {
// return position;
// }
//
// public void setPosition(String position) {
// this.position = position;
// }
//
// public String getTel() {
// return tel;
// }
//
// public void setTel(String tel) {
// this.tel = tel;
// }
//
// public String getPhoneNum() {
// return phoneNum;
// }
//
// public void setPhoneNum(String phoneNum) {
// this.phoneNum = phoneNum;
// }
//
// public String getJobDes() {
// return jobDes;
// }
//
// public void setJobDes(String jobDes) {
// this.jobDes = jobDes;
// }
//
// public String getRemark() {
// return remark;
// }
//
// public void setRemark(String remark) {
// this.remark = remark;
// }
//
// public String getOrgCode() {
// return orgCode;
// }
//
// public void setOrgCode(String orgCode) {
// this.orgCode = orgCode;
// }
//
// public String getCreateBy() {
// return createBy;
// }
//
// public void setCreateBy(String createBy) {
// this.createBy = createBy;
// }
//
// public Time getDayBegin() {
// return dayBegin;
// }
//
// public void setDayBegin(Time dayBegin) {
// this.dayBegin = dayBegin;
// }
//
// public Time getDayEnd() {
// return dayEnd;
// }
//
// public void setDayEnd(Time dayEnd) {
// this.dayEnd = dayEnd;
// }
//
//}
package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.*;
/**
* 水资源
* @author
*
*/
@Entity
@Table(name="f_water_resource")
@NamedQuery(name="WaterResource.findAll", query="SELECT f FROM WaterResource f")
public class WaterResource extends BasicEntity{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 名称
*/
private String name;
/**
* 编号
*/
private String code;
/**
* 类型 1:消火栓,2:消防水池,3:喷淋
*/
private String type;
/**
* 区域
*/
@Column(name="production_area")
private String productionArea;
/**
* 3纬坐标
*/
private String position3d;
/**
* 3维楼层
*/
private String floor3d;
/**
* 是否室内
*/
@Column(name="is_indoor")
private Boolean isIndoor=true;
/**
* 所属风险区域id
*/
@Column(name="risk_source_id")
private Long riskSourceId;
/**
* 房间
*/
private String room;
/**
* 位置
*/
private String address;
/**
* 组织
*/
@Column(name="org_code")
private String orgCode;
/**
* 创建人
*/
@Column(name="create_by")
private String createBy;
@Column(name="area")
private String area;
@Column(name="max_level")
private String maxLevel;
@Column(name="alarm_level")
private String alarmLevel;
/**
* ue4位置
*/
@Lob
private String ue4Location;
/**
* ue4旋转
*/
@Lob
private String ue4Rotation;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getProductionArea() {
return productionArea;
}
public void setProductionArea(String productionArea) {
this.productionArea = productionArea;
}
public String getPosition3d() {
return position3d;
}
public void setPosition3d(String position3d) {
this.position3d = position3d;
}
public String getFloor3d() {
return floor3d;
}
public void setFloor3d(String floor3d) {
this.floor3d = floor3d;
}
public Boolean getIsIndoor() {
return isIndoor;
}
public void setIsIndoor(Boolean isIndoor) {
this.isIndoor = isIndoor;
}
public String getRoom() {
return room;
}
public void setRoom(String room) {
this.room = room;
}
public Long getRiskSourceId() {
return riskSourceId;
}
public void setRiskSourceId(Long riskSourceId) {
this.riskSourceId = riskSourceId;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
@Column(name = "ue4_location")
public String getUe4Location() {
return ue4Location;
}
public void setUe4Location(String ue4Location) {
this.ue4Location = ue4Location;
}
@Column(name = "ue4_rotation")
public String getUe4Rotation() {
return ue4Rotation;
}
public void setUe4Rotation(String ue4Rotation) {
this.ue4Rotation = ue4Rotation;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getMaxLevel() {
return maxLevel;
}
public void setMaxLevel(String maxLevel) {
this.maxLevel = maxLevel;
}
public String getAlarmLevel() {
return alarmLevel;
}
public void setAlarmLevel(String alarmLevel) {
this.alarmLevel = alarmLevel;
}
}
//package com.yeejoin.amos.fas.dao.entity;
//
//import javax.persistence.*;
//
///**
// * 水资源
// * @author
// *
// */
//@Entity
//@Table(name="f_water_resource")
//@NamedQuery(name="WaterResource.findAll", query="SELECT f FROM WaterResource f")
//public class WaterResource extends BasicEntity{
//
// /**
// *
// */
// private static final long serialVersionUID = 1L;
//
// /**
// * 名称
// */
// private String name;
// /**
// * 编号
// */
// private String code;
//
// /**
// * 类型 1:消火栓,2:消防水池,3:喷淋
// */
// private String type;
//
//
// /**
// * 区域
// */
// @Column(name="production_area")
// private String productionArea;
//
//
// /**
// * 3纬坐标
// */
// private String position3d;
//
// /**
// * 3维楼层
// */
// private String floor3d;
//
// /**
// * 是否室内
// */
// @Column(name="is_indoor")
// private Boolean isIndoor=true;
// /**
// * 所属风险区域id
// */
// @Column(name="risk_source_id")
// private Long riskSourceId;
//
// /**
// * 房间
// */
// private String room;
//
// /**
// * 位置
// */
// private String address;
//
//
// /**
// * 组织
// */
// @Column(name="org_code")
// private String orgCode;
//
// /**
// * 创建人
// */
// @Column(name="create_by")
// private String createBy;
//
// @Column(name="area")
// private String area;
//
// @Column(name="max_level")
// private String maxLevel;
//
// @Column(name="alarm_level")
// private String alarmLevel;
//
// /**
// * ue4位置
// */
// @Lob
// private String ue4Location;
//
// /**
// * ue4旋转
// */
// @Lob
// private String ue4Rotation;
//
// public String getName() {
// return name;
// }
//
// public void setName(String name) {
// this.name = name;
// }
//
// public String getCode() {
// return code;
// }
//
// public void setCode(String code) {
// this.code = code;
// }
//
// public String getType() {
// return type;
// }
//
// public void setType(String type) {
// this.type = type;
// }
//
// public String getProductionArea() {
// return productionArea;
// }
//
// public void setProductionArea(String productionArea) {
// this.productionArea = productionArea;
// }
//
// public String getPosition3d() {
// return position3d;
// }
//
// public void setPosition3d(String position3d) {
// this.position3d = position3d;
// }
//
// public String getFloor3d() {
// return floor3d;
// }
//
// public void setFloor3d(String floor3d) {
// this.floor3d = floor3d;
// }
//
// public Boolean getIsIndoor() {
// return isIndoor;
// }
//
// public void setIsIndoor(Boolean isIndoor) {
// this.isIndoor = isIndoor;
// }
//
//
// public String getRoom() {
// return room;
// }
//
// public void setRoom(String room) {
// this.room = room;
// }
//
// public Long getRiskSourceId() {
// return riskSourceId;
// }
//
// public void setRiskSourceId(Long riskSourceId) {
// this.riskSourceId = riskSourceId;
// }
//
// public String getAddress() {
// return address;
// }
//
// public void setAddress(String address) {
// this.address = address;
// }
//
// public String getOrgCode() {
// return orgCode;
// }
//
// public void setOrgCode(String orgCode) {
// this.orgCode = orgCode;
// }
//
// public String getCreateBy() {
// return createBy;
// }
//
// public void setCreateBy(String createBy) {
// this.createBy = createBy;
// }
//
// @Column(name = "ue4_location")
// public String getUe4Location() {
// return ue4Location;
// }
//
// public void setUe4Location(String ue4Location) {
// this.ue4Location = ue4Location;
// }
//
// @Column(name = "ue4_rotation")
// public String getUe4Rotation() {
// return ue4Rotation;
// }
//
// public void setUe4Rotation(String ue4Rotation) {
// this.ue4Rotation = ue4Rotation;
// }
//
// public String getArea() {
// return area;
// }
//
// public void setArea(String area) {
// this.area = area;
// }
//
// public String getMaxLevel() {
// return maxLevel;
// }
//
// public void setMaxLevel(String maxLevel) {
// this.maxLevel = maxLevel;
// }
//
// public String getAlarmLevel() {
// return alarmLevel;
// }
//
// public void setAlarmLevel(String alarmLevel) {
// this.alarmLevel = alarmLevel;
// }
//}
package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
* 水资源设备表
* @author
*
*/
@Entity
@Table(name="f_water_resource_equipment")
@NamedQuery(name="WaterResourceEquipment.findAll", query="SELECT f FROM WaterResourceEquipment f")
public class WaterResourceEquipment extends BasicEntity{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 水源id
*/
@Column(name="waterResourceId")
private Long waterResourceId;
/**
* 关联设备id
*/
@Column(name="fireEquipmentId")
private Long fireEquipmentId;
/**
* 个数
*/
private Double number=1d;
/**
* 单位
*/
private String unit;
public Long getWaterResourceId() {
return waterResourceId;
}
public void setWaterResourceId(Long waterResourceId) {
this.waterResourceId = waterResourceId;
}
public Long getFireEquipmentId() {
return fireEquipmentId;
}
public void setFireEquipmentId(Long fireEquipmentId) {
this.fireEquipmentId = fireEquipmentId;
}
public Double getNumber() {
return number;
}
public void setNumber(Double number) {
this.number = number;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
}
//package com.yeejoin.amos.fas.dao.entity;
//
//import javax.persistence.Column;
//import javax.persistence.Entity;
//import javax.persistence.NamedQuery;
//import javax.persistence.Table;
///**
// * 水资源设备表
// * @author
// *
// */
//@Entity
//@Table(name="f_water_resource_equipment")
//@NamedQuery(name="WaterResourceEquipment.findAll", query="SELECT f FROM WaterResourceEquipment f")
//public class WaterResourceEquipment extends BasicEntity{
//
// /**
// *
// */
// private static final long serialVersionUID = 1L;
//
// /**
// * 水源id
// */
// @Column(name="waterResourceId")
// private Long waterResourceId;
// /**
// * 关联设备id
// */
// @Column(name="fireEquipmentId")
// private Long fireEquipmentId;
// /**
// * 个数
// */
// private Double number=1d;
//
// /**
// * 单位
// */
// private String unit;
//
//
// public Long getWaterResourceId() {
// return waterResourceId;
// }
// public void setWaterResourceId(Long waterResourceId) {
// this.waterResourceId = waterResourceId;
// }
// public Long getFireEquipmentId() {
// return fireEquipmentId;
// }
// public void setFireEquipmentId(Long fireEquipmentId) {
// this.fireEquipmentId = fireEquipmentId;
// }
// public Double getNumber() {
// return number;
// }
// public void setNumber(Double number) {
// this.number = number;
// }
// public String getUnit() {
// return unit;
// }
// public void setUnit(String unit) {
// this.unit = unit;
// }
//
//}
......@@ -47,7 +47,7 @@ import com.yeejoin.amos.fas.business.action.util.StepComparator;
import com.yeejoin.amos.fas.business.feign.IDutyModeServer;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.service.impl.RuleRunigSnapshotServiceImpl;
import com.yeejoin.amos.fas.business.service.intfc.FireStengthService;
//import com.yeejoin.amos.fas.business.service.intfc.FireStengthService;
import com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance;
import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService;
import com.yeejoin.amos.fas.business.service.model.ContingencyDeviceStatus;
......@@ -81,8 +81,8 @@ public class ContingencyAction implements CustomerAction {
@Autowired
private IContingencyInstance iContingencyInstance;
@Autowired
private FireStengthService fireStrengthService;
// @Autowired
// private FireStengthService fireStrengthService;
@Autowired
private ContingencyLogPublisher contingencyLogPublisher;
......
......@@ -121,10 +121,11 @@ public class ExcelController extends BaseController {
if ("fireResource".equals(type)) {//导入消防装备
List<FireEquipmentParam> list = FileHelper.importExcel(file, 1, 1, FireEquipmentParam.class);
iExcelService.importFireEquipment(list);
} else if ("water".equals(type)) {//导入水资源
List<WaterResourceParam> list = FileHelper.importExcel(file, 1, 1, WaterResourceParam.class);
iExcelService.importWaterResource(list);
}
// else if ("water".equals(type)) {//导入水资源
// List<WaterResourceParam> list = FileHelper.importExcel(file, 1, 1, WaterResourceParam.class);
// iExcelService.importWaterResource(list);
// }
return CommonResponseUtil.success();
} catch (YeeException e) {
logger.info("导入数据异常", e);
......
......@@ -10,7 +10,7 @@ import com.yeejoin.amos.fas.config.Permission;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint;
//import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint;
//import com.yeejoin.amos.security.authorization.Authorization;
import io.swagger.annotations.Api;
......@@ -44,60 +44,60 @@ public class FireEquimtPointController extends BaseController {
@Autowired
private FireEquipPointMapper fireEquipPointMapper;
@Permission
@ApiOperation(httpMethod = "POST", value = "添加风险点", notes = "添加风险点")
@RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse createPoint(@RequestBody FireEquipmentPoint fireEquipmentPoint) throws Exception {
if (fireEquipmentPoint == null
|| StringUtils.isEmpty(fireEquipmentPoint.getName())
|| StringUtils.isEmpty(fireEquipmentPoint.getType())
|| StringUtils.isEmpty(fireEquipmentPoint.getCode())
|| ("ANALOGUE".equals(fireEquipmentPoint.getType()) && StringUtils.isEmpty(fireEquipmentPoint.getUnit()))){
return CommonResponseUtil.failure("请检查必填字段");
};
ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams);
fireEquipmentPoint.setOrgCode(compCode);
fireEquipmentPoint.setCreateBy(getUserId());
fireEquipmentPoint.setCreateDate(new Date());
//根据编号查询监测点
FireEquipmentPointEntity pointEntity = fireEquipPointMapper.getByCode(fireEquipmentPoint.getCode());
if (pointEntity != null) {
return CommonResponseUtil.failure("监测点编号已经存在");
}
return CommonResponseUtil.success(fireEquipPontService.savePoint(fireEquipmentPoint));
}
@Permission
// @Authorization(ingore = true)
@ApiOperation(httpMethod = "PUT", value = "编辑风险点", notes = "编辑风险点")
@RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
public CommonResponse udpatePoint(@PathVariable Long id, @RequestBody FireEquipmentPoint fireEquipmentPoint) {
fireEquipmentPoint.setId(id);
return CommonResponseUtil.success(fireEquipPontService.savePoint(fireEquipmentPoint));
}
@Permission
@ApiOperation(httpMethod = "GET", value = "查询单个风险单", notes = "查询单个风险单")
@RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryPoint(@PathVariable Long id) {
return CommonResponseUtil.success(fireEquipPontService.queryOne(id));
}
@Permission
//@Authorization(ingore = true)
@ApiOperation(httpMethod = "DELETE", value = "删除风险点", notes = "查询单个风险单")
@RequestMapping(value = "/{ids}", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
public CommonResponse deletePoint(@PathVariable String ids) throws Exception {
String[] idArray = ids.split(",");
return CommonResponseUtil.success(fireEquipPontService.deletePoint(idArray));
}
// @Permission
// @ApiOperation(httpMethod = "POST", value = "添加风险点", notes = "添加风险点")
// @RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
// public CommonResponse createPoint(@RequestBody FireEquipmentPoint fireEquipmentPoint) throws Exception {
//
// if (fireEquipmentPoint == null
// || StringUtils.isEmpty(fireEquipmentPoint.getName())
// || StringUtils.isEmpty(fireEquipmentPoint.getType())
// || StringUtils.isEmpty(fireEquipmentPoint.getCode())
// || ("ANALOGUE".equals(fireEquipmentPoint.getType()) && StringUtils.isEmpty(fireEquipmentPoint.getUnit()))){
// return CommonResponseUtil.failure("请检查必填字段");
// };
//
// ReginParams reginParams =getSelectedOrgInfo();
// String compCode=getOrgCode(reginParams);
// fireEquipmentPoint.setOrgCode(compCode);
// fireEquipmentPoint.setCreateBy(getUserId());
// fireEquipmentPoint.setCreateDate(new Date());
//
//
// //根据编号查询监测点
// FireEquipmentPointEntity pointEntity = fireEquipPointMapper.getByCode(fireEquipmentPoint.getCode());
// if (pointEntity != null) {
// return CommonResponseUtil.failure("监测点编号已经存在");
// }
//
// return CommonResponseUtil.success(fireEquipPontService.savePoint(fireEquipmentPoint));
// }
// @Permission
// // @Authorization(ingore = true)
// @ApiOperation(httpMethod = "PUT", value = "编辑风险点", notes = "编辑风险点")
// @RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
// public CommonResponse udpatePoint(@PathVariable Long id, @RequestBody FireEquipmentPoint fireEquipmentPoint) {
// fireEquipmentPoint.setId(id);
// return CommonResponseUtil.success(fireEquipPontService.savePoint(fireEquipmentPoint));
// }
//
// @Permission
// @ApiOperation(httpMethod = "GET", value = "查询单个风险单", notes = "查询单个风险单")
// @RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
// public CommonResponse queryPoint(@PathVariable Long id) {
//
// return CommonResponseUtil.success(fireEquipPontService.queryOne(id));
// }
//
// @Permission
// //@Authorization(ingore = true)
// @ApiOperation(httpMethod = "DELETE", value = "删除风险点", notes = "查询单个风险单")
// @RequestMapping(value = "/{ids}", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
// public CommonResponse deletePoint(@PathVariable String ids) throws Exception {
// String[] idArray = ids.split(",");
// return CommonResponseUtil.success(fireEquipPontService.deletePoint(idArray));
// }
@Permission
@ApiOperation(httpMethod = "GET", value = "指定消防设备的风险点列表", notes = "指定消防设备的风险点列表")
......@@ -155,52 +155,52 @@ public class FireEquimtPointController extends BaseController {
List<Long> ids = Arrays.stream(pointIds.split(",")).map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
return fireEquipPontService.batchUnbindToEquipment(ids);
}
@Permission
@ApiOperation(value = "添加监测点", notes = "添加监测点")
@PostMapping(value = "/save")
public CommonResponse save(@ApiParam(value = "监测点对象", required = true) @RequestBody FireEquipmentPointEntity fireEquipmentPointEntity) {
if (fireEquipmentPointEntity.getFireEquipmentId() == null) {
fireEquipmentPointEntity.setFireEquipmentId(0L);
}
return fireEquipPontService.save(fireEquipmentPointEntity);
}
@Permission
@ApiOperation(value = "修改监测点", notes = "修改监测点")
@PostMapping(value = "/update")
public CommonResponse update(@ApiParam(value = "监测点对象", required = true) @RequestBody FireEquipmentPointEntity fireEquipmentPointEntity) {
FireEquipmentPoint old = fireEquipPontService.queryOne(fireEquipmentPointEntity.getId());
if(old.getId() != 0 ) {
String[] idArray = new String[] { String.valueOf(old.getId()) };
if(fireEquipPontService.countImpEquipment(idArray) > 0) {
String riskSourceNames = fireEquipPontService.findBindRiskSourceStrByPointIds(idArray);
return CommonResponseUtil.failure("该设备已被风险区域 [" + riskSourceNames + "] 绑定,请先删除绑定关系");
}
}
return fireEquipPontService.update(fireEquipmentPointEntity);
}
@Permission
@ApiOperation(value = "批量删除监测点", notes = "批量删除监测点")
@GetMapping(value = "/batch/delete")
public CommonResponse batchDelete(@ApiParam(value = "监测点编号(多个逗号隔开)", required = true) @RequestParam String pointIds) {
if (StringUtils.isEmpty(pointIds)) {
return CommonResponseUtil.failure("监测点编号必填");
}
String[] idArray = pointIds.split(",");
if(fireEquipPontService.countImpEquipment(idArray) > 0) {
String riskSourceNames = fireEquipPontService.findBindRiskSourceStrByPointIds(idArray);
return CommonResponseUtil.failure("该点位已被风险区域 [" + riskSourceNames + "] 绑定,请先删除绑定关系");
}
List<Long> ids = Arrays.stream(pointIds.split(",")).map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
return fireEquipPontService.batchDelete(ids);
}
//
// @Permission
// @ApiOperation(value = "添加监测点", notes = "添加监测点")
// @PostMapping(value = "/save")
// public CommonResponse save(@ApiParam(value = "监测点对象", required = true) @RequestBody FireEquipmentPointEntity fireEquipmentPointEntity) {
// if (fireEquipmentPointEntity.getFireEquipmentId() == null) {
// fireEquipmentPointEntity.setFireEquipmentId(0L);
// }
//
//
//
//
// return fireEquipPontService.save(fireEquipmentPointEntity);
// }
// @Permission
// @ApiOperation(value = "修改监测点", notes = "修改监测点")
// @PostMapping(value = "/update")
// public CommonResponse update(@ApiParam(value = "监测点对象", required = true) @RequestBody FireEquipmentPointEntity fireEquipmentPointEntity) {
// FireEquipmentPoint old = fireEquipPontService.queryOne(fireEquipmentPointEntity.getId());
//
// if(old.getId() != 0 ) {
// String[] idArray = new String[] { String.valueOf(old.getId()) };
// if(fireEquipPontService.countImpEquipment(idArray) > 0) {
// String riskSourceNames = fireEquipPontService.findBindRiskSourceStrByPointIds(idArray);
// return CommonResponseUtil.failure("该设备已被风险区域 [" + riskSourceNames + "] 绑定,请先删除绑定关系");
// }
// }
// return fireEquipPontService.update(fireEquipmentPointEntity);
// }
// @Permission
// @ApiOperation(value = "批量删除监测点", notes = "批量删除监测点")
// @GetMapping(value = "/batch/delete")
// public CommonResponse batchDelete(@ApiParam(value = "监测点编号(多个逗号隔开)", required = true) @RequestParam String pointIds) {
// if (StringUtils.isEmpty(pointIds)) {
// return CommonResponseUtil.failure("监测点编号必填");
// }
// String[] idArray = pointIds.split(",");
// if(fireEquipPontService.countImpEquipment(idArray) > 0) {
// String riskSourceNames = fireEquipPontService.findBindRiskSourceStrByPointIds(idArray);
// return CommonResponseUtil.failure("该点位已被风险区域 [" + riskSourceNames + "] 绑定,请先删除绑定关系");
// }
// List<Long> ids = Arrays.stream(pointIds.split(",")).map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
// return fireEquipPontService.batchDelete(ids);
// }
@Permission
@ApiOperation(value = "根据设备类型查询设备", notes = "批量删除监测点")
......
......@@ -4,7 +4,7 @@ import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IEquipmentService;
import com.yeejoin.amos.fas.business.service.intfc.IFireCarService;
import com.yeejoin.amos.fas.business.service.intfc.IFireEquipService;
import com.yeejoin.amos.fas.business.service.intfc.IWaterResourceService;
//import com.yeejoin.amos.fas.business.service.intfc.IWaterResourceService;
import com.yeejoin.amos.fas.business.util.CommonPageParamUtil;
import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.config.Permission;
......@@ -37,8 +37,8 @@ public class FireSourceController extends BaseController {
private IFireCarService fireCarService;
@Autowired
private IFireEquipService iFireEquipService;
@Autowired
private IWaterResourceService iWaterResourceService;
// @Autowired
//// private IWaterResourceService iWaterResourceService;
@Autowired
private IEquipmentService iEquipService;
private final Logger log = LoggerFactory.getLogger(FireSourceController.class);
......@@ -87,12 +87,12 @@ public class FireSourceController extends BaseController {
@RequestMapping(value = "/{ids}", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
public CommonResponse delete(@PathVariable String ids) throws Exception {
String[] idArray = ids.split(",");
if (iWaterResourceService.countAssociatedEquipWaterByIds(idArray) > 0) {
return CommonResponseUtil.failure("该设备已被灭火栓或消防水池绑定,请先删除绑定关系");
}
if (iFireEquipService.countAssociatedEquipStationByIds(idArray) > 0) {
return CommonResponseUtil.failure("该设备已被消防泡沫间或消防小室绑定,请先删除绑定关系");
}
// if (iWaterResourceService.countAssociatedEquipWaterByIds(idArray) > 0) {
// return CommonResponseUtil.failure("该设备已被灭火栓或消防水池绑定,请先删除绑定关系");
// }
// if (iFireEquipService.countAssociatedEquipStationByIds(idArray) > 0) {
// return CommonResponseUtil.failure("该设备已被消防泡沫间或消防小室绑定,请先删除绑定关系");
// }
if (iEquipService.countImpEquipByIds(idArray) > 0) {
return CommonResponseUtil.failure("该设备已被重点设备绑定,请先删除绑定关系");
}
......
package com.yeejoin.amos.fas.business.controller;
import com.yeejoin.amos.fas.business.service.intfc.IFireStationService;
import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.config.Permission;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.dao.entity.FireStation;
import com.yeejoin.amos.fas.dao.entity.FireStationFireEquipment;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.Date;
import java.util.List;
@RestController
@RequestMapping(value = "/api/firestation")
@Api(tags = "消防小室API")
public class FireStationController extends BaseController {
@Autowired
IFireStationService iFireStationService;
@Permission
@ApiOperation(httpMethod = "POST", value = "添加消防小室", notes = "添加消防小室")
@RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse create(@RequestBody FireStation fireStation) throws Exception {
if (fireStation == null || StringUtils.isEmpty(fireStation.getName())
|| StringUtils.isEmpty(fireStation.getAddress()) || StringUtils.isEmpty(fireStation.getPosition3d())
|| StringUtils.isEmpty(fireStation.getCode()))
throw new Exception("数据校验失败.");
ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams);
fireStation.setCreateBy("0");
fireStation.setCreateDate(new Date());
fireStation.setOrgCode(compCode);
return CommonResponseUtil.success(iFireStationService.save(fireStation));
}
@Permission
@ApiOperation(httpMethod = "POST", value = "绑定消防设备", notes = "绑定消防设备")
@RequestMapping(value = "/fireequipmenet", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse createFireRelation(@RequestBody List<FireStationFireEquipment> fireStationFireEquipments)
throws Exception {
if (CollectionUtils.isEmpty(fireStationFireEquipments))
throw new Exception("数据校验失败.");
for (FireStationFireEquipment fireStationFireEquipment : fireStationFireEquipments) {
fireStationFireEquipment.setCreateBy("0");
fireStationFireEquipment.setCreateDate(new Date());
}
try {
List<FireStationFireEquipment> fireStationFireEquipments1 = iFireStationService.saveStationFireEquipment(fireStationFireEquipments);
return CommonResponseUtil.success(fireStationFireEquipments1);
} catch (Exception e){
return CommonResponseUtil.failure(e.getMessage());
}
}
@Permission
@ApiOperation(httpMethod = "DELETE", value = "解除绑定消防设备", notes = "解除绑定消防设备")
@RequestMapping(value = "/fireequipmenet", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
public CommonResponse deleteFireEqRelation(@RequestBody List<FireStationFireEquipment> fireStationFireEquipments)
throws Exception {
if (CollectionUtils.isEmpty(fireStationFireEquipments))
throw new Exception("数据校验失败.");
iFireStationService.deleteStationFireEquipment(fireStationFireEquipments);
return CommonResponseUtil.success("SUCCESS");
}
@Permission
@ApiOperation(httpMethod = "PUT", value = "编辑消防小室", notes = "编辑消防小室")
@RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
public CommonResponse udpate(@PathVariable Long id, @RequestBody FireStation fireStation) {
fireStation.setId(id);
return CommonResponseUtil.success(iFireStationService.save(fireStation));
}
@Permission
@ApiOperation(httpMethod = "GET", value = "查询单个消防小室", notes = "查询单个消防小室")
@RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse query(@PathVariable Long id) {
return CommonResponseUtil.success(iFireStationService.queryOne(id));
}
@Permission
@ApiOperation(httpMethod = "GET", value = "分页查询已经绑定的消防设备列表", notes = "分页查询已经绑定的消防设备列表")
@RequestMapping(value = "/{id}/fireequipmenet/page", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryForEuqimentList(@PathVariable Long id, @RequestParam int pageNumber,
@RequestParam int pageSize) {
CommonPageable commonPageable = new CommonPageable(pageNumber, pageSize);
return CommonResponseUtil.success(iFireStationService.queryForFireEquemtPage(id, commonPageable));
}
@Permission
@ApiOperation(httpMethod = "DELETE", value = "删除消防小室", notes = "查询单个消防小室")
@RequestMapping(value = "/{ids}", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
public CommonResponse delete(@PathVariable String ids) throws Exception {
String[] idArray = ids.split(",");
return CommonResponseUtil.success(iFireStationService.delete(idArray));
}
@Permission
@ApiOperation(httpMethod = "GET", value = "分页查询消防小室", notes = "分页查询消防小室")
@RequestMapping(value = "/page", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse forPage(
@ApiParam(value = "名称模糊查询", required = false) @RequestParam(required = false) String name,
@ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false) String code,
@ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false) String type,
@RequestParam int pageNumber, @RequestParam int pageSize) {
CommonPageable commonPageable = new CommonPageable(pageNumber, pageSize);
return CommonResponseUtil.success(iFireStationService.queryForPage(StringUtils.trimToNull(name),
StringUtils.trimToNull(code), StringUtils.trimToNull(type), commonPageable));
}
@Permission
//@Authorization(ingore = true)
@ApiOperation(httpMethod = "GET", value = "列表查询消防小室", notes = "分页查询消防小室")
@RequestMapping(value = "/list", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse forList(
@ApiParam(value = "名称模糊查询", required = false) @RequestParam(required = false) String name,
@ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false) String code,
@ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false) String type
) {
return CommonResponseUtil.success(iFireStationService.queryForList(StringUtils.trimToNull(name),
StringUtils.trimToNull(code), StringUtils.trimToNull(type)));
}
@Permission
//@Authorization(ingore = true)
@ApiOperation(httpMethod = "POST", value = "添加消防小室及上传图片", notes = "添加消防小室及上传图片")
@RequestMapping(value = "createAndSaveImg", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse createAndSaveImg(@RequestParam(value = "file", required = false) MultipartFile[] file,
FireStation fireStation) throws Exception {
if (fireStation == null || StringUtils.isEmpty(fireStation.getName())
|| StringUtils.isEmpty(fireStation.getAddress())
// || StringUtils.isEmpty(fireStation.getPosition3d())
|| StringUtils.isEmpty(fireStation.getCode()))
throw new Exception("数据校验失败.");
long id = fireStation.getId();
if(id == 0l) {//新增
Boolean existByCode = iFireStationService.isExistByCode(fireStation.getCode());
if(existByCode) {
throw new Exception("改编号已存在,请重试!");
}
}
ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams);
fireStation.setCreateBy(getUserId());
fireStation.setCreateDate(new Date());
fireStation.setOrgCode(compCode);
return CommonResponseUtil.success(iFireStationService.saveAndUpd(fireStation, file));
}
/**
* 查询消防小室关联设备信息
* @param id
* @return
*/
@Permission
@ApiOperation(httpMethod = "GET", value = "分页查询已经绑定的消防设备列表", notes = "分页查询已经绑定的消防设备列表")
@RequestMapping(value = "/fireEquipments/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryForEuqimentListById(@PathVariable Long id) {
return CommonResponseUtil.success(iFireStationService.queryForEuqimentListById(id));
}
}
//package com.yeejoin.amos.fas.business.controller;
//
//import com.yeejoin.amos.fas.business.service.intfc.IFireStationService;
//import com.yeejoin.amos.fas.business.vo.ReginParams;
//import com.yeejoin.amos.fas.config.Permission;
//import com.yeejoin.amos.fas.core.common.request.CommonPageable;
//import com.yeejoin.amos.fas.core.util.CommonResponse;
//import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
//import com.yeejoin.amos.fas.dao.entity.FireStation;
////import com.yeejoin.amos.fas.dao.entity.FireStationFireEquipment;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.util.CollectionUtils;
//import org.springframework.web.bind.annotation.*;
//import org.springframework.web.multipart.MultipartFile;
//
//import java.util.Date;
//import java.util.List;
//
//@RestController
//@RequestMapping(value = "/api/firestation")
//@Api(tags = "消防小室API")
//public class FireStationController extends BaseController {
//
// @Autowired
// IFireStationService iFireStationService;
//
// @Permission
// @ApiOperation(httpMethod = "POST", value = "添加消防小室", notes = "添加消防小室")
// @RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
// public CommonResponse create(@RequestBody FireStation fireStation) throws Exception {
//
// if (fireStation == null || StringUtils.isEmpty(fireStation.getName())
// || StringUtils.isEmpty(fireStation.getAddress()) || StringUtils.isEmpty(fireStation.getPosition3d())
// || StringUtils.isEmpty(fireStation.getCode()))
// throw new Exception("数据校验失败.");
// ReginParams reginParams =getSelectedOrgInfo();
// String compCode=getOrgCode(reginParams);
// fireStation.setCreateBy("0");
// fireStation.setCreateDate(new Date());
// fireStation.setOrgCode(compCode);
// return CommonResponseUtil.success(iFireStationService.save(fireStation));
// }
////
//// @Permission
//// @ApiOperation(httpMethod = "POST", value = "绑定消防设备", notes = "绑定消防设备")
//// @RequestMapping(value = "/fireequipmenet", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
//// public CommonResponse createFireRelation(@RequestBody List<FireStationFireEquipment> fireStationFireEquipments)
//// throws Exception {
////
//// if (CollectionUtils.isEmpty(fireStationFireEquipments))
//// throw new Exception("数据校验失败.");
////
//// for (FireStationFireEquipment fireStationFireEquipment : fireStationFireEquipments) {
//// fireStationFireEquipment.setCreateBy("0");
//// fireStationFireEquipment.setCreateDate(new Date());
//// }
//// try {
//// List<FireStationFireEquipment> fireStationFireEquipments1 = iFireStationService.saveStationFireEquipment(fireStationFireEquipments);
//// return CommonResponseUtil.success(fireStationFireEquipments1);
//// } catch (Exception e){
//// return CommonResponseUtil.failure(e.getMessage());
//// }
//// }
//
//// @Permission
//// @ApiOperation(httpMethod = "DELETE", value = "解除绑定消防设备", notes = "解除绑定消防设备")
//// @RequestMapping(value = "/fireequipmenet", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
//// public CommonResponse deleteFireEqRelation(@RequestBody List<FireStationFireEquipment> fireStationFireEquipments)
//// throws Exception {
////
//// if (CollectionUtils.isEmpty(fireStationFireEquipments))
//// throw new Exception("数据校验失败.");
//// iFireStationService.deleteStationFireEquipment(fireStationFireEquipments);
//// return CommonResponseUtil.success("SUCCESS");
//// }
//
// @Permission
// @ApiOperation(httpMethod = "PUT", value = "编辑消防小室", notes = "编辑消防小室")
// @RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
// public CommonResponse udpate(@PathVariable Long id, @RequestBody FireStation fireStation) {
// fireStation.setId(id);
// return CommonResponseUtil.success(iFireStationService.save(fireStation));
// }
//
// @Permission
// @ApiOperation(httpMethod = "GET", value = "查询单个消防小室", notes = "查询单个消防小室")
// @RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
// public CommonResponse query(@PathVariable Long id) {
//
// return CommonResponseUtil.success(iFireStationService.queryOne(id));
// }
//
// @Permission
// @ApiOperation(httpMethod = "GET", value = "分页查询已经绑定的消防设备列表", notes = "分页查询已经绑定的消防设备列表")
// @RequestMapping(value = "/{id}/fireequipmenet/page", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
// public CommonResponse queryForEuqimentList(@PathVariable Long id, @RequestParam int pageNumber,
// @RequestParam int pageSize) {
// CommonPageable commonPageable = new CommonPageable(pageNumber, pageSize);
// return CommonResponseUtil.success(iFireStationService.queryForFireEquemtPage(id, commonPageable));
// }
//
// @Permission
// @ApiOperation(httpMethod = "DELETE", value = "删除消防小室", notes = "查询单个消防小室")
// @RequestMapping(value = "/{ids}", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
// public CommonResponse delete(@PathVariable String ids) throws Exception {
// String[] idArray = ids.split(",");
// return CommonResponseUtil.success(iFireStationService.delete(idArray));
// }
//
// @Permission
// @ApiOperation(httpMethod = "GET", value = "分页查询消防小室", notes = "分页查询消防小室")
// @RequestMapping(value = "/page", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
// public CommonResponse forPage(
// @ApiParam(value = "名称模糊查询", required = false) @RequestParam(required = false) String name,
// @ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false) String code,
// @ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false) String type,
// @RequestParam int pageNumber, @RequestParam int pageSize) {
// CommonPageable commonPageable = new CommonPageable(pageNumber, pageSize);
// return CommonResponseUtil.success(iFireStationService.queryForPage(StringUtils.trimToNull(name),
// StringUtils.trimToNull(code), StringUtils.trimToNull(type), commonPageable));
// }
//
// @Permission
// //@Authorization(ingore = true)
// @ApiOperation(httpMethod = "GET", value = "列表查询消防小室", notes = "分页查询消防小室")
// @RequestMapping(value = "/list", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
// public CommonResponse forList(
// @ApiParam(value = "名称模糊查询", required = false) @RequestParam(required = false) String name,
// @ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false) String code,
// @ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false) String type
//
// ) {
// return CommonResponseUtil.success(iFireStationService.queryForList(StringUtils.trimToNull(name),
// StringUtils.trimToNull(code), StringUtils.trimToNull(type)));
// }
//
// @Permission
// //@Authorization(ingore = true)
// @ApiOperation(httpMethod = "POST", value = "添加消防小室及上传图片", notes = "添加消防小室及上传图片")
// @RequestMapping(value = "createAndSaveImg", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
// public CommonResponse createAndSaveImg(@RequestParam(value = "file", required = false) MultipartFile[] file,
// FireStation fireStation) throws Exception {
//
// if (fireStation == null || StringUtils.isEmpty(fireStation.getName())
// || StringUtils.isEmpty(fireStation.getAddress())
//// || StringUtils.isEmpty(fireStation.getPosition3d())
// || StringUtils.isEmpty(fireStation.getCode()))
// throw new Exception("数据校验失败.");
// long id = fireStation.getId();
// if(id == 0l) {//新增
// Boolean existByCode = iFireStationService.isExistByCode(fireStation.getCode());
// if(existByCode) {
// throw new Exception("改编号已存在,请重试!");
// }
// }
// ReginParams reginParams =getSelectedOrgInfo();
// String compCode=getOrgCode(reginParams);
// fireStation.setCreateBy(getUserId());
// fireStation.setCreateDate(new Date());
// fireStation.setOrgCode(compCode);
// return CommonResponseUtil.success(iFireStationService.saveAndUpd(fireStation, file));
// }
//
// /**
// * 查询消防小室关联设备信息
// * @param id
// * @return
// */
// @Permission
// @ApiOperation(httpMethod = "GET", value = "分页查询已经绑定的消防设备列表", notes = "分页查询已经绑定的消防设备列表")
// @RequestMapping(value = "/fireEquipments/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
// public CommonResponse queryForEuqimentListById(@PathVariable Long id) {
// return CommonResponseUtil.success(iFireStationService.queryForEuqimentListById(id));
// }
//
//}
package com.yeejoin.amos.fas.business.controller;
import java.util.Date;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
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 com.yeejoin.amos.fas.business.service.intfc.FireStengthService;
import com.yeejoin.amos.fas.config.Permission;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.dao.entity.FireStrength;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@RestController
@RequestMapping(value = "/api/firestrength")
@Api(tags="消防专职人API")
public class FireStrengthController extends BaseController{
@Autowired
FireStengthService fireStengthService;
//@Authorization(ingore = true)
@Permission
@ApiOperation(httpMethod = "POST",value = "添加专职人员", notes = "添加专职人员")
@RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse createPoint(@RequestBody FireStrength fireStrength) throws Exception{
if(fireStrength == null
|| StringUtils.isEmpty(fireStrength.getUsername())
|| StringUtils.isEmpty(fireStrength.getPhoneNum())
|| StringUtils.isEmpty(fireStrength.getPosition())
|| StringUtils.isEmpty(fireStrength.getCode() ))
throw new Exception("数据校验失败.");
fireStrength.setCreateBy("0");
fireStrength.setCreateDate(new Date());
return CommonResponseUtil.success(fireStengthService.savePoint(fireStrength));
}
@Permission
// @Authorization(ingore = true)
@ApiOperation(httpMethod = "PUT",value = "编辑专职人员", notes = "编辑专职人员")
@RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
public CommonResponse udpatePoint(@PathVariable Long id, @RequestBody FireStrength fireStrength) {
fireStrength.setId(id);
return CommonResponseUtil.success(fireStengthService.savePoint(fireStrength));
}
@Permission
//@Authorization(ingore = true)
@ApiOperation(httpMethod = "GET",value = "查询单个专职人员", notes = "查询单个专职人员")
@RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryPoint(@PathVariable Long id) {
return CommonResponseUtil.success(fireStengthService.queryOne(id));
}
@Permission
//@Authorization(ingore = true)
@ApiOperation(httpMethod = "DELETE",value = "删除专职人员", notes = "查询单个专职人员")
@RequestMapping(value = "/{ids}", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
public CommonResponse deletePoint(@PathVariable String ids) throws Exception {
String [] idArray = ids.split(",");
return CommonResponseUtil.success(fireStengthService.deletePoint(idArray));
}
@Permission
//@Authorization(ingore = true)
@ApiOperation(httpMethod = "GET",value = "分页查询专职人员", notes = "分页查询专职人员")
@RequestMapping(value = "/page", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse pointList(
@ApiParam(value = "名称模糊查询", required = false) @RequestParam(required = false)String name,
@ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false)String code,
@RequestParam int pageNumber,
@RequestParam int pageSize
) {
CommonPageable commonPageable = new CommonPageable(pageNumber,pageSize);
return CommonResponseUtil.success(fireStengthService.queryByFireEquimt(StringUtils.trimToNull(name),StringUtils.trimToNull(code),commonPageable));
}
}
//package com.yeejoin.amos.fas.business.controller;
//
//
//import java.util.Date;
//
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.PathVariable;
//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 com.yeejoin.amos.fas.business.service.intfc.FireStengthService;
//import com.yeejoin.amos.fas.config.Permission;
//import com.yeejoin.amos.fas.core.common.request.CommonPageable;
//import com.yeejoin.amos.fas.core.util.CommonResponse;
//import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
////import com.yeejoin.amos.fas.dao.entity.FireStrength;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//
//@RestController
//@RequestMapping(value = "/api/firestrength")
//@Api(tags="消防专职人API")
//public class FireStrengthController extends BaseController{
//
//
// @Autowired
// FireStengthService fireStengthService;
// //@Authorization(ingore = true)
//// @Permission
//// @ApiOperation(httpMethod = "POST",value = "添加专职人员", notes = "添加专职人员")
//// @RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
//// public CommonResponse createPoint(@RequestBody FireStrength fireStrength) throws Exception{
////
//// if(fireStrength == null
//// || StringUtils.isEmpty(fireStrength.getUsername())
//// || StringUtils.isEmpty(fireStrength.getPhoneNum())
//// || StringUtils.isEmpty(fireStrength.getPosition())
//// || StringUtils.isEmpty(fireStrength.getCode() ))
//// throw new Exception("数据校验失败.");
////
//// fireStrength.setCreateBy("0");
//// fireStrength.setCreateDate(new Date());
//// return CommonResponseUtil.success(fireStengthService.savePoint(fireStrength));
//// }
//
//// @Permission
//// // @Authorization(ingore = true)
//// @ApiOperation(httpMethod = "PUT",value = "编辑专职人员", notes = "编辑专职人员")
//// @RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
//// public CommonResponse udpatePoint(@PathVariable Long id, @RequestBody FireStrength fireStrength) {
//// fireStrength.setId(id);
//// return CommonResponseUtil.success(fireStengthService.savePoint(fireStrength));
//// }
//
// @Permission
// //@Authorization(ingore = true)
// @ApiOperation(httpMethod = "GET",value = "查询单个专职人员", notes = "查询单个专职人员")
// @RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
// public CommonResponse queryPoint(@PathVariable Long id) {
//
// return CommonResponseUtil.success(fireStengthService.queryOne(id));
// }
//
// @Permission
// //@Authorization(ingore = true)
// @ApiOperation(httpMethod = "DELETE",value = "删除专职人员", notes = "查询单个专职人员")
// @RequestMapping(value = "/{ids}", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
// public CommonResponse deletePoint(@PathVariable String ids) throws Exception {
// String [] idArray = ids.split(",");
// return CommonResponseUtil.success(fireStengthService.deletePoint(idArray));
// }
//
// @Permission
// //@Authorization(ingore = true)
// @ApiOperation(httpMethod = "GET",value = "分页查询专职人员", notes = "分页查询专职人员")
// @RequestMapping(value = "/page", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
// public CommonResponse pointList(
// @ApiParam(value = "名称模糊查询", required = false) @RequestParam(required = false)String name,
// @ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false)String code,
// @RequestParam int pageNumber,
// @RequestParam int pageSize
// ) {
// CommonPageable commonPageable = new CommonPageable(pageNumber,pageSize);
//
// return CommonResponseUtil.success(fireStengthService.queryByFireEquimt(StringUtils.trimToNull(name),StringUtils.trimToNull(code),commonPageable));
// }
//
//}
......@@ -618,12 +618,12 @@ public class RiskSourceController extends BaseController {
return CommonResponseUtil.success();
}
@ApiOperation(httpMethod = "POST", value = "上传消防设备数据", notes = "上传消防设备数据")
@RequestMapping(value = "/data/fireqeuiment/all", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse postFireEqumentData(@RequestBody List<AlarmParam> deviceDatas) throws Exception {
riskSourceService.saveData(deviceDatas, "all");
return CommonResponseUtil.success();
}
// @ApiOperation(httpMethod = "POST", value = "上传消防设备数据", notes = "上传消防设备数据")
// @RequestMapping(value = "/data/fireqeuiment/all", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
// public CommonResponse postFireEqumentData(@RequestBody List<AlarmParam> deviceDatas) throws Exception {
// riskSourceService.saveData(deviceDatas, "all");
// return CommonResponseUtil.success();
// }
// @Permission
// @Authorization(ingore = true)
......
package com.yeejoin.amos.fas.business.controller;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PathVariable;
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 com.yeejoin.amos.fas.business.service.intfc.IWaterResourceService;
import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.config.Permission;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.dao.entity.WaterResource;
import com.yeejoin.amos.fas.dao.entity.WaterResourceEquipment;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@RestController
@RequestMapping(value = "/api/waterresource")
@Api(tags="水资源API")
public class WaterResourceController extends BaseController{
@Autowired
IWaterResourceService iWaterResourceService;
@Permission
@ApiOperation(httpMethod = "POST",value = "添加水资源", notes = "添加水资源")
@RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse create(@RequestBody WaterResource waterResource) throws Exception{
if(waterResource == null
|| StringUtils.isEmpty(waterResource.getType())
|| StringUtils.isEmpty(waterResource.getFloor3d())
// || StringUtils.isEmpty(waterResource.getPosition3d())
|| StringUtils.isEmpty(waterResource.getCode() ))
throw new Exception("数据校验失败.");
ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams);
waterResource.setCreateBy("0");
waterResource.setCreateDate(new Date());
waterResource.setOrgCode(compCode);
return CommonResponseUtil.success(iWaterResourceService.save(waterResource));
}
@Permission
@ApiOperation(httpMethod = "PUT",value = "编辑水资源", notes = "编辑水资源")
@RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
public CommonResponse udpate(@PathVariable Long id, @RequestBody WaterResource waterResource) {
waterResource.setId(id);
ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams);
waterResource.setOrgCode(compCode);
return CommonResponseUtil.success(iWaterResourceService.save(waterResource));
}
@Permission
// @Authorization(ingore = true)
@ApiOperation(httpMethod = "GET",value = "查询单个水资源", notes = "查询单个水资源")
@RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryPoint(@PathVariable Long id) {
return CommonResponseUtil.success(iWaterResourceService.queryOne(id));
}
@Permission
@ApiOperation(httpMethod = "DELETE",value = "删除水资源", notes = "查询单个水资源")
@RequestMapping(value = "/{ids}", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
public CommonResponse delete(@PathVariable String ids) throws Exception {
String [] idArray = ids.split(",");
return CommonResponseUtil.success(iWaterResourceService.delete(idArray));
}
@Permission
@ApiOperation(httpMethod = "GET",value = "分页查询水资源", notes = "分页查询水资源")
@RequestMapping(value = "/page", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse forPage(
@ApiParam(value = "名称模糊查询", required = false) @RequestParam(required = false)String name,
@ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false)String code,
@ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false)String type,
@RequestParam int pageNumber,
@RequestParam int pageSize
) {
CommonPageable commonPageable = new CommonPageable(pageNumber,pageSize);
ReginParams reginParams =getSelectedOrgInfo();
String compCode = getOrgCode(reginParams);
return CommonResponseUtil.success(iWaterResourceService.queryForPage(compCode,StringUtils.trimToNull(name),StringUtils.trimToNull(code),StringUtils.trimToNull(type),commonPageable));
}
@Permission
//@Authorization(ingore = true)
@ApiOperation(httpMethod = "GET",value = "查询水资源", notes = "分页查询水资源")
@RequestMapping(value = "/list", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse list() {
return CommonResponseUtil.success(iWaterResourceService.queryForList());
}
@Permission
@ApiOperation(httpMethod = "POST", value = "绑定消防设备", notes = "绑定消防设备")
@RequestMapping(value = "/fireEquipmenet", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse createFireRelation(@RequestBody List<WaterResourceEquipment> waterResourceEquipments)
throws Exception {
if (CollectionUtils.isEmpty(waterResourceEquipments))
throw new Exception("数据校验失败.");
iWaterResourceService.saveBindFireEquipment(waterResourceEquipments);
return CommonResponseUtil.success();
}
@Permission
@ApiOperation(httpMethod = "DELETE", value = "解除绑定消防设备", notes = "解除绑定消防设备")
@RequestMapping(value = "/fireEquipmenet", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
public CommonResponse deleteFireEqRelation(@RequestBody List<WaterResourceEquipment> waterResourceEquipments)
throws Exception {
if (CollectionUtils.isEmpty(waterResourceEquipments))
throw new Exception("数据校验失败.");
iWaterResourceService.deleteBindFireEquipment(waterResourceEquipments);
return CommonResponseUtil.success();
}
@Permission
@ApiOperation(httpMethod = "GET", value = "分页查询已经绑定的消防设备列表", notes = "分页查询已经绑定的消防设备列表")
@RequestMapping(value = "/{waterResourceId}/fireEquipmenet/page", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryForEuqimentList(@PathVariable Long waterResourceId, @RequestParam int pageNumber,
@RequestParam int pageSize) {
CommonPageable commonPageable = new CommonPageable(pageNumber, pageSize);
return CommonResponseUtil.success(iWaterResourceService.queryBindFireEquemtPage(waterResourceId, commonPageable));
}
}
//package com.yeejoin.amos.fas.business.controller;
//
//
//import java.util.Date;
//import java.util.List;
//
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.util.CollectionUtils;
//import org.springframework.web.bind.annotation.PathVariable;
//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 com.yeejoin.amos.fas.business.service.intfc.IWaterResourceService;
//import com.yeejoin.amos.fas.business.vo.ReginParams;
//import com.yeejoin.amos.fas.config.Permission;
//import com.yeejoin.amos.fas.core.common.request.CommonPageable;
//import com.yeejoin.amos.fas.core.util.CommonResponse;
//import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
//import com.yeejoin.amos.fas.dao.entity.WaterResource;
////import com.yeejoin.amos.fas.dao.entity.WaterResourceEquipment;
//import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
//
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//
//@RestController
//@RequestMapping(value = "/api/waterresource")
//@Api(tags="水资源API")
//public class WaterResourceController extends BaseController{
//
//
// @Autowired
// IWaterResourceService iWaterResourceService;
//
// @Permission
// @ApiOperation(httpMethod = "POST",value = "添加水资源", notes = "添加水资源")
// @RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
// public CommonResponse create(@RequestBody WaterResource waterResource) throws Exception{
//
// if(waterResource == null
// || StringUtils.isEmpty(waterResource.getType())
// || StringUtils.isEmpty(waterResource.getFloor3d())
//// || StringUtils.isEmpty(waterResource.getPosition3d())
// || StringUtils.isEmpty(waterResource.getCode() ))
// throw new Exception("数据校验失败.");
// ReginParams reginParams =getSelectedOrgInfo();
// String compCode=getOrgCode(reginParams);
// waterResource.setCreateBy("0");
// waterResource.setCreateDate(new Date());
// waterResource.setOrgCode(compCode);
// return CommonResponseUtil.success(iWaterResourceService.save(waterResource));
// }
//
// @Permission
// @ApiOperation(httpMethod = "PUT",value = "编辑水资源", notes = "编辑水资源")
// @RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
// public CommonResponse udpate(@PathVariable Long id, @RequestBody WaterResource waterResource) {
// waterResource.setId(id);
// ReginParams reginParams =getSelectedOrgInfo();
// String compCode=getOrgCode(reginParams);
// waterResource.setOrgCode(compCode);
// return CommonResponseUtil.success(iWaterResourceService.save(waterResource));
// }
//
// @Permission
// // @Authorization(ingore = true)
// @ApiOperation(httpMethod = "GET",value = "查询单个水资源", notes = "查询单个水资源")
// @RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
// public CommonResponse queryPoint(@PathVariable Long id) {
//
// return CommonResponseUtil.success(iWaterResourceService.queryOne(id));
// }
//
// @Permission
// @ApiOperation(httpMethod = "DELETE",value = "删除水资源", notes = "查询单个水资源")
// @RequestMapping(value = "/{ids}", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
// public CommonResponse delete(@PathVariable String ids) throws Exception {
// String [] idArray = ids.split(",");
// return CommonResponseUtil.success(iWaterResourceService.delete(idArray));
// }
//
// @Permission
// @ApiOperation(httpMethod = "GET",value = "分页查询水资源", notes = "分页查询水资源")
// @RequestMapping(value = "/page", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
// public CommonResponse forPage(
// @ApiParam(value = "名称模糊查询", required = false) @RequestParam(required = false)String name,
// @ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false)String code,
// @ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false)String type,
// @RequestParam int pageNumber,
// @RequestParam int pageSize
// ) {
// CommonPageable commonPageable = new CommonPageable(pageNumber,pageSize);
// ReginParams reginParams =getSelectedOrgInfo();
// String compCode = getOrgCode(reginParams);
// return CommonResponseUtil.success(iWaterResourceService.queryForPage(compCode,StringUtils.trimToNull(name),StringUtils.trimToNull(code),StringUtils.trimToNull(type),commonPageable));
// }
//
// @Permission
// //@Authorization(ingore = true)
// @ApiOperation(httpMethod = "GET",value = "查询水资源", notes = "分页查询水资源")
// @RequestMapping(value = "/list", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
// public CommonResponse list() {
// return CommonResponseUtil.success(iWaterResourceService.queryForList());
// }
//
// @Permission
// @ApiOperation(httpMethod = "POST", value = "绑定消防设备", notes = "绑定消防设备")
// @RequestMapping(value = "/fireEquipmenet", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
// public CommonResponse createFireRelation(@RequestBody List<WaterResourceEquipment> waterResourceEquipments)
// throws Exception {
//
// if (CollectionUtils.isEmpty(waterResourceEquipments))
// throw new Exception("数据校验失败.");
// iWaterResourceService.saveBindFireEquipment(waterResourceEquipments);
// return CommonResponseUtil.success();
// }
//
// @Permission
// @ApiOperation(httpMethod = "DELETE", value = "解除绑定消防设备", notes = "解除绑定消防设备")
// @RequestMapping(value = "/fireEquipmenet", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
// public CommonResponse deleteFireEqRelation(@RequestBody List<WaterResourceEquipment> waterResourceEquipments)
// throws Exception {
//
// if (CollectionUtils.isEmpty(waterResourceEquipments))
// throw new Exception("数据校验失败.");
// iWaterResourceService.deleteBindFireEquipment(waterResourceEquipments);
// return CommonResponseUtil.success();
// }
//
// @Permission
// @ApiOperation(httpMethod = "GET", value = "分页查询已经绑定的消防设备列表", notes = "分页查询已经绑定的消防设备列表")
// @RequestMapping(value = "/{waterResourceId}/fireEquipmenet/page", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
// public CommonResponse queryForEuqimentList(@PathVariable Long waterResourceId, @RequestParam int pageNumber,
// @RequestParam int pageSize) {
// CommonPageable commonPageable = new CommonPageable(pageNumber, pageSize);
// return CommonResponseUtil.success(iWaterResourceService.queryBindFireEquemtPage(waterResourceId, commonPageable));
// }
//
//}
......@@ -6,7 +6,7 @@ import com.yeejoin.amos.fas.business.param.FireEquipmentParam;
import com.yeejoin.amos.fas.business.vo.EquipCommunicationData;
import com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse;
import com.yeejoin.amos.fas.dao.entity.FireEquipment;
import com.yeejoin.amos.fas.dao.entity.FireStation;
//import com.yeejoin.amos.fas.dao.entity.FireStation;
import org.apache.ibatis.annotations.Param;
......@@ -90,5 +90,5 @@ public interface FireEquipMapper extends BaseMapper {
FireEquipment findVideoById (@Param("id") Long id);
FireStation findFireStationById(@Param("id") Long id);
// FireStation findFireStationById(@Param("id") Long id);
}
......@@ -9,12 +9,12 @@ public interface FireStationMapper extends BaseMapper {
Map queryOne(@Param("id") Long id);
List<Map> queryForFireEqumntPage(
@Param("fireStationId") Long fireStationId,
@Param("start") long start,
@Param("length") Integer length);
Long queryCountForFireEqumntPage(
@Param("fireStationId") Long fireStationId);
// List<Map> queryForFireEqumntPage(
// @Param("fireStationId") Long fireStationId,
// @Param("start") long start,
// @Param("length") Integer length);
// Long queryCountForFireEqumntPage(
// @Param("fireStationId") Long fireStationId);
List<Map> queryForPage(@Param("name") String name,
......@@ -31,5 +31,5 @@ public interface FireStationMapper extends BaseMapper {
@Param("code") String code,
@Param("type")String type);
List<Map> queryEquipCountById(@Param("id") Long id);
// List<Map> queryEquipCountById(@Param("id") Long id);
}
package com.yeejoin.amos.fas.business.dao.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.fas.dao.entity.FireStrength;
public interface FireStrengthMapper extends BaseMapper {
Map queryOne(@Param("id") Long id);
List<Map> queryForPage(@Param("username") String username, @Param("code") String code, @Param("start") long start, @Param("length") Integer length);
Long queryCountForPage(@Param("username") String username, @Param("code") String code);
List<FireStrength> queryForStrengthList(@Param("time")String time);
}
//package com.yeejoin.amos.fas.business.dao.mapper;
//
//import java.util.List;
//import java.util.Map;
//
//import org.apache.ibatis.annotations.Param;
//
////import com.yeejoin.amos.fas.dao.entity.FireStrength;
//
//public interface FireStrengthMapper extends BaseMapper {
//
// Map queryOne(@Param("id") Long id);
//
// List<Map> queryForPage(@Param("username") String username, @Param("code") String code, @Param("start") long start, @Param("length") Integer length);
//
// Long queryCountForPage(@Param("username") String username, @Param("code") String code);
//
//// List<FireStrength> queryForStrengthList(@Param("time")String time);
//}
package com.yeejoin.amos.fas.business.dao.mapper;
import com.yeejoin.amos.fas.business.param.WaterResourceParam;
import com.yeejoin.amos.fas.dao.entity.WaterResource;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface WaterResourceMapper extends BaseMapper {
Map queryOne(@Param("id") Long id);
List<Map> queryForPage(
@Param("orgCode") String compCode,
@Param("name") String name,
@Param("code") String code,
@Param("type") String type,
@Param("start") long start,
@Param("length") Integer length);
Long queryCountForPage(
@Param("orgCode") String compCode,
@Param("name") String name,
@Param("code") String code,
@Param("type")String type);
List<Map> queryForBindFireEqumntPage(
@Param("waterResourceId") Long waterResourceId,
@Param("start") long start,
@Param("length") Integer length);
Long queryCountForBindFireEqumntPage(
@Param("waterResourceId") Long waterResourceId);
List<WaterResource> listByCodes(@Param("codes") Set<String> codes);
void saveBatch(List<WaterResourceParam> list);
void updateBatch(List<WaterResourceParam> list);
}
//package com.yeejoin.amos.fas.business.dao.mapper;
//
//import com.yeejoin.amos.fas.business.param.WaterResourceParam;
//import com.yeejoin.amos.fas.dao.entity.WaterResource;
//import org.apache.ibatis.annotations.Param;
//
//import java.util.List;
//import java.util.Map;
//import java.util.Set;
//
//public interface WaterResourceMapper extends BaseMapper {
//
// Map queryOne(@Param("id") Long id);
//
//
// List<Map> queryForPage(
// @Param("orgCode") String compCode,
// @Param("name") String name,
// @Param("code") String code,
// @Param("type") String type,
// @Param("start") long start,
// @Param("length") Integer length);
// Long queryCountForPage(
// @Param("orgCode") String compCode,
// @Param("name") String name,
// @Param("code") String code,
// @Param("type")String type);
//
// List<Map> queryForBindFireEqumntPage(
// @Param("waterResourceId") Long waterResourceId,
// @Param("start") long start,
// @Param("length") Integer length);
//
// Long queryCountForBindFireEqumntPage(
// @Param("waterResourceId") Long waterResourceId);
//
// List<WaterResource> listByCodes(@Param("codes") Set<String> codes);
//
// void saveBatch(List<WaterResourceParam> list);
//
// void updateBatch(List<WaterResourceParam> list);
//}
package com.yeejoin.amos.fas.business.dao.repository;
import com.yeejoin.amos.fas.dao.entity.FireStrength;
import java.util.Optional;
import org.springframework.stereotype.Repository;
@Repository("fireStrengthPointDao")
public interface FireStrengthPointDao extends BaseDao<FireStrength, Long> {
Optional<FireStrength> findById(Long id);
}
//package com.yeejoin.amos.fas.business.dao.repository;
//
//import com.yeejoin.amos.fas.dao.entity.FireStrength;
//
//import java.util.Optional;
//
//import org.springframework.stereotype.Repository;
//
//@Repository("fireStrengthPointDao")
//public interface FireStrengthPointDao extends BaseDao<FireStrength, Long> {
//
// Optional<FireStrength> findById(Long id);
//
//}
package com.yeejoin.amos.fas.business.dao.repository;
import com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData;
import com.yeejoin.amos.fas.dao.entity.FireStrength;
//import com.yeejoin.amos.fas.dao.entity.FireStrength;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
......
......@@ -16,8 +16,8 @@ public interface IFireEquipmentDao extends BaseDao<FireEquipment, Long> {
Optional<FireEquipment> findById(Long id);
@Query(value = "SELECT count(1) FROM `f_fire_station_equipment` WHERE fire_equipment_id in ?1", nativeQuery = true)
int countAssociatedEquipStationByIds(String[] ids);
// @Query(value = "SELECT count(1) FROM `f_fire_station_equipment` WHERE fire_equipment_id in ?1", nativeQuery = true)
// int countAssociatedEquipStationByIds(String[] ids);
Optional<FireEquipment> findByCode(String code);
}
package com.yeejoin.amos.fas.business.dao.repository;
import java.util.Optional;
import org.springframework.stereotype.Repository;
import com.yeejoin.amos.fas.dao.entity.FireEquipmentData;
@Repository("iFireEquipmentDataDao")
public interface IFireEquipmentDataDao extends BaseDao<FireEquipmentData, Long> {
Optional<FireEquipmentData> findById(Long id);
}
//package com.yeejoin.amos.fas.business.dao.repository;
//
//import java.util.Optional;
//
//import org.springframework.stereotype.Repository;
//
//import com.yeejoin.amos.fas.dao.entity.FireEquipmentData;
//
//@Repository("iFireEquipmentDataDao")
//public interface IFireEquipmentDataDao extends BaseDao<FireEquipmentData, Long> {
//
// Optional<FireEquipmentData> findById(Long id);
//
//
//
//}
package com.yeejoin.amos.fas.business.dao.repository;
import java.util.Optional;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint;
@Repository("iFireEquipmentPointDao")
public interface IFireEquipmentPointDao extends BaseDao<FireEquipmentPoint, Long> {
Optional<FireEquipmentPoint> findById(Long id);
FireEquipmentPoint findOneByCode(String pointCode);
int countByCode(String code);
@Query(value = "SELECT count(1) FROM `f_fmea_equipment_point` WHERE equipment_point_id in ?1", nativeQuery = true)
int countImpEquipment(String[] idArray);
@Query(value = "select group_CONCAT(r.name) from f_fmea_equipment_point ep " +
"left join f_fmea f on f.id = ep.fmea_id " +
"left join f_risk_source r on r.id = f.risk_source_id " +
" WHERE ep.equipment_point_id in ?1 ", nativeQuery = true)
String findBindRiskSourceStrByPointIds(String[] idArray);
}
//package com.yeejoin.amos.fas.business.dao.repository;
//
//import java.util.Optional;
//
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.stereotype.Repository;
//
//import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint;
//
//@Repository("iFireEquipmentPointDao")
//public interface IFireEquipmentPointDao extends BaseDao<FireEquipmentPoint, Long> {
//
// Optional<FireEquipmentPoint> findById(Long id);
//
// FireEquipmentPoint findOneByCode(String pointCode);
//
// int countByCode(String code);
//
// @Query(value = "SELECT count(1) FROM `f_fmea_equipment_point` WHERE equipment_point_id in ?1", nativeQuery = true)
// int countImpEquipment(String[] idArray);
//
// @Query(value = "select group_CONCAT(r.name) from f_fmea_equipment_point ep " +
// "left join f_fmea f on f.id = ep.fmea_id " +
// "left join f_risk_source r on r.id = f.risk_source_id " +
// " WHERE ep.equipment_point_id in ?1 ", nativeQuery = true)
// String findBindRiskSourceStrByPointIds(String[] idArray);
//
//}
package com.yeejoin.amos.fas.business.dao.repository;
import java.util.Optional;
import org.springframework.stereotype.Repository;
import com.yeejoin.amos.fas.dao.entity.FireStation;
@Repository("iFireStationDao")
public interface IFireStationDao extends BaseDao<FireStation, Long> {
Optional<FireStation> findById(Long id);
Optional<FireStation> findByCode(String code);
}
//package com.yeejoin.amos.fas.business.dao.repository;
//
//import java.util.Optional;
//
//import org.springframework.stereotype.Repository;
//
//import com.yeejoin.amos.fas.dao.entity.FireStation;
//
//@Repository("iFireStationDao")
//public interface IFireStationDao extends BaseDao<FireStation, Long> {
//
// Optional<FireStation> findById(Long id);
//
// Optional<FireStation> findByCode(String code);
//}
package com.yeejoin.amos.fas.business.dao.repository;
import com.yeejoin.amos.fas.dao.entity.FireStationFireEquipment;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
@Repository("iFireStationEquipmentDao")
public interface IFireStationEquipmentDao extends BaseDao<FireStationFireEquipment, Long> {
@Transactional
@Modifying
@Query(value = "delete FROM `f_fire_station_equipment` WHERE fire_station_id = ?1", nativeQuery = true)
void deleteByStationId(Long id);
}
//package com.yeejoin.amos.fas.business.dao.repository;
//
//import com.yeejoin.amos.fas.dao.entity.FireStationFireEquipment;
//
//import org.springframework.data.jpa.repository.Modifying;
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.stereotype.Repository;
//import org.springframework.transaction.annotation.Transactional;
//
//@Repository("iFireStationEquipmentDao")
//public interface IFireStationEquipmentDao extends BaseDao<FireStationFireEquipment, Long> {
//
// @Transactional
// @Modifying
// @Query(value = "delete FROM `f_fire_station_equipment` WHERE fire_station_id = ?1", nativeQuery = true)
// void deleteByStationId(Long id);
//
//
//}
package com.yeejoin.amos.fas.business.dao.repository;
import java.util.List;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint;
@Repository("iFmeaEquipmentPointDao")
public interface IFmeaEquipmentPointDao extends BaseDao<FmeaEquipmentPoint, Long>{
@Modifying
@Query(value="DELETE fmep FROM `f_fmea_equipment_point` fmep"+
"LEFT JOIN f_fire_equipment_point fep ON fep.id = fmep.equipment_point_id"+
"WHERE fep.fire_equipment_id = ?1 AND fmep.important_equipment_id = ?2", nativeQuery = true)
void removeByFireEquipIdAndEquipId(Long fire_equipment_id,Long importantEquipmentId);
}
//package com.yeejoin.amos.fas.business.dao.repository;
//
//import java.util.List;
//
//import org.springframework.data.jpa.repository.Modifying;
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.stereotype.Repository;
//
//import com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint;
//
//
//@Repository("iFmeaEquipmentPointDao")
//public interface IFmeaEquipmentPointDao extends BaseDao<FmeaEquipmentPoint, Long>{
//
// @Modifying
// @Query(value="DELETE fmep FROM `f_fmea_equipment_point` fmep"+
// "LEFT JOIN f_fire_equipment_point fep ON fep.id = fmep.equipment_point_id"+
// "WHERE fep.fire_equipment_id = ?1 AND fmep.important_equipment_id = ?2", nativeQuery = true)
// void removeByFireEquipIdAndEquipId(Long fire_equipment_id,Long importantEquipmentId);
//}
package com.yeejoin.amos.fas.business.dao.repository;
import com.yeejoin.amos.fas.dao.entity.WaterResource;
import java.util.Optional;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
@Repository("iWaterResourceDao")
public interface IWaterResourceDao extends BaseDao<WaterResource, Long> {
Optional<WaterResource> findById(Long id);
@Query(value = "SELECT count(1) FROM `f_water_resource_equipment` WHERE fire_equipment_id in ?1", nativeQuery = true)
int countAssociatedEquipWaterByIds(String[] ids);
}
//package com.yeejoin.amos.fas.business.dao.repository;
//
//import com.yeejoin.amos.fas.dao.entity.WaterResource;
//
//import java.util.Optional;
//
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.stereotype.Repository;
//
//@Repository("iWaterResourceDao")
//public interface IWaterResourceDao extends BaseDao<WaterResource, Long> {
//
// Optional<WaterResource> findById(Long id);
//
// @Query(value = "SELECT count(1) FROM `f_water_resource_equipment` WHERE fire_equipment_id in ?1", nativeQuery = true)
// int countAssociatedEquipWaterByIds(String[] ids);
//}
package com.yeejoin.amos.fas.business.dao.repository;
import java.util.List;
import java.util.Optional;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.yeejoin.amos.fas.dao.entity.WaterResourceEquipment;
@Repository("iWaterResourceEquipmentDao")
public interface IWaterResourceEquipmentDao extends BaseDao<WaterResourceEquipment, Long> {
Optional<WaterResourceEquipment> findById(Long id);
WaterResourceEquipment findByWaterResourceIdAndFireEquipmentId(Long waterResourceId,Long fireEquipmentId);
int countByWaterResourceIdAndFireEquipmentId(Long waterResourceId,Long fireEquipmentId);
@Transactional
@Modifying
@Query(value = "delete FROM `f_water_resource_equipment` WHERE water_resource_id = ?1", nativeQuery = true)
void deleteByWaterSourceId(Long id);
}
//package com.yeejoin.amos.fas.business.dao.repository;
//
//import java.util.List;
//import java.util.Optional;
//
//import org.springframework.data.jpa.repository.Modifying;
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.stereotype.Repository;
//import org.springframework.transaction.annotation.Transactional;
//
//import com.yeejoin.amos.fas.dao.entity.WaterResourceEquipment;
//
//@Repository("iWaterResourceEquipmentDao")
//public interface IWaterResourceEquipmentDao extends BaseDao<WaterResourceEquipment, Long> {
//
// Optional<WaterResourceEquipment> findById(Long id);
//
// WaterResourceEquipment findByWaterResourceIdAndFireEquipmentId(Long waterResourceId,Long fireEquipmentId);
//
// int countByWaterResourceIdAndFireEquipmentId(Long waterResourceId,Long fireEquipmentId);
//
// @Transactional
// @Modifying
// @Query(value = "delete FROM `f_water_resource_equipment` WHERE water_resource_id = ?1", nativeQuery = true)
// void deleteByWaterSourceId(Long id);
//
//}
......@@ -41,7 +41,7 @@ import com.yeejoin.amos.fas.business.dao.mapper.ImpEquipMapper;
import com.yeejoin.amos.fas.business.dao.repository.IEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IEquipmentFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IFmeaEquipmentPointDao;
//import com.yeejoin.amos.fas.business.dao.repository.IFmeaEquipmentPointDao;
import com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.param.ImgParam;
......@@ -94,8 +94,8 @@ public class EquipmentServiceImpl implements IEquipmentService {
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private IFmeaEquipmentPointDao iFmeaEquipmentPointDao;
// @Autowired
// private IFmeaEquipmentPointDao iFmeaEquipmentPointDao;
// @Autowired
// private MongoTemplate mongoTemplate;
......
......@@ -5,7 +5,7 @@ import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper;
import com.yeejoin.amos.fas.business.dao.mapper.WaterResourceMapper;
//import com.yeejoin.amos.fas.business.dao.mapper.WaterResourceMapper;
import com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao;
import com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity;
import com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity;
......@@ -17,7 +17,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IFireEquipPontService;
import com.yeejoin.amos.fas.business.util.StringUtil;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.dao.entity.RiskSource;
import com.yeejoin.amos.fas.dao.entity.WaterResource;
//import com.yeejoin.amos.fas.dao.entity.WaterResource;
import com.yeejoin.amos.fas.exception.YeeException;
import org.springframework.beans.BeanUtils;
......@@ -45,8 +45,8 @@ public class ExcelServiceImpl implements IExcelService {
@Autowired
private IFireEquipPontService fireEquipPointService;
@Autowired
private WaterResourceMapper waterResourceMapper;
// @Autowired
// private WaterResourceMapper waterResourceMapper;
@Autowired
private IRiskSourceDao riskSourceDao;
......@@ -151,40 +151,40 @@ public class ExcelServiceImpl implements IExcelService {
return pointExcelList;
}
@Override
public void importWaterResource(List<WaterResourceParam> list) {
List<String> codeList = Lists.transform(list, WaterResourceParam::getCode);
Set<String> codeSet = Sets.newHashSet(codeList);
List<WaterResource> waterResources = waterResourceMapper.listByCodes(codeSet);
Map<String, WaterResource> waterResourceMap = Maps.uniqueIndex(waterResources, WaterResource::getCode);
List<WaterResourceParam> saveList = Lists.newArrayList();
List<WaterResourceParam> updateList = Lists.newArrayList();
list.forEach(warerRes -> {
if(!StringUtil.isNotEmpty(warerRes.getName())
|| !StringUtil.isNotEmpty(warerRes.getCode())) {
throw new YeeException("请检查必填项是否为空!");
}
String riskSourceCode = warerRes.getRiskSourceCode();
Optional<RiskSource> riskSourceOptional = riskSourceDao.findByCode(riskSourceCode);
if(riskSourceOptional.isPresent()) {
warerRes.setRiskSourceId(riskSourceOptional.get().getId());
}else {
throw new YeeException("编号: [" + riskSourceCode + "] 风险区域不存在!");
}
String code = warerRes.getCode();
WaterResource waterResource = waterResourceMap.get(code);
if (waterResource == null) {
saveList.add(warerRes);
} else {
warerRes.setId(waterResource.getId());
updateList.add(warerRes);
}
});
if (!CollectionUtils.isEmpty(saveList)) {
waterResourceMapper.saveBatch(saveList);
}
if (!CollectionUtils.isEmpty(updateList)) {
waterResourceMapper.updateBatch(updateList);
}
}
// @Override
// public void importWaterResource(List<WaterResourceParam> list) {
// List<String> codeList = Lists.transform(list, WaterResourceParam::getCode);
// Set<String> codeSet = Sets.newHashSet(codeList);
// List<WaterResource> waterResources = waterResourceMapper.listByCodes(codeSet);
// Map<String, WaterResource> waterResourceMap = Maps.uniqueIndex(waterResources, WaterResource::getCode);
// List<WaterResourceParam> saveList = Lists.newArrayList();
// List<WaterResourceParam> updateList = Lists.newArrayList();
// list.forEach(warerRes -> {
// if(!StringUtil.isNotEmpty(warerRes.getName())
// || !StringUtil.isNotEmpty(warerRes.getCode())) {
// throw new YeeException("请检查必填项是否为空!");
// }
// String riskSourceCode = warerRes.getRiskSourceCode();
// Optional<RiskSource> riskSourceOptional = riskSourceDao.findByCode(riskSourceCode);
// if(riskSourceOptional.isPresent()) {
// warerRes.setRiskSourceId(riskSourceOptional.get().getId());
// }else {
// throw new YeeException("编号: [" + riskSourceCode + "] 风险区域不存在!");
// }
// String code = warerRes.getCode();
// WaterResource waterResource = waterResourceMap.get(code);
// if (waterResource == null) {
// saveList.add(warerRes);
// } else {
// warerRes.setId(waterResource.getId());
// updateList.add(warerRes);
// }
// });
// if (!CollectionUtils.isEmpty(saveList)) {
// waterResourceMapper.saveBatch(saveList);
// }
// if (!CollectionUtils.isEmpty(updateList)) {
// waterResourceMapper.updateBatch(updateList);
// }
// }
}
......@@ -2,7 +2,7 @@ package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentPointDao;
//import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentPointDao;
import com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity;
import com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity;
import com.yeejoin.amos.fas.business.service.intfc.IEquipmentService;
......@@ -12,7 +12,7 @@ import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.core.util.StringUtil;
import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint;
//import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint;
import org.assertj.core.util.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
......@@ -26,8 +26,8 @@ import java.util.Optional;
@Service("fireEquipPoint")
public class FireEquipPointServiceImpl implements IFireEquipPontService {
@Autowired
private IFireEquipmentPointDao fireEquipmentPointDao;
// @Autowired
// private IFireEquipmentPointDao fireEquipmentPointDao;
@Autowired
private FireEquipPointMapper fireEquipPointMapper;
......@@ -38,40 +38,40 @@ public class FireEquipPointServiceImpl implements IFireEquipPontService {
@Autowired
private FireEquipMapper fireEquipMapper;
public FireEquipmentPoint savePoint(FireEquipmentPoint fireEquipmentPoint) {
return fireEquipmentPointDao.save(fireEquipmentPoint);
}
public FireEquipmentPoint queryOne(Long id) {
Optional<FireEquipmentPoint> fireCar1= fireEquipmentPointDao.findById(id);
FireEquipmentPoint fireCar=null;
if(fireCar1.isPresent()){
fireCar=fireCar1.get();
}
return fireCar;
}
@Override
public String[] deletePoint(String[] idArray) throws Exception {
for (String id : idArray) {
Optional<FireEquipmentPoint> fireEquipmentPoint1 = fireEquipmentPointDao.findById(Long.parseLong(id));
FireEquipmentPoint fireEquipmentPoint=null;
if(fireEquipmentPoint1.isPresent()){
fireEquipmentPoint=fireEquipmentPoint1.get();
}
if (fireEquipmentPoint != null) {
this.fireEquipmentPointDao.deleteById(Long.parseLong(id));
} else {
throw new Exception("找不到指定的监测点:" + id);
}
}
return idArray;
}
//
// public FireEquipmentPoint savePoint(FireEquipmentPoint fireEquipmentPoint) {
// return fireEquipmentPointDao.save(fireEquipmentPoint);
// }
// public FireEquipmentPoint queryOne(Long id) {
// Optional<FireEquipmentPoint> fireCar1= fireEquipmentPointDao.findById(id);
// FireEquipmentPoint fireCar=null;
// if(fireCar1.isPresent()){
// fireCar=fireCar1.get();
// }
// return fireCar;
// }
// @Override
// public String[] deletePoint(String[] idArray) throws Exception {
// for (String id : idArray) {
// Optional<FireEquipmentPoint> fireEquipmentPoint1 = fireEquipmentPointDao.findById(Long.parseLong(id));
// FireEquipmentPoint fireEquipmentPoint=null;
//
// if(fireEquipmentPoint1.isPresent()){
// fireEquipmentPoint=fireEquipmentPoint1.get();
// }
//
// if (fireEquipmentPoint != null) {
// this.fireEquipmentPointDao.deleteById(Long.parseLong(id));
// } else {
// throw new Exception("找不到指定的监测点:" + id);
// }
// }
//
// return idArray;
// }
public Page queryByFireEquimt(Long fireEqumntId, String name, CommonPageable pageable) {
......@@ -116,15 +116,15 @@ public class FireEquipPointServiceImpl implements IFireEquipPontService {
return CommonResponseUtil.success();
}
@Override
public CommonResponse save(FireEquipmentPointEntity fireEquipmentPointEntity) {
FireEquipmentPointEntity pointEntity = fireEquipPointMapper.getByCode(fireEquipmentPointEntity.getCode());
if (pointEntity != null) {
return CommonResponseUtil.failure("监测点编号已经存在");
}
fireEquipPointMapper.save(fireEquipmentPointEntity);
return CommonResponseUtil.success();
}
// @Override
// public CommonResponse save(FireEquipmentPointEntity fireEquipmentPointEntity) {
// FireEquipmentPointEntity pointEntity = fireEquipPointMapper.getByCode(fireEquipmentPointEntity.getCode());
// if (pointEntity != null) {
// return CommonResponseUtil.failure("监测点编号已经存在");
// }
// fireEquipPointMapper.save(fireEquipmentPointEntity);
// return CommonResponseUtil.success();
// }
@Override
public CommonResponse update(FireEquipmentPointEntity fireEquipmentPointEntity) {
......@@ -156,14 +156,14 @@ public class FireEquipPointServiceImpl implements IFireEquipPontService {
}
@Override
public int countImpEquipment(String[] idArray) {
return fireEquipmentPointDao.countImpEquipment(idArray);
}
// @Override
// public int countImpEquipment(String[] idArray) {
// return fireEquipmentPointDao.countImpEquipment(idArray);
// }
@Override
public String findBindRiskSourceStrByPointIds(String[] idArray) {
return fireEquipmentPointDao.findBindRiskSourceStrByPointIds(idArray);
}
// @Override
// public String findBindRiskSourceStrByPointIds(String[] idArray) {
// return fireEquipmentPointDao.findBindRiskSourceStrByPointIds(idArray);
// }
}
......@@ -3,8 +3,8 @@ package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.ImpEquipMapper;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireStationDao;
import com.yeejoin.amos.fas.business.dao.repository.IWaterResourceDao;
//import com.yeejoin.amos.fas.business.dao.repository.IFireStationDao;
//import com.yeejoin.amos.fas.business.dao.repository.IWaterResourceDao;
import com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IFireEquipService;
......@@ -13,8 +13,8 @@ import com.yeejoin.amos.fas.common.enums.EquipClassifyEnum;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.response.CommonPage;
import com.yeejoin.amos.fas.dao.entity.FireEquipment;
import com.yeejoin.amos.fas.dao.entity.FireStation;
import com.yeejoin.amos.fas.dao.entity.WaterResource;
//import com.yeejoin.amos.fas.dao.entity.FireStation;
//import com.yeejoin.amos.fas.dao.entity.WaterResource;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
......@@ -38,11 +38,11 @@ public class FireEquipServiceImpl implements IFireEquipService {
@Autowired
ImpEquipMapper impEquipMapper;
@Autowired
IWaterResourceDao iWaterResourceDao;
// @Autowired
// IWaterResourceDao iWaterResourceDao;
@Autowired
IFireStationDao iFireStationDao;
// @Autowired
// IFireStationDao iFireStationDao;
public FireEquipment save(FireEquipment fireEquipment) {
Long id = fireEquipment.getId();
......@@ -146,24 +146,24 @@ public class FireEquipServiceImpl implements IFireEquipService {
switch (fireEquipmentType)
{
case pool:
FireStation fireStation = fireEquipMapper.findFireStationById(id);
fireStation.setType("2");
fireStation.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
returnEntity = fireStation;
break;
case fireFoamRoom:
FireStation fireStation1 = fireEquipMapper.findFireStationById(id);
fireStation1.setType("2");
fireStation1.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
returnEntity = fireStation1;
break;
case fireChamber:
FireStation fireStation11 = fireEquipMapper.findFireStationById(id);
fireStation11.setType("1");
fireStation11.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
returnEntity = fireStation11;
break;
// case pool:
// FireStation fireStation = fireEquipMapper.findFireStationById(id);
// fireStation.setType("2");
// fireStation.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
// returnEntity = fireStation;
// break;
// case fireFoamRoom:
// FireStation fireStation1 = fireEquipMapper.findFireStationById(id);
// fireStation1.setType("2");
// fireStation1.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
// returnEntity = fireStation1;
// break;
// case fireChamber:
// FireStation fireStation11 = fireEquipMapper.findFireStationById(id);
// fireStation11.setType("1");
// fireStation11.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id));
// returnEntity = fireStation11;
// break;
case extinguisher:
case hydrant:
case monitorEquipment:
......@@ -193,10 +193,10 @@ public class FireEquipServiceImpl implements IFireEquipService {
return returnEntity;
}
@Override
public int countAssociatedEquipStationByIds(String[] ids) {
return iFireEquipmentDao.countAssociatedEquipStationByIds(ids);
}
// @Override
// public int countAssociatedEquipStationByIds(String[] ids) {
// return iFireEquipmentDao.countAssociatedEquipStationByIds(ids);
// }
@Override
......
package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.constants.FasConstant;
import com.yeejoin.amos.fas.business.dao.mapper.FireStationEquipmentMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FireStationMapper;
import com.yeejoin.amos.fas.business.dao.repository.IEquipmentFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireStationDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireStationEquipmentDao;
import com.yeejoin.amos.fas.business.service.intfc.IFireStationService;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.dao.entity.FireEquipment;
import com.yeejoin.amos.fas.dao.entity.FireStation;
import com.yeejoin.amos.fas.dao.entity.FireStationFireEquipment;
import com.yeejoin.amos.fas.exception.YeeException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.*;
@Service("fireStationService")
public class FireStationServiceImpl implements IFireStationService {
@Autowired
IFireStationDao iFireStationDao;
@Autowired
FireStationMapper fireStationMapper;
@Autowired
FireStationEquipmentMapper fireStationEquipmentMapper;
@Autowired
IFireStationEquipmentDao iFireStationEquipmentDao;
@Autowired
IFireEquipmentDao iFireEquipmentDao;
@Value("${windows.img.path}")
private String winImgPath;
@Value("${linux.img.path}")
private String linuxImgPath;
public FireStation save(FireStation fireStation) {
Long id = fireStation.getId();
iFireStationDao.saveAndFlush(fireStation);
return fireStation;
}
public List<FireStationFireEquipment> saveStationFireEquipment(
List<FireStationFireEquipment> fireStationFireEquipments) throws Exception {
for (FireStationFireEquipment fireStationFireEquipment : fireStationFireEquipments) {
Optional<FireStation> fireStation1 = iFireStationDao.findById(fireStationFireEquipment.getFireStationId());
Optional<FireEquipment> fireEquipment1 = iFireEquipmentDao.findById(fireStationFireEquipment.getFireEquipmentId());
FireStation fireStation=null;
FireEquipment fireEquipment=null;
if(fireStation1.isPresent()){
fireStation=fireStation1.get();
}
if(fireEquipment1.isPresent()){
fireEquipment=fireEquipment1.get();
}
if (fireStation == null)
throw new Exception("找不到指定的消防站");
if (fireEquipment == null)
throw new Exception("消防设备不存在");
// if (!CollectionUtils.isEmpty(map))
// throw new Exception("绑定关系已经存在.");
Map map = fireStationEquipmentMapper.queryRelation(fireStationFireEquipment.getFireStationId(),
fireStationFireEquipment.getFireEquipmentId());
if (!CollectionUtils.isEmpty(map)) {
if(fireEquipment.getEquipClassify() == 1) {//耗材类
Long stationEquiId = (Long) map.get("id");
Double number = (Double) map.get("number");//当前数量
Double number2 = fireStationFireEquipment.getNumber();//添加的数量
Double number3 = (double)fireEquipment.getNumber();//库存
Double diff = number3 - number2;
if(diff < 0){
throw new Exception("添加数量超过现有数量!.");
}else {
Double curNumber = number + number2;
fireStationEquipmentMapper.updateNumberById(stationEquiId,curNumber);
fireEquipment.setNumber(diff.intValue());
iFireEquipmentDao.saveAndFlush(fireEquipment);
}
}
}else {
fireStationFireEquipment = iFireStationEquipmentDao.save(fireStationFireEquipment);
}
}
return fireStationFireEquipments;
}
public void deleteStationFireEquipment(List<FireStationFireEquipment> fireStationFireEquipments) throws Exception {
for (FireStationFireEquipment fireStationFireEquipment : fireStationFireEquipments) {
Map map = fireStationEquipmentMapper.queryRelation(fireStationFireEquipment.getFireStationId(),
fireStationFireEquipment.getFireEquipmentId());
if (!CollectionUtils.isEmpty(map)) {
Long id = Long.parseLong(String.valueOf(map.get("id")));
this.iFireStationEquipmentDao.deleteById(id);
} else {
throw new Exception("指定的数据不存在.");
}
}
}
public Map queryOne(Long id) {
return fireStationMapper.queryOne(id);
}
public Page queryForFireEquemtPage(Long fireStationId, CommonPageable pageable) {
Long total = fireStationMapper.queryCountForFireEqumntPage(fireStationId);
List<Map> content = fireStationMapper.queryForFireEqumntPage(fireStationId, pageable.getOffset(),
pageable.getPageSize());
Page result = new PageImpl(content, pageable, total);
return result;
}
@Transactional
public String[] delete(String[] idArray) throws Exception {
for (String id : idArray) {
Optional<FireStation> fireStation1 = iFireStationDao.findById(Long.parseLong(id));
FireStation fireStation=null;
if(fireStation1.isPresent()){
fireStation=fireStation1.get();
}
iFireStationEquipmentDao.deleteByStationId(Long.valueOf(id));
if (fireStation != null) {
this.iFireStationDao.deleteById(Long.parseLong(id));
} else {
throw new Exception("找不到指定的监测点:" + id);
}
}
return idArray;
}
public Page queryForPage(String username, String code, String type, CommonPageable pageable) {
Long total = fireStationMapper.queryCountForPage(username, code, type);
List<Map> content = fireStationMapper.queryForPage(username, code, type, pageable.getOffset(),
pageable.getPageSize());
Page result = new PageImpl(content, pageable, total);
return result;
}
public List<Map> queryForList(String username, String code, String type) {
List<Map> content = fireStationMapper.queryForList(username, code, type);
return content;
}
@Override
public FireStation saveAndUpd(FireStation fireStation, MultipartFile[] files) {
fireStation.setCreateDate(new Date());
fireStation = save(fireStation);
if (files != null && files.length > 0) {
for (int i = 0; i < files.length; i++) {
String picture = fireStation.getPicture();
MultipartFile file = files[i];
if (file.isEmpty()) {
continue;
}
String path = FasConstant.UPLOAD_ROOT_PATH + File.separator + FasConstant.UPLOAD_FIRESTATION_PATH+
File.separator +fireStation.getName();
String filePath = getRootPath() + path;
String fileName = File.separator + file.getOriginalFilename();
try {
File dest = new File(filePath + File.separator + fileName);
if (!dest.exists()) {
if (dest.getParentFile() != null && !dest.getParentFile().exists()) {
dest.getParentFile().mkdirs();
}
dest.createNewFile();
}
file.transferTo(dest);
} catch (IOException e) {
throw new YeeException("上传图片失败");
}
String photoFile = path + fileName;
// try{
// photoFile = URLEncoder.encode(photoFile, "utf-8");
// } catch (UnsupportedEncodingException e){
// throw new YeeException("字符转义失败 ");
// }
if ( picture != null && picture != "") {
picture += "," + photoFile;
} else {
picture = photoFile;
}
fireStation.setPicture(picture);
}
fireStation = save(fireStation);
}
return fireStation;
}
private String getRootPath() {
String localPath = "";
if ("\\".equals(File.separator)) {
localPath += winImgPath;
} else if ("/".equals(File.separator)) {
localPath += linuxImgPath;
}
return localPath.trim();
}
@Override
public Map queryForEuqimentListById(Long id) {
Map<String,Object> result = new HashMap<String, Object>();
result.put("fireStation", fireStationMapper.queryOne(id));
result.put("EquipmentList", fireStationMapper.queryEquipCountById(id));
return result;
}
@Override
public Boolean isExistByCode(String code) {
Optional<FireStation> optional = iFireStationDao.findByCode(code);
return optional.isPresent();
}
}
//package com.yeejoin.amos.fas.business.service.impl;
//
//import com.yeejoin.amos.fas.business.constants.FasConstant;
//import com.yeejoin.amos.fas.business.dao.mapper.FireStationEquipmentMapper;
//import com.yeejoin.amos.fas.business.dao.mapper.FireStationMapper;
//import com.yeejoin.amos.fas.business.dao.repository.IEquipmentFireEquipmentDao;
//import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao;
//import com.yeejoin.amos.fas.business.dao.repository.IFireStationDao;
//import com.yeejoin.amos.fas.business.dao.repository.IFireStationEquipmentDao;
//import com.yeejoin.amos.fas.business.service.intfc.IFireStationService;
//import com.yeejoin.amos.fas.core.common.request.CommonPageable;
//import com.yeejoin.amos.fas.dao.entity.FireEquipment;
//import com.yeejoin.amos.fas.dao.entity.FireStation;
//import com.yeejoin.amos.fas.dao.entity.FireStationFireEquipment;
//import com.yeejoin.amos.fas.exception.YeeException;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.data.domain.Page;
//import org.springframework.data.domain.PageImpl;
//import org.springframework.stereotype.Service;
//import org.springframework.transaction.annotation.Transactional;
//import org.springframework.util.CollectionUtils;
//import org.springframework.web.multipart.MultipartFile;
//
//import java.io.File;
//import java.io.IOException;
//import java.io.UnsupportedEncodingException;
//import java.net.URLEncoder;
//import java.util.*;
//
//@Service("fireStationService")
//public class FireStationServiceImpl implements IFireStationService {
//
// @Autowired
// IFireStationDao iFireStationDao;
//
// @Autowired
// FireStationMapper fireStationMapper;
//
// @Autowired
// FireStationEquipmentMapper fireStationEquipmentMapper;
//
// @Autowired
// IFireStationEquipmentDao iFireStationEquipmentDao;
//
// @Autowired
// IFireEquipmentDao iFireEquipmentDao;
//
// @Value("${windows.img.path}")
// private String winImgPath;
//
// @Value("${linux.img.path}")
// private String linuxImgPath;
//
// public FireStation save(FireStation fireStation) {
// Long id = fireStation.getId();
// iFireStationDao.saveAndFlush(fireStation);
// return fireStation;
// }
//
// public List<FireStationFireEquipment> saveStationFireEquipment(
// List<FireStationFireEquipment> fireStationFireEquipments) throws Exception {
//
// for (FireStationFireEquipment fireStationFireEquipment : fireStationFireEquipments) {
// Optional<FireStation> fireStation1 = iFireStationDao.findById(fireStationFireEquipment.getFireStationId());
// Optional<FireEquipment> fireEquipment1 = iFireEquipmentDao.findById(fireStationFireEquipment.getFireEquipmentId());
// FireStation fireStation=null;
// FireEquipment fireEquipment=null;
// if(fireStation1.isPresent()){
// fireStation=fireStation1.get();
// }
// if(fireEquipment1.isPresent()){
// fireEquipment=fireEquipment1.get();
// }
//
// if (fireStation == null)
// throw new Exception("找不到指定的消防站");
// if (fireEquipment == null)
// throw new Exception("消防设备不存在");
//
//// if (!CollectionUtils.isEmpty(map))
//// throw new Exception("绑定关系已经存在.");
//
// Map map = fireStationEquipmentMapper.queryRelation(fireStationFireEquipment.getFireStationId(),
// fireStationFireEquipment.getFireEquipmentId());
// if (!CollectionUtils.isEmpty(map)) {
// if(fireEquipment.getEquipClassify() == 1) {//耗材类
//
// Long stationEquiId = (Long) map.get("id");
// Double number = (Double) map.get("number");//当前数量
// Double number2 = fireStationFireEquipment.getNumber();//添加的数量
// Double number3 = (double)fireEquipment.getNumber();//库存
// Double diff = number3 - number2;
// if(diff < 0){
// throw new Exception("添加数量超过现有数量!.");
// }else {
// Double curNumber = number + number2;
// fireStationEquipmentMapper.updateNumberById(stationEquiId,curNumber);
// fireEquipment.setNumber(diff.intValue());
// iFireEquipmentDao.saveAndFlush(fireEquipment);
// }
// }
// }else {
// fireStationFireEquipment = iFireStationEquipmentDao.save(fireStationFireEquipment);
// }
//
//
//
// }
// return fireStationFireEquipments;
// }
//
// public void deleteStationFireEquipment(List<FireStationFireEquipment> fireStationFireEquipments) throws Exception {
//
// for (FireStationFireEquipment fireStationFireEquipment : fireStationFireEquipments) {
// Map map = fireStationEquipmentMapper.queryRelation(fireStationFireEquipment.getFireStationId(),
// fireStationFireEquipment.getFireEquipmentId());
// if (!CollectionUtils.isEmpty(map)) {
// Long id = Long.parseLong(String.valueOf(map.get("id")));
// this.iFireStationEquipmentDao.deleteById(id);
//
// } else {
// throw new Exception("指定的数据不存在.");
// }
// }
// }
//
// public Map queryOne(Long id) {
// return fireStationMapper.queryOne(id);
// }
//
// public Page queryForFireEquemtPage(Long fireStationId, CommonPageable pageable) {
// Long total = fireStationMapper.queryCountForFireEqumntPage(fireStationId);
// List<Map> content = fireStationMapper.queryForFireEqumntPage(fireStationId, pageable.getOffset(),
// pageable.getPageSize());
// Page result = new PageImpl(content, pageable, total);
// return result;
// }
//
// @Transactional
// public String[] delete(String[] idArray) throws Exception {
// for (String id : idArray) {
// Optional<FireStation> fireStation1 = iFireStationDao.findById(Long.parseLong(id));
// FireStation fireStation=null;
// if(fireStation1.isPresent()){
// fireStation=fireStation1.get();
// }
// iFireStationEquipmentDao.deleteByStationId(Long.valueOf(id));
// if (fireStation != null) {
// this.iFireStationDao.deleteById(Long.parseLong(id));
// } else {
// throw new Exception("找不到指定的监测点:" + id);
// }
// }
//
// return idArray;
// }
//
// public Page queryForPage(String username, String code, String type, CommonPageable pageable) {
// Long total = fireStationMapper.queryCountForPage(username, code, type);
// List<Map> content = fireStationMapper.queryForPage(username, code, type, pageable.getOffset(),
// pageable.getPageSize());
// Page result = new PageImpl(content, pageable, total);
// return result;
// }
//
// public List<Map> queryForList(String username, String code, String type) {
// List<Map> content = fireStationMapper.queryForList(username, code, type);
//
// return content;
// }
//
// @Override
// public FireStation saveAndUpd(FireStation fireStation, MultipartFile[] files) {
// fireStation.setCreateDate(new Date());
// fireStation = save(fireStation);
// if (files != null && files.length > 0) {
// for (int i = 0; i < files.length; i++) {
// String picture = fireStation.getPicture();
// MultipartFile file = files[i];
// if (file.isEmpty()) {
// continue;
// }
// String path = FasConstant.UPLOAD_ROOT_PATH + File.separator + FasConstant.UPLOAD_FIRESTATION_PATH+
// File.separator +fireStation.getName();
//
// String filePath = getRootPath() + path;
// String fileName = File.separator + file.getOriginalFilename();
// try {
// File dest = new File(filePath + File.separator + fileName);
// if (!dest.exists()) {
// if (dest.getParentFile() != null && !dest.getParentFile().exists()) {
// dest.getParentFile().mkdirs();
// }
// dest.createNewFile();
// }
// file.transferTo(dest);
// } catch (IOException e) {
// throw new YeeException("上传图片失败");
// }
//
// String photoFile = path + fileName;
//// try{
//// photoFile = URLEncoder.encode(photoFile, "utf-8");
//// } catch (UnsupportedEncodingException e){
//// throw new YeeException("字符转义失败 ");
//// }
//
// if ( picture != null && picture != "") {
// picture += "," + photoFile;
// } else {
// picture = photoFile;
// }
// fireStation.setPicture(picture);
// }
// fireStation = save(fireStation);
//
// }
//
// return fireStation;
// }
//
// private String getRootPath() {
// String localPath = "";
// if ("\\".equals(File.separator)) {
// localPath += winImgPath;
// } else if ("/".equals(File.separator)) {
// localPath += linuxImgPath;
// }
// return localPath.trim();
// }
//
// @Override
// public Map queryForEuqimentListById(Long id) {
// Map<String,Object> result = new HashMap<String, Object>();
// result.put("fireStation", fireStationMapper.queryOne(id));
// result.put("EquipmentList", fireStationMapper.queryEquipCountById(id));
// return result;
// }
//
// @Override
// public Boolean isExistByCode(String code) {
// Optional<FireStation> optional = iFireStationDao.findByCode(code);
// return optional.isPresent();
// }
//
//}
package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.dao.mapper.FireStrengthMapper;
import com.yeejoin.amos.fas.business.dao.repository.FireStrengthPointDao;
import com.yeejoin.amos.fas.business.service.intfc.FireStengthService;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.dao.entity.FireStrength;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@Service("fireStengthService")
public class FireStrengthServiceImpl implements FireStengthService {
@Autowired
private FireStrengthPointDao fireStrengthPointDao;
@Autowired
private FireStrengthMapper fireStrengthMapper;
public FireStrength savePoint(FireStrength fireEquipmentPoint) {
return fireStrengthPointDao.save(fireEquipmentPoint);
}
public Map queryOne(Long id) {
return fireStrengthMapper.queryOne(id);
}
public String[] deletePoint(String[] idArray) throws Exception {
for (String id : idArray) {
Optional<FireStrength> fireEquipmentPoint1 = fireStrengthPointDao.findById(Long.parseLong(id));
FireStrength fireEquipmentPoint = null;
if (fireEquipmentPoint1.isPresent()) {
fireEquipmentPoint = fireEquipmentPoint1.get();
}
if (fireEquipmentPoint != null) {
this.fireStrengthPointDao.deleteById(Long.parseLong(id));
} else {
throw new Exception("找不到指定的监测点:" + id);
}
}
return idArray;
}
public Page queryByFireEquimt(String username, String code, CommonPageable pageable) {
Long total = fireStrengthMapper.queryCountForPage(username, code);
List<Map> content = fireStrengthMapper.queryForPage(username, code, pageable.getOffset(),
pageable.getPageSize());
Page result = new PageImpl(content, pageable, total);
return result;
}
public List<FireStrength> queryForStrengthList(String time) {
return fireStrengthMapper.queryForStrengthList(time);
}
}
//package com.yeejoin.amos.fas.business.service.impl;
//
//import com.yeejoin.amos.fas.business.dao.mapper.FireStrengthMapper;
//import com.yeejoin.amos.fas.business.dao.repository.FireStrengthPointDao;
//import com.yeejoin.amos.fas.business.service.intfc.FireStengthService;
//import com.yeejoin.amos.fas.core.common.request.CommonPageable;
//import com.yeejoin.amos.fas.dao.entity.FireStrength;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.domain.Page;
//import org.springframework.data.domain.PageImpl;
//import org.springframework.stereotype.Service;
//
//import java.util.List;
//import java.util.Map;
//import java.util.Optional;
//
//@Service("fireStengthService")
//public class FireStrengthServiceImpl implements FireStengthService {
//
// @Autowired
// private FireStrengthPointDao fireStrengthPointDao;
// @Autowired
// private FireStrengthMapper fireStrengthMapper;
//
// public FireStrength savePoint(FireStrength fireEquipmentPoint) {
// return fireStrengthPointDao.save(fireEquipmentPoint);
// }
//
// public Map queryOne(Long id) {
// return fireStrengthMapper.queryOne(id);
// }
//
// public String[] deletePoint(String[] idArray) throws Exception {
// for (String id : idArray) {
// Optional<FireStrength> fireEquipmentPoint1 = fireStrengthPointDao.findById(Long.parseLong(id));
// FireStrength fireEquipmentPoint = null;
// if (fireEquipmentPoint1.isPresent()) {
// fireEquipmentPoint = fireEquipmentPoint1.get();
// }
// if (fireEquipmentPoint != null) {
// this.fireStrengthPointDao.deleteById(Long.parseLong(id));
// } else {
// throw new Exception("找不到指定的监测点:" + id);
// }
// }
//
// return idArray;
// }
//
// public Page queryByFireEquimt(String username, String code, CommonPageable pageable) {
// Long total = fireStrengthMapper.queryCountForPage(username, code);
// List<Map> content = fireStrengthMapper.queryForPage(username, code, pageable.getOffset(),
// pageable.getPageSize());
// Page result = new PageImpl(content, pageable, total);
// return result;
// }
//
// public List<FireStrength> queryForStrengthList(String time) {
// return fireStrengthMapper.queryForStrengthList(time);
// }
//
//}
......@@ -141,11 +141,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Autowired
IContingencyOriginalDataDao iContingencyOriginalDataDao;
@Autowired
IFireEquipmentPointDao iFireEquipmentPointDao;
// @Autowired
// IFireEquipmentPointDao iFireEquipmentPointDao;
@Autowired
IFireEquipmentDataDao iFireEquipmentDataDao;
// @Autowired
// IFireEquipmentDataDao iFireEquipmentDataDao;
@Autowired
private RemoteWebSocketServer remoteWebSocketServer;
......@@ -836,7 +836,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
// cacheMap.setex(TOKE, toke, times);
// }
// log.error("rule token ", toke.toString());
processDeivceData(deviceData);
// processDeivceData(deviceData);
} catch (Exception e) {
log.error("parse alarmParam happened error", e);
// 失败处理
......@@ -848,52 +848,52 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
private void processDeivceData(AlarmParam deviceData) {
//处理设备和巡检数据
deviceData.setNodeState(deviceData.getState());
FireEquipmentPoint fireEquipmentPoint = iFireEquipmentPointDao.findOneByCode(deviceData.getPointCode());
if (!ObjectUtils.isEmpty(fireEquipmentPoint)) {
fireEquipmentPoint.setValue(deviceData.getState());
updateFirePointValue(fireEquipmentPoint.getId(), deviceData.getState());//不需要
String fireEquipmentPointType = null;
if (!ObjectUtils.isEmpty(fireEquipmentPoint.getAlarmType())) {
Dict dict = dictDao.getOne(fireEquipmentPoint.getAlarmType());
fireEquipmentPointType = dict.getDictValue();
}
// 根据监测点获取监测点设备信息
Optional<FireEquipment> fireEquipment1 = this.iFireEquipmentDao.findById(fireEquipmentPoint.getFireEquipmentId());
FireEquipment fireEquipment = null;
if (fireEquipment1.isPresent()) {
fireEquipment = fireEquipment1.get();
}
Equipment equipment = null;
if (fireEquipment != null) {
Toke toke = remoteSecurityService.getServerToken();
//保存实时数据
// 根据监测点设备信息获取保护的重点装备
equipment = impAndFireEquipMapper.queryImpEqumtByFireEquipmt(fireEquipmentPoint.getFireEquipmentId());
deviceData.setMonitor(equipment != null ? equipment.getName() : "");
deviceData.setId(String.valueOf(fireEquipment.getId()));
deviceData.setCode(fireEquipment.getCode());
saveFireEquipmentData(fireEquipmentPoint, fireEquipment, deviceData, fireEquipmentPointType, toke);
DeviceRo deviceRo = new DeviceRo();
deviceRo.setEquipmentId(equipment.getId());
deviceRo.setPointCode(deviceData.getPointCode());
deviceRo.setValue(deviceData.getState());
triggerPlanDevice(deviceRo, equipment, toke);
Boolean have = impAndFireEquipMapper.existsAlarmPointByEqpPointIdAndEquipId(fireEquipmentPoint.getId(), equipment.getId());//判断重点设备关联该指标项,需要修改为新查询
if (!ObjectUtils.isEmpty(have) && have) {
//动态预案执行
dynamicPlan(deviceData, equipment, fireEquipment, toke);
}
}
}
}
// private void processDeivceData(AlarmParam deviceData) {
// //处理设备和巡检数据
// deviceData.setNodeState(deviceData.getState());
// FireEquipmentPoint fireEquipmentPoint = iFireEquipmentPointDao.findOneByCode(deviceData.getPointCode());
// if (!ObjectUtils.isEmpty(fireEquipmentPoint)) {
//
// fireEquipmentPoint.setValue(deviceData.getState());
// updateFirePointValue(fireEquipmentPoint.getId(), deviceData.getState());//不需要
//
// String fireEquipmentPointType = null;
// if (!ObjectUtils.isEmpty(fireEquipmentPoint.getAlarmType())) {
// Dict dict = dictDao.getOne(fireEquipmentPoint.getAlarmType());
// fireEquipmentPointType = dict.getDictValue();
// }
//
// // 根据监测点获取监测点设备信息
// Optional<FireEquipment> fireEquipment1 = this.iFireEquipmentDao.findById(fireEquipmentPoint.getFireEquipmentId());
// FireEquipment fireEquipment = null;
// if (fireEquipment1.isPresent()) {
// fireEquipment = fireEquipment1.get();
// }
//
// Equipment equipment = null;
// if (fireEquipment != null) {
// Toke toke = remoteSecurityService.getServerToken();
// //保存实时数据
// // 根据监测点设备信息获取保护的重点装备
// equipment = impAndFireEquipMapper.queryImpEqumtByFireEquipmt(fireEquipmentPoint.getFireEquipmentId());
// deviceData.setMonitor(equipment != null ? equipment.getName() : "");
// deviceData.setId(String.valueOf(fireEquipment.getId()));
// deviceData.setCode(fireEquipment.getCode());
// saveFireEquipmentData(fireEquipmentPoint, fireEquipment, deviceData, fireEquipmentPointType, toke);
// DeviceRo deviceRo = new DeviceRo();
// deviceRo.setEquipmentId(equipment.getId());
// deviceRo.setPointCode(deviceData.getPointCode());
// deviceRo.setValue(deviceData.getState());
// triggerPlanDevice(deviceRo, equipment, toke);
// Boolean have = impAndFireEquipMapper.existsAlarmPointByEqpPointIdAndEquipId(fireEquipmentPoint.getId(), equipment.getId());//判断重点设备关联该指标项,需要修改为新查询
// if (!ObjectUtils.isEmpty(have) && have) {
// //动态预案执行
// dynamicPlan(deviceData, equipment, fireEquipment, toke);
// }
// }
// }
//
// }
/**
* 预案执行
......@@ -1029,7 +1029,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
private void saveFireEquipmentData(FireEquipmentPoint fireEquipmentPoint, FireEquipment fireEquipment, AlarmParam deviceData, String fireEquipmentPointType, Toke toke) {
// private void saveFireEquipmentData(FireEquipmentPoint fireEquipmentPoint, FireEquipment fireEquipment, AlarmParam deviceData, String fireEquipmentPointType, Toke toke) {
// if ("alarm_type_fire".equals(fireEquipmentPointType) || "alarm_type_trouble".equals(fireEquipmentPointType)) {
// Alarm alarm = iAlarmDao.findByStatusTrueAndFireEquipmentPointCode(deviceData.getPointCode());
// if (alarm != null) {
......@@ -1112,96 +1112,96 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
// list.add(deviceData);
// //保存所有数据(遥测,遥信)到mongo
// saveData(list, "soe");
}
// }
@Override
public void saveData(List<AlarmParam> deviceDatas, String type) {
List<EquipCommunicationData> list = deviceDatas.stream().map(param -> {
log.debug("pointCode==" + param.getPointCode() + " InformationAddress==" + param.getInformationAddress());
// 格式化发送数据
sendRiskSourceData(param);
if (ObjectUtils.isEmpty(param.getPointCode())) {
EquipCommunicationData data = new EquipCommunicationData();
data.setIsInvalid(param.getIsInvalid());
data.setInformationAddress(param.getInformationAddress());
data.setRecDate(new Date());
data.setState(param.getState());
data.setSoe(param.getSoe());
data.setServiceId(param.getServiceId());
return data;
}
EquipCommunicationData data = equipmentService.findFireEquipmentByPointCode(param.getPointCode());
if (ObjectUtils.isEmpty(data)) {
return null;
}
data.setIsInvalid(param.getIsInvalid());
data.setInformationAddress(param.getInformationAddress());
data.setRecDate(new Date());
data.setState(param.getState());
data.setSoe(param.getSoe());
data.setServiceId(param.getServiceId());
if ("all".equals(type)) {
FireEquipmentPoint fireEquipmentPoint = iFireEquipmentPointDao.findOneByCode(param.getPointCode());
Dict dict = null;
if (fireEquipmentPoint.getAlarmType() != null) {
Optional<Dict> dict1 = dictDao.findById(fireEquipmentPoint.getAlarmType());
if (dict1.isPresent()) {
dict = dict1.get();
}
}
if (!param.getState().equals(fireEquipmentPoint.getValue())) {
fireEquipmentPoint.setValue(param.getState());
updateFirePointValue(fireEquipmentPoint.getId(), param.getState());
Equipment equipment = impAndFireEquipMapper.queryImpEqumtByFireEquipmt(Long.valueOf(data.getFireEquipmentId()));
if (!ObjectUtils.isEmpty(equipment)) {
if (dict != null && dict.getDictValue().equals("alarm_type_trouble")) {
notifyAlarm(fireEquipmentPoint, param);
}
}
}
}
if ("ANALOGUE".equals(data.getType())) {
sendAnalogue(data);
}
return data;
}).filter(param -> !ObjectUtils.isEmpty(param)).collect(Collectors.toList());
// equipCommunicationDao.saveAll(list);
}
// @Override
// public void saveData(List<AlarmParam> deviceDatas, String type) {
// List<EquipCommunicationData> list = deviceDatas.stream().map(param -> {
//
// log.debug("pointCode==" + param.getPointCode() + " InformationAddress==" + param.getInformationAddress());
//
// // 格式化发送数据
// sendRiskSourceData(param);
//
// if (ObjectUtils.isEmpty(param.getPointCode())) {
// EquipCommunicationData data = new EquipCommunicationData();
// data.setIsInvalid(param.getIsInvalid());
// data.setInformationAddress(param.getInformationAddress());
// data.setRecDate(new Date());
// data.setState(param.getState());
// data.setSoe(param.getSoe());
// data.setServiceId(param.getServiceId());
// return data;
// }
// EquipCommunicationData data = equipmentService.findFireEquipmentByPointCode(param.getPointCode());
// if (ObjectUtils.isEmpty(data)) {
// return null;
// }
// data.setIsInvalid(param.getIsInvalid());
// data.setInformationAddress(param.getInformationAddress());
// data.setRecDate(new Date());
// data.setState(param.getState());
// data.setSoe(param.getSoe());
// data.setServiceId(param.getServiceId());
//
// if ("all".equals(type)) {
// FireEquipmentPoint fireEquipmentPoint = iFireEquipmentPointDao.findOneByCode(param.getPointCode());
// Dict dict = null;
// if (fireEquipmentPoint.getAlarmType() != null) {
// Optional<Dict> dict1 = dictDao.findById(fireEquipmentPoint.getAlarmType());
// if (dict1.isPresent()) {
// dict = dict1.get();
// }
// }
// if (!param.getState().equals(fireEquipmentPoint.getValue())) {
// fireEquipmentPoint.setValue(param.getState());
// updateFirePointValue(fireEquipmentPoint.getId(), param.getState());
// Equipment equipment = impAndFireEquipMapper.queryImpEqumtByFireEquipmt(Long.valueOf(data.getFireEquipmentId()));
// if (!ObjectUtils.isEmpty(equipment)) {
// if (dict != null && dict.getDictValue().equals("alarm_type_trouble")) {
// notifyAlarm(fireEquipmentPoint, param);
// }
// }
// }
// }
// if ("ANALOGUE".equals(data.getType())) {
// sendAnalogue(data);
// }
//
// return data;
// }).filter(param -> !ObjectUtils.isEmpty(param)).collect(Collectors.toList());
//// equipCommunicationDao.saveAll(list);
// }
/**
* 设备告警触发fema的sod值
*/
private void notifyAlarm(FireEquipmentPoint fireEquipmentPoint, AlarmParam param) {
List<FmeaEquipmentPoint> fmeaEquipmentPoints = fmeaEquipmentPointMapper.listByEquipmentPointId(fireEquipmentPoint.getId());
Set<Long> fmeaIds = Sets.newHashSet();
List<Long> ids = Lists.newArrayList();
fmeaEquipmentPoints.forEach(fmeaEquipmentPoint -> {
ids.add(fmeaEquipmentPoint.getId());
fmeaIds.add(fmeaEquipmentPoint.getFmeaId());
});
Integer state = null;
if (param.getState().equals("true")) {
state = 1;
} else if (param.getState().equals("false")) {
state = 0;
}
if (state != null) {
if (ids.size() > 0) {
fmeaEquipmentPointMapper.updateStateByIds(state, ids);
}
final Integer st = state;
String monitor = fireEquipMapper.findById(fireEquipPointMapper.getByCode(param.getPointCode()).getFireEquipmentId()).getName();
RsDataQueue rsDataQueue = RsDataQueue.getInstance();
fmeaIds.forEach(fmeaId -> rsDataQueue.addEquipmentMessage(fmeaId, monitor, st));
}
}
// private void notifyAlarm(FireEquipmentPoint fireEquipmentPoint, AlarmParam param) {
// List<FmeaEquipmentPoint> fmeaEquipmentPoints = fmeaEquipmentPointMapper.listByEquipmentPointId(fireEquipmentPoint.getId());
// Set<Long> fmeaIds = Sets.newHashSet();
// List<Long> ids = Lists.newArrayList();
// fmeaEquipmentPoints.forEach(fmeaEquipmentPoint -> {
// ids.add(fmeaEquipmentPoint.getId());
// fmeaIds.add(fmeaEquipmentPoint.getFmeaId());
// });
// Integer state = null;
// if (param.getState().equals("true")) {
// state = 1;
// } else if (param.getState().equals("false")) {
// state = 0;
// }
//
// if (state != null) {
// if (ids.size() > 0) {
// fmeaEquipmentPointMapper.updateStateByIds(state, ids);
// }
// final Integer st = state;
// String monitor = fireEquipMapper.findById(fireEquipPointMapper.getByCode(param.getPointCode()).getFireEquipmentId()).getName();
// RsDataQueue rsDataQueue = RsDataQueue.getInstance();
// fmeaIds.forEach(fmeaId -> rsDataQueue.addEquipmentMessage(fmeaId, monitor, st));
// }
// }
@Autowired
private WebMqttComponent webMqttComponent;
......
......@@ -47,11 +47,11 @@ import com.yeejoin.amos.fas.business.dao.mapper.RiskSourceMapper;
import com.yeejoin.amos.fas.business.dao.mapper.View3dMapper;
import com.yeejoin.amos.fas.business.dao.repository.IEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireStationDao;
//import com.yeejoin.amos.fas.business.dao.repository.IFireStationDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao;
import com.yeejoin.amos.fas.business.dao.repository.ISafetyIndexChangeLogDao;
import com.yeejoin.amos.fas.business.dao.repository.IWaterResourceDao;
//import com.yeejoin.amos.fas.business.dao.repository.IWaterResourceDao;
import com.yeejoin.amos.fas.business.feign.IDutyModeServer;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService;
......@@ -81,11 +81,11 @@ import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.core.util.StringUtil;
import com.yeejoin.amos.fas.dao.entity.Equipment;
import com.yeejoin.amos.fas.dao.entity.FireEquipment;
import com.yeejoin.amos.fas.dao.entity.FireStation;
//import com.yeejoin.amos.fas.dao.entity.FireStation;
import com.yeejoin.amos.fas.dao.entity.RiskLevel;
import com.yeejoin.amos.fas.dao.entity.RiskSource;
import com.yeejoin.amos.fas.dao.entity.SafetyIndexChangeLog;
import com.yeejoin.amos.fas.dao.entity.WaterResource;
//import com.yeejoin.amos.fas.dao.entity.WaterResource;
import com.yeejoin.amos.fas.exception.YeeException;
import io.swagger.annotations.ApiOperation;
......@@ -104,12 +104,12 @@ public class View3dServiceImpl implements IView3dService {
private IRiskSourceDao iRiskSourceDao;
@Autowired
private IFireEquipmentDao iFireEquipmentDao;
@Autowired
private IFireStationDao iFireStationDao;
// @Autowired
// private IFireStationDao iFireStationDao;
@Autowired
private IEquipmentDao iEquipmentDao;
@Autowired
private IWaterResourceDao iWaterResourceDao;
// @Autowired
// private IWaterResourceDao iWaterResourceDao;
@Autowired
private PatrolMapper patrolMapper;
@Autowired
......@@ -162,11 +162,11 @@ public class View3dServiceImpl implements IView3dService {
this.updateFireCarPosition(pointBo);
case "fireChamber":
case "fireFoamRoom":
this.updateFireStationPosition(pointBo);
break;
// this.updateFireStationPosition(pointBo);
// break;
case "hydrant":
case "pool":
this.updateWaterSourcePosition(pointBo);
// case "pool":
// this.updateWaterSourcePosition(pointBo);
break;
default:
log.error("不支持的类型-->" + pointType);
......@@ -188,33 +188,33 @@ public class View3dServiceImpl implements IView3dService {
// }
}
public void updateWaterSourcePosition(BindPointBo pointBo) {
Optional<WaterResource> data = iWaterResourceDao.findById(pointBo.getPointId());
if(data.isPresent()){
WaterResource waterResource = data.get();
String ue4Location = pointBo.getUe4Location();
String ue4Rotation = pointBo.getUe4Rotation();
String position3d = pointBo.getPosition3d();
if(ue4Location != null) waterResource.setUe4Location(ue4Location);
if(ue4Rotation != null) waterResource.setUe4Rotation(ue4Rotation);
if(position3d != null) waterResource.setPosition3d(position3d);
iWaterResourceDao.save(waterResource);
}
}
// public void updateWaterSourcePosition(BindPointBo pointBo) {
// Optional<WaterResource> data = iWaterResourceDao.findById(pointBo.getPointId());
// if(data.isPresent()){
// WaterResource waterResource = data.get();
// String ue4Location = pointBo.getUe4Location();
// String ue4Rotation = pointBo.getUe4Rotation();
// String position3d = pointBo.getPosition3d();
// if(ue4Location != null) waterResource.setUe4Location(ue4Location);
// if(ue4Rotation != null) waterResource.setUe4Rotation(ue4Rotation);
// if(position3d != null) waterResource.setPosition3d(position3d);
// iWaterResourceDao.save(waterResource);
// }
// }
public void updateFireStationPosition(BindPointBo pointBo) {
Optional<FireStation> data = iFireStationDao.findById(pointBo.getPointId());
if(data.isPresent()){
FireStation fireStation = data.get();
String ue4Location = pointBo.getUe4Location();
String ue4Rotation = pointBo.getUe4Rotation();
String position3d = pointBo.getPosition3d();
if(ue4Location != null) fireStation.setUe4Location(ue4Location);
if(ue4Rotation != null) fireStation.setUe4Rotation(ue4Rotation);
if(position3d != null) fireStation.setPosition3d(position3d);
iFireStationDao.save(fireStation);
}
}
// public void updateFireStationPosition(BindPointBo pointBo) {
// Optional<FireStation> data = iFireStationDao.findById(pointBo.getPointId());
// if(data.isPresent()){
// FireStation fireStation = data.get();
// String ue4Location = pointBo.getUe4Location();
// String ue4Rotation = pointBo.getUe4Rotation();
// String position3d = pointBo.getPosition3d();
// if(ue4Location != null) fireStation.setUe4Location(ue4Location);
// if(ue4Rotation != null) fireStation.setUe4Rotation(ue4Rotation);
// if(position3d != null) fireStation.setPosition3d(position3d);
// iFireStationDao.save(fireStation);
// }
// }
public void updateFireEquipmentPosition(BindPointBo pointBo) {
Optional<FireEquipment> data = iFireEquipmentDao.findById(pointBo.getPointId());
......
package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.dao.mapper.WaterResourceMapper;
import com.yeejoin.amos.fas.business.dao.repository.IWaterResourceDao;
import com.yeejoin.amos.fas.business.dao.repository.IWaterResourceEquipmentDao;
import com.yeejoin.amos.fas.business.service.intfc.IWaterResourceService;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.util.StringUtil;
import com.yeejoin.amos.fas.dao.entity.WaterResource;
import com.yeejoin.amos.fas.dao.entity.WaterResourceEquipment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@Service("waterResourceService")
public class WaterResourceServiceImpl implements IWaterResourceService {
@Autowired
IWaterResourceDao iWaterResourceDao;
@Autowired
WaterResourceMapper waterResourceMapper;
@Autowired
IWaterResourceEquipmentDao iWaterResourceEquipmentDao;
@Override
public WaterResource save(WaterResource waterResource)
{
Long id = waterResource.getId();
waterResource = iWaterResourceDao.saveAndFlush(waterResource);
return waterResource;
}
public Map queryOne(Long id)
{
return waterResourceMapper.queryOne(id);
}
@Transactional
public String [] delete(String []idArray) throws Exception
{
for(String id:idArray)
{
Optional<WaterResource> waterResource1 = iWaterResourceDao.findById(Long.parseLong(id));
WaterResource waterResource = null;
if(waterResource1.isPresent()){
waterResource=waterResource1.get();
}
iWaterResourceEquipmentDao.deleteByWaterSourceId(Long.valueOf(id));
if(waterResource != null)
{
this.iWaterResourceDao.deleteById(Long.parseLong(id));
}else
{
throw new Exception("找不到指定的监测点:"+id);
}
}
return idArray;
}
public Page queryForPage(String compCode, String username,String code,String type, CommonPageable pageable)
{
Long total = waterResourceMapper.queryCountForPage(compCode,username,code,type);
List<Map> content = waterResourceMapper.queryForPage(compCode,username,code,type,pageable.getOffset(),pageable.getPageSize());
Page result = new PageImpl(content,pageable,total);
return result;
}
@Override
public void saveBindFireEquipment(List<WaterResourceEquipment> waterResourceEquipments) {
// TODO Auto-generated method stub
List<WaterResourceEquipment> saveList = new ArrayList<WaterResourceEquipment>();
for(WaterResourceEquipment waterResourceEquipment:waterResourceEquipments){
int count = iWaterResourceEquipmentDao.countByWaterResourceIdAndFireEquipmentId(waterResourceEquipment.getWaterResourceId(),waterResourceEquipment.getFireEquipmentId());
if(count==0){
saveList.add(waterResourceEquipment);
}
}
iWaterResourceEquipmentDao.saveAll(saveList);
}
@Override
public void deleteBindFireEquipment(List<WaterResourceEquipment> waterResourceEquipments) {
// TODO Auto-generated method stub
List<WaterResourceEquipment> deleteList = new ArrayList<WaterResourceEquipment>();
for(WaterResourceEquipment waterResourceEquipment:waterResourceEquipments){
WaterResourceEquipment saveWaterResourceEquipment = iWaterResourceEquipmentDao.findByWaterResourceIdAndFireEquipmentId(waterResourceEquipment.getWaterResourceId(),waterResourceEquipment.getFireEquipmentId());
if(StringUtil.isNotEmpty(saveWaterResourceEquipment)){
deleteList.add(saveWaterResourceEquipment);
}
}
iWaterResourceEquipmentDao.deleteAll(deleteList);
}
@Override
public Page queryBindFireEquemtPage(Long waterResourceId, CommonPageable pageable) {
Long total = waterResourceMapper.queryCountForBindFireEqumntPage(waterResourceId);
List<Map> content = waterResourceMapper.queryForBindFireEqumntPage(waterResourceId, pageable.getOffset(),
pageable.getPageSize());
return new PageImpl(content, pageable, total);
}
@Override
public Object queryForList() {
return iWaterResourceDao.findAll();
}
@Override
public int countAssociatedEquipWaterByIds(String[] ids) {
return iWaterResourceDao.countAssociatedEquipWaterByIds(ids);
}
}
//package com.yeejoin.amos.fas.business.service.impl;
//
//import com.yeejoin.amos.fas.business.dao.mapper.WaterResourceMapper;
//import com.yeejoin.amos.fas.business.dao.repository.IWaterResourceDao;
//import com.yeejoin.amos.fas.business.dao.repository.IWaterResourceEquipmentDao;
//import com.yeejoin.amos.fas.business.service.intfc.IWaterResourceService;
//import com.yeejoin.amos.fas.core.common.request.CommonPageable;
//import com.yeejoin.amos.fas.core.util.StringUtil;
//import com.yeejoin.amos.fas.dao.entity.WaterResource;
//import com.yeejoin.amos.fas.dao.entity.WaterResourceEquipment;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.domain.Page;
//import org.springframework.data.domain.PageImpl;
//import org.springframework.stereotype.Service;
//import org.springframework.transaction.annotation.Transactional;
//
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Map;
//import java.util.Optional;
//
//@Service("waterResourceService")
//public class WaterResourceServiceImpl implements IWaterResourceService {
//
//
//
// @Autowired
// IWaterResourceDao iWaterResourceDao;
//
// @Autowired
// WaterResourceMapper waterResourceMapper;
//
// @Autowired
// IWaterResourceEquipmentDao iWaterResourceEquipmentDao;
//
// @Override
// public WaterResource save(WaterResource waterResource)
// {
// Long id = waterResource.getId();
// waterResource = iWaterResourceDao.saveAndFlush(waterResource);
// return waterResource;
// }
//
//
// public Map queryOne(Long id)
// {
// return waterResourceMapper.queryOne(id);
// }
//
// @Transactional
// public String [] delete(String []idArray) throws Exception
// {
// for(String id:idArray)
// {
// Optional<WaterResource> waterResource1 = iWaterResourceDao.findById(Long.parseLong(id));
// WaterResource waterResource = null;
// if(waterResource1.isPresent()){
// waterResource=waterResource1.get();
// }
// iWaterResourceEquipmentDao.deleteByWaterSourceId(Long.valueOf(id));
// if(waterResource != null)
// {
// this.iWaterResourceDao.deleteById(Long.parseLong(id));
// }else
// {
// throw new Exception("找不到指定的监测点:"+id);
// }
// }
//
// return idArray;
// }
//
//
// public Page queryForPage(String compCode, String username,String code,String type, CommonPageable pageable)
// {
// Long total = waterResourceMapper.queryCountForPage(compCode,username,code,type);
// List<Map> content = waterResourceMapper.queryForPage(compCode,username,code,type,pageable.getOffset(),pageable.getPageSize());
// Page result = new PageImpl(content,pageable,total);
// return result;
// }
//
//
// @Override
// public void saveBindFireEquipment(List<WaterResourceEquipment> waterResourceEquipments) {
// // TODO Auto-generated method stub
// List<WaterResourceEquipment> saveList = new ArrayList<WaterResourceEquipment>();
// for(WaterResourceEquipment waterResourceEquipment:waterResourceEquipments){
// int count = iWaterResourceEquipmentDao.countByWaterResourceIdAndFireEquipmentId(waterResourceEquipment.getWaterResourceId(),waterResourceEquipment.getFireEquipmentId());
// if(count==0){
// saveList.add(waterResourceEquipment);
// }
// }
// iWaterResourceEquipmentDao.saveAll(saveList);
// }
//
//
// @Override
// public void deleteBindFireEquipment(List<WaterResourceEquipment> waterResourceEquipments) {
// // TODO Auto-generated method stub
// List<WaterResourceEquipment> deleteList = new ArrayList<WaterResourceEquipment>();
// for(WaterResourceEquipment waterResourceEquipment:waterResourceEquipments){
// WaterResourceEquipment saveWaterResourceEquipment = iWaterResourceEquipmentDao.findByWaterResourceIdAndFireEquipmentId(waterResourceEquipment.getWaterResourceId(),waterResourceEquipment.getFireEquipmentId());
// if(StringUtil.isNotEmpty(saveWaterResourceEquipment)){
// deleteList.add(saveWaterResourceEquipment);
// }
// }
// iWaterResourceEquipmentDao.deleteAll(deleteList);
// }
//
//
// @Override
// public Page queryBindFireEquemtPage(Long waterResourceId, CommonPageable pageable) {
// Long total = waterResourceMapper.queryCountForBindFireEqumntPage(waterResourceId);
// List<Map> content = waterResourceMapper.queryForBindFireEqumntPage(waterResourceId, pageable.getOffset(),
// pageable.getPageSize());
// return new PageImpl(content, pageable, total);
// }
//
//
// @Override
// public Object queryForList() {
// return iWaterResourceDao.findAll();
// }
//
//
// @Override
// public int countAssociatedEquipWaterByIds(String[] ids) {
// return iWaterResourceDao.countAssociatedEquipWaterByIds(ids);
// }
//}
package com.yeejoin.amos.fas.business.service.intfc;
import java.util.List;
import java.util.Map;
import org.springframework.data.domain.Page;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.dao.entity.FireStrength;
public interface FireStengthService {
/**
* 保存或者更新风险点
* @param fireEquipmentPoint
* @return
*/
FireStrength savePoint(FireStrength fireEquipmentPoint);
/**
* 查询单个风险点
* @param id
* @return
*/
Map queryOne(Long id);
/**
* 删除单个风险点
* @return
* @throws Exception
*/
String [] deletePoint(String[] idArray) throws Exception;
/**
* 查询指定设备的风险点列表
* @param fireEqumntId
* @return
*/
Page queryByFireEquimt(String username,String code, CommonPageable pageable);
List<FireStrength> queryForStrengthList(String time);
}
//package com.yeejoin.amos.fas.business.service.intfc;
//
//import java.util.List;
//import java.util.Map;
//
//import org.springframework.data.domain.Page;
//
//import com.yeejoin.amos.fas.core.common.request.CommonPageable;
////import com.yeejoin.amos.fas.dao.entity.FireStrength;
//
//public interface FireStengthService {
//
// /**
// * 保存或者更新风险点
// * @param fireEquipmentPoint
// * @return
// */
// FireStrength savePoint(FireStrength fireEquipmentPoint);
//
//
// /**
// * 查询单个风险点
// * @param id
// * @return
// */
// Map queryOne(Long id);
//
//
// /**
// * 删除单个风险点
// * @return
// * @throws Exception
// */
// String [] deletePoint(String[] idArray) throws Exception;
//
//
// /**
// * 查询指定设备的风险点列表
// * @param fireEqumntId
// * @return
// */
// Page queryByFireEquimt(String username,String code, CommonPageable pageable);
//
//
// List<FireStrength> queryForStrengthList(String time);
//}
package com.yeejoin.amos.fas.business.service.intfc;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.dao.entity.WaterResource;
//import com.yeejoin.amos.fas.dao.entity.WaterResource;
import org.springframework.data.domain.Page;
import java.util.Map;
......
......@@ -15,5 +15,5 @@ public interface IExcelService {
List<?> exportPointData(Map<String, Object> paramsMap);
void importWaterResource(List<WaterResourceParam> list);
// void importWaterResource(List<WaterResourceParam> list);
}
......@@ -3,7 +3,7 @@ package com.yeejoin.amos.fas.business.service.intfc;
import com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint;
//import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint;
import org.springframework.data.domain.Page;
import java.util.List;
......@@ -17,7 +17,7 @@ public interface IFireEquipPontService {
* @param fireEquipmentPoint
* @return
*/
FireEquipmentPoint savePoint(FireEquipmentPoint fireEquipmentPoint);
// FireEquipmentPoint savePoint(FireEquipmentPoint fireEquipmentPoint);
/**
......@@ -26,7 +26,7 @@ public interface IFireEquipPontService {
* @param id
* @return
*/
FireEquipmentPoint queryOne(Long id);
// FireEquipmentPoint queryOne(Long id);
/**
......@@ -35,7 +35,7 @@ public interface IFireEquipPontService {
* @return
* @throws Exception
*/
String[] deletePoint(String[] idArray) throws Exception;
// String[] deletePoint(String[] idArray) throws Exception;
/**
......@@ -52,7 +52,7 @@ public interface IFireEquipPontService {
CommonResponse batchUnbindToEquipment(List<Long> pointIds);
CommonResponse save(FireEquipmentPointEntity fireEquipmentPointEntity);
// CommonResponse save(FireEquipmentPointEntity fireEquipmentPointEntity);
CommonResponse update(FireEquipmentPointEntity fireEquipmentPointEntity);
......@@ -61,8 +61,8 @@ public interface IFireEquipPontService {
CommonResponse listByType(Integer type);
int countImpEquipment(String[] idArray);
// int countImpEquipment(String[] idArray);
String findBindRiskSourceStrByPointIds(String[] idArray);
// String findBindRiskSourceStrByPointIds(String[] idArray);
}
......@@ -45,7 +45,7 @@ public interface IFireEquipService {
* @param ids
* @return
*/
int countAssociatedEquipStationByIds(String[] ids);
// int countAssociatedEquipStationByIds(String[] ids);
Boolean isExistByCode(String code);
}
package com.yeejoin.amos.fas.business.service.intfc;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.dao.entity.FireStation;
import com.yeejoin.amos.fas.dao.entity.FireStationFireEquipment;
import org.springframework.data.domain.Page;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;
public interface IFireStationService {
/**
* 保存或者更新风险点
* @param fireStation
* @return
*/
FireStation save(FireStation fireStation);
/**
* 保存或者更新消防小室
* @param fireStation
* @return
*/
FireStation saveAndUpd(FireStation fireStation,MultipartFile[] file);
/**
* 关联消防设备
* @param fireStationFireEquipments
* @return
*/
List<FireStationFireEquipment> saveStationFireEquipment(List<FireStationFireEquipment> fireStationFireEquipments) throws Exception;
/**
* 查询单个风险点
* @param id
* @return
*/
Map queryOne(Long id);
/**
* 查询已经绑定的消防设备列表
* @param fireStationId
* @return
*/
Page queryForFireEquemtPage(Long fireStationId,CommonPageable pageable);
void deleteStationFireEquipment(List<FireStationFireEquipment> fireStationFireEquipments) throws Exception;
/**
* 删除单个风险点
* @return
* @throws Exception
*/
String [] delete(String[] idArray) throws Exception;
/**
* 查询指定设备的风险点列表
* @return
*/
Page queryForPage(String username, String code,String type, CommonPageable pageable);
List<Map> queryForList(String username, String code,String type);
/**
* 获取消防小室配置装备数据
* @param id
* @return
*/
Map queryForEuqimentListById(Long id);
Boolean isExistByCode(String code);
}
//package com.yeejoin.amos.fas.business.service.intfc;
//
//import com.yeejoin.amos.fas.core.common.request.CommonPageable;
//import com.yeejoin.amos.fas.dao.entity.FireStation;
//import com.yeejoin.amos.fas.dao.entity.FireStationFireEquipment;
//import org.springframework.data.domain.Page;
//import org.springframework.web.multipart.MultipartFile;
//
//import java.util.List;
//import java.util.Map;
//
//public interface IFireStationService {
//
// /**
// * 保存或者更新风险点
// * @param fireStation
// * @return
// */
// FireStation save(FireStation fireStation);
//
// /**
// * 保存或者更新消防小室
// * @param fireStation
// * @return
// */
// FireStation saveAndUpd(FireStation fireStation,MultipartFile[] file);
//
// /**
// * 关联消防设备
// * @param fireStationFireEquipments
// * @return
// */
// List<FireStationFireEquipment> saveStationFireEquipment(List<FireStationFireEquipment> fireStationFireEquipments) throws Exception;
//
//
// /**
// * 查询单个风险点
// * @param id
// * @return
// */
// Map queryOne(Long id);
//
// /**
// * 查询已经绑定的消防设备列表
// * @param fireStationId
// * @return
// */
// Page queryForFireEquemtPage(Long fireStationId,CommonPageable pageable);
// void deleteStationFireEquipment(List<FireStationFireEquipment> fireStationFireEquipments) throws Exception;
//
// /**
// * 删除单个风险点
// * @return
// * @throws Exception
// */
// String [] delete(String[] idArray) throws Exception;
//
//
// /**
// * 查询指定设备的风险点列表
// * @return
// */
// Page queryForPage(String username, String code,String type, CommonPageable pageable);
//
//
// List<Map> queryForList(String username, String code,String type);
//
// /**
// * 获取消防小室配置装备数据
// * @param id
// * @return
// */
// Map queryForEuqimentListById(Long id);
//
// Boolean isExistByCode(String code);
//
//}
......@@ -136,7 +136,7 @@ public interface IRiskSourceService {
String processFireEqumtData(AlarmParam deviceData) throws Exception;
void saveData(List<AlarmParam> deviceDatas, String type);
// void saveData(List<AlarmParam> deviceDatas, String type);
List<HashMap<String, Object>> queryRiskSourceSecondLevel(String compCode);
......
package com.yeejoin.amos.fas.business.service.intfc;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.dao.entity.WaterResource;
import com.yeejoin.amos.fas.dao.entity.WaterResourceEquipment;
import org.springframework.data.domain.Page;
import java.util.List;
import java.util.Map;
public interface IWaterResourceService {
/**
* 保存或者更新风险点
* @param waterResource
* @return
*/
WaterResource save(WaterResource waterResource);
/**
* 查询单个风险点
* @param id
* @return
*/
Map queryOne(Long id);
/**
* 删除单个风险点
* @return
* @throws Exception
*/
String [] delete(String[] idArray) throws Exception;
/**
* 查询指定设备的风险点列表
* @return
*/
Page queryForPage(String compCode,String username, String code, String type,CommonPageable pageable);
void saveBindFireEquipment(List<WaterResourceEquipment> waterResourceEquipments);
void deleteBindFireEquipment(List<WaterResourceEquipment> waterResourceEquipments);
/**
* 查询已经绑定的消防设备列表
* @param waterResourceId
* @return
*/
Page queryBindFireEquemtPage(Long waterResourceId,CommonPageable pageable);
Object queryForList();
int countAssociatedEquipWaterByIds(String[] ids);
}
//package com.yeejoin.amos.fas.business.service.intfc;
//
//import com.yeejoin.amos.fas.core.common.request.CommonPageable;
//import com.yeejoin.amos.fas.dao.entity.WaterResource;
//import com.yeejoin.amos.fas.dao.entity.WaterResourceEquipment;
//
//import org.springframework.data.domain.Page;
//
//import java.util.List;
//import java.util.Map;
//
//public interface IWaterResourceService {
//
// /**
// * 保存或者更新风险点
// * @param waterResource
// * @return
// */
// WaterResource save(WaterResource waterResource);
//
//
// /**
// * 查询单个风险点
// * @param id
// * @return
// */
// Map queryOne(Long id);
//
//
// /**
// * 删除单个风险点
// * @return
// * @throws Exception
// */
// String [] delete(String[] idArray) throws Exception;
//
//
// /**
// * 查询指定设备的风险点列表
// * @return
// */
// Page queryForPage(String compCode,String username, String code, String type,CommonPageable pageable);
//
// void saveBindFireEquipment(List<WaterResourceEquipment> waterResourceEquipments);
//
// void deleteBindFireEquipment(List<WaterResourceEquipment> waterResourceEquipments);
//
// /**
// * 查询已经绑定的消防设备列表
// * @param waterResourceId
// * @return
// */
// Page queryBindFireEquemtPage(Long waterResourceId,CommonPageable pageable);
//
//
// Object queryForList();
//
// int countAssociatedEquipWaterByIds(String[] ids);
//}
......@@ -178,110 +178,110 @@ CREATE TABLE `f_fire_equipment` (
-- ----------------------------
-- Table structure for f_fire_equipment_data
-- ----------------------------
DROP TABLE IF EXISTS `f_fire_equipment_data`;
CREATE TABLE `f_fire_equipment_data` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`fire_equipment_id` bigint(20) NOT NULL COMMENT '消防监测设备id',
`fire_equipment_point_id` bigint(20) NOT NULL COMMENT '消防监测设备信息地址id',
`eq_point_name` varchar(255) DEFAULT NULL COMMENT '指标名称',
`eq_point_unit` varchar(255) DEFAULT NULL COMMENT '指标单位',
`type` varchar(50) DEFAULT NULL COMMENT '数据类型:alarm(报警),monitor(监测)',
`common_address` int(11) DEFAULT NULL COMMENT '公共地址',
`information_address` bigint(11) DEFAULT NULL COMMENT '信息地址',
`e_value` varchar(255) DEFAULT NULL COMMENT '值',
`data_type` int(11) DEFAULT NULL COMMENT '数据类型:浮点型,整数,布尔类型',
`create_date` datetime DEFAULT NULL COMMENT '创建时间',
`occur_time` datetime DEFAULT NULL COMMENT '品质描述',
`quality` longtext,
`is_blocked` bit(1) DEFAULT b'0' COMMENT '是否被锁',
`isSubstituted` bit(1) DEFAULT b'0' COMMENT '是否被取代',
`isNotTopical` bit(1) DEFAULT b'0' COMMENT '是否非当前值',
`isInvalid` int(11) DEFAULT '0' COMMENT '是否有效',
`isOverflow` bit(1) DEFAULT b'0' COMMENT '是否越界',
`soe` int(11) DEFAULT '0',
`org_code` varchar(50) DEFAULT NULL COMMENT '组织',
`alarm_type` varchar(255) DEFAULT NULL,
`eq_point_code` varchar(225) DEFAULT '' COMMENT '点位编码',
`is_invalid` int(11) DEFAULT '0' COMMENT '是否有效',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=14912 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='消防站点资源表';
-- DROP TABLE IF EXISTS `f_fire_equipment_data`;
-- CREATE TABLE `f_fire_equipment_data` (
-- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
-- `fire_equipment_id` bigint(20) NOT NULL COMMENT '消防监测设备id',
-- `fire_equipment_point_id` bigint(20) NOT NULL COMMENT '消防监测设备信息地址id',
-- `eq_point_name` varchar(255) DEFAULT NULL COMMENT '指标名称',
-- `eq_point_unit` varchar(255) DEFAULT NULL COMMENT '指标单位',
-- `type` varchar(50) DEFAULT NULL COMMENT '数据类型:alarm(报警),monitor(监测)',
-- `common_address` int(11) DEFAULT NULL COMMENT '公共地址',
-- `information_address` bigint(11) DEFAULT NULL COMMENT '信息地址',
-- `e_value` varchar(255) DEFAULT NULL COMMENT '值',
-- `data_type` int(11) DEFAULT NULL COMMENT '数据类型:浮点型,整数,布尔类型',
-- `create_date` datetime DEFAULT NULL COMMENT '创建时间',
-- `occur_time` datetime DEFAULT NULL COMMENT '品质描述',
-- `quality` longtext,
-- `is_blocked` bit(1) DEFAULT b'0' COMMENT '是否被锁',
-- `isSubstituted` bit(1) DEFAULT b'0' COMMENT '是否被取代',
-- `isNotTopical` bit(1) DEFAULT b'0' COMMENT '是否非当前值',
-- `isInvalid` int(11) DEFAULT '0' COMMENT '是否有效',
-- `isOverflow` bit(1) DEFAULT b'0' COMMENT '是否越界',
-- `soe` int(11) DEFAULT '0',
-- `org_code` varchar(50) DEFAULT NULL COMMENT '组织',
-- `alarm_type` varchar(255) DEFAULT NULL,
-- `eq_point_code` varchar(225) DEFAULT '' COMMENT '点位编码',
-- `is_invalid` int(11) DEFAULT '0' COMMENT '是否有效',
-- PRIMARY KEY (`id`) USING BTREE
-- ) ENGINE=InnoDB AUTO_INCREMENT=14912 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='消防站点资源表';
-- ----------------------------
-- Table structure for f_fire_equipment_point
-- ----------------------------
DROP TABLE IF EXISTS `f_fire_equipment_point`;
CREATE TABLE `f_fire_equipment_point` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(255) DEFAULT NULL COMMENT '名称',
`code` varchar(255) DEFAULT NULL COMMENT '编号',
`fire_equipment_id` bigint(20) NOT NULL COMMENT '消防装备id',
`create_by` varchar(225) DEFAULT '0' COMMENT '创建者',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建日期',
`remark` varchar(255) DEFAULT NULL,
`type` varchar(32) NOT NULL COMMENT '类型:模拟量ANALOGUE,开关量SWITCH',
`value` varchar(50) DEFAULT NULL COMMENT '当前值保存时若为开关量(1,0)默认为1',
`unit` varchar(50) DEFAULT NULL COMMENT '指标项名称',
`org_code` varchar(50) DEFAULT NULL COMMENT '组织',
`alarm_type` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5734 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='消防装备点表';
-- DROP TABLE IF EXISTS `f_fire_equipment_point`;
-- CREATE TABLE `f_fire_equipment_point` (
-- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
-- `name` varchar(255) DEFAULT NULL COMMENT '名称',
-- `code` varchar(255) DEFAULT NULL COMMENT '编号',
-- `fire_equipment_id` bigint(20) NOT NULL COMMENT '消防装备id',
-- `create_by` varchar(225) DEFAULT '0' COMMENT '创建者',
-- `create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建日期',
-- `remark` varchar(255) DEFAULT NULL,
-- `type` varchar(32) NOT NULL COMMENT '类型:模拟量ANALOGUE,开关量SWITCH',
-- `value` varchar(50) DEFAULT NULL COMMENT '当前值保存时若为开关量(1,0)默认为1',
-- `unit` varchar(50) DEFAULT NULL COMMENT '指标项名称',
-- `org_code` varchar(50) DEFAULT NULL COMMENT '组织',
-- `alarm_type` bigint(20) DEFAULT NULL,
-- PRIMARY KEY (`id`) USING BTREE
-- ) ENGINE=InnoDB AUTO_INCREMENT=5734 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='消防装备点表';
-- ----------------------------
-- Table structure for f_fire_station
-- ----------------------------
DROP TABLE IF EXISTS `f_fire_station`;
CREATE TABLE `f_fire_station` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(100) NOT NULL COMMENT '名称',
`code` varchar(50) DEFAULT NULL COMMENT '编码',
`type` varchar(10) DEFAULT NULL COMMENT '类型 1:消防小室,2:消防泡沫间',
`address` varchar(255) DEFAULT NULL COMMENT '位置',
`floor3d` varchar(100) DEFAULT NULL COMMENT '楼层',
`position3d` varchar(100) DEFAULT NULL COMMENT '3维坐标',
`is_indoor` bit(1) DEFAULT b'1' COMMENT '是否室内点:默认是',
`org_code` varchar(50) DEFAULT NULL COMMENT '组织',
`create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
`picture` varchar(1000) DEFAULT NULL COMMENT '图片',
`risk_source_id` bigint(20) DEFAULT '0' COMMENT '风险区域id',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='消防站点';
-- DROP TABLE IF EXISTS `f_fire_station`;
-- CREATE TABLE `f_fire_station` (
-- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
-- `name` varchar(100) NOT NULL COMMENT '名称',
-- `code` varchar(50) DEFAULT NULL COMMENT '编码',
-- `type` varchar(10) DEFAULT NULL COMMENT '类型 1:消防小室,2:消防泡沫间',
-- `address` varchar(255) DEFAULT NULL COMMENT '位置',
-- `floor3d` varchar(100) DEFAULT NULL COMMENT '楼层',
-- `position3d` varchar(100) DEFAULT NULL COMMENT '3维坐标',
-- `is_indoor` bit(1) DEFAULT b'1' COMMENT '是否室内点:默认是',
-- `org_code` varchar(50) DEFAULT NULL COMMENT '组织',
-- `create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
-- `create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
-- `picture` varchar(1000) DEFAULT NULL COMMENT '图片',
-- `risk_source_id` bigint(20) DEFAULT '0' COMMENT '风险区域id',
-- PRIMARY KEY (`id`) USING BTREE
-- ) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='消防站点';
-- ----------------------------
-- Table structure for f_fire_station_equipment
-- ----------------------------
DROP TABLE IF EXISTS `f_fire_station_equipment`;
CREATE TABLE `f_fire_station_equipment` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`fire_station_id` bigint(20) NOT NULL COMMENT '消防站id',
`fire_equipment_id` bigint(20) NOT NULL COMMENT '消防物资id',
`number` double DEFAULT NULL COMMENT '个数',
`create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
`unit` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='消防站点资源表';
-- DROP TABLE IF EXISTS `f_fire_station_equipment`;
-- CREATE TABLE `f_fire_station_equipment` (
-- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
-- `fire_station_id` bigint(20) NOT NULL COMMENT '消防站id',
-- `fire_equipment_id` bigint(20) NOT NULL COMMENT '消防物资id',
-- `number` double DEFAULT NULL COMMENT '个数',
-- `create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
-- `create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
-- `unit` varchar(32) DEFAULT NULL,
-- PRIMARY KEY (`id`) USING BTREE
-- ) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='消防站点资源表';
-- ----------------------------
-- Table structure for f_fire_strength
-- ----------------------------
DROP TABLE IF EXISTS `f_fire_strength`;
CREATE TABLE `f_fire_strength` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(50) NOT NULL COMMENT '名称',
`code` varchar(50) DEFAULT NULL COMMENT '编码',
`position` varchar(50) DEFAULT NULL COMMENT '职位',
`tel` varchar(20) DEFAULT NULL COMMENT '固话',
`phone_num` varchar(20) DEFAULT NULL COMMENT '移动号码',
`job_des` varchar(500) DEFAULT NULL COMMENT '工作描述',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`org_code` varchar(255) DEFAULT NULL COMMENT '组织',
`create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
`day_end` time DEFAULT NULL COMMENT '结束时间',
`day_begin` time DEFAULT NULL COMMENT '开始时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='消防力量';
-- DROP TABLE IF EXISTS `f_fire_strength`;
-- CREATE TABLE `f_fire_strength` (
-- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
-- `username` varchar(50) NOT NULL COMMENT '名称',
-- `code` varchar(50) DEFAULT NULL COMMENT '编码',
-- `position` varchar(50) DEFAULT NULL COMMENT '职位',
-- `tel` varchar(20) DEFAULT NULL COMMENT '固话',
-- `phone_num` varchar(20) DEFAULT NULL COMMENT '移动号码',
-- `job_des` varchar(500) DEFAULT NULL COMMENT '工作描述',
-- `remark` varchar(500) DEFAULT NULL COMMENT '备注',
-- `org_code` varchar(255) DEFAULT NULL COMMENT '组织',
-- `create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
-- `create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
-- `day_end` time DEFAULT NULL COMMENT '结束时间',
-- `day_begin` time DEFAULT NULL COMMENT '开始时间',
-- PRIMARY KEY (`id`) USING BTREE
-- ) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='消防力量';
-- ----------------------------
-- Table structure for f_fmea
......@@ -551,41 +551,41 @@ CREATE TABLE `f_topography_node_detail` (
-- ----------------------------
-- Table structure for f_water_resource
-- ----------------------------
DROP TABLE IF EXISTS `f_water_resource`;
CREATE TABLE `f_water_resource` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(100) NOT NULL COMMENT '名称',
`code` varchar(50) DEFAULT NULL COMMENT '编码',
`type` varchar(10) DEFAULT NULL COMMENT '类型: 1:消火栓,2:消防水池,3:喷淋',
`production_area` varchar(255) DEFAULT NULL COMMENT '区域',
`floor3d` varchar(100) DEFAULT NULL COMMENT '楼层',
`room` varchar(255) DEFAULT NULL COMMENT '房间',
`address` varchar(255) DEFAULT NULL COMMENT '位置',
`position3d` varchar(100) DEFAULT NULL COMMENT '3维坐标',
`org_code` varchar(50) DEFAULT NULL COMMENT '组织',
`create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
`is_indoor` bit(1) DEFAULT b'1' COMMENT '是否室内点:默认是',
`risk_source_id` bigint(20) DEFAULT '0' COMMENT '风险区域id',
`max_level` varchar(255) DEFAULT '0' COMMENT '最大液位',
`alarm_level` varchar(255) DEFAULT '0' COMMENT '告警液位',
`area` varchar(255) DEFAULT '0' COMMENT '水池面積',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='水资源表';
-- DROP TABLE IF EXISTS `f_water_resource`;
-- CREATE TABLE `f_water_resource` (
-- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
-- `name` varchar(100) NOT NULL COMMENT '名称',
-- `code` varchar(50) DEFAULT NULL COMMENT '编码',
-- `type` varchar(10) DEFAULT NULL COMMENT '类型: 1:消火栓,2:消防水池,3:喷淋',
-- `production_area` varchar(255) DEFAULT NULL COMMENT '区域',
-- `floor3d` varchar(100) DEFAULT NULL COMMENT '楼层',
-- `room` varchar(255) DEFAULT NULL COMMENT '房间',
-- `address` varchar(255) DEFAULT NULL COMMENT '位置',
-- `position3d` varchar(100) DEFAULT NULL COMMENT '3维坐标',
-- `org_code` varchar(50) DEFAULT NULL COMMENT '组织',
-- `create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
-- `create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
-- `is_indoor` bit(1) DEFAULT b'1' COMMENT '是否室内点:默认是',
-- `risk_source_id` bigint(20) DEFAULT '0' COMMENT '风险区域id',
-- `max_level` varchar(255) DEFAULT '0' COMMENT '最大液位',
-- `alarm_level` varchar(255) DEFAULT '0' COMMENT '告警液位',
-- `area` varchar(255) DEFAULT '0' COMMENT '水池面積',
-- PRIMARY KEY (`id`) USING BTREE
-- ) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='水资源表';
-- ----------------------------
-- Table structure for f_water_resource_equipment
-- ----------------------------
DROP TABLE IF EXISTS `f_water_resource_equipment`;
CREATE TABLE `f_water_resource_equipment` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`water_resource_id` bigint(20) NOT NULL,
`fire_equipment_id` bigint(20) NOT NULL,
`number` double DEFAULT NULL COMMENT '个数',
`unit` varchar(16) DEFAULT NULL COMMENT '单位',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='水资源设备表';
-- DROP TABLE IF EXISTS `f_water_resource_equipment`;
-- CREATE TABLE `f_water_resource_equipment` (
-- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
-- `water_resource_id` bigint(20) NOT NULL,
-- `fire_equipment_id` bigint(20) NOT NULL,
-- `number` double DEFAULT NULL COMMENT '个数',
-- `unit` varchar(16) DEFAULT NULL COMMENT '单位',
-- `create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
-- PRIMARY KEY (`id`) USING BTREE
-- ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='水资源设备表';
-- ----------------------------
-- Table structure for contingency_original_data
-- ----------------------------
......
......@@ -3,91 +3,91 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.PlanVisual3dMapper">
<!--查询 0-设备类;1-耗材类;2-视频监控;3-灭火器材'-->
<select id="getResourceListByType" resultType="java.util.HashMap">
<!-- <select id="getResourceListByType" resultType="java.util.HashMap">-->
<!-- -->
<!-- SELECT-->
<!-- rs.id as `key` ,-->
<!-- rs.id AS `value`,-->
<!-- rs.name as label,-->
<!-- rs.code ,-->
<!-- 'id' as dataType-->
<!-- from-->
<!-- <choose>-->
<!-- <when test="type=='fireCar'">-->
<!-- (SELECT a.id,a.name,a.car_num as code FROM `f_fire_car` a) as rs-->
<!-- </when>-->
<!-- <when test="type=='monitorEquipment'">-->
<!-- (select a.id,a.name,a.code from f_fire_equipment a where a.equip_classify = 0) as rs-->
<!-- </when>-->
<!-- <when test="type=='fireConsumables'">-->
<!-- (select a.id,a.name,a.code from f_fire_equipment a where a.equip_classify = 1) as rs-->
<!-- </when>-->
<!-- <when test="type=='video'">-->
<!-- (select a.id,a.name,a.code from f_fire_equipment a where a.equip_classify = 2) as rs-->
<!-- </when>-->
<!-- <when test="type=='fireEquipment'">-->
<!-- (select a.id,a.name,a.code from f_fire_equipment a where a.equip_classify = 3) as rs-->
<!-- </when>-->
<!-- <when test="type=='impEquipment'">-->
<!-- (select a.id,a.`name`,a.`code` from f_equipment a) as rs-->
<!-- </when>-->
<!-- <when test="type=='fireStrength'">-->
<!-- (select a.id,a.`username` as name ,a.`code` from f_fire_strength a) as rs-->
<!-- </when>-->
<!-- <when test="type=='fireChamber'">-->
<!-- (select a.id,a.`name`,a.`code` from f_fire_station a where a.type = '1') as rs-->
<!-- </when>-->
<!-- <when test="type=='fireFoamRoom'">-->
<!-- (select a.id,a.`name`,a.`code` from f_fire_station a where a.type = '2') as rs-->
<!-- </when>-->
<!-- <when test="type=='hydrant'">-->
<!-- (SELECT a.id,a.`name`,a.code FROM `f_water_resource` a where a.type = '1') as rs-->
<!-- </when>-->
<!-- <when test="type=='pool'">-->
<!-- (SELECT a.id,a.`name`,a.code FROM `f_water_resource` a where a.type = '2') as rs-->
<!-- </when>-->
<!-- </choose>-->
<!-- </select>-->
<!-- SELECT
rs.id as `key` ,
rs.id AS `value`,
rs.name as label,
rs.code ,
'id' as dataType
from
<choose>
<when test="type=='fireCar'">
(SELECT a.id,a.name,a.car_num as code FROM `f_fire_car` a) as rs
</when>
<when test="type=='monitorEquipment'">
(select a.id,a.name,a.code from f_fire_equipment a where a.equip_classify = 0) as rs
</when>
<when test="type=='fireConsumables'">
(select a.id,a.name,a.code from f_fire_equipment a where a.equip_classify = 1) as rs
</when>
<when test="type=='video'">
(select a.id,a.name,a.code from f_fire_equipment a where a.equip_classify = 2) as rs
</when>
<when test="type=='fireEquipment'">
(select a.id,a.name,a.code from f_fire_equipment a where a.equip_classify = 3) as rs
</when>
<when test="type=='impEquipment'">
(select a.id,a.`name`,a.`code` from f_equipment a) as rs
</when>
<when test="type=='fireStrength'">
(select a.id,a.`username` as name ,a.`code` from f_fire_strength a) as rs
</when>
<when test="type=='fireChamber'">
(select a.id,a.`name`,a.`code` from f_fire_station a where a.type = '1') as rs
</when>
<when test="type=='fireFoamRoom'">
(select a.id,a.`name`,a.`code` from f_fire_station a where a.type = '2') as rs
</when>
<when test="type=='hydrant'">
(SELECT a.id,a.`name`,a.code FROM `f_water_resource` a where a.type = '1') as rs
</when>
<when test="type=='pool'">
(SELECT a.id,a.`name`,a.code FROM `f_water_resource` a where a.type = '2') as rs
</when>
</choose> -->
</select>
<select id="queryOneByTypeAndId" resultType="hashmap">
<!-- SELECT
*
from
<choose>
<when test="type=='fireCar'">
(SELECT * FROM `f_fire_car` a) as rs
</when>
<when test="type=='monitorEquipment'">
(select * from f_fire_equipment a where a.equip_classify = 0) as rs
</when>
<when test="type=='fireConsumables'">
(select * from f_fire_equipment a where a.equip_classify = 1) as rs
</when>
<when test="type=='video'">
(select * from f_fire_equipment a where a.equip_classify = 2) as rs
</when>
<when test="type=='fireEquipment'">
(select * from f_fire_equipment a where a.equip_classify = 3) as rs
</when>
<when test="type=='impEquipment'">
(select * from f_equipment a) as rs
</when>
<when test="type=='fireStrength'">
(select * from f_fire_strength a) as rs
</when>
<when test="type=='fireChamber'">
(select * from f_fire_station a where a.type = '1') as rs
</when>
<when test="type=='fireFoamRoom'">
(select * from f_fire_station a where a.type = '2') as rs
</when>
<when test="type=='hydrant'">
(SELECT * FROM `f_water_resource` a where a.type = '1') as rs
</when>
<when test="type=='pool'">
(SELECT * FROM `f_water_resource` a where a.type = '2') as rs
</when>
</choose>
where rs.id = #{id}-->
</select>
<!-- <select id="queryOneByTypeAndId" resultType="hashmap">-->
<!-- SELECT-->
<!-- *-->
<!-- from-->
<!-- <choose>-->
<!-- <when test="type=='fireCar'">-->
<!-- (SELECT * FROM `f_fire_car` a) as rs-->
<!-- </when>-->
<!-- <when test="type=='monitorEquipment'">-->
<!-- (select * from f_fire_equipment a where a.equip_classify = 0) as rs-->
<!-- </when>-->
<!-- <when test="type=='fireConsumables'">-->
<!-- (select * from f_fire_equipment a where a.equip_classify = 1) as rs-->
<!-- </when>-->
<!-- <when test="type=='video'">-->
<!-- (select * from f_fire_equipment a where a.equip_classify = 2) as rs-->
<!-- </when>-->
<!-- <when test="type=='fireEquipment'">-->
<!-- (select * from f_fire_equipment a where a.equip_classify = 3) as rs-->
<!-- </when>-->
<!-- <when test="type=='impEquipment'">-->
<!-- (select * from f_equipment a) as rs-->
<!-- </when>-->
<!-- <when test="type=='fireStrength'">-->
<!-- (select * from f_fire_strength a) as rs-->
<!-- </when>-->
<!-- <when test="type=='fireChamber'">-->
<!-- (select * from f_fire_station a where a.type = '1') as rs-->
<!-- </when>-->
<!-- <when test="type=='fireFoamRoom'">-->
<!-- (select * from f_fire_station a where a.type = '2') as rs-->
<!-- </when>-->
<!-- <when test="type=='hydrant'">-->
<!-- (SELECT * FROM `f_water_resource` a where a.type = '1') as rs-->
<!-- </when>-->
<!-- <when test="type=='pool'">-->
<!-- (SELECT * FROM `f_water_resource` a where a.type = '2') as rs-->
<!-- </when>-->
<!-- </choose>-->
<!-- where rs.id = #{id}-->
<!-- </select>-->
</mapper>
\ No newline at end of file
......@@ -4,98 +4,98 @@
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.FireStationMapper">
<select id="queryOne" resultType="java.util.Map">
SELECT
fs.id,
fs.name,
fs.code,
fs.type,
fs.address,
fs.floor3d,
fs.position3d,
fs.is_indoor AS isIndoor,
fs.picture,
fs.risk_source_id as riskSourceId
FROM
f_fire_station fs
WHERE
fs.id = ${id}
</select>
<select id="queryCountForFireEqumntPage" resultType="long">
SELECT
count(1)
FROM
f_fire_station_equipment fs
JOIN f_fire_equipment f ON fs.fire_equipment_id = f.id
WHERE
fs.fire_station_id = ${fireStationId}
</select>
<select id="queryForFireEqumntPage" resultType="java.util.Map">
SELECT
fs.fire_station_id,
fs.number numberInStation,
fs.unit unitInStation,
f.*,
frs.name riskSourceName
FROM
f_fire_station_equipment fs
left join f_fire_equipment f ON fs.fire_equipment_id = f.id
left join f_risk_source frs on frs.id = f.risk_source_id
WHERE
fs.fire_station_id = ${fireStationId}
and f.id is not null
LIMIT ${start}, ${length};
</select>
<select id="queryCountForPage" resultType="long">
SELECT
COUNT(1)
FROM
f_fire_station fs
WHERE
1=1
<if test="name!=null">
AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')
</if>
<if test="code!=null">
AND fs.`code` LIKE '%${code}%'
</if>
<if test="type!=null">
AND fs.`type` LIKE '%${type}%';
</if>
</select>
<select id="queryForPage" resultType="java.util.Map">
SELECT
fs.id,
fs.name,
fs.code,
fs.type,
fs.address,
fs.floor3d,
fs.position3d,
fs.is_indoor as isIndoor,
frs.name riskSourceName
FROM
f_fire_station fs
left join f_risk_source frs on frs.id = fs.risk_source_id
WHERE
1=1
<if test="name!=null">
AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')
</if>
<if test="code!=null">
AND fs.`code` LIKE '%${code}%'
</if>
<if test="type!=null">
AND fs.`type` LIKE '%${type}%'
</if>
LIMIT ${start},${length} ;
</select>
<!-- <select id="queryOne" resultType="java.util.Map">-->
<!-- SELECT-->
<!-- fs.id,-->
<!-- fs.name,-->
<!-- fs.code,-->
<!-- fs.type,-->
<!-- fs.address,-->
<!-- fs.floor3d,-->
<!-- fs.position3d,-->
<!-- fs.is_indoor AS isIndoor,-->
<!-- fs.picture,-->
<!-- fs.risk_source_id as riskSourceId-->
<!-- FROM-->
<!-- f_fire_station fs-->
<!-- WHERE-->
<!-- fs.id = ${id}-->
<!-- </select>-->
<!-- <select id="queryCountForFireEqumntPage" resultType="long">-->
<!-- SELECT-->
<!-- count(1)-->
<!-- FROM-->
<!-- f_fire_station_equipment fs-->
<!-- JOIN f_fire_equipment f ON fs.fire_equipment_id = f.id-->
<!-- WHERE-->
<!-- fs.fire_station_id = ${fireStationId}-->
<!-- </select>-->
<!-- <select id="queryForFireEqumntPage" resultType="java.util.Map">-->
<!-- SELECT-->
<!-- fs.fire_station_id,-->
<!-- fs.number numberInStation,-->
<!-- fs.unit unitInStation,-->
<!-- f.*,-->
<!-- frs.name riskSourceName-->
<!-- FROM-->
<!-- f_fire_station_equipment fs-->
<!-- left join f_fire_equipment f ON fs.fire_equipment_id = f.id-->
<!-- left join f_risk_source frs on frs.id = f.risk_source_id-->
<!-- WHERE-->
<!-- fs.fire_station_id = ${fireStationId}-->
<!-- and f.id is not null-->
<!-- LIMIT ${start}, ${length};-->
<!-- </select>-->
<!-- <select id="queryCountForPage" resultType="long">-->
<!-- SELECT-->
<!-- COUNT(1)-->
<!-- FROM-->
<!-- f_fire_station fs-->
<!-- WHERE-->
<!-- 1=1-->
<!-- <if test="name!=null">-->
<!-- AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')-->
<!-- </if>-->
<!-- <if test="code!=null">-->
<!-- AND fs.`code` LIKE '%${code}%'-->
<!-- </if>-->
<!-- <if test="type!=null">-->
<!-- AND fs.`type` LIKE '%${type}%';-->
<!-- </if>-->
<!-- </select>-->
<!-- <select id="queryForPage" resultType="java.util.Map">-->
<!-- SELECT-->
<!-- fs.id,-->
<!-- fs.name,-->
<!-- fs.code,-->
<!-- fs.type,-->
<!-- fs.address,-->
<!-- fs.floor3d,-->
<!-- fs.position3d,-->
<!-- fs.is_indoor as isIndoor,-->
<!-- frs.name riskSourceName-->
<!-- FROM-->
<!-- f_fire_station fs-->
<!-- left join f_risk_source frs on frs.id = fs.risk_source_id-->
<!-- WHERE-->
<!-- 1=1-->
<!-- <if test="name!=null">-->
<!-- AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')-->
<!-- </if>-->
<!-- <if test="code!=null">-->
<!-- AND fs.`code` LIKE '%${code}%'-->
<!-- </if>-->
<!-- <if test="type!=null">-->
<!-- AND fs.`type` LIKE '%${type}%'-->
<!-- </if>-->
<!-- LIMIT ${start},${length} ;-->
<!-- </select>-->
<select id="queryForList" resultType="java.util.Map">
......@@ -139,19 +139,19 @@
</select>
<select id="queryEquipCountById" resultType="java.util.Map">
SELECT
fe.`name`,
SUM(fse.number) count,
fe.unit
FROM
`f_fire_station_equipment` fse
LEFT JOIN f_fire_equipment fe ON fe.id = fse.fire_equipment_id
WHERE
fire_station_id = #{id}
GROUP BY
fe.`name`,fe.unit
</select>
<!-- <select id="queryEquipCountById" resultType="java.util.Map">-->
<!-- SELECT-->
<!-- fe.`name`,-->
<!-- SUM(fse.number) count,-->
<!-- fe.unit-->
<!-- FROM-->
<!-- `f_fire_station_equipment` fse-->
<!-- LEFT JOIN f_fire_equipment fe ON fe.id = fse.fire_equipment_id-->
<!-- WHERE-->
<!-- fire_station_id = #{id}-->
<!-- GROUP BY-->
<!-- fe.`name`,fe.unit-->
<!-- </select>-->
</mapper>
\ No newline at end of file
......@@ -4,19 +4,19 @@
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.FireStationEquipmentMapper">
<select id="queryRelation" resultType="java.util.Map">
<!-- <select id="queryRelation" resultType="java.util.Map">-->
SELECT
*
FROM
f_fire_station_equipment se
WHERE
se.fire_equipment_id = ${fireEquipmentId}
AND se.fire_station_id = ${fireStationId};
</select>
<update id="updateNumberById">
update f_fire_station_equipment set number = #{diff}
where id = #{stationEquiId}
</update>
<!-- SELECT-->
<!-- *-->
<!-- FROM-->
<!-- f_fire_station_equipment se-->
<!-- WHERE-->
<!-- se.fire_equipment_id = ${fireEquipmentId}-->
<!-- AND se.fire_station_id = ${fireStationId};-->
<!-- </select>-->
<!-- -->
<!-- <update id="updateNumberById">-->
<!-- update f_fire_station_equipment set number = #{diff}-->
<!-- where id = #{stationEquiId}-->
<!-- </update>-->
</mapper>
\ No newline at end of file
......@@ -4,90 +4,90 @@
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.FireStrengthMapper">
<select id="queryOne" resultType="java.util.Map">
SELECT
id,
username,
`code`,
position,
tel,
phone_num,
job_des,
remark,
org_code,
create_by,
create_date,
day_end dayEnd,
day_begin dayBegin
FROM
f_fire_strength
WHERE
id = #{id}
</select>
<!-- <select id="queryOne" resultType="java.util.Map">-->
<!-- SELECT-->
<!-- id,-->
<!-- username,-->
<!-- `code`,-->
<!-- position,-->
<!-- tel,-->
<!-- phone_num,-->
<!-- job_des,-->
<!-- remark,-->
<!-- org_code,-->
<!-- create_by,-->
<!-- create_date,-->
<!-- day_end dayEnd,-->
<!-- day_begin dayBegin-->
<!-- FROM-->
<!-- f_fire_strength-->
<!-- WHERE-->
<!-- id = #{id}-->
<!-- </select>-->
<select id="queryCountForPage" resultType="long">
<!-- <select id="queryCountForPage" resultType="long">-->
SELECT
COUNT(1)
FROM
f_fire_strength fs
WHERE
1=1
<if test="username!=null">
AND (fs.username LIKE '%${username}%' or fs.`code` LIKE '%${username}%')
</if>
<if test="code!=null">
AND fs.`code` LIKE '%${code}%';
</if>
</select>
<select id="queryForPage" resultType="java.util.Map">
<!-- SELECT-->
<!-- COUNT(1)-->
<!-- FROM-->
<!-- f_fire_strength fs-->
<!-- WHERE-->
<!-- 1=1-->
<!-- <if test="username!=null">-->
<!-- AND (fs.username LIKE '%${username}%' or fs.`code` LIKE '%${username}%')-->
<!-- </if>-->
<!-- <if test="code!=null">-->
<!-- AND fs.`code` LIKE '%${code}%';-->
<!-- </if>-->
<!-- </select>-->
<!-- <select id="queryForPage" resultType="java.util.Map">-->
SELECT
*
FROM
f_fire_strength fs
WHERE
1=1
<!-- SELECT-->
<!-- *-->
<!-- FROM-->
<!-- f_fire_strength fs-->
<!-- WHERE-->
<!-- 1=1-->
<if test="username!=null">
AND (fs.username LIKE '%${username}%' or fs.`code` LIKE '%${username}%')
</if>
<if test="code!=null">
AND fs.`code` LIKE '%${code}%';
</if>
LIMIT ${start},${length} ;
<!-- <if test="username!=null">-->
<!-- AND (fs.username LIKE '%${username}%' or fs.`code` LIKE '%${username}%')-->
<!-- </if>-->
<!-- <if test="code!=null">-->
<!-- AND fs.`code` LIKE '%${code}%';-->
<!-- </if>-->
<!-- LIMIT ${start},${length} ;-->
</select>
<!-- </select>-->
<select id="queryForStrengthList" resultType="com.yeejoin.amos.fas.dao.entity.FireStrength">
SELECT
*
FROM
f_fire_strength t
WHERE
TIME_TO_SEC(#{time}) &gt;= TIME_TO_SEC( t.day_begin )
AND TIME_TO_SEC(#{time}) &lt;= TIME_TO_SEC(
t.day_end)
</select>
<!-- <select id="queryForStrengthList" resultType="com.yeejoin.amos.fas.dao.entity.FireStrength">-->
<!-- SELECT-->
<!-- * -->
<!-- FROM-->
<!-- f_fire_strength t -->
<!-- WHERE-->
<!-- TIME_TO_SEC(#{time}) &gt;= TIME_TO_SEC( t.day_begin ) -->
<!-- AND TIME_TO_SEC(#{time}) &lt;= TIME_TO_SEC(-->
<!-- t.day_end)-->
<!-- </select>-->
<insert id="save" parameterType="com.yeejoin.amos.fas.dao.entity.FireStrength">
INSERT INTO f_fire_strength
username,
`code`,
position,
tel,
phone_num,
job_des,
remark,
org_code,
create_by,
create_date,
day_end ,
day_begin
VALUES(#{username},#{code},#{position},#{tel},#{phoneNum},#{jobDes},#{remark},#{orgCode},#{createBy},NOW(),#{dayEnd},#{dayBegin})
</insert>
<!-- <insert id="save" parameterType="com.yeejoin.amos.fas.dao.entity.FireStrength">-->
<!-- INSERT INTO f_fire_strength-->
<!-- username,-->
<!-- `code`,-->
<!-- position,-->
<!-- tel,-->
<!-- phone_num,-->
<!-- job_des,-->
<!-- remark,-->
<!-- org_code,-->
<!-- create_by,-->
<!-- create_date,-->
<!-- day_end ,-->
<!-- day_begin -->
<!-- VALUES(#{username},#{code},#{position},#{tel},#{phoneNum},#{jobDes},#{remark},#{orgCode},#{createBy},NOW(),#{dayEnd},#{dayBegin})-->
<!-- </insert>-->
</mapper>
\ No newline at end of file
......@@ -202,90 +202,90 @@
</select>
<select id="queryForEquipmentPageCount" resultType="long">
select
count(1)
from f_fire_equipment fe
where
1=1
<if test="equipClassify!=null">
and fe.equip_classify in ( ${equipClassify} )
</if>
<!-- <select id="queryForEquipmentPageCount" resultType="long">-->
<!-- select-->
<!-- count(1)-->
<!-- from f_fire_equipment fe-->
<!-- where-->
<!-- 1=1-->
<!-- <if test="equipClassify!=null">-->
<!-- and fe.equip_classify in ( ${equipClassify} )-->
<!-- </if>-->
<if test="code!=null">
and fe.`code` like '%${code}%'
</if>
<if test="name!=null">
and (fe.`name` like '%${name}%' or fe.`code` like '%${name}%')
</if>
<!-- 筛选未绑定的配套设施
-->
<if test="bindStation != null and bindStation == 'false'">
AND (select true from
f_fire_station_equipment fse
left join f_fire_equipment e on fse.fire_equipment_id = e.id
where fse.fire_equipment_id = fe.id AND e.equip_classify != 1 limit 0,1) is not true
</if>
</select>
<!-- <if test="code!=null">-->
<!-- and fe.`code` like '%${code}%'-->
<!-- </if>-->
<!-- <if test="name!=null">-->
<!-- and (fe.`name` like '%${name}%' or fe.`code` like '%${name}%')-->
<!-- </if>-->
<!-- &lt;!&ndash; 筛选未绑定的配套设施-->
<!-- &ndash;&gt;-->
<!-- <if test="bindStation != null and bindStation == 'false'">-->
<!-- AND (select true from-->
<!-- f_fire_station_equipment fse-->
<!-- left join f_fire_equipment e on fse.fire_equipment_id = e.id-->
<!-- where fse.fire_equipment_id = fe.id AND e.equip_classify != 1 limit 0,1) is not true-->
<!-- </if>-->
<!-- </select>-->
<select id="queryForEquipmentPage" resultType="map">
select * from (
select
fe.*, (
SELECT
'YES'
FROM
f_equipment_fire_equipment efe
WHERE
efe.fire_equipment_id = fe.id limit 0,1
) isBind,
frs.name riskSourceName,
(select true from
f_fire_station_equipment fse
left join f_fire_equipment e on fse.fire_equipment_id = e.id
where fse.fire_equipment_id = fe.id AND e.equip_classify != 1 limit 0,1) as bindStation
from f_fire_equipment fe
left join f_risk_source frs on frs.id = fe.risk_source_id
where 1=1) tmp
<where>
<if test="equipClassify!=null">
and tmp.equip_classify in ( ${equipClassify} )
</if>
<!-- <select id="queryForEquipmentPage" resultType="map">-->
<!-- select * from (-->
<!-- select-->
<!-- fe.*, (-->
<!-- SELECT-->
<!-- 'YES'-->
<!-- FROM-->
<!-- f_equipment_fire_equipment efe-->
<!-- WHERE-->
<!-- efe.fire_equipment_id = fe.id limit 0,1-->
<!-- ) isBind,-->
<!-- frs.name riskSourceName,-->
<!-- (select true from-->
<!-- f_fire_station_equipment fse-->
<!-- left join f_fire_equipment e on fse.fire_equipment_id = e.id-->
<!-- where fse.fire_equipment_id = fe.id AND e.equip_classify != 1 limit 0,1) as bindStation-->
<!-- from f_fire_equipment fe-->
<!-- left join f_risk_source frs on frs.id = fe.risk_source_id-->
<!-- where 1=1) tmp-->
<!-- <where>-->
<!-- <if test="equipClassify!=null">-->
<!-- and tmp.equip_classify in ( ${equipClassify} )-->
<!-- </if>-->
<if test="code!=null">
and tmp.`code` like '%${code}%'
</if>
<if test="name!=null">
and (tmp.`name` like '%${name}%' or tmp.`code` like '%${name}%')
</if>
<!-- 筛选未绑定的配套设施
-->
<if test="bindStation != null and bindStation == 'false'">
AND tmp.bindStation is not true
</if>
</where>
LIMIT ${start},${length}
</select>
<!-- <if test="code!=null">-->
<!-- and tmp.`code` like '%${code}%'-->
<!-- </if>-->
<!-- <if test="name!=null">-->
<!-- and (tmp.`name` like '%${name}%' or tmp.`code` like '%${name}%')-->
<!-- </if>-->
<!-- &lt;!&ndash; 筛选未绑定的配套设施-->
<!-- &ndash;&gt;-->
<!-- <if test="bindStation != null and bindStation == 'false'">-->
<!-- AND tmp.bindStation is not true-->
<!-- </if>-->
<!-- </where>-->
<!-- LIMIT ${start},${length}-->
<!-- </select>-->
<select id="queryForGroupCount" resultType="map">
SELECT
fe.`name`,
fe.unit,
count(1) fireEquipmentCount
FROM
f_fire_equipment fe
WHERE
EXISTS (
SELECT
1
FROM
f_fire_station_equipment se
WHERE
se.fire_station_id = ${fireStationId}
AND se.fire_equipment_id = fe.id
)
</select>
<!-- <select id="queryForGroupCount" resultType="map">-->
<!-- SELECT-->
<!-- fe.`name`,-->
<!-- fe.unit,-->
<!-- count(1) fireEquipmentCount-->
<!-- FROM-->
<!-- f_fire_equipment fe-->
<!-- WHERE-->
<!-- EXISTS (-->
<!-- SELECT-->
<!-- 1-->
<!-- FROM-->
<!-- f_fire_station_equipment se-->
<!-- WHERE-->
<!-- se.fire_station_id = ${fireStationId}-->
<!-- AND se.fire_equipment_id = fe.id-->
<!-- )-->
<!-- </select>-->
<select id="queryStorageEquips" resultType="map">
SELECT
......@@ -306,38 +306,38 @@
wed.`name`
</select>
<select id="findEquipDetailsById" resultType="com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse">
SELECT
eq.`name`,
eq.`code`,
eq.address,
fs.`name` stationName,
eq.charge_user_id userId
FROM
f_equipment eq
LEFT JOIN f_fire_station fs ON fs.id = eq.fire_station_id
<where>
<if test="id!=null">AND eq.id = #{id}</if>
</where>
</select>
<!-- <select id="findEquipDetailsById" resultType="com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse">-->
<!-- SELECT-->
<!-- eq.`name`,-->
<!-- eq.`code`,-->
<!-- eq.address,-->
<!-- fs.`name` stationName,-->
<!-- eq.charge_user_id userId-->
<!-- FROM-->
<!-- f_equipment eq-->
<!-- LEFT JOIN f_fire_station fs ON fs.id = eq.fire_station_id-->
<!-- <where>-->
<!-- <if test="id!=null">AND eq.id = #{id}</if>-->
<!-- </where>-->
<!-- </select>-->
<select id="findOneByPointCode" resultType="com.yeejoin.amos.fas.business.vo.EquipCommunicationData">
SELECT
p.`code` pointCode,
p.`name` pointName,
e.id fireEquipmentId,
e.`name` fireEquipmentName,
e.code fireEquipmentCode,
p.type,
d.dict_value alarmType,
p.unit
FROM
f_fire_equipment_point p
LEFT JOIN f_fire_equipment e ON e.id = p.fire_equipment_id
LEFT JOIN f_dict d on d.id = p.alarm_type
where p.`code` = #{code}
</select>
<!-- <select id="findOneByPointCode" resultType="com.yeejoin.amos.fas.business.vo.EquipCommunicationData">-->
<!-- SELECT-->
<!-- p.`code` pointCode,-->
<!-- p.`name` pointName,-->
<!-- e.id fireEquipmentId,-->
<!-- e.`name` fireEquipmentName,-->
<!-- e.code fireEquipmentCode,-->
<!-- p.type,-->
<!-- d.dict_value alarmType,-->
<!-- p.unit-->
<!-- FROM-->
<!-- f_fire_equipment_point p-->
<!-- LEFT JOIN f_fire_equipment e ON e.id = p.fire_equipment_id-->
<!-- LEFT JOIN f_dict d on d.id = p.alarm_type-->
<!-- where p.`code` = #{code}-->
<!-- </select>-->
<select id="listByCodes" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity">
select
......@@ -603,39 +603,39 @@
</if>
</select>
<select id="findFireStationById" resultType="com.yeejoin.amos.fas.dao.entity.FireStation">
SELECT
*
FROM
(
SELECT
a.instance_id AS id,
MAX(
CASE
WHEN a.field_name = 'name' THEN
a.field_value
END
) AS name,
MAX(
CASE
WHEN a.field_name = 'code' THEN
a.field_value
END
) AS code,
MAX(
CASE
WHEN a.field_name = 'address' THEN
a.field_value
END
) AS address
FROM
`wl_form_instance` a
WHERE
a.group_code IN ('pool','r_pool','fireFoamRoom', 'r_fireFoamRoom','fireRoom','r_fireRoom')
GROUP BY
a.instance_id
) s,
f_risk_source r
where s.id = r.source_id and s.id = #{id}
</select>
<!-- <select id="findFireStationById" resultType="com.yeejoin.amos.fas.dao.entity.FireStation">-->
<!-- SELECT-->
<!-- *-->
<!-- FROM-->
<!-- (-->
<!-- SELECT-->
<!-- a.instance_id AS id,-->
<!-- MAX(-->
<!-- CASE-->
<!-- WHEN a.field_name = 'name' THEN-->
<!-- a.field_value-->
<!-- END-->
<!-- ) AS name,-->
<!-- MAX(-->
<!-- CASE-->
<!-- WHEN a.field_name = 'code' THEN-->
<!-- a.field_value-->
<!-- END-->
<!-- ) AS code,-->
<!-- MAX(-->
<!-- CASE-->
<!-- WHEN a.field_name = 'address' THEN-->
<!-- a.field_value-->
<!-- END-->
<!-- ) AS address-->
<!-- FROM-->
<!-- `wl_form_instance` a-->
<!-- WHERE-->
<!-- a.group_code IN ('pool','r_pool','fireFoamRoom', 'r_fireFoamRoom','fireRoom','r_fireRoom')-->
<!-- GROUP BY-->
<!-- a.instance_id-->
<!-- ) s,-->
<!-- f_risk_source r-->
<!-- where s.id = r.source_id and s.id = #{id}-->
<!-- </select>-->
</mapper>
\ No newline at end of file
......@@ -3,323 +3,323 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.View3dMapper">
<select id="getPointByType" resultType="com.yeejoin.amos.fas.core.common.response.RegionTreeResponse">
<choose>
<when test="type == 'riskSource'">
select
R.id,R.name,R.code,R.parent_id,R.ue4_location,R.ue4_rotation,R.ue4_extent,
<choose>
<when test="channelType == '3dpage'">
IF(ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,R.ue4_rotation))
AND ISNULL(IF(replace(trim(ue4_location),'[]','')='',NULL,R.ue4_location)),0,1) as is_bind,
</otherwise>
</choose>
#{type} as type,
route_path,
rl.level,
CONCAT('level_',rl.level) as level_str,
0 as is_region,
R.position3d
from f_risk_source R
left join f_risk_level rl on rl.id = R.risk_level_id
where 1=1
AND R.risk_level_id is not null
AND R.is_region = 'FALSE'
</when>
<when test="type == 'patrol'">
select
B.id,B.risk_source_id as parent_id,
<choose>
<when test="channelType == '3dpage'">
IF(ISNULL(B.coordinates) || LENGTH(trim(B.coordinates)) <![CDATA[ <]]> 1,0,1) as is_bind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))
AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,
</otherwise>
</choose>
#{type} as type,
B.name as name,B.point_no as code,B.ue4_location,B.ue4_rotation,
0 as is_region,
B.coordinates as position3d,
B.status as level,
CONCAT('level_',B.status) as level_str
from f_risk_source R
left join p_point B on B.risk_source_id = R.id AND R.is_region='TRUE'
where 1=1
AND B.id is not null AND B.is_delete = 0
</when>
<when test="type == 'impEquipment'">
select
B.id,B.risk_source_id as parent_id,
<choose>
<when test="channelType == '3dpage'">
IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))
AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,
</otherwise>
</choose>
#{type} as type,
B.name,B.code,B.ue4_location,B.ue4_rotation,
0 as is_region,
B.position3d
from f_risk_source R
left join f_equipment B on B.risk_source_id = R.id AND R.is_region='TRUE'
where 1=1
AND B.id is not null
</when>
<when test="type == 'monitorEquipment'">
select
B.id,B.risk_source_id as parent_id,
<choose>
<when test="channelType == '3dpage'">
IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))
AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,
</otherwise>
</choose>
#{type} as type,
B.name,B.code,B.ue4_location,B.ue4_rotation,
0 as is_region,
B.position3d
from f_risk_source R
left join f_fire_equipment B on B.risk_source_id = R.id AND B.equip_classify = 0
where 1=1
AND B.id is not null
</when>
<when test="type == 'video'">
select
B.id,B.risk_source_id as parent_id,
<choose>
<when test="channelType == '3dpage'">
IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))
AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,
</otherwise>
</choose>
#{type} as type,
B.name,B.code,B.ue4_location,B.ue4_rotation,
0 as is_region,
B.position3d
from f_risk_source R
left join f_fire_equipment B on B.risk_source_id = R.id AND B.equip_classify = 2
where 1=1
AND B.id is not null
</when>
<when test="type == 'fireEquipment'">
select tmp.id,tmp.name,tmp.type,tmp.position3d,tmp.ue4_rotation,tmp.ue4_location,tmp.code,R.id as parent_id,
<choose>
<when test="channelType == '3dpage'">
IF(ISNULL(tmp.position3d) || LENGTH(trim(tmp.position3d)) <![CDATA[ <]]> 1,0,1) as isBind
</when>
<otherwise>
IF(ISNULL(IF(replace(trim(tmp.ue4_rotation),'[]','')='',NULL,tmp.ue4_rotation))
AND ISNULL(IF(replace(trim(tmp.ue4_location),'[]','')='',NULL,tmp.ue4_location)),0,1) as isBind
</otherwise>
</choose>
from (
select id,name,'fireCar' as type,position3d,car_num as code,ue4_location,ue4_rotation,risk_source_id
from f_fire_car
union all
select id,name,'fireEquipment' as type,position3d,code,ue4_location,ue4_rotation,risk_source_id
from f_fire_equipment
where equip_classify =3
union all
select id,name,CASE
WHEN S.type = 1 then 'fireChamber'
WHEN S.type = 2 then 'fireFoamRoom'
END as type,position3d,code,ue4_location,ue4_rotation,risk_source_id
from f_fire_station s
union all
select id,name,
CASE
WHEN W.type = 1 then 'hydrant'
WHEN W.type = 2 then 'pool'
END as type,position3d,code,ue4_location,ue4_rotation,risk_source_id
from f_water_resource w
) tmp
left join f_risk_source R on R.id = tmp.risk_source_id
<!-- <select id="getPointByType" resultType="com.yeejoin.amos.fas.core.common.response.RegionTreeResponse">-->
<!-- <choose>-->
<!-- <when test="type == 'riskSource'">-->
<!-- select-->
<!-- R.id,R.name,R.code,R.parent_id,R.ue4_location,R.ue4_rotation,R.ue4_extent,-->
<!-- <choose>-->
<!-- <when test="channelType == '3dpage'">-->
<!-- IF(ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- IF(ISNULL(IF(replace(trim(ue4_rotation),'[]','')='',NULL,R.ue4_rotation))-->
<!-- AND ISNULL(IF(replace(trim(ue4_location),'[]','')='',NULL,R.ue4_location)),0,1) as is_bind,-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- #{type} as type,-->
<!-- route_path,-->
<!-- rl.level,-->
<!-- CONCAT('level_',rl.level) as level_str,-->
<!-- 0 as is_region,-->
<!-- R.position3d-->
<!-- from f_risk_source R-->
<!-- left join f_risk_level rl on rl.id = R.risk_level_id-->
<!-- where 1=1-->
<!-- AND R.risk_level_id is not null-->
<!-- AND R.is_region = 'FALSE'-->
<!-- </when>-->
<!-- <when test="type == 'patrol'">-->
<!-- select-->
<!-- B.id,B.risk_source_id as parent_id,-->
<!-- <choose>-->
<!-- <when test="channelType == '3dpage'">-->
<!-- IF(ISNULL(B.coordinates) || LENGTH(trim(B.coordinates)) <![CDATA[ <]]> 1,0,1) as is_bind,-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))-->
<!-- AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- #{type} as type,-->
<!-- B.name as name,B.point_no as code,B.ue4_location,B.ue4_rotation,-->
<!-- 0 as is_region,-->
<!-- B.coordinates as position3d,-->
<!-- B.status as level,-->
<!-- CONCAT('level_',B.status) as level_str-->
<!-- from f_risk_source R-->
<!-- left join p_point B on B.risk_source_id = R.id AND R.is_region='TRUE'-->
<!-- where 1=1-->
<!-- AND B.id is not null AND B.is_delete = 0-->
<!-- </when>-->
<!-- <when test="type == 'impEquipment'">-->
<!-- select-->
<!-- B.id,B.risk_source_id as parent_id,-->
<!-- <choose>-->
<!-- <when test="channelType == '3dpage'">-->
<!-- IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))-->
<!-- AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- #{type} as type,-->
<!-- B.name,B.code,B.ue4_location,B.ue4_rotation,-->
<!-- 0 as is_region,-->
<!-- B.position3d-->
<!-- from f_risk_source R-->
<!-- left join f_equipment B on B.risk_source_id = R.id AND R.is_region='TRUE'-->
<!-- where 1=1-->
<!-- AND B.id is not null-->
<!-- </when>-->
<!-- <when test="type == 'monitorEquipment'">-->
<!-- select-->
<!-- B.id,B.risk_source_id as parent_id,-->
<!-- <choose>-->
<!-- <when test="channelType == '3dpage'">-->
<!-- IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))-->
<!-- AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- #{type} as type,-->
<!-- B.name,B.code,B.ue4_location,B.ue4_rotation,-->
<!-- 0 as is_region,-->
<!-- B.position3d-->
<!-- from f_risk_source R-->
<!-- left join f_fire_equipment B on B.risk_source_id = R.id AND B.equip_classify = 0-->
<!-- where 1=1-->
<!-- AND B.id is not null-->
<!-- </when>-->
<!-- <when test="type == 'video'">-->
<!-- select-->
<!-- B.id,B.risk_source_id as parent_id,-->
<!-- <choose>-->
<!-- <when test="channelType == '3dpage'">-->
<!-- IF(ISNULL(B.position3d) || LENGTH(trim(B.position3d)) <![CDATA[ <]]> 1,0,1) as is_bind,-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- IF(ISNULL(IF(replace(trim(B.ue4_rotation),'[]','')='',NULL,B.ue4_rotation))-->
<!-- AND ISNULL(IF(replace(trim(B.ue4_location),'[]','')='',NULL,B.ue4_location)),0,1) as is_bind,-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- #{type} as type,-->
<!-- B.name,B.code,B.ue4_location,B.ue4_rotation,-->
<!-- 0 as is_region,-->
<!-- B.position3d-->
<!-- from f_risk_source R-->
<!-- left join f_fire_equipment B on B.risk_source_id = R.id AND B.equip_classify = 2-->
<!-- where 1=1-->
<!-- AND B.id is not null-->
<!-- </when>-->
<!-- <when test="type == 'fireEquipment'">-->
<!-- select tmp.id,tmp.name,tmp.type,tmp.position3d,tmp.ue4_rotation,tmp.ue4_location,tmp.code,R.id as parent_id,-->
<!-- <choose>-->
<!-- <when test="channelType == '3dpage'">-->
<!-- IF(ISNULL(tmp.position3d) || LENGTH(trim(tmp.position3d)) <![CDATA[ <]]> 1,0,1) as isBind-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- IF(ISNULL(IF(replace(trim(tmp.ue4_rotation),'[]','')='',NULL,tmp.ue4_rotation))-->
<!-- AND ISNULL(IF(replace(trim(tmp.ue4_location),'[]','')='',NULL,tmp.ue4_location)),0,1) as isBind-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- from (-->
<!-- select id,name,'fireCar' as type,position3d,car_num as code,ue4_location,ue4_rotation,risk_source_id-->
<!-- from f_fire_car-->
<!-- union all-->
<!-- select id,name,'fireEquipment' as type,position3d,code,ue4_location,ue4_rotation,risk_source_id-->
<!-- from f_fire_equipment-->
<!-- where equip_classify =3-->
<!-- union all-->
<!-- select id,name,CASE-->
<!-- WHEN S.type = 1 then 'fireChamber'-->
<!-- WHEN S.type = 2 then 'fireFoamRoom'-->
<!-- END as type,position3d,code,ue4_location,ue4_rotation,risk_source_id-->
<!-- from f_fire_station s-->
<!-- union all-->
<!-- select id,name,-->
<!-- CASE-->
<!-- WHEN W.type = 1 then 'hydrant'-->
<!-- WHEN W.type = 2 then 'pool'-->
<!-- END as type,position3d,code,ue4_location,ue4_rotation,risk_source_id-->
<!-- from f_water_resource w-->
<!-- ) tmp-->
<!-- left join f_risk_source R on R.id = tmp.risk_source_id-->
</when>
</choose>
<if test="orgCode != null">
AND (R.org_code = #{orgCode} OR R.org_code like CONCAT(#{orgCode},'-%'))
</if>
</select>
<!-- </when>-->
<!-- </choose>-->
<!-- <if test="orgCode != null">-->
<!-- AND (R.org_code = #{orgCode} OR R.org_code like CONCAT(#{orgCode},'-%'))-->
<!-- </if>-->
<!-- </select>-->
<select id="getPointDetailByTypeAndId" resultType="java.util.HashMap">
<choose>
<when test="type == 'riskSource'">
select rs.id,rs.name,rs.code,rs.ue4_location as ue4Location,rs.ue4_rotation as ue4Rotation,rs.position3d,
rl.level,rl.name as levelStr,rs.floor3d ,rs.is_indoor as isIndoor,
rs.flicker_frequency as frequency,
true as 'showInfo',
#{type} as type,
rs.rpn as title
from f_risk_source rs
left join f_risk_level rl ON rl.id = rs.risk_level_id
where 1=1
<if test="pointId != null">
AND rs.id = #{pointId}
</if>
</when>
<when test="type == 'patrol'">
select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,coordinates as position3d,
status,floor as floor3d,is_indoor as isIndoor,
0 as frequency,
case p.status
when '0' then false
when '1' then false
else true
end as `showInfo`,
case p.status
when '0' then '未计划'
when '1' then '合格'
when '2' then '不合格'
when '3' then '漏检'
end as title,
case p.status
when '0' then '未计划'
when '1' then '合格'
when '2' then '不合格'
when '3' then '漏检'
end as levelStr,
#{type} as type,
status as level
from p_point p
where 1=1 and is_delete = 0
<if test="pointId != null">
AND id = #{pointId}
</if>
</when>
<when test="type == 'impEquipment'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor,
0 as frequency,
false as 'showInfo',
#{type} as type,
name as 'title'
from f_equipment
where 1=1
<if test="pointId != null">
AND id = #{pointId}
</if>
</when>
<when test="type == 'monitorEquipment'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor,
0 as frequency,
false as 'showInfo',
#{type} as type,
name as 'title'
from f_fire_equipment
where equip_classify = 0
<if test="pointId != null">
AND id = #{pointId}
</if>
</when>
<when test="type == 'video'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor,
0 as frequency,
false as 'showInfo',
#{type} as type,
name as 'title'
from f_fire_equipment
where equip_classify = 2
<if test="pointId != null">
AND id = #{pointId}
</if>
</when>
<when test="type == 'hydrant'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor,
0 as frequency,
false as 'showInfo',
#{type} as type,
name as 'title'
from f_water_resource
where type = 1
<if test="pointId != null">
AND id = #{pointId}
</if>
</when>
<when test="type == 'pool'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor,
0 as frequency,
false as 'showInfo',
#{type} as type,
name as 'title'
from f_water_resource
where type = 2
<if test="pointId != null">
AND id = #{pointId}
</if>
</when>
<when test="type == 'fireCar'">
select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor,
0 as frequency,
true as 'showInfo',
#{type} as type,
name as 'title'
from f_fire_car
where 1=1
<if test="pointId != null">
AND id = #{pointId}
</if>
</when>
<when test="type == 'fireEquipment'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor,
0 as frequency,
true as 'showInfo',
#{type} as type,
name as 'title'
from f_fire_equipment
where equip_classify = 3
<if test="pointId != null">
AND id = #{pointId}
</if>
</when>
<when test="type == 'fireChamber'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor,
0 as frequency,
true as 'showInfo',
#{type} as type,
name as 'title'
from f_fire_station
where type = 1
<if test="pointId != null">
AND id = #{pointId}
</if>
</when>
<when test="type == 'fireFoamRoom'">
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,
floor3d,is_indoor as isIndoor,
0 as frequency,
true as 'showInfo',
#{type} as type,
name as 'title'
from f_fire_station
where type = 2
<if test="pointId != null">
AND id = #{pointId}
</if>
</when>
</choose>
</select>
<!-- <select id="getPointDetailByTypeAndId" resultType="java.util.HashMap">-->
<!-- <choose>-->
<!-- <when test="type == 'riskSource'">-->
<!-- select rs.id,rs.name,rs.code,rs.ue4_location as ue4Location,rs.ue4_rotation as ue4Rotation,rs.position3d,-->
<!-- rl.level,rl.name as levelStr,rs.floor3d ,rs.is_indoor as isIndoor,-->
<!-- rs.flicker_frequency as frequency,-->
<!-- true as 'showInfo',-->
<!-- #{type} as type,-->
<!-- rs.rpn as title-->
<!-- from f_risk_source rs-->
<!-- left join f_risk_level rl ON rl.id = rs.risk_level_id-->
<!-- where 1=1-->
<!-- <if test="pointId != null">-->
<!-- AND rs.id = #{pointId}-->
<!-- </if>-->
<!-- </when>-->
<!-- <when test="type == 'patrol'">-->
<!-- select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,coordinates as position3d,-->
<!-- status,floor as floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,-->
<!-- case p.status-->
<!-- when '0' then false-->
<!-- when '1' then false-->
<!-- else true-->
<!-- end as `showInfo`,-->
<!-- case p.status-->
<!-- when '0' then '未计划'-->
<!-- when '1' then '合格'-->
<!-- when '2' then '不合格'-->
<!-- when '3' then '漏检'-->
<!-- end as title,-->
<!-- case p.status-->
<!-- when '0' then '未计划'-->
<!-- when '1' then '合格'-->
<!-- when '2' then '不合格'-->
<!-- when '3' then '漏检'-->
<!-- end as levelStr,-->
<!-- #{type} as type,-->
<!-- status as level-->
<!-- from p_point p-->
<!-- where 1=1 and is_delete = 0-->
<!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}-->
<!-- </if>-->
<!-- </when>-->
<!-- <when test="type == 'impEquipment'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,-->
<!-- false as 'showInfo',-->
<!-- #{type} as type,-->
<!-- name as 'title'-->
<!-- from f_equipment-->
<!-- where 1=1-->
<!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}-->
<!-- </if>-->
<!-- </when>-->
<!-- <when test="type == 'monitorEquipment'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,-->
<!-- false as 'showInfo',-->
<!-- #{type} as type,-->
<!-- name as 'title'-->
<!-- from f_fire_equipment-->
<!-- where equip_classify = 0-->
<!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}-->
<!-- </if>-->
<!-- </when>-->
<!-- <when test="type == 'video'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,-->
<!-- false as 'showInfo',-->
<!-- #{type} as type,-->
<!-- name as 'title'-->
<!-- from f_fire_equipment-->
<!-- where equip_classify = 2-->
<!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}-->
<!-- </if>-->
<!-- </when>-->
<!-- <when test="type == 'hydrant'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,-->
<!-- false as 'showInfo',-->
<!-- #{type} as type,-->
<!-- name as 'title'-->
<!-- from f_water_resource-->
<!-- where type = 1-->
<!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}-->
<!-- </if>-->
<!-- </when>-->
<!-- <when test="type == 'pool'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,-->
<!-- false as 'showInfo',-->
<!-- #{type} as type,-->
<!-- name as 'title'-->
<!-- from f_water_resource-->
<!-- where type = 2-->
<!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}-->
<!-- </if>-->
<!-- </when>-->
<!-- <when test="type == 'fireCar'">-->
<!-- select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,-->
<!-- true as 'showInfo',-->
<!-- #{type} as type,-->
<!-- name as 'title'-->
<!-- from f_fire_car-->
<!-- where 1=1-->
<!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}-->
<!-- </if>-->
<!-- </when>-->
<!-- <when test="type == 'fireEquipment'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,-->
<!-- true as 'showInfo',-->
<!-- #{type} as type,-->
<!-- name as 'title'-->
<!-- from f_fire_equipment-->
<!-- where equip_classify = 3-->
<!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}-->
<!-- </if>-->
<!-- </when>-->
<!-- <when test="type == 'fireChamber'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,-->
<!-- true as 'showInfo',-->
<!-- #{type} as type,-->
<!-- name as 'title'-->
<!-- from f_fire_station-->
<!-- where type = 1-->
<!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}-->
<!-- </if>-->
<!-- </when>-->
<!-- <when test="type == 'fireFoamRoom'">-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,position3d,-->
<!-- floor3d,is_indoor as isIndoor,-->
<!-- 0 as frequency,-->
<!-- true as 'showInfo',-->
<!-- #{type} as type,-->
<!-- name as 'title'-->
<!-- from f_fire_station-->
<!-- where type = 2-->
<!-- <if test="pointId != null">-->
<!-- AND id = #{pointId}-->
<!-- </if>-->
<!-- </when>-->
<!-- </choose>-->
<!-- </select>-->
<select id="getSafetyIndexWeek" resultType="java.util.HashMap">
<![CDATA[
......@@ -523,226 +523,226 @@
limit 0,5
</select>
<select id="getPintsByType" resultType="hashmap">
select CONCAT(type,'-',id) as `key`,sp.* from
(select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'riskSource' as type,org_code as orgCode,
null as relationKeys
from f_risk_source where is_region = 'FALSE'
UNION all
select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'patrol' as type,org_code as orgCode,
null as relationKeys
from p_point WHERE is_delete = FALSE
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'impEquipment' as type,org_code as orgCode,
tmp.relationKeys
from f_equipment e
LEFT JOIN
(select GROUP_CONCAT(fire_equipment_id) as relationKeys,equipment_id from f_equipment_fire_equipment GROUP BY equipment_id) tmp
ON TMP.equipment_id = e.id
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'monitorEquipment' as type,org_code as orgCode,
null as relationKeys
from f_fire_equipment where equip_classify = 0
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'video' as type,org_code as orgCode,
null as relationKeys
from f_fire_equipment where equip_classify = 2
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'hydrant' as type,org_code as orgCode,
null as relationKeys
from f_water_resource where type = 1
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'pool' as type,org_code as orgCode,
null as relationKeys
from f_water_resource where type = 2
UNION all
select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation, 'fireCar' as type,org_code as orgCode,
null as relationKeys
from f_fire_car
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'fireEquipment' as type,org_code as orgCode,
null as relationKeys
from f_fire_equipment where equip_classify = 3
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation , 'fireChamber' as type,org_code as orgCode,
null as relationKeys
from f_fire_station where type = 2
UNION all
select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'fireFoamRoom' as type,org_code as orgCode,
null as relationKeys
from f_fire_station where type = 1
) as sp
where
sp.orgCode = #{orgCode}
<if test="type!=null">and sp.type =#{type}</if>
</select>
<!-- <select id="getPintsByType" resultType="hashmap">-->
<!-- select CONCAT(type,'-',id) as `key`,sp.* from-->
<!-- (select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'riskSource' as type,org_code as orgCode,-->
<!-- null as relationKeys-->
<!-- from f_risk_source where is_region = 'FALSE'-->
<!-- UNION all-->
<!-- select id,name,point_no as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'patrol' as type,org_code as orgCode,-->
<!-- null as relationKeys-->
<!-- from p_point WHERE is_delete = FALSE-->
<!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'impEquipment' as type,org_code as orgCode,-->
<!-- tmp.relationKeys-->
<!-- from f_equipment e-->
<!-- LEFT JOIN-->
<!-- (select GROUP_CONCAT(fire_equipment_id) as relationKeys,equipment_id from f_equipment_fire_equipment GROUP BY equipment_id) tmp-->
<!-- ON TMP.equipment_id = e.id-->
<!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'monitorEquipment' as type,org_code as orgCode,-->
<!-- null as relationKeys-->
<!-- from f_fire_equipment where equip_classify = 0-->
<!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'video' as type,org_code as orgCode,-->
<!-- null as relationKeys-->
<!-- from f_fire_equipment where equip_classify = 2-->
<!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'hydrant' as type,org_code as orgCode,-->
<!-- null as relationKeys-->
<!-- from f_water_resource where type = 1-->
<!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'pool' as type,org_code as orgCode,-->
<!-- null as relationKeys-->
<!-- from f_water_resource where type = 2-->
<!-- UNION all-->
<!-- select id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation, 'fireCar' as type,org_code as orgCode,-->
<!-- null as relationKeys-->
<!-- from f_fire_car-->
<!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'fireEquipment' as type,org_code as orgCode,-->
<!-- null as relationKeys-->
<!-- from f_fire_equipment where equip_classify = 3-->
<!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation , 'fireChamber' as type,org_code as orgCode,-->
<!-- null as relationKeys-->
<!-- from f_fire_station where type = 2-->
<!-- UNION all-->
<!-- select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'fireFoamRoom' as type,org_code as orgCode,-->
<!-- null as relationKeys-->
<!-- from f_fire_station where type = 1-->
<!-- ) as sp-->
<!-- where-->
<!-- sp.orgCode = #{orgCode}-->
<!-- <if test="type!=null">and sp.type =#{type}</if>-->
<!-- </select>-->
<select id="getImpEqu3dPoints" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo">
SELECT id,name,code,ue4_location,ue4_rotation,
case
when equip_classify= 0 then 'monitorEquipment'
when equip_classify= 2 then 'video'
when equip_classify= 3 then 'fireEquipment'
end as type,
case
when equip_classify= 0 then 'monitorEquipment'
when equip_classify= 2 then 'video'
when equip_classify= 3 then 'fireEquipment'
end as level,
null as relationKeys,
CASE
WHEN (
ISNULL(fe.position3d) || LENGTH(trim(fe.position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(fe.position3d, ',', 1),
',"y":',
substring_index(
substring_index(fe.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(fe.position3d, ',', - 1),
'}'
)
END position,
concat('monitorEquipment-',fe.id) as `key`
FROM f_fire_equipment fe
WHERE fe.id IN (
select fire_equipment_id from f_equipment_fire_equipment
) AND (org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%'))
AND fe.equip_classify <![CDATA[ <> ]]> 1
UNION ALL
SELECT e.id,e.name,e.code,e.ue4_location,e.ue4_rotation,'impEquipment' as type,'impEquipment' as level,
TMP.relationKeys,
CASE
WHEN (
ISNULL(e.position3d) || LENGTH(trim(e.position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(e.position3d, ',', 1),
',"y":',
substring_index(
substring_index(e.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(e.position3d, ',', - 1),
'}'
)
END position,
concat('impEquipment-',e.id) as `key`
FROM f_equipment e
LEFT JOIN
(select GROUP_CONCAT(fire_equipment_id) as relationKeys,equipment_id from f_equipment_fire_equipment GROUP BY equipment_id) tmp
ON TMP.equipment_id = e.id
WHERE e.org_code = #{orgCode} OR e.org_code like CONCAT(#{orgCode},'-%')
UNION ALL
SELECT id,name,code,ue4_location,ue4_rotation,
case type
when 1 then 'hydrant'
when 2 then 'pool'
end as type,
case type
when 1 then 'hydrant'
when 2 then 'pool'
end as level,
null as relationKeys,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END position,
case type
when 1 then concat('hydrant-',id)
when 2 then concat('pool-',id)
end as `key`
FROM f_water_resource
WHERE org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%')
UNION ALL
SELECT id,name,code,ue4_location,ue4_rotation,
case
when type = 1 then 'fireChamber'
when type = 2 then 'fireFoamRoom'
end as type,
case
when type = 1 then 'fireChamber'
when type = 2 then 'fireFoamRoom'
end as level,
null as relationKeys,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END position,
concat('fireChamber-',id) as `key`
FROM f_fire_station
WHERE org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%')
UNION ALL
SELECT id,name,car_num as code,ue4_location,ue4_rotation,'fireCar' as type,'fireCar' as level,
null as relationKeys,
CASE
WHEN (
ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(position3d, ',', 1),
',"y":',
substring_index(
substring_index(position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(position3d, ',', - 1),
'}'
)
END position,
concat('fireCar-',id) as `key`
FROM f_fire_car
WHERE org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%')
</select>
<!-- <select id="getImpEqu3dPoints" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo">-->
<!-- SELECT id,name,code,ue4_location,ue4_rotation,-->
<!-- case-->
<!-- when equip_classify= 0 then 'monitorEquipment'-->
<!-- when equip_classify= 2 then 'video'-->
<!-- when equip_classify= 3 then 'fireEquipment'-->
<!-- end as type,-->
<!-- case-->
<!-- when equip_classify= 0 then 'monitorEquipment'-->
<!-- when equip_classify= 2 then 'video'-->
<!-- when equip_classify= 3 then 'fireEquipment'-->
<!-- end as level,-->
<!-- null as relationKeys,-->
<!-- CASE-->
<!-- WHEN (-->
<!-- ISNULL(fe.position3d) || LENGTH(trim(fe.position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN-->
<!-- NULL-->
<!-- ELSE-->
<!-- CONCAT(-->
<!-- '{"x":',-->
<!-- substring_index(fe.position3d, ',', 1),-->
<!-- ',"y":',-->
<!-- substring_index(-->
<!-- substring_index(fe.position3d, ',', - 2),-->
<!-- ',',-->
<!-- 1-->
<!-- ),-->
<!-- ',"z":',-->
<!-- substring_index(fe.position3d, ',', - 1),-->
<!-- '}'-->
<!-- )-->
<!-- END position,-->
<!-- concat('monitorEquipment-',fe.id) as `key`-->
<!-- FROM f_fire_equipment fe-->
<!-- WHERE fe.id IN (-->
<!-- select fire_equipment_id from f_equipment_fire_equipment-->
<!-- ) AND (org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%'))-->
<!-- AND fe.equip_classify <![CDATA[ <> ]]> 1-->
<!-- UNION ALL-->
<!-- SELECT e.id,e.name,e.code,e.ue4_location,e.ue4_rotation,'impEquipment' as type,'impEquipment' as level,-->
<!-- TMP.relationKeys,-->
<!-- CASE-->
<!-- WHEN (-->
<!-- ISNULL(e.position3d) || LENGTH(trim(e.position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN-->
<!-- NULL-->
<!-- ELSE-->
<!-- CONCAT(-->
<!-- '{"x":',-->
<!-- substring_index(e.position3d, ',', 1),-->
<!-- ',"y":',-->
<!-- substring_index(-->
<!-- substring_index(e.position3d, ',', - 2),-->
<!-- ',',-->
<!-- 1-->
<!-- ),-->
<!-- ',"z":',-->
<!-- substring_index(e.position3d, ',', - 1),-->
<!-- '}'-->
<!-- )-->
<!-- END position,-->
<!-- concat('impEquipment-',e.id) as `key`-->
<!-- FROM f_equipment e-->
<!-- LEFT JOIN-->
<!-- (select GROUP_CONCAT(fire_equipment_id) as relationKeys,equipment_id from f_equipment_fire_equipment GROUP BY equipment_id) tmp-->
<!-- ON TMP.equipment_id = e.id-->
<!-- WHERE e.org_code = #{orgCode} OR e.org_code like CONCAT(#{orgCode},'-%')-->
<!-- UNION ALL-->
<!-- SELECT id,name,code,ue4_location,ue4_rotation,-->
<!-- case type-->
<!-- when 1 then 'hydrant'-->
<!-- when 2 then 'pool'-->
<!-- end as type,-->
<!-- case type-->
<!-- when 1 then 'hydrant'-->
<!-- when 2 then 'pool'-->
<!-- end as level,-->
<!-- null as relationKeys,-->
<!-- CASE-->
<!-- WHEN (-->
<!-- ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN-->
<!-- NULL-->
<!-- ELSE-->
<!-- CONCAT(-->
<!-- '{"x":',-->
<!-- substring_index(position3d, ',', 1),-->
<!-- ',"y":',-->
<!-- substring_index(-->
<!-- substring_index(position3d, ',', - 2),-->
<!-- ',',-->
<!-- 1-->
<!-- ),-->
<!-- ',"z":',-->
<!-- substring_index(position3d, ',', - 1),-->
<!-- '}'-->
<!-- )-->
<!-- END position,-->
<!-- case type-->
<!-- when 1 then concat('hydrant-',id)-->
<!-- when 2 then concat('pool-',id)-->
<!-- end as `key`-->
<!-- FROM f_water_resource-->
<!-- WHERE org_code = #{orgCode} OR org_code like CONCAT(#{orgCode},'-%')-->
<!-- UNION ALL-->
<!-- SELECT id,name,code,ue4_location,ue4_rotation,-->
<!-- case-->
<!-- when type = 1 then 'fireChamber'-->
<!-- when type = 2 then 'fireFoamRoom'-->
<!-- end as type,-->
<!-- case-->
<!-- when type = 1 then 'fireChamber'-->
<!-- when type = 2 then 'fireFoamRoom'-->
<!-- end as level,-->
<!-- null as relationKeys,-->
<!-- CASE-->
<!-- WHEN (-->
<!-- ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN-->
<!-- NULL-->
<!-- ELSE-->
<!-- CONCAT(-->
<!-- '{"x":',-->
<!-- substring_index(position3d, ',', 1),-->
<!-- ',"y":',-->
<!-- substring_index(-->
<!-- substring_index(position3d, ',', - 2),-->
<!-- ',',-->
<!-- 1-->
<!-- ),-->
<!-- ',"z":',-->
<!-- substring_index(position3d, ',', - 1),-->
<!-- '}'-->
<!-- )-->
<!-- END position,-->
<!-- concat('fireChamber-',id) as `key`-->
<!-- FROM f_fire_station-->
<!-- WHERE org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%')-->
<!-- UNION ALL-->
<!-- SELECT id,name,car_num as code,ue4_location,ue4_rotation,'fireCar' as type,'fireCar' as level,-->
<!-- null as relationKeys,-->
<!-- CASE-->
<!-- WHEN (-->
<!-- ISNULL(position3d) || LENGTH(trim(position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN-->
<!-- NULL-->
<!-- ELSE-->
<!-- CONCAT(-->
<!-- '{"x":',-->
<!-- substring_index(position3d, ',', 1),-->
<!-- ',"y":',-->
<!-- substring_index(-->
<!-- substring_index(position3d, ',', - 2),-->
<!-- ',',-->
<!-- 1-->
<!-- ),-->
<!-- ',"z":',-->
<!-- substring_index(position3d, ',', - 1),-->
<!-- '}'-->
<!-- )-->
<!-- END position,-->
<!-- concat('fireCar-',id) as `key`-->
<!-- FROM f_fire_car-->
<!-- WHERE org_code = #{orgCode} OR org_code LIKE CONCAT(#{orgCode},'-%')-->
<!-- </select>-->
<select id="initViewErrorNode" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo">
select * from (
......@@ -811,409 +811,409 @@
</if>
</select>
<select id="findViewDataByType" resultType="com.yeejoin.amos.fas.core.common.response.Node3DVoResponse">
SELECT
*
FROM
(
SELECT
rs.code,
rs.id,
rs.is_indoor inDoor,
CONCAT('riskSource-', rs.id) 'key',
rs.`name` label,
rl.`level` 'level',
CONCAT('level_', rl.`level`) levelStr,
CONCAT('floor_1', floor3d) objKey,
CASE
WHEN (
ISNULL(rs.position3d) || LENGTH(trim(rs.position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(rs.position3d, ',', 1),
',"y":',
substring_index(
substring_index(rs.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(rs.position3d, ',', - 1),
'}'
)
END positionDTO,
'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,
'{ "x": 1, "y": 1, "z": 1 }' scaleDTO,
true as showInfo,
rs.rpn as title,
'riskSource' type,
rs.org_code as orgCode,
rs.id as riskSourceId,
rs.flicker_frequency as frequency,
if('NORMAL'=rs.status,FALSE,TRUE) as twinkle
FROM
f_risk_source rs
LEFT JOIN f_risk_level rl ON rl.id = rs.risk_level_id
WHERE
rs.position3d IS NOT NULL
AND rs.position3d != ''
AND rs.risk_level_id is not null
<if test="abnormalStatus != false">
AND rs.status = 'ANOMALY'
</if>
AND rs.is_region <![CDATA[<>]]> 'TRUE'
UNION ALL
SELECT
eq.code,
id,
is_indoor inDoor,
CONCAT('impEquipment-', id) 'key',
`name` label,
'0' LEVEL,
'level_0' levelStr,
CONCAT('floor_1', floor3d) objKey,
CASE
WHEN (
ISNULL(eq.position3d) || LENGTH(trim(eq.position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(eq.position3d, ',', 1),
',"y":',
substring_index(
substring_index(eq.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(eq.position3d, ',', - 1),
'}'
)
END positionDTO,
'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,
'{ "x": 1, "y": 1, "z": 1 }' scaleDTO,
FALSE as showInfo,
name as title,
'impEquipment' type,
eq.org_code as orgCode,
eq.risk_source_id as riskSourceId,
0 as frequency,
FALSE as twinkle
FROM
f_equipment eq
WHERE
position3d IS NOT NULL
AND eq.risk_source_id in (select id from f_risk_source where is_region='TRUE')
AND position3d != ''
<if test="abnormalStatus != false">
AND eq.id in
(select equipment_id from f_equipment_fire_equipment fefe
left join f_fire_equipment fe ON fe.id = fefe.fire_equipment_id
where fe.equip_status = 1)
</if>
UNION ALL
select
p.point_no code,
p.id,
p.is_indoor as inDoor,
CONCAT('patrol',p.id) as `key`,
p.name,
p.status as LEVEL,
CONCAT('level_',p.status) as levelStr,
CONCAT('floor',p.floor) as objKey,
CASE
WHEN (
ISNULL(p.coordinates) || LENGTH(trim(p.coordinates)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(p.coordinates, ',', 1),
',"y":',
substring_index(
substring_index(p.coordinates, ',', - 2),
',',
1
),
',"z":',
substring_index(p.coordinates, ',', - 1),
'}'
)
END positionDTO,
'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,
'{ "x": 1, "y": 1, "z": 1 }' scaleDTO,
case p.status
when '0'
then false
else
true
end as `showInfo`,
p.name as title,
'patrol' as type,
p.org_code as orgCode,
p.risk_source_id as riskSourceId,
0 as frequency,
if(p.status > 1 ,TRUE,FALSE) as twinkle
from
p_point p
left join f_risk_source rs on p.risk_source_id = rs.id AND rs.is_region='TRUE'
where rs.id is not null
<if test="abnormalStatus != false">
AND p.status in ('0','2','3')
</if>
AND p.coordinates != '' AND p.coordinates is not null AND p.is_delete = 0
UNION ALL
select
fe.code,
fe.id,
fe.is_indoor as inDoor,
case
when fe.equip_classify = 0 then CONCAT('monitorEquipment',fe.id)
when fe.equip_classify = 3 then CONCAT('fireEquipment',fe.id)
end as `key`,
fe.name,
'' as LEVEL,
'' as levelStr,
CONCAT('floor',fe.floor3d) as objKey,
CASE
WHEN (
ISNULL(fe.position3d) || LENGTH(trim(fe.position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(fe.position3d, ',', 1),
',"y":',
substring_index(
substring_index(fe.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(fe.position3d, ',', - 1),
'}'
)
END positionDTO,
'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,
'{ "x": 1, "y": 1, "z": 1 }' scaleDTO,
false as `showInfo`,
fe.name as title,
case
when fe.equip_classify = 0 then 'monitorEquipment'
when fe.equip_classify = 3 then 'fireEquipment'
end as type,
fe.org_code as orgCode,
fe.risk_source_id as riskSourceId,
0 as frequency,
false as twinkle
from
f_fire_equipment fe
left join f_risk_source rs on fe.risk_source_id = rs.id AND rs.is_region='TRUE'
where rs.id is not null
<if test="abnormalStatus != false">
AND fe.equip_status = 1
</if>
AND fe.equip_classify in (0,2,3)
AND fe.position3d != '' AND fe.position3d is not null
UNION ALL
select
c.car_num code,
c.id,
c.is_indoor as inDoor,
CONCAT('fireCar',c.id) as `key`,
c.name,
'' as LEVEL,
'' as levelStr,
CONCAT('floor',c.floor3d) as objKey,
CASE
WHEN (
ISNULL(c.position3d) || LENGTH(trim(c.position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(c.position3d, ',', 1),
',"y":',
substring_index(
substring_index(c.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(c.position3d, ',', - 1),
'}'
)
END positionDTO,
'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,
'{ "x": 1, "y": 1, "z": 1 }' scaleDTO,
false as `showInfo`,
c.name as title,
'fireCar' as type,
c.org_code as orgCode,
c.risk_source_id as riskSourceId,
0 as frequency,
false as twinkle
from f_fire_car c
left join f_risk_source rs on c.risk_source_id = rs.id AND rs.is_region='TRUE'
where rs.id is not null
AND c.position3d != '' AND c.position3d is not null
UNION ALL
select
s.code,
s.id,
s.is_indoor as inDoor,
case
when S.type = 1 then CONCAT('fireChamber',s.id)
when S.type = 2 then CONCAT('fireFoamRoom',s.id)
end as `key`,
s.name,
'' as LEVEL,
'' as levelStr,
CONCAT('floor',s.floor3d) as objKey,
CASE
WHEN (
ISNULL(s.position3d) || LENGTH(trim(s.position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(s.position3d, ',', 1),
',"y":',
substring_index(
substring_index(s.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(s.position3d, ',', - 1),
'}'
)
END positionDTO,
'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,
'{ "x": 1, "y": 1, "z": 1 }' scaleDTO,
false as `showInfo`,
s.name as title,
case
when S.type = 1 then 'fireChamber'
when S.type = 2 then 'fireFoamRoom'
end as type,
s.org_code as orgCode,
s.risk_source_id as riskSourceId,
0 as frequency,
false as twinkle
from
f_fire_station s
left join f_risk_source rs on s.risk_source_id = rs.id AND rs.is_region='TRUE'
where rs.id is not null
AND s.position3d != '' AND s.position3d is not null
UNION ALL
SELECT
wlv.CODE,
wlv.id,
'' AS inDoor,
CONCAT( 'video', wlv.id ) AS `key`,
wlv.NAME,
'' AS LEVEL,
'' AS levelStr,
'' AS objKey,
CONCAT(
'{"x":',
substring_index( wlv.position3d, ',', 1 ),
',"y":',
substring_index( substring_index( wlv.position3d, ',', - 2 ), ',', 1 ),
',"z":',
substring_index( wlv.position3d, ',', - 1 ),
'}'
)
as positionDTO,
'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,
'{ "x": 1, "y": 1, "z": 1 }' scaleDTO,
FALSE AS `showInfo`,
wlv.NAME AS title,
'video' AS type,
wlv.org_code AS orgCode,
'' AS riskSourceId,
0 AS frequency,
FALSE AS twinkle
FROM
wl_video wlv
WHERE
wlv.position3d != ''
AND wlv.position3d IS NOT NULL
union all
select
w.code,
w.id,
w.is_indoor as inDoor,
case
when w.type = 1 then CONCAT('hydrant',w.id)
when w.type = 2 then CONCAT('pool',w.id)
end as `key`,
w.name,
'' as LEVEL,
'' as levelStr,
CONCAT('floor',w.floor3d) as objKey,
CASE
WHEN (
ISNULL(w.position3d) || LENGTH(trim(w.position3d)) <![CDATA[ <]]> 1
) THEN
NULL
ELSE
CONCAT(
'{"x":',
substring_index(w.position3d, ',', 1),
',"y":',
substring_index(
substring_index(w.position3d, ',', - 2),
',',
1
),
',"z":',
substring_index(w.position3d, ',', - 1),
'}'
)
END positionDTO,
'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,
'{ "x": 1, "y": 1, "z": 1 }' scaleDTO,
false as `showInfo`,
w.name as title,
case
when w.type = 1 then 'hydrant'
when w.type = 2 then 'pool'
end as type,
w.org_code as orgCode,
w.risk_source_id as riskSourceId,
0 as frequency,
false as twinkle
from
f_water_resource w
left join f_risk_source rs on w.risk_source_id = rs.id AND rs.is_region='TRUE'
where rs.id is not null
AND w.position3d != '' AND w.position3d is not null
) temp
WHERE 1=1
<if test="riskSourceId != null">
AND FIND_IN_SET(temp.riskSourceId,queryRiskSourceChildrenIds(#{riskSourceId}))
</if>
<if test="type != null and type !='fireResource' and type !=''">
AND temp.type = #{type}
</if>
<if test="type == 'fireResource'">
AND temp.type in ('fireCar','fireEquipment','fireChamber','fireFoamRoom','hydrant','pool')
</if>
<if test="orgCode != null">
AND (temp.orgCode = #{orgCode} OR temp.orgCode LIKE CONCAT(#{orgCode},'-%'))
</if>
</select>
<!-- <select id="findViewDataByType" resultType="com.yeejoin.amos.fas.core.common.response.Node3DVoResponse">-->
<!-- SELECT-->
<!-- *-->
<!-- FROM-->
<!-- (-->
<!-- SELECT-->
<!-- rs.code,-->
<!-- rs.id,-->
<!-- rs.is_indoor inDoor,-->
<!-- CONCAT('riskSource-', rs.id) 'key',-->
<!-- rs.`name` label,-->
<!-- rl.`level` 'level',-->
<!-- CONCAT('level_', rl.`level`) levelStr,-->
<!-- CONCAT('floor_1', floor3d) objKey,-->
<!-- CASE-->
<!-- WHEN (-->
<!-- ISNULL(rs.position3d) || LENGTH(trim(rs.position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN-->
<!-- NULL-->
<!-- ELSE-->
<!-- CONCAT(-->
<!-- '{"x":',-->
<!-- substring_index(rs.position3d, ',', 1),-->
<!-- ',"y":',-->
<!-- substring_index(-->
<!-- substring_index(rs.position3d, ',', - 2),-->
<!-- ',',-->
<!-- 1-->
<!-- ),-->
<!-- ',"z":',-->
<!-- substring_index(rs.position3d, ',', - 1),-->
<!-- '}'-->
<!-- )-->
<!-- END positionDTO,-->
<!-- '{ "x": 0, "y": 0, "z": 0 }' rotationDTO,-->
<!-- '{ "x": 1, "y": 1, "z": 1 }' scaleDTO,-->
<!-- true as showInfo,-->
<!-- rs.rpn as title,-->
<!-- 'riskSource' type,-->
<!-- rs.org_code as orgCode,-->
<!-- rs.id as riskSourceId,-->
<!-- rs.flicker_frequency as frequency,-->
<!-- if('NORMAL'=rs.status,FALSE,TRUE) as twinkle-->
<!-- FROM-->
<!-- f_risk_source rs-->
<!-- LEFT JOIN f_risk_level rl ON rl.id = rs.risk_level_id-->
<!-- WHERE-->
<!-- rs.position3d IS NOT NULL-->
<!-- AND rs.position3d != ''-->
<!-- AND rs.risk_level_id is not null-->
<!-- <if test="abnormalStatus != false">-->
<!-- AND rs.status = 'ANOMALY'-->
<!-- </if>-->
<!-- AND rs.is_region <![CDATA[<>]]> 'TRUE'-->
<!-- UNION ALL-->
<!-- SELECT-->
<!-- eq.code,-->
<!-- id,-->
<!-- is_indoor inDoor,-->
<!-- CONCAT('impEquipment-', id) 'key',-->
<!-- `name` label,-->
<!-- '0' LEVEL,-->
<!-- 'level_0' levelStr,-->
<!-- CONCAT('floor_1', floor3d) objKey,-->
<!-- CASE-->
<!-- WHEN (-->
<!-- ISNULL(eq.position3d) || LENGTH(trim(eq.position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN-->
<!-- NULL-->
<!-- ELSE-->
<!-- CONCAT(-->
<!-- '{"x":',-->
<!-- substring_index(eq.position3d, ',', 1),-->
<!-- ',"y":',-->
<!-- substring_index(-->
<!-- substring_index(eq.position3d, ',', - 2),-->
<!-- ',',-->
<!-- 1-->
<!-- ),-->
<!-- ',"z":',-->
<!-- substring_index(eq.position3d, ',', - 1),-->
<!-- '}'-->
<!-- )-->
<!-- END positionDTO,-->
<!-- '{ "x": 0, "y": 0, "z": 0 }' rotationDTO,-->
<!-- '{ "x": 1, "y": 1, "z": 1 }' scaleDTO,-->
<!-- FALSE as showInfo,-->
<!-- name as title,-->
<!-- 'impEquipment' type,-->
<!-- eq.org_code as orgCode,-->
<!-- eq.risk_source_id as riskSourceId,-->
<!-- 0 as frequency,-->
<!-- FALSE as twinkle-->
<!-- FROM-->
<!-- f_equipment eq-->
<!-- WHERE-->
<!-- position3d IS NOT NULL-->
<!-- AND eq.risk_source_id in (select id from f_risk_source where is_region='TRUE')-->
<!-- AND position3d != ''-->
<!-- <if test="abnormalStatus != false">-->
<!-- AND eq.id in-->
<!-- (select equipment_id from f_equipment_fire_equipment fefe-->
<!-- left join f_fire_equipment fe ON fe.id = fefe.fire_equipment_id-->
<!-- where fe.equip_status = 1)-->
<!-- </if>-->
<!-- UNION ALL-->
<!-- select-->
<!-- p.point_no code,-->
<!-- p.id,-->
<!-- p.is_indoor as inDoor,-->
<!-- CONCAT('patrol',p.id) as `key`,-->
<!-- p.name,-->
<!-- p.status as LEVEL,-->
<!-- CONCAT('level_',p.status) as levelStr,-->
<!-- CONCAT('floor',p.floor) as objKey,-->
<!-- CASE-->
<!-- WHEN (-->
<!-- ISNULL(p.coordinates) || LENGTH(trim(p.coordinates)) <![CDATA[ <]]> 1-->
<!-- ) THEN-->
<!-- NULL-->
<!-- ELSE-->
<!-- CONCAT(-->
<!-- '{"x":',-->
<!-- substring_index(p.coordinates, ',', 1),-->
<!-- ',"y":',-->
<!-- substring_index(-->
<!-- substring_index(p.coordinates, ',', - 2),-->
<!-- ',',-->
<!-- 1-->
<!-- ),-->
<!-- ',"z":',-->
<!-- substring_index(p.coordinates, ',', - 1),-->
<!-- '}'-->
<!-- )-->
<!-- END positionDTO,-->
<!-- '{ "x": 0, "y": 0, "z": 0 }' rotationDTO,-->
<!-- '{ "x": 1, "y": 1, "z": 1 }' scaleDTO,-->
<!-- case p.status-->
<!-- when '0'-->
<!-- then false-->
<!-- else-->
<!-- true-->
<!-- end as `showInfo`,-->
<!-- p.name as title,-->
<!-- 'patrol' as type,-->
<!-- p.org_code as orgCode,-->
<!-- p.risk_source_id as riskSourceId,-->
<!-- 0 as frequency,-->
<!-- if(p.status > 1 ,TRUE,FALSE) as twinkle-->
<!-- from-->
<!-- p_point p-->
<!-- left join f_risk_source rs on p.risk_source_id = rs.id AND rs.is_region='TRUE'-->
<!-- where rs.id is not null-->
<!-- <if test="abnormalStatus != false">-->
<!-- AND p.status in ('0','2','3')-->
<!-- </if>-->
<!-- AND p.coordinates != '' AND p.coordinates is not null AND p.is_delete = 0-->
<!-- UNION ALL-->
<!-- select-->
<!-- fe.code,-->
<!-- fe.id,-->
<!-- fe.is_indoor as inDoor,-->
<!-- case-->
<!-- when fe.equip_classify = 0 then CONCAT('monitorEquipment',fe.id)-->
<!-- when fe.equip_classify = 3 then CONCAT('fireEquipment',fe.id)-->
<!-- end as `key`,-->
<!-- fe.name,-->
<!-- '' as LEVEL,-->
<!-- '' as levelStr,-->
<!-- CONCAT('floor',fe.floor3d) as objKey,-->
<!-- CASE-->
<!-- WHEN (-->
<!-- ISNULL(fe.position3d) || LENGTH(trim(fe.position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN-->
<!-- NULL-->
<!-- ELSE-->
<!-- CONCAT(-->
<!-- '{"x":',-->
<!-- substring_index(fe.position3d, ',', 1),-->
<!-- ',"y":',-->
<!-- substring_index(-->
<!-- substring_index(fe.position3d, ',', - 2),-->
<!-- ',',-->
<!-- 1-->
<!-- ),-->
<!-- ',"z":',-->
<!-- substring_index(fe.position3d, ',', - 1),-->
<!-- '}'-->
<!-- )-->
<!-- END positionDTO,-->
<!-- '{ "x": 0, "y": 0, "z": 0 }' rotationDTO,-->
<!-- '{ "x": 1, "y": 1, "z": 1 }' scaleDTO,-->
<!-- false as `showInfo`,-->
<!-- fe.name as title,-->
<!-- case-->
<!-- when fe.equip_classify = 0 then 'monitorEquipment'-->
<!-- when fe.equip_classify = 3 then 'fireEquipment'-->
<!-- end as type,-->
<!-- fe.org_code as orgCode,-->
<!-- fe.risk_source_id as riskSourceId,-->
<!-- 0 as frequency,-->
<!-- false as twinkle-->
<!-- from-->
<!-- f_fire_equipment fe-->
<!-- left join f_risk_source rs on fe.risk_source_id = rs.id AND rs.is_region='TRUE'-->
<!-- where rs.id is not null-->
<!-- <if test="abnormalStatus != false">-->
<!-- AND fe.equip_status = 1-->
<!-- </if>-->
<!-- AND fe.equip_classify in (0,2,3)-->
<!-- AND fe.position3d != '' AND fe.position3d is not null-->
<!-- UNION ALL-->
<!-- select-->
<!-- c.car_num code,-->
<!-- c.id,-->
<!-- c.is_indoor as inDoor,-->
<!-- CONCAT('fireCar',c.id) as `key`,-->
<!-- c.name,-->
<!-- '' as LEVEL,-->
<!-- '' as levelStr,-->
<!-- CONCAT('floor',c.floor3d) as objKey,-->
<!-- CASE-->
<!-- WHEN (-->
<!-- ISNULL(c.position3d) || LENGTH(trim(c.position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN-->
<!-- NULL-->
<!-- ELSE-->
<!-- CONCAT(-->
<!-- '{"x":',-->
<!-- substring_index(c.position3d, ',', 1),-->
<!-- ',"y":',-->
<!-- substring_index(-->
<!-- substring_index(c.position3d, ',', - 2),-->
<!-- ',',-->
<!-- 1-->
<!-- ),-->
<!-- ',"z":',-->
<!-- substring_index(c.position3d, ',', - 1),-->
<!-- '}'-->
<!-- )-->
<!-- END positionDTO,-->
<!-- '{ "x": 0, "y": 0, "z": 0 }' rotationDTO,-->
<!-- '{ "x": 1, "y": 1, "z": 1 }' scaleDTO,-->
<!-- false as `showInfo`,-->
<!-- c.name as title,-->
<!-- 'fireCar' as type,-->
<!-- c.org_code as orgCode,-->
<!-- c.risk_source_id as riskSourceId,-->
<!-- 0 as frequency,-->
<!-- false as twinkle-->
<!-- from f_fire_car c-->
<!-- left join f_risk_source rs on c.risk_source_id = rs.id AND rs.is_region='TRUE'-->
<!-- where rs.id is not null-->
<!-- AND c.position3d != '' AND c.position3d is not null-->
<!-- UNION ALL-->
<!-- select-->
<!-- s.code,-->
<!-- s.id,-->
<!-- s.is_indoor as inDoor,-->
<!-- case-->
<!-- when S.type = 1 then CONCAT('fireChamber',s.id)-->
<!-- when S.type = 2 then CONCAT('fireFoamRoom',s.id)-->
<!-- end as `key`,-->
<!-- s.name,-->
<!-- '' as LEVEL,-->
<!-- '' as levelStr,-->
<!-- CONCAT('floor',s.floor3d) as objKey,-->
<!-- CASE-->
<!-- WHEN (-->
<!-- ISNULL(s.position3d) || LENGTH(trim(s.position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN-->
<!-- NULL-->
<!-- ELSE-->
<!-- CONCAT(-->
<!-- '{"x":',-->
<!-- substring_index(s.position3d, ',', 1),-->
<!-- ',"y":',-->
<!-- substring_index(-->
<!-- substring_index(s.position3d, ',', - 2),-->
<!-- ',',-->
<!-- 1-->
<!-- ),-->
<!-- ',"z":',-->
<!-- substring_index(s.position3d, ',', - 1),-->
<!-- '}'-->
<!-- )-->
<!-- END positionDTO,-->
<!-- '{ "x": 0, "y": 0, "z": 0 }' rotationDTO,-->
<!-- '{ "x": 1, "y": 1, "z": 1 }' scaleDTO,-->
<!-- false as `showInfo`,-->
<!-- s.name as title,-->
<!-- case-->
<!-- when S.type = 1 then 'fireChamber'-->
<!-- when S.type = 2 then 'fireFoamRoom'-->
<!-- end as type,-->
<!-- s.org_code as orgCode,-->
<!-- s.risk_source_id as riskSourceId,-->
<!-- 0 as frequency,-->
<!-- false as twinkle-->
<!-- from-->
<!-- f_fire_station s-->
<!-- left join f_risk_source rs on s.risk_source_id = rs.id AND rs.is_region='TRUE'-->
<!-- where rs.id is not null-->
<!-- AND s.position3d != '' AND s.position3d is not null-->
<!-- UNION ALL-->
<!-- SELECT-->
<!-- wlv.CODE,-->
<!-- wlv.id,-->
<!-- '' AS inDoor,-->
<!-- CONCAT( 'video', wlv.id ) AS `key`,-->
<!-- wlv.NAME,-->
<!-- '' AS LEVEL,-->
<!-- '' AS levelStr,-->
<!-- '' AS objKey,-->
<!-- CONCAT(-->
<!-- '{"x":',-->
<!-- substring_index( wlv.position3d, ',', 1 ),-->
<!-- ',"y":',-->
<!-- substring_index( substring_index( wlv.position3d, ',', - 2 ), ',', 1 ),-->
<!-- ',"z":',-->
<!-- substring_index( wlv.position3d, ',', - 1 ),-->
<!-- '}'-->
<!-- )-->
<!-- as positionDTO,-->
<!-- '{ "x": 0, "y": 0, "z": 0 }' rotationDTO,-->
<!-- '{ "x": 1, "y": 1, "z": 1 }' scaleDTO,-->
<!-- FALSE AS `showInfo`,-->
<!-- wlv.NAME AS title,-->
<!-- 'video' AS type,-->
<!-- wlv.org_code AS orgCode,-->
<!-- '' AS riskSourceId,-->
<!-- 0 AS frequency,-->
<!-- FALSE AS twinkle-->
<!-- FROM-->
<!-- wl_video wlv-->
<!-- WHERE-->
<!-- wlv.position3d != ''-->
<!-- AND wlv.position3d IS NOT NULL-->
<!-- union all-->
<!-- select-->
<!-- w.code,-->
<!-- w.id,-->
<!-- w.is_indoor as inDoor,-->
<!-- case-->
<!-- when w.type = 1 then CONCAT('hydrant',w.id)-->
<!-- when w.type = 2 then CONCAT('pool',w.id)-->
<!-- end as `key`,-->
<!-- w.name,-->
<!-- '' as LEVEL,-->
<!-- '' as levelStr,-->
<!-- CONCAT('floor',w.floor3d) as objKey,-->
<!-- CASE-->
<!-- WHEN (-->
<!-- ISNULL(w.position3d) || LENGTH(trim(w.position3d)) <![CDATA[ <]]> 1-->
<!-- ) THEN-->
<!-- NULL-->
<!-- ELSE-->
<!-- CONCAT(-->
<!-- '{"x":',-->
<!-- substring_index(w.position3d, ',', 1),-->
<!-- ',"y":',-->
<!-- substring_index(-->
<!-- substring_index(w.position3d, ',', - 2),-->
<!-- ',',-->
<!-- 1-->
<!-- ),-->
<!-- ',"z":',-->
<!-- substring_index(w.position3d, ',', - 1),-->
<!-- '}'-->
<!-- )-->
<!-- END positionDTO,-->
<!-- '{ "x": 0, "y": 0, "z": 0 }' rotationDTO,-->
<!-- '{ "x": 1, "y": 1, "z": 1 }' scaleDTO,-->
<!-- false as `showInfo`,-->
<!-- w.name as title,-->
<!-- case-->
<!-- when w.type = 1 then 'hydrant'-->
<!-- when w.type = 2 then 'pool'-->
<!-- end as type,-->
<!-- w.org_code as orgCode,-->
<!-- w.risk_source_id as riskSourceId,-->
<!-- 0 as frequency,-->
<!-- false as twinkle-->
<!-- from-->
<!-- f_water_resource w-->
<!-- left join f_risk_source rs on w.risk_source_id = rs.id AND rs.is_region='TRUE'-->
<!-- where rs.id is not null-->
<!-- AND w.position3d != '' AND w.position3d is not null-->
<!-- ) temp-->
<!-- WHERE 1=1-->
<!-- <if test="riskSourceId != null">-->
<!-- AND FIND_IN_SET(temp.riskSourceId,queryRiskSourceChildrenIds(#{riskSourceId}))-->
<!-- </if>-->
<!-- <if test="type != null and type !='fireResource' and type !=''">-->
<!-- AND temp.type = #{type}-->
<!-- </if>-->
<!-- <if test="type == 'fireResource'">-->
<!-- AND temp.type in ('fireCar','fireEquipment','fireChamber','fireFoamRoom','hydrant','pool')-->
<!-- </if>-->
<!-- <if test="orgCode != null">-->
<!-- AND (temp.orgCode = #{orgCode} OR temp.orgCode LIKE CONCAT(#{orgCode},'-%'))-->
<!-- </if>-->
<!-- </select>-->
<select id="retrieveAllCount" resultType="long">
......@@ -1827,54 +1827,54 @@
</where>
LIMIT ${start},${length}
</select>
<select id="getAllPointInRegions" resultType="java.util.Map">
select
CONCAT(type,'-',id) as `key`,
id as pointId,
name,
type,
risk_source_id as regionId,
position3d
from
(select id,name,'riskSource' as type, parent_id as risk_source_id,position3d
from f_risk_source where is_region = 'FALSE'
UNION all
select id,name,'patrol' as type,risk_source_id,coordinates as position3d
from p_point WHERE is_delete = FALSE
UNION all
select id,name ,'impEquipment' as type,risk_source_id,position3d
from f_equipment e
UNION all
select id,name,'monitorEquipment' as type,risk_source_id,position3d
from f_fire_equipment where equip_classify = 0
UNION all
select id,name,'video' as type,risk_source_id,position3d
from f_fire_equipment where equip_classify = 2
UNION all
select id,name ,'hydrant' as type,risk_source_id,position3d
from f_water_resource where type = 1
UNION all
select id,name,'pool' as type,risk_source_id,position3d
from f_water_resource where type = 2
UNION all
select id,name,'fireCar' as type,risk_source_id,position3d
from f_fire_car
UNION all
select id,name,'fireEquipment' as type,risk_source_id,position3d
from f_fire_equipment where equip_classify = 3
UNION all
select id,name,'fireChamber' as type,risk_source_id,position3d
from f_fire_station where type = 2
UNION all
select id,name,'fireFoamRoom' as type,risk_source_id,position3d
from f_fire_station where type = 1
) as sp
where
position3d <![CDATA[<>]]> '' and
risk_source_id in
<foreach collection="ids" open="(" separator="," close=")" item="id">
#{id}
</foreach>
order by regionId
</select>
<!-- <select id="getAllPointInRegions" resultType="java.util.Map">-->
<!-- select-->
<!-- CONCAT(type,'-',id) as `key`,-->
<!-- id as pointId,-->
<!-- name,-->
<!-- type,-->
<!-- risk_source_id as regionId,-->
<!-- position3d-->
<!-- from-->
<!-- (select id,name,'riskSource' as type, parent_id as risk_source_id,position3d-->
<!-- from f_risk_source where is_region = 'FALSE'-->
<!-- UNION all-->
<!-- select id,name,'patrol' as type,risk_source_id,coordinates as position3d-->
<!-- from p_point WHERE is_delete = FALSE-->
<!-- UNION all-->
<!-- select id,name ,'impEquipment' as type,risk_source_id,position3d-->
<!-- from f_equipment e-->
<!-- UNION all-->
<!-- select id,name,'monitorEquipment' as type,risk_source_id,position3d-->
<!-- from f_fire_equipment where equip_classify = 0-->
<!-- UNION all-->
<!-- select id,name,'video' as type,risk_source_id,position3d-->
<!-- from f_fire_equipment where equip_classify = 2-->
<!-- UNION all-->
<!-- select id,name ,'hydrant' as type,risk_source_id,position3d-->
<!-- from f_water_resource where type = 1-->
<!-- UNION all-->
<!-- select id,name,'pool' as type,risk_source_id,position3d-->
<!-- from f_water_resource where type = 2-->
<!-- UNION all-->
<!-- select id,name,'fireCar' as type,risk_source_id,position3d-->
<!-- from f_fire_car-->
<!-- UNION all-->
<!-- select id,name,'fireEquipment' as type,risk_source_id,position3d-->
<!-- from f_fire_equipment where equip_classify = 3-->
<!-- UNION all-->
<!-- select id,name,'fireChamber' as type,risk_source_id,position3d-->
<!-- from f_fire_station where type = 2-->
<!-- UNION all-->
<!-- select id,name,'fireFoamRoom' as type,risk_source_id,position3d-->
<!-- from f_fire_station where type = 1-->
<!-- ) as sp-->
<!-- where-->
<!-- position3d <![CDATA[<>]]> '' and-->
<!-- risk_source_id in-->
<!-- <foreach collection="ids" open="(" separator="," close=")" item="id">-->
<!-- #{id}-->
<!-- </foreach>-->
<!-- order by regionId-->
<!-- </select>-->
</mapper>
\ No newline at end of file
......@@ -4,188 +4,188 @@
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.WaterResourceMapper">
<select id="queryOne" resultType="java.util.Map">
<!-- <select id="queryOne" resultType="java.util.Map">-->
select
fs.id,
fs.name,
fs.code,
fs.type,
fs.production_area AS productionArea,
fs.floor3d,
fs.room,
fs.address,
fs.position3d,
fs.area,
fs.max_level maxLevel,
fs.alarm_level alarmLevel,
fs.is_indoor as isIndoor,
fs.org_code AS orgCode,
fs.risk_source_id as riskSourceId
from f_water_resource fs where fs.id = ${id}
</select>
<!-- select -->
<!-- fs.id,-->
<!-- fs.name,-->
<!-- fs.code,-->
<!-- fs.type,-->
<!-- fs.production_area AS productionArea,-->
<!-- fs.floor3d,-->
<!-- fs.room,-->
<!-- fs.address,-->
<!-- fs.position3d,-->
<!-- fs.area,-->
<!-- fs.max_level maxLevel,-->
<!-- fs.alarm_level alarmLevel,-->
<!-- fs.is_indoor as isIndoor,-->
<!-- fs.org_code AS orgCode,-->
<!-- fs.risk_source_id as riskSourceId-->
<!-- from f_water_resource fs where fs.id = ${id}-->
<!-- </select>-->
<select id="queryCountForPage" resultType="long">
<!-- <select id="queryCountForPage" resultType="long">-->
SELECT
COUNT(1)
FROM
f_water_resource fs
WHERE
fs.org_code = #{orgCode}
<if test="name!=null">
AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')
</if>
<if test="code!=null">
AND fs.`code` LIKE '%${code}%'
</if>
<if test="type!=null">
AND fs.`type` LIKE '%${type}%'
</if>
</select>
<select id="queryForPage" resultType="java.util.Map">
SELECT
fs.id,
fs.name,
fs.code,
fs.type,
fs.production_area AS productionArea,
fs.floor3d,
fs.room,
fs.address,
fs.position3d,
fs.area,
fs.max_level maxLevel,
fs.alarm_level alarmLevel,
fs.is_indoor as isIndoor,
frs.name riskSourceName
FROM
f_water_resource fs
left join f_risk_source frs on frs.id = fs.risk_source_id
WHERE
fs.org_code = #{orgCode}
<if test="name!=null">
AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')
</if>
<if test="code!=null">
AND fs.`code` LIKE '%${code}%'
</if>
<if test="type!=null">
AND fs.`type` LIKE '%${type}%'
</if>
LIMIT ${start},${length} ;
<!-- SELECT-->
<!-- COUNT(1)-->
<!-- FROM-->
<!-- f_water_resource fs-->
<!-- WHERE-->
<!-- fs.org_code = #{orgCode}-->
<!-- <if test="name!=null">-->
<!-- AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')-->
<!-- </if>-->
<!-- <if test="code!=null">-->
<!-- AND fs.`code` LIKE '%${code}%'-->
<!-- </if>-->
<!-- <if test="type!=null">-->
<!-- AND fs.`type` LIKE '%${type}%'-->
<!-- </if>-->
<!-- </select>-->
<!-- <select id="queryForPage" resultType="java.util.Map">-->
<!-- SELECT-->
<!-- fs.id,-->
<!-- fs.name,-->
<!-- fs.code,-->
<!-- fs.type,-->
<!-- fs.production_area AS productionArea,-->
<!-- fs.floor3d,-->
<!-- fs.room,-->
<!-- fs.address,-->
<!-- fs.position3d,-->
<!-- fs.area,-->
<!-- fs.max_level maxLevel,-->
<!-- fs.alarm_level alarmLevel,-->
<!-- fs.is_indoor as isIndoor,-->
<!-- frs.name riskSourceName-->
<!-- FROM-->
<!-- f_water_resource fs-->
<!-- left join f_risk_source frs on frs.id = fs.risk_source_id-->
<!-- WHERE-->
<!-- fs.org_code = #{orgCode}-->
<!-- <if test="name!=null">-->
<!-- AND (fs.name LIKE '%${name}%' or fs.`code` LIKE '%${name}%')-->
<!-- </if>-->
<!-- <if test="code!=null">-->
<!-- AND fs.`code` LIKE '%${code}%'-->
<!-- </if>-->
<!-- <if test="type!=null">-->
<!-- AND fs.`type` LIKE '%${type}%'-->
<!-- </if>-->
<!-- LIMIT ${start},${length} ;-->
</select>
<!-- </select>-->
<select id="queryCountForBindFireEqumntPage" resultType="long">
SELECT
count(1)
FROM
f_water_resource_equipment fs
JOIN f_fire_equipment f ON fs.fire_equipment_id = f.id
WHERE
fs.water_resource_id = ${waterResourceId}
</select>
<select id="queryForBindFireEqumntPage" resultType="java.util.Map">
SELECT
fs.water_resource_id,
fs.number numberInStation,
fs.unit unitInStation,
f.*,
frs.name riskSourceName
FROM
f_water_resource_equipment fs
left join f_fire_equipment f on fs.fire_equipment_id = f.id
left join f_risk_source frs on frs.id = f.risk_source_id
WHERE
fs.water_resource_id = ${waterResourceId}
and f.id is not null
LIMIT ${start}, ${length};
</select>
<!-- <select id="queryCountForBindFireEqumntPage" resultType="long">-->
<!-- SELECT-->
<!-- count(1)-->
<!-- FROM-->
<!-- f_water_resource_equipment fs-->
<!-- JOIN f_fire_equipment f ON fs.fire_equipment_id = f.id-->
<!-- WHERE-->
<!-- fs.water_resource_id = ${waterResourceId}-->
<!-- </select>-->
<!-- <select id="queryForBindFireEqumntPage" resultType="java.util.Map">-->
<!-- SELECT-->
<!-- fs.water_resource_id,-->
<!-- fs.number numberInStation,-->
<!-- fs.unit unitInStation,-->
<!-- f.*,-->
<!-- frs.name riskSourceName-->
<!-- FROM-->
<!-- f_water_resource_equipment fs-->
<!-- left join f_fire_equipment f on fs.fire_equipment_id = f.id-->
<!-- left join f_risk_source frs on frs.id = f.risk_source_id-->
<!-- WHERE-->
<!-- fs.water_resource_id = ${waterResourceId}-->
<!-- and f.id is not null-->
<!-- LIMIT ${start}, ${length};-->
<!-- </select>-->
<select id="listByCodes" resultType="com.yeejoin.amos.fas.dao.entity.WaterResource">
select
id,
code,
name
from
f_water_resource
where
code in
<foreach collection="codes" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<!-- <select id="listByCodes" resultType="com.yeejoin.amos.fas.dao.entity.WaterResource">-->
<!-- select-->
<!-- id,-->
<!-- code,-->
<!-- name-->
<!-- from-->
<!-- f_water_resource-->
<!-- where-->
<!-- code in-->
<!-- <foreach collection="codes" item="item" index="index" open="(" separator="," close=")">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </select>-->
<insert id="saveBatch" keyColumn="id" keyProperty="id"
parameterType="com.yeejoin.amos.fas.business.param.WaterResourceParam"
useGeneratedKeys="true">
insert into f_water_resource
(
`name`,
`code`,
`type`,
`floor3d`,
`room`,
`address`,
`position3d`,
`org_code`,
`is_indoor`,
`risk_source_id`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.name},
#{item.code},
#{item.type},
#{item.floor3d},
#{item.room},
#{item.address},
#{item.position3d},
#{item.orgCode},
#{item.isIndoor},
#{item.riskSourceId}
)
</foreach>
</insert>
<!-- <insert id="saveBatch" keyColumn="id" keyProperty="id"-->
<!-- parameterType="com.yeejoin.amos.fas.business.param.WaterResourceParam"-->
<!-- useGeneratedKeys="true">-->
<!-- insert into f_water_resource-->
<!-- (-->
<!-- `name`,-->
<!-- `code`,-->
<!-- `type`,-->
<!-- `floor3d`,-->
<!-- `room`,-->
<!-- `address`,-->
<!-- `position3d`,-->
<!-- `org_code`,-->
<!-- `is_indoor`,-->
<!-- `risk_source_id`-->
<!-- )-->
<!-- values-->
<!-- <foreach collection="list" item="item" index="index" separator=",">-->
<!-- (-->
<!-- #{item.name},-->
<!-- #{item.code},-->
<!-- #{item.type},-->
<!-- #{item.floor3d},-->
<!-- #{item.room},-->
<!-- #{item.address},-->
<!-- #{item.position3d},-->
<!-- #{item.orgCode},-->
<!-- #{item.isIndoor},-->
<!-- #{item.riskSourceId}-->
<!-- )-->
<!-- </foreach>-->
<!-- </insert>-->
<update id="updateBatch">
<foreach collection="list" item="item" index="index" separator=";">
update f_water_resource
<set>
<if test="item.orgCode != null">
org_code = #{item.orgCode},
</if>
<if test="item.code != null">
code = #{item.code},
</if>
<if test="item.type != null">
type = #{item.type},
</if>
<if test="item.position3d != null">
position3d = #{item.position3d},
</if>
<if test="item.floor3d != null">
floor3d = #{item.floor3d},
</if>
<if test="item.isIndoor != null">
is_indoor = #{item.isIndoor},
</if>
<if test="item.name != null">
name = #{item.name},
</if>
<if test="item.room != null">
room = #{item.room},
</if>
<if test="item.address != null">
address = #{item.address},
</if>
<if test="item.riskSourceId != null">
risk_source_id = #{item.riskSourceId},
</if>
</set>
where id = #{item.id}
</foreach>
</update>
<!-- <update id="updateBatch">-->
<!-- <foreach collection="list" item="item" index="index" separator=";">-->
<!-- update f_water_resource-->
<!-- <set>-->
<!-- <if test="item.orgCode != null">-->
<!-- org_code = #{item.orgCode},-->
<!-- </if>-->
<!-- <if test="item.code != null">-->
<!-- code = #{item.code},-->
<!-- </if>-->
<!-- <if test="item.type != null">-->
<!-- type = #{item.type},-->
<!-- </if>-->
<!-- <if test="item.position3d != null">-->
<!-- position3d = #{item.position3d},-->
<!-- </if>-->
<!-- <if test="item.floor3d != null">-->
<!-- floor3d = #{item.floor3d},-->
<!-- </if>-->
<!-- <if test="item.isIndoor != null">-->
<!-- is_indoor = #{item.isIndoor},-->
<!-- </if>-->
<!-- <if test="item.name != null">-->
<!-- name = #{item.name},-->
<!-- </if>-->
<!-- <if test="item.room != null">-->
<!-- room = #{item.room},-->
<!-- </if>-->
<!-- <if test="item.address != null">-->
<!-- address = #{item.address},-->
<!-- </if>-->
<!-- <if test="item.riskSourceId != null">-->
<!-- risk_source_id = #{item.riskSourceId},-->
<!-- </if>-->
<!-- </set>-->
<!-- where id = #{item.id}-->
<!-- </foreach>-->
<!-- </update>-->
</mapper>
\ No newline at end of file
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