Commit a27b910a authored by chenzhao's avatar chenzhao

Merge branch 'develop_dl_plan6_temp' of…

Merge branch 'develop_dl_plan6_temp' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6_temp
parents 10f551db 3cc51fa9
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
) s group by date,bizOrgCode ) s group by date,bizOrgCode
</select> </select>
<select id="queryPersonNum" resultType="java.lang.Integer"> <select id="queryPersonNum" resultType="java.lang.Integer">
select count(*) from cb_firefighters where biz_org_code like #{bizOgrCode} AND people_type = '1601' select count(*) from cb_firefighters where biz_org_code like CONCAT('%',#{bizOgrCode}, '%') AND people_type = '1601'
AND is_delete = 0 AND now() > rec_date AND is_delete = 0 AND now() > rec_date
</select> </select>
......
...@@ -5,9 +5,11 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams; ...@@ -5,9 +5,11 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil; import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.utils.DateUtils; import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.vo.IotDataVO; import com.yeejoin.equipmanage.common.vo.IotDataVO;
import com.yeejoin.equipmanage.config.PersonIdentify;
import com.yeejoin.equipmanage.service.IEmergencyService; import com.yeejoin.equipmanage.service.IEmergencyService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -65,7 +67,7 @@ public class EmergencyController extends AbstractBaseController { ...@@ -65,7 +67,7 @@ public class EmergencyController extends AbstractBaseController {
public ResponseModel getCAFSWaterTankInfo() { public ResponseModel getCAFSWaterTankInfo() {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode(); String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
return CommonResponseUtil.success(iEmergencyService.getCAFSWaterTankInfo(bizOrgCode)); return CommonResponseUtil.success(iEmergencyService.getCAFSWaterTankInfo());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -114,16 +116,11 @@ public class EmergencyController extends AbstractBaseController { ...@@ -114,16 +116,11 @@ public class EmergencyController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("泡沫罐列表") @ApiOperation("泡沫罐列表")
@GetMapping(value = "/selectFoamTank") @GetMapping(value = "/selectFoamTank")
public Page<Map<String, Object>> selectFoamTank(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode, public Page<Map<String, Object>> selectFoamTank(@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageNumber") int pageNumber,
@RequestParam(value = "pageSize") int pageSize @RequestParam(value = "pageSize") int pageSize
) { ) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize); Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (ObjectUtils.isEmpty(bizOrgCode)){ return iEmergencyService.selectFoamTank(page);
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return iEmergencyService.selectFoamTank(page, bizOrgCode);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -560,6 +557,30 @@ public class EmergencyController extends AbstractBaseController { ...@@ -560,6 +557,30 @@ public class EmergencyController extends AbstractBaseController {
return result; return result;
} }
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getEquipExpiryList")
@ApiOperation(httpMethod = "GET", value = "四横八纵-临期设备列表", notes = "四横八纵-临期设备列表")
public ResponseModel getEquipExpiryList(@ApiParam("临期天数-近多少天") @RequestParam(value = "expiryDayNum", required = false) Integer expiryDayNum) {
expiryDayNum = Objects.isNull(expiryDayNum) ? 180 : expiryDayNum;
return CommonResponseUtil.success(iEmergencyService.getEquipExpiryList(expiryDayNum));
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getEquipExpiryStatistics")
@ApiOperation(httpMethod = "GET", value = "四横八纵-临期设备统计", notes = "四横八纵-临期设备统计")
public ResponseModel getEquipExpiryStatistics(@ApiParam("临期天数-近多少天") @RequestParam(value = "expiryDayNum", required = false) Integer expiryDayNum) {
expiryDayNum = Objects.isNull(expiryDayNum) ? 180 : expiryDayNum;
return CommonResponseUtil.success(iEmergencyService.getEquipExpiryStatistics(expiryDayNum));
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getStockEquipStatistics")
@ApiOperation(httpMethod = "GET", value = "四横八纵-报废设备统计", notes = "四横八纵-报废设备统计")
public ResponseModel getStockEquipStatistics() {
return CommonResponseUtil.success(iEmergencyService.getStockEquipStatistics());
}
} }
...@@ -35,6 +35,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -35,6 +35,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto; import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil; import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
...@@ -196,9 +197,40 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -196,9 +197,40 @@ public class FireFightingSystemController extends AbstractBaseController {
//查询系统下设备状态 //查询系统下设备状态
@RequestMapping(value = "/alarmSystem/info", method = RequestMethod.GET) @RequestMapping(value = "/alarmSystem/info", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("通过id查询消防系统信息") @ApiOperation("通过systemCode查询消防系统信息")
public List<Map<String,Object>> getEquip() { public List<Map<String,Object>> getEquip(@RequestParam(required = false) String bizOrgCode,
return fireFightingSystemService.getEquip(); @RequestParam(required = false) String systemCode) {
if (StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
if (StringUtils.isEmpty(bizOrgCode)) {
return Lists.newArrayList();
}
}
}
return fireFightingSystemService.getEquip(bizOrgCode, systemCode);
}
//查询系统下设备状态
@RequestMapping(value = "/getFireSystemEquipStatusList", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("通过systemCode、设备分类编码字符串查询消防系统信息")
public List<Map<String,Object>> getFireSystemEquipStatusList(@RequestParam(required = false) String bizOrgCode,
@RequestParam(required = false) String systemCode,
@RequestParam(required = false) String categoryCodes) {
if (StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
if (StringUtils.isEmpty(bizOrgCode)) {
return Lists.newArrayList();
}
}
}
return fireFightingSystemService.getFireSystemEquipStatusList(bizOrgCode, systemCode, categoryCodes);
} }
......
...@@ -39,7 +39,7 @@ public interface EmergencyMapper extends BaseMapper{ ...@@ -39,7 +39,7 @@ public interface EmergencyMapper extends BaseMapper{
* @param bizOrgCode * @param bizOrgCode
* @return * @return
*/ */
Page<Map<String, Object>> selectFoamTank(Page<Map<String, Object>> page , @Param("bizOrgCode") String bizOrgCode); Page<Map<String, Object>> selectFoamTank(Page<Map<String, Object>> page);
/** /**
* 排油系统 * 排油系统
...@@ -59,7 +59,7 @@ public interface EmergencyMapper extends BaseMapper{ ...@@ -59,7 +59,7 @@ public interface EmergencyMapper extends BaseMapper{
List<Map<String, Object>> getSystemState(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> getSystemState(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getCAFSWaterTankInfo(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> getCAFSWaterTankInfo();
List<Map<String, Object>> selectAlarmAnalysis(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("dataType")String dataType, @Param("date")String date, @Param("list") List<String> codes); List<Map<String, Object>> selectAlarmAnalysis(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("dataType")String dataType, @Param("date")String date, @Param("list") List<String> codes);
...@@ -77,7 +77,10 @@ public interface EmergencyMapper extends BaseMapper{ ...@@ -77,7 +77,10 @@ public interface EmergencyMapper extends BaseMapper{
List<Map<String, Object>> fireCannonSystemAlarmAnalysis(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("dataType")String dataType, @Param("date")String date, @Param("list") List<String> codes); List<Map<String, Object>> fireCannonSystemAlarmAnalysis(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("dataType")String dataType, @Param("date")String date, @Param("list") List<String> codes);
List<Map<String, String>> getEquipExpiryList(@Param("expiryDayNum") Integer expiryDayNum);
Map<String, Integer> getStockEquipStatistics();
List<Map<String, Object>> getEquipExpiryStatistics(@Param("expiryDayNum") Integer expiryDayNum);
} }
...@@ -644,10 +644,11 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -644,10 +644,11 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> selectAllDays(); List<Map<String, Object>> selectAllDays();
List<Map<String, Object>> getEquip(); List<Map<String, Object>> getEquip(String bizOrgCode, String systemCode);
List<Map<String, Object>> getFireSystemEquipStatusList(String bizOrgCode, String systemCode, String categoryCodes);
List<Map<String, Object>> selectPressureDetails(@Param("bizOrgCode") String bizOrgCode); List<Map<String, Object>> selectPressureDetails(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> selectEquipmentSpecificById(@Param("id") String id); Map<String, Object> selectEquipmentSpecificById(@Param("id") String id);
} }
...@@ -20,7 +20,7 @@ public interface IEmergencyService { ...@@ -20,7 +20,7 @@ public interface IEmergencyService {
/** /**
* @return * @return
*/ */
List<Map<String, Object>> getCAFSWaterTankInfo(String bizOrgCode); List<Map<String, Object>> getCAFSWaterTankInfo();
Map<String, Object> emergencyMaterials(); Map<String, Object> emergencyMaterials();
...@@ -28,7 +28,7 @@ public interface IEmergencyService { ...@@ -28,7 +28,7 @@ public interface IEmergencyService {
Page<Map<String, Object>> selectFireMonitor(Page<Map<String, Object>> page, String bizOrgCode,String code); Page<Map<String, Object>> selectFireMonitor(Page<Map<String, Object>> page, String bizOrgCode,String code);
Page<Map<String, Object>> selectFoamTank(Page<Map<String, Object>> page, String bizOrgCode); Page<Map<String, Object>> selectFoamTank(Page<Map<String, Object>> page);
Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page, String bizOrgCode, String code); Page<Map<String, Object>> selectOilDrainage(Page<Map<String, Object>> page, String bizOrgCode, String code);
...@@ -48,5 +48,9 @@ public interface IEmergencyService { ...@@ -48,5 +48,9 @@ public interface IEmergencyService {
List<Map<String, Object>> fireCannonSystemAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType); List<Map<String, Object>> fireCannonSystemAlarmAnalysis(String startDate, String endDate, String dataType, String date, String systemType);
List<Map<String, Object>> getEquipExpiryStatistics(Integer expiryDayNum);
List<Map<String, String>> getEquipExpiryList(Integer expiryDayNum);
Map<String, Integer> getStockEquipStatistics();
} }
...@@ -171,7 +171,10 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -171,7 +171,10 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
*/ */
FireFightingSystemEntity getDetailByCode(String systemCode); FireFightingSystemEntity getDetailByCode(String systemCode);
List<Map<String,Object>> getEquip(); List<Map<String,Object>> getEquip(String bizOrgCode, String systemCode);
List<Map<String, Object>> getFireSystemEquipStatusList(String bizOrgCode, String systemCode, String categoryCodes);
/** /**
* 集成页面系统数据 * 集成页面系统数据
* *
......
...@@ -49,8 +49,8 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -49,8 +49,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
@Override @Override
public List<Map<String, Object>> getCAFSWaterTankInfo(String bizOrgCode) { public List<Map<String, Object>> getCAFSWaterTankInfo() {
List<Map<String, Object>> list = emergencyMapper.getCAFSWaterTankInfo(bizOrgCode); List<Map<String, Object>> list = emergencyMapper.getCAFSWaterTankInfo();
// List<Map<String, Object>> res = new ArrayList(); // List<Map<String, Object>> res = new ArrayList();
// if (0 < list.size()) { // if (0 < list.size()) {
// list.forEach(x -> { // list.forEach(x -> {
...@@ -81,8 +81,8 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -81,8 +81,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
@Override @Override
public Page<Map<String, Object>> selectFoamTank(Page<Map<String, Object>> page, String bizOrgCode) { public Page<Map<String, Object>> selectFoamTank(Page<Map<String, Object>> page) {
return emergencyMapper.selectFoamTank(page, bizOrgCode); return emergencyMapper.selectFoamTank(page);
} }
@Override @Override
...@@ -158,4 +158,25 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -158,4 +158,25 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
@Override
public List<Map<String, Object>> getEquipExpiryStatistics(Integer expiryDayNum) {
List<Map<String, Object>> equipExpiryStatistics = emergencyMapper.getEquipExpiryStatistics(expiryDayNum);
equipExpiryStatistics.forEach(item -> {
item.put("value", Integer.parseInt(item.get("value").toString()));
});
return equipExpiryStatistics;
}
@Override
public List<Map<String, String>> getEquipExpiryList(Integer expiryDayNum) {
return emergencyMapper.getEquipExpiryList(expiryDayNum);
}
@Override
public Map<String, Integer> getStockEquipStatistics() {
return emergencyMapper.getStockEquipStatistics();
}
} }
...@@ -982,22 +982,61 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -982,22 +982,61 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
@Override @Override
public List<Map<String, Object>> getEquip() { public List<Map<String, Object>> getEquip(String bizOrgCode, String systemCode) {
List<Map<String, Object>> list = fireFightingSystemMapper.getEquip(); List<Map<String, Object>> list = fireFightingSystemMapper.getEquip(bizOrgCode, systemCode);
List<Map<String, Object>> resList = new ArrayList<>(); List<Map<String, Object>> resList = new ArrayList<>();
int i = 1; int i = 1;
if (0 < list.size()) { if (0 < list.size()) {
for (Map<String, Object> m : list) { for (Map<String, Object> m : list) {
List<Map<String, Object>> list1 = new ArrayList();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
Map<String, Object> statusMap = new HashMap<>();
map.put("key", i); map.put("key", i);
map.put("name", m.get("equipmentName")); map.put("name", m.get("name"));
map.put("equipmentCode", m.get("equipmentCode"));
map.put("code", m.get("code")); map.put("code", m.get("code"));
map.put("value", m.get("flag")); map.put("systemTypeCode", systemCode);
map.put("unit", ""); map.put("img", m.get("shbzImg"));
statusMap.put("name", m.get("status"));
if ("正常".equals(String.valueOf(m.get("status")))) {
statusMap.put("level", "success");
} else {
statusMap.put("level", "warning");
}
list1.add(statusMap);
map.put("status", list1);
resList.add(map); resList.add(map);
i++; i++;
} };
}
return resList;
}
@Override
public List<Map<String, Object>> getFireSystemEquipStatusList(String bizOrgCode, String systemCode, String categoryCodes) {
List<Map<String, Object>> list = fireFightingSystemMapper.getFireSystemEquipStatusList(bizOrgCode, systemCode, categoryCodes);
List<Map<String, Object>> resList = new ArrayList<>();
int i = 1;
if (0 < list.size()) {
for (Map<String, Object> m : list) {
List<Map<String, Object>> list1 = new ArrayList();
Map<String, Object> map = new HashMap<>();
Map<String, Object> statusMap = new HashMap<>();
map.put("key", i);
map.put("name", m.get("name"));
map.put("code", m.get("code"));
map.put("systemTypeCode", systemCode);
map.put("img", m.get("shbzImg"));
statusMap.put("name", m.get("status"));
if ("正常".equals(String.valueOf(m.get("status")))) {
statusMap.put("level", "success");
} else {
statusMap.put("level", "warning");
}
list1.add(statusMap);
map.put("status", list1);
resList.add(map);
i++;
};
} }
return resList; return resList;
} }
...@@ -2145,6 +2184,12 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2145,6 +2184,12 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override @Override
public List<Map<String, Object>> getSystemAlarmInfoList(String startDate, String endDate) { public List<Map<String, Object>> getSystemAlarmInfoList(String startDate, String endDate) {
if (!StringUtil.isNotEmpty(startDate)) {
startDate = null;
}
if (!StringUtil.isNotEmpty(endDate)) {
endDate = null;
}
return fireFightingSystemMapper.getSystemAlarmInfoList(startDate, endDate); return fireFightingSystemMapper.getSystemAlarmInfoList(startDate, endDate);
} }
......
...@@ -613,4 +613,110 @@ ...@@ -613,4 +613,110 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="tianyiming" id="202301101653">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment" columnName="shbz_img"/>
</not>
</preConditions>
<comment>新增四横八纵图片属性字段</comment>
<sql>
ALTER TABLE `wl_equipment` ADD COLUMN `shbz_img` varchar(255) NULL COMMENT '四横八纵图片' AFTER `img`;</sql>
</changeSet>
<changeSet author="gaojianqiang" id="20230113-01">
<preConditions onFail="MARK_RAN">
<columnExists tableName="wl_equipment" columnName="shbz_img"/>
</preConditions>
<comment>初始化四横八纵shbz_img图片属性字段</comment>
<sql>
-- ----------------------------
-- Table structure for equipment_icon
-- ----------------------------
DROP TABLE IF EXISTS `equipment_icon`;
CREATE TABLE `equipment_icon` (
`id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`sys_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`type_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`type_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`sort` int(11) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of equipment_icon
-- ----------------------------
INSERT INTO `equipment_icon` VALUES ('1392361049260539906', '自动喷水灭火系统', 'FHS-消防泵', '920106007GV44', 'upload/state/dcfc/viewicon/firePump.png', 46);
INSERT INTO `equipment_icon` VALUES ('1392361051122810882', '火灾自动报警系统', 'FAS-烟雾报警器', '920402009EM44', 'upload/state/dcfc/viewicon/ganYanTanCeQi.png', 44);
INSERT INTO `equipment_icon` VALUES ('1392361052318187522', '火灾自动报警系统', 'FAS-手动报警器', '920404002PU44', 'upload/state/dcfc/viewicon/shouDongBaoJingQi.png', 43);
INSERT INTO `equipment_icon` VALUES ('1392361052926361602', '火灾自动报警系统', 'FAS-空气采样探测器', '920405002O544', NULL, 52);
INSERT INTO `equipment_icon` VALUES ('1392361054348230658', '火灾自动报警系统', 'FAS-感温电缆', '92040700PEM44', 'upload/state/dcfc/viewicon/ganWenDianLan.png', 34);
INSERT INTO `equipment_icon` VALUES ('1392361056457965569', '火灾自动报警系统', 'FAS-声光报警器', '92041000LCW44', 'upload/state/dcfc/viewicon/shengGuangBaoJingQi.png', 41);
INSERT INTO `equipment_icon` VALUES ('1392361057196163073', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-主机', '92030100TGX44', 'upload/state/dcfc/viewicon/zhuji.png', 30);
INSERT INTO `equipment_icon` VALUES ('1392361057749811202', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-炮阀', '92030200DOD44', 'upload/state/dcfc/viewicon/paofa.png', 11);
INSERT INTO `equipment_icon` VALUES ('1392361058299265025', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-切换阀', '92030300DI444', 'upload/state/dcfc/viewicon/qieHuanFa.png', 17);
INSERT INTO `equipment_icon` VALUES ('1392361058894856194', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-卷帘门', '92030400FTV44', 'upload/state/dcfc/viewicon/juanLianMen.png', 12);
INSERT INTO `equipment_icon` VALUES ('1392361059477864450', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-产生装置', '92030500MG644', 'upload/state/dcfc/viewicon/chanshengzhuangzhi.png', 13);
INSERT INTO `equipment_icon` VALUES ('1392361059951820801', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-泡沫泵', '92030600QO344', 'upload/state/dcfc/viewicon/paoMoPump.png', 18);
INSERT INTO `equipment_icon` VALUES ('1392361060509663233', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-空压机', '92030700SFT44', 'upload/state/dcfc/viewicon/kongYaMachine.png', 19);
INSERT INTO `equipment_icon` VALUES ('1392361061012979713', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-控制柜', '92030800K2R44', 'upload/state/dcfc/viewicon/kongZhiGui.png', 10);
INSERT INTO `equipment_icon` VALUES ('1392361061486936066', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-电源柜', '92030900KYD44', 'upload/state/dcfc/viewicon/pwoerGui.png', 16);
INSERT INTO `equipment_icon` VALUES ('1392361062007029761', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-设备间', '92031000EXB44', 'upload/state/dcfc/viewicon/sheBeiJian.png', 9);
INSERT INTO `equipment_icon` VALUES ('1392361062543900673', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-控制按钮', '92031100HQL44', 'upload/state/dcfc/viewicon/kongZhiButton.png', 20);
INSERT INTO `equipment_icon` VALUES ('1392361063101743105', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-插件', '92031200DMT44', 'upload/state/dcfc/viewicon/chaJian.png', 29);
INSERT INTO `equipment_icon` VALUES ('1392361063550533634', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-交换机', '92031300WFJ44', 'upload/state/dcfc/viewicon/jiaoHuanji.png', 8);
INSERT INTO `equipment_icon` VALUES ('1392361064016101378', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-光纤', '92031400GMT44', 'upload/state/dcfc/viewicon/guangxian.png', 32);
INSERT INTO `equipment_icon` VALUES ('1392361064620081153', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-电源', '92031500Z9E44', 'upload/state/dcfc/viewicon/power.png', 14);
INSERT INTO `equipment_icon` VALUES ('1392361065161146370', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-AD通道', '92031600TQ244', 'upload/state/dcfc/viewicon/tongDao.png', 15);
INSERT INTO `equipment_icon` VALUES ('1392361065656074242', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-断路器', '92031700EGW44', 'upload/state/dcfc/viewicon/duanLuQi.png', 21);
INSERT INTO `equipment_icon` VALUES ('1392361066734010370', '其他系统', 'CAFS-泡沫罐', '92031900INJ44', NULL, 64);
INSERT INTO `equipment_icon` VALUES ('1392361070315945986', '排油注氮系统', 'ONL-交流电源', '921002000JK44', 'upload/state/dcfc/viewicon/jiaoLiuDianYuan.png', 1);
INSERT INTO `equipment_icon` VALUES ('1392361070907342850', '排油注氮系统', 'ONL-直流电源', '92100300MNL44', 'upload/state/dcfc/viewicon/zhiLiuDianYuan.png', 5);
INSERT INTO `equipment_icon` VALUES ('1392361071419047937', '排油注氮系统', 'ONL-排油阀', '92100400VWE44', 'upload/state/dcfc/viewicon/benTiPaiYouFa.png', 6);
INSERT INTO `equipment_icon` VALUES ('1392361071851061250', '排油注氮系统', 'ONL-排油注氮装置', '92100500RIP44', 'upload/state/dcfc/viewicon/paiyouzhudanzhuangzhi.png', 4);
INSERT INTO `equipment_icon` VALUES ('1392662028300304385', '自动喷水灭火系统', 'WSS-雨淋阀', '92130300BH644', NULL, 55);
INSERT INTO `equipment_icon` VALUES ('1392662045933158401', '火灾自动报警系统', 'SCS-防火阀', '92160200J4244', NULL, 53);
INSERT INTO `equipment_icon` VALUES ('1392662048705593345', '其他系统', 'ES-电梯', '92170100NKI44', NULL, 66);
INSERT INTO `equipment_icon` VALUES ('1392662052493049858', '自动喷水灭火系统', 'FFS-雨淋蝶阀', '92110900ATW44', NULL, 54);
INSERT INTO `equipment_icon` VALUES ('1392662054481149954', '其他系统', 'FHS-消防水池装置', '92010700SHY44', NULL, 63);
INSERT INTO `equipment_icon` VALUES ('1392662055093518337', '消防给水及消火栓系统', 'FHS-稳压泵', '92010800KAL44', 'upload/state/dcfc/viewicon/wenYaBeng.png', 23);
INSERT INTO `equipment_icon` VALUES ('1401866673925124097', '火灾自动报警系统', 'FAS-感温式火灾探测器', '92041200KNU44', 'upload/state/dcfc/viewicon/ganYanTanCeQi.png', 33);
INSERT INTO `equipment_icon` VALUES ('1401866675300855810', '火灾自动报警系统', 'FAS-备用设备', '92041800CK844', NULL, 50);
INSERT INTO `equipment_icon` VALUES ('1401866678102650882', '自动喷水灭火系统', 'FHS-压力开关', '92010900K8G44', NULL, 45);
INSERT INTO `equipment_icon` VALUES ('1401866678308171778', '其他系统', 'FHS-管网压力探测器', '92011000T5Q44', 'upload/state/dcfc/viewicon/guanWangYaLi.png', 65);
INSERT INTO `equipment_icon` VALUES ('1401866678450778114', '消防给水及消火栓系统', 'FHS-液位探测器', '92011100BIK44', 'upload/state/dcfc/viewicon/yeWeiDetecor.png', 24);
INSERT INTO `equipment_icon` VALUES ('1401866678975066113', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-CAFS消防炮', '92032200BUX44', 'upload/state/dcfc/viewicon/CAFSGun.png', 31);
INSERT INTO `equipment_icon` VALUES ('1401866680124305409', '火灾自动报警系统', 'AIRCS-空调', '92200100VAC44', NULL, 48);
INSERT INTO `equipment_icon` VALUES ('1404693507742093314', '排油注氮系统', 'ONL-采集模块', '92101400P3N44', 'upload/state/dcfc/viewicon/caiJiMuKuai.png', 7);
INSERT INTO `equipment_icon` VALUES ('1404693508211855361', '火灾自动报警系统', 'FAS-感光式火灾探测器', '92041900GNS44', 'upload/state/dcfc/viewicon/ziWaiHuoYanTanCeQi.png', 49);
INSERT INTO `equipment_icon` VALUES ('1404693508639674370', '火灾自动报警系统', 'FAS-模块', '92042000YVN44', NULL, 51);
INSERT INTO `equipment_icon` VALUES ('1404693512771063809', '其他系统', 'FPMS-配电开关', '922206009JO44', NULL, 60);
INSERT INTO `equipment_icon` VALUES ('1417377345773498370', '火灾自动报警系统', 'FAS-强切设备', '92042200EKM44', 'upload/state/dcfc/viewicon/qiangQieShebei.png', 39);
INSERT INTO `equipment_icon` VALUES ('1417377347702878209', '火灾自动报警系统', 'FAS-复位电源', '92042300YBA44', 'upload/state/dcfc/viewicon/fuWeiPower.png', 35);
INSERT INTO `equipment_icon` VALUES ('1417377349053444098', '排油注氮系统', 'ONL-智能终端', '92101800NKO44', 'upload/state/dcfc/viewicon/zhunDuan.png', 3);
INSERT INTO `equipment_icon` VALUES ('1417377350970241025', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-直流系统', '92032400MWX44', 'upload/state/dcfc/viewicon/zhiliuSystem.png', 22);
INSERT INTO `equipment_icon` VALUES ('1417377352845094913', '火灾自动报警系统', 'FAS-切电设备', '92042400X2V44', NULL, 47);
INSERT INTO `equipment_icon` VALUES ('1418444533010169858', '消防给水及消火栓系统', '消火栓', '31050000ZLF44', 'upload/state/dcfc/viewicon/fireMachine.png', 25);
INSERT INTO `equipment_icon` VALUES ('1418445233194696705', '其他系统', '灭火器', '31040000PV244', NULL, 61);
INSERT INTO `equipment_icon` VALUES ('1418462802521784321', '火灾自动报警系统', '火灾自动报警系统', '92040000KPO44', 'upload/state/dcfc/viewicon/fireAutoAlarm.png', 36);
INSERT INTO `equipment_icon` VALUES ('1418464225015791617', '自动喷水灭火系统', '消防专用电话', '92120000GYI44', 'upload/state/dcfc/viewicon/fireMobile.png', 37);
INSERT INTO `equipment_icon` VALUES ('1418464823584915458', '其他系统', '防火分隔设施', '92990000UVR44', NULL, 59);
INSERT INTO `equipment_icon` VALUES ('1418465438318886913', '自动喷水灭火系统', '雨淋阀', '92110900V9B44', 'upload/state/dcfc/viewicon/yuLinFa.png', 38);
INSERT INTO `equipment_icon` VALUES ('1418465836974899202', '其他系统', '消防小室', '92990000AQT44', NULL, 56);
INSERT INTO `equipment_icon` VALUES ('1418466180761026562', '压缩空气泡沫灭火系统(CAFS)', '压缩空气泡沫灭火系统', '92030000WEW44', 'upload/state/dcfc/viewicon/yasuokongqi.png', 26);
INSERT INTO `equipment_icon` VALUES ('1418466508642353153', '自动喷水灭火系统', '自动喷水灭火系统', '92130000YCG44', NULL, 40);
INSERT INTO `equipment_icon` VALUES ('1418496226158649346', '其他系统', '灭火器巡检', '92990000N2844', NULL, 57);
INSERT INTO `equipment_icon` VALUES ('1418497428988567554', '其他系统', '消火栓系统', '92990000RIN44', NULL, 58);
INSERT INTO `equipment_icon` VALUES ('1418505479128817666', '消防给水及消火栓系统', '消防供水设施', '92010000S0F44', 'upload/state/dcfc/viewicon/gongshuiSheShi.png', 27);
INSERT INTO `equipment_icon` VALUES ('1418822147562434562', '自动喷水灭火系统', '消防水池', '92010000XBB44', 'upload/state/dcfc/viewicon/xiaoFangShuiChi.png', 42);
INSERT INTO `equipment_icon` VALUES ('1450756152672518146', '其他系统', 'FHS-无线液位探测器', '92011500EBH44', NULL, 62);
INSERT INTO `equipment_icon` VALUES ('1527227300964233217', '消防给水及消火栓系统', '消火栓', '93060400CQX44', 'upload/state/dcfc/viewicon/fireMachine.png', 28);
INSERT INTO `equipment_icon` VALUES ('1578945741864742914', '排油注氮系统', '消防水箱', '93060600HQK44', 'upload/state/dcfc/viewicon/fireShuiXiang.png', 2);
UPDATE wl_equipment e SET e.shbz_img = (SELECT ei.icon FROM equipment_icon ei WHERE e.`code` = ei.`type_code`);
DROP TABLE IF EXISTS `equipment_icon`;
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
}, },
{ {
"code": "92990000", "code": "92100000",
"index": "OilLeak,Open,Fault" "index": "OilLeak,Open,Fault"
} }
......
...@@ -91,9 +91,9 @@ ...@@ -91,9 +91,9 @@
WHERE WHERE
-- 因为此处属于确定查询条件,所以此处写入常量 -- 因为此处属于确定查询条件,所以此处写入常量
wes.equipment_code LIKE CONCAT( '92032000', '%' ) wes.equipment_code LIKE CONCAT( '92032000', '%' )
<if test="bizOrgCode!=null and bizOrgCode!=''"> <!-- <if test="bizOrgCode!=null and bizOrgCode!=''">-->
AND wes.biz_org_code like concat(#{bizOrgCode}, '%') <!-- AND wes.biz_org_code like concat(#{bizOrgCode}, '%')-->
</if> <!-- </if>-->
</select> </select>
<select id="selectEmergencyMaterials" resultType="java.util.Map"> <select id="selectEmergencyMaterials" resultType="java.util.Map">
...@@ -165,55 +165,48 @@ ...@@ -165,55 +165,48 @@
</select> </select>
<select id="selectFoamTank" resultType="java.util.Map"> <select id="selectFoamTank" resultType="java.util.Map">
SELECT SELECT
temp.id, temp.id,
temp.name, temp.name,
temp.nowLevel, temp.nowLevel,
temp.volume, temp.volume,
CASE CASE
WHEN ( temp.nowLevel = '--' ) THEN WHEN ( temp.nowLevel = '--' ) THEN
'--' '--'
WHEN ( temp.maxLevel = 0 ) THEN WHEN ( temp.minLevel - temp.nowLevel > 0 ) THEN
'--' '液位低'
WHEN ( temp.minLevel = 0 ) THEN WHEN ( temp.nowLevel - temp.maxLevel > 0) THEN
'--' '液位高' ELSE '正常'
WHEN ( temp.minLevel - temp.nowLevel > 0 ) THEN END AS status,
'液位低' CASE
WHEN ( temp.nowLevel - temp.maxLevel > 0) THEN WHEN ( temp.nowLevel = '--' ) THEN
'液位高' ELSE '正常' '--' ELSE format(
END AS status, IF
CASE (
WHEN ( temp.nowLevel = '--' ) THEN (
'--' ELSE format( abs( ( ( temp.nowLevel ) / IF ( temp.maxLevel = 0, 1, temp.maxLevel ) ) ) * 100
IF ) > 100,
( 100,
( (
abs( ( ( temp.nowLevel ) / IF ( temp.maxLevel = 0, 1, temp.maxLevel ) ) ) * 100 abs( ( ( temp.nowLevel ) / IF ( temp.maxLevel = 0, 1, temp.maxLevel ) ) ) * 100
) > 100, )
100, ),
( 2
abs( ( ( temp.nowLevel ) / IF ( temp.maxLevel = 0, 1, temp.maxLevel ) ) ) * 100 )
) END AS abs
),
2
)
END AS abs
FROM
(
SELECT
wes.id,
wes.name,
IFNULL( ( SELECT value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS nowLevel,
IFNULL(( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxLevel' ) , 0 )AS maxLevel,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minLevel' ), 0 ) AS minLevel,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'volume' ), 0 ) AS volume
FROM FROM
wl_equipment_specific wes (
SELECT
WHERE wes.id,
wes.equipment_code LIKE concat( '920319', '%' ) wes.name,
IFNULL( ( SELECT value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS nowLevel,
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) IFNULL(( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxLevel' ) , 0 )AS maxLevel,
) temp IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minLevel' ), 0 ) AS minLevel,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'volume' ), 0 ) AS volume
FROM
wl_equipment_specific wes
WHERE
wes.equipment_code LIKE concat( '920319', '%' )
) temp
</select> </select>
<select id="selectOilDrainage" resultType="java.util.Map"> <select id="selectOilDrainage" resultType="java.util.Map">
...@@ -1022,4 +1015,149 @@ ...@@ -1022,4 +1015,149 @@
(SELECT count(*) FROM f_fire_fighting_system) fireSystem, (SELECT count(*) FROM f_fire_fighting_system) fireSystem,
(SELECT count(*) FROM wl_car) fireCar (SELECT count(*) FROM wl_car) fireCar
</select> </select>
<select id="getEquipExpiryStatistics" resultType="java.util.Map">
SELECT
a.`name`,
a.value,
CONCAT( CAST( ROUND(( a.VALUE / b.num )* 100,1) AS CHAR),'%') percent
FROM
(
SELECT
CONCAT( temp.NAME, '类' ) AS `name`,
count( 1 ) AS `value`,
CODE
FROM
(
SELECT
es.id,
ed.`name`,
DATE_FORMAT( ed.production_date, '%Y-%m-%d' ) AS productDate,
ed.CODE
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND (
( sd.`status` != 7 )
OR ( sd.`status` IS NULL )
OR ( sd.`status` = '' ))
AND e.expiry_date IS NOT NULL
AND #{expiryDayNum} >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
) temp
GROUP BY
temp.CODE
) a
LEFT JOIN ( SELECT equipment_code CODE, COUNT( 1 ) num FROM wl_equipment_specific es GROUP BY equipment_code ) b ON a.`code` = b.`code`
</select>
<select id="getEquipExpiryList" resultType="java.util.Map">
SELECT
@rownum := @rownum + 1 AS id,
t.*
FROM
( SELECT @rownum := 0 ) r,
(
SELECT
ed.`name` AS specificName,
IFNULL( ed.standard, '' ) AS modelNumber,
DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) AS dayNum,
COUNT( ed.CODE ) sum,
IFNULL( ws.full_name, '' ) AS equipAddress
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_warehouse_structure ws ON ws.id = es.warehouse_structure_id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND (
( sd.`status` != 7 )
OR ( sd.`status` IS NULL )
OR ( sd.`status` = '' ))
AND e.expiry_date IS NOT NULL
AND #{expiryDayNum} >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
GROUP BY
ed.standard,
ed.CODE,
equipAddress
ORDER BY
DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) ASC
) AS t
</select>
<select id="getStockEquipStatistics" resultType="java.util.Map">
SELECT
(
SELECT
count( 1 )
FROM
wl_stock_detail sd
LEFT JOIN wl_equipment_specific es ON es.id = sd.equipment_specific_id
WHERE
sd.`status` = 7
AND update_date LIKE CONCAT( DATE_FORMAT( CURRENT_DATE, '%Y' ), '%' )) yearScrap,
(
SELECT
count( 1 )
FROM
wl_stock_detail sd
LEFT JOIN wl_equipment_specific es ON es.id = sd.equipment_specific_id
WHERE
sd.`status` = 7
AND update_date LIKE CONCAT( DATE_FORMAT( CURRENT_DATE, '%Y-%m' ), '%' )) monthScrap,
( SELECT count( 1 ) FROM wl_stock_detail sd LEFT JOIN wl_equipment_specific es ON es.id = sd.equipment_specific_id WHERE sd.`status` = 7 ) scrap,
(
SELECT
count( es.id )
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND (
( sd.`status` != 7 )
OR ( sd.`status` IS NULL )
OR ( sd.`status` = '' ))
AND e.expiry_date IS NOT NULL
AND 30 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )) oneImminent,
(
SELECT
count( es.id )
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND (
( sd.`status` != 7 )
OR ( sd.`status` IS NULL )
OR ( sd.`status` = '' ))
AND e.expiry_date IS NOT NULL
AND 60 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )) twoImminent,
(
SELECT
count( es.id )
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND (
( sd.`status` != 7 )
OR ( sd.`status` IS NULL )
OR ( sd.`status` = '' ))
AND e.expiry_date IS NOT NULL
AND 90 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )) sixImminent
</select>
</mapper> </mapper>
...@@ -2847,6 +2847,7 @@ ...@@ -2847,6 +2847,7 @@
LEFT JOIN wl_equipment_specific_alarm esa ON esa.equipment_specific_id = es.id LEFT JOIN wl_equipment_specific_alarm esa ON esa.equipment_specific_id = es.id
WHERE WHERE
ed.`code` LIKE '92010800%' ed.`code` LIKE '92010800%'
AND es.iot_code IS NOT NULL
AND es.biz_org_code like concat(#{bizOrgCode}, '%') AND es.biz_org_code like concat(#{bizOrgCode}, '%')
<if test="systemCode!=null and systemCode!=''"> <if test="systemCode!=null and systemCode!=''">
AND fs.code = #{systemCode,jdbcType=VARCHAR} AND fs.code = #{systemCode,jdbcType=VARCHAR}
...@@ -2884,7 +2885,7 @@ ...@@ -2884,7 +2885,7 @@
LEFT JOIN wl_warehouse_structure wws ON wsd.warehouse_structure_id = wws.id LEFT JOIN wl_warehouse_structure wws ON wsd.warehouse_structure_id = wws.id
LEFT JOIN wl_equipment_category wec on wec.id=eq.category_id LEFT JOIN wl_equipment_category wec on wec.id=eq.category_id
<where> <where>
and wec.industry_code = 2 wec.industry_code = 2
<if test="dto.code!=null and dto.code!=''"> <if test="dto.code!=null and dto.code!=''">
and wesp.code = #{dto.code} and wesp.code = #{dto.code}
</if> </if>
...@@ -4063,7 +4064,14 @@ ...@@ -4063,7 +4064,14 @@
) temp ) temp
LEFT JOIN LEFT JOIN
( (
SELECT temp.*, SELECT temp.*,
CASE CASE
WHEN wei.is_trend = 0 then "遥信" WHEN wei.is_trend = 0 then "遥信"
...@@ -4121,7 +4129,7 @@ ...@@ -4121,7 +4129,7 @@
</select> </select>
<select id="selectAlarms" resultType="java.lang.Integer"> <select id="selectAlarms" resultType="java.lang.Integer">
SELECT SELECT
COUNT(1) SUM(index_true_num)
FROM FROM
wl_equipment_alarm_report_day report wl_equipment_alarm_report_day report
LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET( s.id, report.system_ids ) LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET( s.id, report.system_ids )
...@@ -4454,7 +4462,8 @@ ...@@ -4454,7 +4462,8 @@
LEFT JOIN wl_equipment equipment ON equipment.id =detail.equipment_id LEFT JOIN wl_equipment equipment ON equipment.id =detail.equipment_id
left join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id) left join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id)
where where
FIND_IN_SET(#{systemId},spec.system_id) AND equipment.is_iot = 1 FIND_IN_SET(#{systemId},spec.system_id)
AND equipment.is_iot = 1
GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1 GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1
GROUP BY a1.system_id GROUP BY a1.system_id
) as b ) as b
...@@ -5272,7 +5281,7 @@ ...@@ -5272,7 +5281,7 @@
END as 'status' END as 'status'
FROM FROM
f_fire_fighting_system fs f_fire_fighting_system fs
where system_type_code IS NOT NULL where system_type_code IS NOT NULL AND LENGTH(trim(system_type_code)) != 0
</select> </select>
<select id="getSystemAlarmInfoList" resultType="java.util.Map"> <select id="getSystemAlarmInfoList" resultType="java.util.Map">
SELECT SELECT
...@@ -5298,7 +5307,7 @@ ...@@ -5298,7 +5307,7 @@
FROM FROM
`f_fire_fighting_system` `fs` `f_fire_fighting_system` `fs`
where where
fs.system_type_code IS NOT NULL fs.system_type_code IS NOT NULL AND LENGTH(trim(fs.system_type_code)) != 0 AND fs.system_type_code != 'otherSys'
</select> </select>
<select id="getSystemCountInfo" resultType="java.util.Map"> <select id="getSystemCountInfo" resultType="java.util.Map">
...@@ -5608,29 +5617,68 @@ ...@@ -5608,29 +5617,68 @@
<select id="getEquip" resultType="java.util.Map"> <select id="getEquip" resultType="java.util.Map">
SELECT SELECT
spe.id, spe.id,
det.`name` equipmentName, wle.`name`,
spe.`code`, wle.`code`,
det.`code` equipmentCode,
( (
CASE CASE
( SELECT count(*) FROM wl_equipment_specific_alarm wesa WHERE wesa.equipment_specific_id = spe.id AND STATUS = 1 ) ( SELECT count(*) FROM wl_equipment_specific_alarm wesa WHERE wesa.equipment_specific_id = spe.id AND STATUS = 1 )
WHEN 0 THEN WHEN 0 THEN
'正常' ELSE '异常' '正常' ELSE '异常'
END END
) flag ) `status`,
wle.shbz_img shbzImg
FROM FROM
wl_equipment_specific AS spe wl_equipment_specific AS spe
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, spe.system_id ) LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, spe.system_id )
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
LEFT JOIN wl_stock_detail AS wlsd ON wlsd.equipment_detail_id = det.id
WHERE WHERE
fs.system_type_code IS NOT NULL fs.system_type_code IS NOT NULL
AND fs.system_type_code = 'fireAlarmSys' <if test="bizOrgCode != null and bizOrgCode != ''">
AND wlsd.`status` = 1 AND spe.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
<if test="systemCode != null and systemCode != ''">
AND fs.system_type_code = #{systemCode}
</if>
GROUP BY det.`code` GROUP BY det.`code`
</select> </select>
<select id="getFireSystemEquipStatusList" resultType="java.util.Map">
SELECT
spe.id,
spe.`name`,
spe.`code`,
(
CASE
( SELECT count(*) FROM wl_equipment_specific_alarm wesa WHERE wesa.equipment_specific_id = spe.id AND STATUS = 1 )
WHEN 0 THEN
'正常' ELSE '异常'
END
) `status`,
wle.shbz_img shbzImg
FROM
wl_equipment_specific AS spe
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, spe.system_id )
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
WHERE
fs.system_type_code IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''">
AND spe.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
<if test="systemCode != null and systemCode != ''">
AND fs.system_type_code = #{systemCode}
</if>
<if test="categoryCodes != null and categoryCodes.split(',').length >0">
AND
<foreach collection="categoryCodes.split(',')" item="item" index="index" open="(" close=")" separator=" OR ">
LOCATE(#{item}, det.`code`) > 0
</foreach>
</if>
GROUP BY spe.id
ORDER BY spe.id
</select>
<select id="selectPressureDetails" resultType="java.util.Map"> <select id="selectPressureDetails" resultType="java.util.Map">
SELECT SELECT
ed.`name`, ed.`name`,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment