Commit d4b32d10 authored by 高建强's avatar 高建强

item:三维告警信息初始化、消防水池信息接口提供

parent 0d5d5664
package com.yeejoin.amos.fas.dao.entity; package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.*;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.persistence.*;
/** /**
* 消防站点 * 消防站点
* @author Administrator * @author Administrator
...@@ -92,6 +91,29 @@ public class FireStation extends BasicEntity{ ...@@ -92,6 +91,29 @@ public class FireStation extends BasicEntity{
@Lob @Lob
private String ue4Rotation; private String ue4Rotation;
/**
* 高度/最大液位(m)
*/
@Transient
private Double height;
/**
* 低度/最小液位(m)
*/
@Transient
private Double low;
/**
* 实时液位(m)
*/
@Transient
private String level;
/**
* 设计容量(m³)
*/
@Transient
private Double designCapacity;
@Transient @Transient
public List<Map> getFireEquipmentInfo() { public List<Map> getFireEquipmentInfo() {
return fireEquipmentInfo; return fireEquipmentInfo;
...@@ -206,4 +228,36 @@ public class FireStation extends BasicEntity{ ...@@ -206,4 +228,36 @@ public class FireStation extends BasicEntity{
public void setUe4Rotation(String ue4Rotation) { public void setUe4Rotation(String ue4Rotation) {
this.ue4Rotation = ue4Rotation; this.ue4Rotation = ue4Rotation;
} }
public Double getHeight() {
return height;
}
public void setHeight(Double height) {
this.height = height;
}
public Double getLow() {
return low;
}
public void setLow(Double low) {
this.low = low;
}
public Double getDesignCapacity() {
return designCapacity;
}
public void setDesignCapacity(Double designCapacity) {
this.designCapacity = designCapacity;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
} }
package com.yeejoin.amos.fas.business.controller;
import com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificIndexService;
import com.yeejoin.amos.fas.config.Permission;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
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;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.controller
* @ClassName: EquipmentSpecificIndexController
* @Author: Jianqiang Gao
* @Description: EquipmentSpecificIndexController
* @Date: 2021/1/18 16:32
* @Version: 1.0
*/
@RestController
@RequestMapping(value = "/api/equipSpecificIndex")
@Api(tags = "装备性能指标Api")
public class EquipmentSpecificIndexController extends BaseController {
@Autowired
private EquipmentSpecificIndexService equipmentSpecificIndexService;
@Permission
@ApiOperation(httpMethod = "GET", value = "获取最新告警状态", notes = "获取最新告警状态")
@RequestMapping(value = "/queryInitAlarm", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryInitAlerm(@ApiParam(value = "告警状态", required = true) @RequestParam String status,
@ApiParam(value = "多nameKey,中间英文逗号隔开", required = true) @RequestParam String nameKeys,
@ApiParam(value = "多status,中间英文逗号隔开", required = true) @RequestParam String pollStatus) {
return CommonResponseUtil.success(equipmentSpecificIndexService.queryInitAlarm(status, nameKeys, pollStatus));
}
}
\ No newline at end of file
package com.yeejoin.amos.fas.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 装备性能指标 Mapper 接口
*
* @author Jianqiang Gao
* @date 2021-01-18
*/
public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecificIndexVo> {
List<EquipmentSpecificIndexVo> findByDetailIdInAndNameKey(@Param("list") List<Object> equipDetailIdList, @Param("nameKey") String nameKey);
List<EquipmentSpecificIndexVo> queryInitAlarm(@Param("status") String status, @Param("list") String[] nameKeys);
}
package com.yeejoin.amos.fas.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.fas.business.vo.PollPointVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.dao.mapper
* @ClassName: PollPointMapper
* @Author: Jianqiang Gao
* @Description: 巡检点Mapper
* @Date: 2021/1/18 17:36
* @Version: 1.0
*/
public interface PollPointMapper extends BaseMapper<PollPointVo> {
List<PollPointVo> queryInitAlarm(@Param("list") String[] pollStatus);
}
\ No newline at end of file
package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificIndexMapper;
import com.yeejoin.amos.fas.business.dao.mapper.PollPointMapper;
import com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificIndexService;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import com.yeejoin.amos.fas.business.vo.PollPointVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.service.impl
* @ClassName: EquipmentSpecificIndexServiceImpl
* @Author: Jianqiang Gao
* @Description: EquipmentSpecificIndexServiceImpl
* @Date: 2021/1/18 16:35
* @Version: 1.0
*/
@Service
public class EquipmentSpecificIndexServiceImpl implements EquipmentSpecificIndexService {
@Autowired
private EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
@Autowired
private PollPointMapper pollPointMapper;
@Override
public Map<String, Object> queryInitAlarm(String status, String nameKeys, String pollStatus) {
Map<String, Object> map = new HashMap<>(16);
// 查询设备告警
List<EquipmentSpecificIndexVo> equipmentSpecificAlarmVoList = equipmentSpecificIndexMapper.queryInitAlarm(status, nameKeys.split(","));
map.put("equip", equipmentSpecificAlarmVoList);
// 查询巡检告警
List<PollPointVo> pollPointVoList = pollPointMapper.queryInitAlarm(pollStatus.split(","));
map.put("poll", pollPointVoList);
return map;
}
}
\ No newline at end of file
package com.yeejoin.amos.fas.business.service.impl; package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificIndexMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper; 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.mapper.ImpEquipMapper;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao; import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao;
...@@ -9,6 +10,7 @@ import com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity; ...@@ -9,6 +10,7 @@ import com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam; import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IFireEquipService; import com.yeejoin.amos.fas.business.service.intfc.IFireEquipService;
import com.yeejoin.amos.fas.business.util.FireEquipmentType; import com.yeejoin.amos.fas.business.util.FireEquipmentType;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import com.yeejoin.amos.fas.common.enums.EquipClassifyEnum; import com.yeejoin.amos.fas.common.enums.EquipClassifyEnum;
import com.yeejoin.amos.fas.core.common.request.CommonPageable; import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.response.CommonPage; import com.yeejoin.amos.fas.core.common.response.CommonPage;
...@@ -21,14 +23,16 @@ import org.springframework.data.domain.Page; ...@@ -21,14 +23,16 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@Service("fireEquipService") @Service("fireEquipService")
public class FireEquipServiceImpl implements IFireEquipService { public class FireEquipServiceImpl implements IFireEquipService {
/**
* 液位
*/
private final static String NAME_KEY = "liquidLevel";
@Autowired @Autowired
FireEquipMapper fireEquipMapper; FireEquipMapper fireEquipMapper;
...@@ -44,6 +48,9 @@ public class FireEquipServiceImpl implements IFireEquipService { ...@@ -44,6 +48,9 @@ public class FireEquipServiceImpl implements IFireEquipService {
@Autowired @Autowired
IFireStationDao iFireStationDao; IFireStationDao iFireStationDao;
@Autowired
EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
public FireEquipment save(FireEquipment fireEquipment) { public FireEquipment save(FireEquipment fireEquipment) {
Long id = fireEquipment.getId(); Long id = fireEquipment.getId();
iFireEquipmentDao.save(fireEquipment); iFireEquipmentDao.save(fireEquipment);
...@@ -52,8 +59,8 @@ public class FireEquipServiceImpl implements IFireEquipService { ...@@ -52,8 +59,8 @@ public class FireEquipServiceImpl implements IFireEquipService {
public FireEquipment queryOne(Long id) { public FireEquipment queryOne(Long id) {
Optional<FireEquipment> fireEquipment1=iFireEquipmentDao.findById(id); Optional<FireEquipment> fireEquipment1 = iFireEquipmentDao.findById(id);
if(fireEquipment1.isPresent()){ if (fireEquipment1.isPresent()) {
return fireEquipment1.get(); return fireEquipment1.get();
} }
return null; return null;
...@@ -62,9 +69,9 @@ public class FireEquipServiceImpl implements IFireEquipService { ...@@ -62,9 +69,9 @@ public class FireEquipServiceImpl implements IFireEquipService {
public String[] delete(String[] idArray) throws Exception { public String[] delete(String[] idArray) throws Exception {
for (String id : idArray) { for (String id : idArray) {
Optional<FireEquipment> fireEquipment1 = iFireEquipmentDao.findById(Long.parseLong(id)); Optional<FireEquipment> fireEquipment1 = iFireEquipmentDao.findById(Long.parseLong(id));
FireEquipment fireEquipment=null; FireEquipment fireEquipment = null;
if(fireEquipment1.isPresent()){ if (fireEquipment1.isPresent()) {
fireEquipment= fireEquipment1.get(); fireEquipment = fireEquipment1.get();
} }
if (fireEquipment != null) { if (fireEquipment != null) {
...@@ -107,7 +114,7 @@ public class FireEquipServiceImpl implements IFireEquipService { ...@@ -107,7 +114,7 @@ public class FireEquipServiceImpl implements IFireEquipService {
String endTime, String endTime,
CommonPageable commonPageable) { CommonPageable commonPageable) {
long total = fireEquipMapper.queryForFireEquipmentHistoryCount( fireEquipmentName,equipmentName, long total = fireEquipMapper.queryForFireEquipmentHistoryCount(fireEquipmentName, equipmentName,
startTime, startTime,
endTime); endTime);
...@@ -122,9 +129,9 @@ public class FireEquipServiceImpl implements IFireEquipService { ...@@ -122,9 +129,9 @@ public class FireEquipServiceImpl implements IFireEquipService {
} }
public Page queryForEquipmentList(String name, String code,String equipClassify,CommonPageable commonPageable,String bindStation) { public Page queryForEquipmentList(String name, String code, String equipClassify, CommonPageable commonPageable, String bindStation) {
long total = fireEquipMapper.queryForEquipmentPageCount( name, code,equipClassify,bindStation); long total = fireEquipMapper.queryForEquipmentPageCount(name, code, equipClassify, bindStation);
List<Map> content = this.fireEquipMapper.queryForEquipmentPage(name, code,equipClassify,commonPageable.getOffset(),commonPageable.getPageSize(),bindStation); List<Map> content = this.fireEquipMapper.queryForEquipmentPage(name, code, equipClassify, commonPageable.getOffset(), commonPageable.getPageSize(), bindStation);
Page result = new CommonPage(content, commonPageable, total); Page result = new CommonPage(content, commonPageable, total);
return result; return result;
} }
...@@ -132,42 +139,51 @@ public class FireEquipServiceImpl implements IFireEquipService { ...@@ -132,42 +139,51 @@ public class FireEquipServiceImpl implements IFireEquipService {
/** /**
* 查询设备信息明细 * 查询设备信息明细
*
* @param type * @param type
* @param id * @param id
* @return * @return
* @throws Exception * @throws Exception
*/ */
public Object queryForDetail(String type, Long id) throws Exception public Object queryForDetail(String type, Long id) throws Exception {
{
Object returnEntity = null; Object returnEntity = null;
FireEquipmentType fireEquipmentType = FireEquipmentType.valueOf(type); FireEquipmentType fireEquipmentType = FireEquipmentType.valueOf(type);
switch (fireEquipmentType) switch (fireEquipmentType) {
{
case pool: case pool:
FireStation fireStation = fireEquipMapper.findFireStationById(id); FireStation fireStation = fireEquipMapper.findFireStationById(id);
fireStation.setType("2"); fireStation.setType("2");
fireStation.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id)); List<Map> equipDetails = this.fireEquipMapper.queryStorageEquips(fireStation.getRiskSourceId());
fireStation.setFireEquipmentInfo(equipDetails);
// 获取水池实时液位
List<Object> equipDetailIdList = new ArrayList<>();
if (equipDetails != null && !equipDetails.isEmpty()) {
equipDetails.stream().forEach(map -> equipDetailIdList.add(map.get("id")));
List<EquipmentSpecificIndexVo> specificIndexVos = equipmentSpecificIndexMapper.findByDetailIdInAndNameKey(equipDetailIdList, NAME_KEY);
if (specificIndexVos != null && !specificIndexVos.isEmpty()) {
fireStation.setLevel(specificIndexVos.get(0).getValue());
}
}
returnEntity = fireStation; returnEntity = fireStation;
break; break;
case fireFoamRoom: case fireFoamRoom:
FireStation fireStation1 = fireEquipMapper.findFireStationById(id); FireStation fireStation1 = fireEquipMapper.findFireStationById(id);
fireStation1.setType("2"); fireStation1.setType("2");
fireStation1.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id)); fireStation1.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(fireStation1.getRiskSourceId()));
returnEntity = fireStation1; returnEntity = fireStation1;
break; break;
case fireChamber: case fireChamber:
FireStation fireStation11 = fireEquipMapper.findFireStationById(id); FireStation fireStation11 = fireEquipMapper.findFireStationById(id);
fireStation11.setType("1"); fireStation11.setType("1");
fireStation11.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(id)); fireStation11.setFireEquipmentInfo(this.fireEquipMapper.queryStorageEquips(fireStation11.getRiskSourceId()));
returnEntity = fireStation11; returnEntity = fireStation11;
break; break;
case extinguisher: case extinguisher:
case hydrant: case hydrant:
case monitorEquipment: case monitorEquipment:
FireEquipment fireEquipment=fireEquipMapper.findFireEquipById(id); FireEquipment fireEquipment = fireEquipMapper.findFireEquipById(id);
fireEquipment.setEquipClassify(Integer.parseInt(EquipClassifyEnum.EQUIPMENT.getCode())); fireEquipment.setEquipClassify(Integer.parseInt(EquipClassifyEnum.EQUIPMENT.getCode()));
returnEntity = fireEquipment; returnEntity = fireEquipment;
break; break;
...@@ -179,9 +195,9 @@ public class FireEquipServiceImpl implements IFireEquipService { ...@@ -179,9 +195,9 @@ public class FireEquipServiceImpl implements IFireEquipService {
case fireDetection: case fireDetection:
Optional<FireEquipment> fireDetection1 = this.iFireEquipmentDao.findById(id); Optional<FireEquipment> fireDetection1 = this.iFireEquipmentDao.findById(id);
FireEquipment fireDetection=null; FireEquipment fireDetection = null;
if(fireDetection1.isPresent()){ if (fireDetection1.isPresent()) {
fireDetection=fireDetection1.get(); fireDetection = fireDetection1.get();
} }
fireDetection.setProtectObjNames(this.impEquipMapper.queryProtectObjNames(fireDetection.getId())); fireDetection.setProtectObjNames(this.impEquipMapper.queryProtectObjNames(fireDetection.getId()));
returnEntity = fireDetection; returnEntity = fireDetection;
......
package com.yeejoin.amos.fas.business.service.intfc;
import java.util.Map;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.service.intfc
* @ClassName: EquipmentSpecificIndexService
* @Author: Jianqiang Gao
* @Description: EquipmentSpecificIndexService
* @Date: 2021/1/18 16:34
* @Version: 1.0
*/
public interface EquipmentSpecificIndexService {
Map<String, Object> queryInitAlarm(String status, String nameKeys, String pollStatus);
}
\ No newline at end of file
...@@ -25,6 +25,8 @@ public class EquipmentSpecificIndexVo { ...@@ -25,6 +25,8 @@ public class EquipmentSpecificIndexVo {
// 性能指标id // 性能指标id
private Long equipmentIndexId; private Long equipmentIndexId;
private String name;
private String equipmentIndexName; private String equipmentIndexName;
private String equipmentIndexUnitName; private String equipmentIndexUnitName;
...@@ -105,16 +107,45 @@ public class EquipmentSpecificIndexVo { ...@@ -105,16 +107,45 @@ public class EquipmentSpecificIndexVo {
this.code = code; this.code = code;
} }
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEquipmentIndexName() {
return equipmentIndexName;
}
public void setEquipmentIndexName(String equipmentIndexName) {
this.equipmentIndexName = equipmentIndexName;
}
public String getEquipmentIndexUnitName() {
return equipmentIndexUnitName;
}
public void setEquipmentIndexUnitName(String equipmentIndexUnitName) {
this.equipmentIndexUnitName = equipmentIndexUnitName;
}
public EquipmentSpecificIndexVo() { public EquipmentSpecificIndexVo() {
} }
public EquipmentSpecificIndexVo(Long equipmentSpecificId, String value, Long equipmentIndexId, String nameKey, String code, String iotCode, String type) { public EquipmentSpecificIndexVo(long id, Long equipmentSpecificId, String value, Long equipmentIndexId, String name, String equipmentIndexName, String equipmentIndexUnitName, String nameKey, String code, String iotCode, String type) {
this.id = id;
this.equipmentSpecificId = equipmentSpecificId; this.equipmentSpecificId = equipmentSpecificId;
this.value = value; this.value = value;
this.equipmentIndexId = equipmentIndexId; this.equipmentIndexId = equipmentIndexId;
this.name = name;
this.equipmentIndexName = equipmentIndexName;
this.equipmentIndexUnitName = equipmentIndexUnitName;
this.nameKey = nameKey; this.nameKey = nameKey;
this.code = code; this.code = code;
this.iotCode = iotCode; this.iotCode = iotCode;
this.type = type; this.type = type;
} }
} }
package com.yeejoin.amos.fas.business.vo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.vo
* @ClassName: EquipmentSpecificAlarm
* @Author: Jianqiang Gao
* @Description: 巡检点Vo
* @Date: 2021/1/18 15:54
* @Version: 1.0
*/
@Data
@Api("巡检点Vo")
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
public class PollPointVo {
@ApiModelProperty("巡检点名称")
private String name;
@ApiModelProperty("巡检点编码")
private String code;
@ApiModelProperty("巡检点状态:0 未纳入巡检,1 合格;2 不合格;3 漏检")
private String status;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificIndexMapper">
<select id="findByDetailIdInAndNameKey"
resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo">
SELECT
wsi.`value`
FROM
`wl_equipment_index` wei
RIGHT JOIN wl_equipment_specific_index wsi ON wei.id = wsi.equipment_index_id
LEFT JOIN wl_equipment_specific wes ON wsi.equipment_specific_id = wes.id
WHERE
wsi.`value` != ''
<if test="nameKey != null and nameKey !=''">
AND wei.name_key = #{nameKey}
</if>
<if test="list != null and list.size() > 0">
AND wes.equipment_detail_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY
wsi.id
ORDER BY
wsi.update_date DESC
</select>
<select id="queryInitAlarm" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo">
SELECT
wed.`name`,
wed.`code`,
wei.name_key
FROM
`wl_equipment_specific_index` wsi
LEFT JOIN wl_equipment_index wei ON wsi.equipment_index_id = wei.id
LEFT JOIN wl_equipment_specific wes ON wsi.equipment_specific_id = wes.id
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
<where>
<if test="status != null and status != ''">
AND wsi.`value` = #{status}
</if>
<if test="list != null and list.length > 0">
AND
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
wei.name_key = #{item}
</foreach>
</if>
</where>
GROUP BY
wsi.equipment_specific_id
ORDER BY
wsi.update_date DESC
</select>
</mapper>
\ No newline at end of file
...@@ -289,6 +289,7 @@ ...@@ -289,6 +289,7 @@
<select id="queryStorageEquips" resultType="map"> <select id="queryStorageEquips" resultType="map">
SELECT SELECT
wed.id,
wed.`name`, wed.`name`,
u.`name` AS unit, u.`name` AS unit,
sum(wsd.amount) fireEquipmentCount sum(wsd.amount) fireEquipmentCount
...@@ -298,8 +299,11 @@ ...@@ -298,8 +299,11 @@
LEFT JOIN wl_equipment we ON we.id = wed.equipment_id LEFT JOIN wl_equipment we ON we.id = wed.equipment_id
LEFT JOIN wl_unit u ON u.id = we.unit_id LEFT JOIN wl_unit u ON u.id = we.unit_id
LEFT JOIN wl_warehouse_structure ws ON ws.id = wsd.warehouse_structure_id LEFT JOIN wl_warehouse_structure ws ON ws.id = wsd.warehouse_structure_id
WHERE <where>
ws.source_id = #{riskSourceId} <if test="riskSourceId != null">
AND ws.source_id = #{riskSourceId}
</if>
</where>
GROUP BY GROUP BY
wsd.equipment_detail_id, wsd.equipment_detail_id,
wed.`name` wed.`name`
...@@ -607,7 +611,10 @@ ...@@ -607,7 +611,10 @@
wb.`name`, wb.`name`,
wb.`code`, wb.`code`,
wb.address, wb.address,
wb.region_id AS riskSourceId wb.region_id AS riskSourceId,
wb.height,
wb.low,
wb.design_capacity
FROM FROM
wl_building wb wl_building wb
WHERE WHERE
......
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.PollPointMapper">
<select id="queryInitAlarm" resultType="com.yeejoin.amos.fas.business.vo.PollPointVo">
SELECT
p.`name`,
p.point_no AS `code`,
p.`status`
FROM
`p_point` p
<where>
<if test="list != null and list.length > 0">
AND
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
p.`status` = #{item}
</foreach>
</if>
</where>
</select>
</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