Commit ece65294 authored by 李成龙's avatar 李成龙

新增装备工程

parent bfe763c3
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>amos-biz-boot</artifactId>
<groupId>com.amosframework.boot</groupId>
<version>1.0.0</version>
</parent>
<artifactId>amos-boot-system-equip</artifactId>
<version>3.0.1.3</version>
<dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-equip-biz</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
package com.yeejoin;
import java.net.InetAddress;
import java.net.UnknownHostException;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
@SpringBootApplication
@EnableDiscoveryClient
@MapperScan({ "org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*",
"com.yeejoin.amos.boot.module.*.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper",
"com.yeejoin.equipmanage.mapper"})
@ComponentScan({"org.typroject", "com.yeejoin.amos", "com.yeejoin.equipmanage"})
@EnableFeignClients
@EnableAsync
public class AmostEquipApplication {
private static final Logger logger = LoggerFactory.getLogger(AmostEquipApplication.class);
public static void main(String[] args) throws UnknownHostException {
ConfigurableApplicationContext context = SpringApplication.run(AmostEquipApplication.class, args);
Environment env = context.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port");
String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
GlobalExceptionHandler.setAlwaysOk(true);
logger.info("\n----------------------------------------------------------\n\t"
+ "Application Amos-Biz-Boot is running! Access URLs:\n\t" + "Swagger文档: \thttp://" + ip + ":" + port
+ path + "/doc.html\n" + "----------------------------------------------------------");
}
}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://172.16.10.85:3306/autosys_business_v3.0.0.2?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username=root
spring.datasource.password=Amos2019Mysql8
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.minimum-idle= 3
spring.datasource.hikari.maximum-pool-size= 30
spring.datasource.hikari.auto-commit= true
spring.datasource.hikari.idle-timeout= 500000
spring.datasource.hikari.max-lifetime= 1800000
spring.datasource.hikari.connection-timeout= 60000
spring.datasource.hikari.connection-test-query= SELECT 1
# \u6587\u4EF6\u670D\u52A1\u5668\u5730\u5740
fileserver_domain=http://39.98.246.31:8888/
eureka.instance.hostname= 172.16.11.20
eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password=a1234560
security.loginId=fas_system
security.productApp=STUDIO_APP_MOBILE
security.productWeb=STUDIO_APP_WEB
security.appKeyApp=studio_normalapp_3056965
#redis
spring.redis.database=1
spring.redis.host=172.16.11.20
spring.redis.port=6379
spring.redis.password=1234560
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.11.33:1883
emqx.user-name=admin
emqx.password=public
mqtt.scene.host=mqtt://172.16.11.33:8083/mqtt
mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000
#数据同步开关
systemctl.sync.switch=false
#数据JCS开关
systemctl.jcs.switch=false
#平台数据开关
systemctl.amos.switch=false
#报表数据地址
equip.report.url=/fire-fighting-system/ureport/preview?_u=file:
#数字化南瑞平台接口
dcs.url.token=http://198.87.103.158:8001/auth-service/oauth/token
dcs.url.sendalarm=http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间
param.system.online.date = 2019-02-12
# 视频转码服务开关 off/on,默认关闭,数字换流站使用时开启
param.isUseVideoTranscoding = off
# 航天视频服务地址
param.htvideo.url="http://192.168.4.174:9001";
# 南瑞视频转码服务地址
param.nrvideo.url="http://198.87.103.158:8001";
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://172.16.11.20:3306/autosys_business_v3.0.0.2?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username= root
spring.datasource.password= root_123
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.minimum-idle= 3
spring.datasource.hikari.maximum-pool-size= 30
spring.datasource.hikari.auto-commit= true
spring.datasource.hikari.idle-timeout= 10000
spring.datasource.hikari.max-lifetime= 1800000
spring.datasource.hikari.connection-timeout= 30000
spring.datasource.hikari.connection-test-query= SELECT 1
# 文件服务器地址
fileserver_domain=http://39.98.246.31:8888/
eureka.instance.hostname= 172.16.11.20
eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password=a1234560
security.loginId=fas_system
security.productApp=STUDIO_APP_MOBILE
security.productWeb=STUDIO_APP_WEB
security.appKeyApp=studio_normalapp_3056965
#redis
spring.redis.database=1
spring.redis.host=172.16.11.20
spring.redis.port=6379
spring.redis.password=1234560
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.11.33:1883
emqx.user-name=admin
emqx.password=public
mqtt.scene.host=mqtt://172.16.11.33:8083/mqtt
mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000
#数据同步开关
systemctl.sync.switch=false
#数据JCS开关
systemctl.jcs.switch=false
#平台数据开关
systemctl.amos.switch=false
#报表数据地址
equip.report.url=/fire-fighting-system/ureport/preview?_u=file:
#数字化南瑞平台接口
dcs.url.token=http://198.87.103.158:8001/auth-service/oauth/token
dcs.url.sendalarm=http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间
param.system.online.date = 2019-02-12
# 视频转码服务开关 off/on,默认关闭,数字换流站使用时开启
param.isUseVideoTranscoding = off
# 航天视频服务地址
param.htvideo.url="";
# 南瑞视频转码服务地址
param.nrvideo.url="";
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://172.16.10.66:3306/safety-business-3.0.1?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username= root
spring.datasource.password= root_123
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.minimum-idle= 3
spring.datasource.hikari.maximum-pool-size= 30
spring.datasource.hikari.auto-commit= true
spring.datasource.hikari.idle-timeout= 10000
spring.datasource.hikari.max-lifetime= 1800000
spring.datasource.hikari.connection-timeout= 30000
spring.datasource.hikari.connection-test-query= SELECT 1
fdfs.so-timeout=1501
fdfs.connect-timeout=601
fdfs.thumb-image.height=200
fdfs.thumb-image.width=200
fdfs.tracker-list[0]=39.98.246.31:22122
# 文件服务器地址
fileserver_domain=http://39.98.246.31:8888/
eureka.instance.hostname= 172.16.10.72
eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password=a1234560
security.loginId=fas_system
security.productApp=STUDIO_APP_MOBILE
security.productWeb=STUDIO_APP_WEB
security.appKeyApp=studio_normalapp_3157169
#redis
spring.redis.database=0
spring.redis.host=172.16.10.85
spring.redis.port=6379
spring.redis.password=amos2019Redis
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
mqtt.scene.host=mqtt://172.16.10.85:8083/mqtt
mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.85:1883
emqx.user-name=super
emqx.password=a123456
#数据同步开关
systemctl.sync.switch=false
#数据JCS开关
systemctl.jcs.switch=true
#平台数据开关
systemctl.amos.switch=true
#报表数据地址
equip.report.url=/fire-fighting-system/ureport/preview?_u=file:
#数字化南瑞平台接口
dcs.url.token=http://198.87.103.158:8001/auth-service/oauth/token
dcs.url.sendalarm=http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间
param.system.online.date = 2019-02-12
# 视频转码服务开关 off/on,默认关闭,数字换流站使用时开启
param.isUseVideoTranscoding = off
# 航天视频服务地址
param.htvideo.url="";
# 南瑞视频转码服务地址
param.nrvideo.url="";
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://172.16.11.20:3306/autosys_business_v3.0.0.2?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username= root
spring.datasource.password= root_123
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.minimum-idle= 3
spring.datasource.hikari.maximum-pool-size= 30
spring.datasource.hikari.auto-commit= true
spring.datasource.hikari.idle-timeout= 10000
spring.datasource.hikari.max-lifetime= 1800000
spring.datasource.hikari.connection-timeout= 30000
spring.datasource.hikari.connection-test-query= SELECT 1
# 文件服务器地址
fileserver_domain=http://39.98.246.31:8888/
eureka.instance.hostname= 172.16.11.20
eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password=a1234560
security.loginId=fas_system
security.productApp=STUDIO_APP_MOBILE
security.productWeb=STUDIO_APP_WEB
security.appKeyApp=studio_normalapp_3056965
#redis
spring.redis.database=1
spring.redis.host=172.16.11.20
spring.redis.port=6379
spring.redis.password=1234560
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.11.33:1883
emqx.user-name=admin
emqx.password=public
mqtt.scene.host=mqtt://172.16.11.33:8083/mqtt
mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000
#数据同步开关
systemctl.sync.switch=false
#数据JCS开关
systemctl.jcs.switch=false
#平台数据开关
systemctl.amos.switch=false
#报表数据地址
equip.report.url=/fire-fighting-system/ureport/preview?_u=file:
#数字化南瑞平台接口
dcs.url.token=http://198.87.103.158:8001/auth-service/oauth/token
dcs.url.sendalarm=http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间
param.system.online.date = 2019-02-12
# 视频转码服务开关 off/on,默认关闭,数字换流站使用时开启
param.isUseVideoTranscoding = off
# 航天视频服务地址
param.htvideo.url="";
# 南瑞视频转码服务地址
param.nrvideo.url="";
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://172.16.11.20:3306/autosys_business_v3.0.0.2?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username= root
spring.datasource.password= root_123
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.minimum-idle= 3
spring.datasource.hikari.maximum-pool-size= 30
spring.datasource.hikari.auto-commit= true
spring.datasource.hikari.idle-timeout= 10000
spring.datasource.hikari.max-lifetime= 1800000
spring.datasource.hikari.connection-timeout= 30000
spring.datasource.hikari.connection-test-query= SELECT 1
# 文件服务器地址
fileserver_domain=http://39.98.246.31:8888/
eureka.instance.hostname= 172.16.11.20
eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone: http://${eureka.instance.hostname}:10001/eureka/
#security config
security.password=a1234560
security.loginId=fas_system
security.productApp=STUDIO_APP_MOBILE
security.productWeb=STUDIO_APP_WEB
security.appKeyApp=studio_normalapp_3056965
#redis
spring.redis.database=1
spring.redis.host=172.16.11.20
spring.redis.port=6379
spring.redis.password=1234560
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.11.33:1883
emqx.user-name=admin
emqx.password=public
mqtt.scene.host=mqtt://172.16.11.33:8083/mqtt
mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000
#报表数据地址
equip.report.url=/fire-fighting-system/ureport/preview?_u=file:
#数字化南瑞平台接口
dcs.url.token=http://198.87.103.158:8001/auth-service/oauth/token
dcs.url.sendalarm=http://198.87.103.158:8001/alarm-service/appalarm/sendalarm
#系统上线时间
param.system.online.date = 2019-02-12
# 视频转码服务开关 off/on,默认关闭,数字换流站使用时开启
param.isUseVideoTranscoding = off
# 航天视频服务地址
param.htvideo.url="";
# 南瑞视频转码服务地址
param.nrvideo.url="";
spring.application.name= AMOS-EQUIPMANAGE
server.servlet.context-path=/equip
server.port= 8100
#server.servlet.context-path=/case
spring.profiles.active = dev
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#mybatis mapper file
mybatis.mapper-locations=classpath:mapper/*.xml
#mybatis-plus
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
# mybatis entity package
mybatis.type-aliases-package=com.yeejoin.equipmanage.common.entity
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
#pagehelper \u5206\u9875\u63D2\u4EF6
pagehelper.helper-dialect=mysql
pagehelper.params=count=countSql
pagehelper.reasonable=false
pagehelper.support-methods-arguments=true
#liquibase
spring.liquibase.change-log = classpath:/changelog/changelog-master.xml
spring.liquibase.enabled= true
#\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u5927\u5C0F
spring.servlet.multipart.maxFileSize=100MB
spring.servlet.multipart.maxRequestSize=100MB
#saveUserRedis\u8FC7\u671F\u65F6\u95F428\u5929
#redis_region_time_second=2419200
patrol.fegin.name = AMOS-PATROL
maintenance.feign.name = AMOS-MAINTENANCE-API
precontrol.feign.name = JEPCC-PRECONTROL-SERVER
security.privilege.name=AMOS-API-PRIVILEGE
security.systemctl.name=AMOS-API-SYSTEMCTL
#jpush
Push.fegin.name=AppMessagePushService
dutyMode.fegin.name=AMOS-DUTYMODE
riskSource.feign.name=AMOS-AUTOSYS
equipManage.name=AMOS-EQUIPMANAGE
iot.vehicle.track=AMOS-API-IOT
jcs.fegin.name=JCS
#项目初始化画布id
morphic.projectSeq=1390314016458514433
#wl_equipment_category 表id (取火灾报警系统id)
equipment.fire.systemid=1302870628873932802
equipment.type=2
equipment.hierarchy=1,2,4,6
#装备查询根据装备类型编码过滤,4为过滤掉车相关数据,多个的话,添加方式为4,5
equipment.filter.code=4
#wl_equipment_category 编码 92040000 为消防行业 火灾系统分类编码
equip.system.alarm.code=92040000
#wl_equipment_category 编码 50000000 为安防行业 摄像头分类编码
equip.security.code=50000000
## redis失效时间
redis.cache.failure.time=10800
#平台字典配置项
systemctl.dict.iot-core-param=IOT_CORE_PARAM
systemctl.dict.area-type=AREA_TYPE
systemctl.dict.allow-operation=ALLOW_OPERATION
systemctl.dict.build-type=BUILD_TYPE
systemctl.dict.build-use-type=BUILD_USE_TYPE
systemctl.dict.building-structure-type=BUILDING_STRUCTURE_TYPE
equip.dict.car-state=CarState
equip.dict.name-key=FireCar_GDLongitude,FireCar_GDLatitude
#Project application topic
mqtt.vehicle.topic=${equipManage.name}.vehicle.state
equip.point.equipmentdata.topic=${equipManage.name}.equipment.state
equip.index.topic=${equipManage.name}.equipment.index.state
equip.iot.monitor.topic=team/station/monitor/matrix
# 接口地址
equip.scene.detail.url=${server.servlet.context-path}/scene/%s/detail/list
equip.point.equipmentdata.url=${server.servlet.context-path}/equipSpecific/getAll?id=
equip.point.speindex.url=${server.servlet.context-path}/fire-fighting-system/getSpeIndex?id=
equip.point.equipmentDetail.url=${server.servlet.context-path}/equipSpecific/getOneCard?id=
#组态获取系统详情接口地址
firefightingsystem.detail.url=${server.servlet.context-path}/fire-fighting-system/getSystemById?id=
#组态获取分页接口地址
firefightingsystem.equip.alarms.url=${server.servlet.context-path}/fire-fighting-system/getEquipmentAlarmBySystemIdOrSourceIdVO
building.detail=${server.servlet.context-path}/building/findByInstanceId
building.floor.detail=${server.servlet.context-path}/building/getBuildDetaliByFloorId?instanceId=
dcs.client-id=fire_system
dcs.grant-type=client_credentials
dcs.scope=all
dcs.token-key=dcs_token_key
dcs.client.secret=fire_system
dcs.x.hw.id=NR_REST_APP
dcs.x.hw.appKey=s+YkvQhwilx91TRJHhNDmw==
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<track>
<car
longitude = "108.905463"
latitude = "34.23045"
/>
<car
longitude = "108.906965"
latitude = "34.229811"
/>
<car
longitude = "108.907823"
latitude = "34.229403"
/>
<car
longitude = "108.909626"
latitude = "34.228658"
/>
<car
longitude = "108.910849"
latitude = "34.228108"
/>
<car
longitude = "108.91175"
latitude = "34.2277"
/>
<car
longitude = "108.91205"
latitude = "34.227647"
/>
<car
longitude = "108.912072"
latitude = "34.227629"
/>
<car
longitude = "108.912737"
latitude = "34.227328"
/>
<car
longitude = "108.915591"
latitude = "34.225997"
/>
<car
longitude = "108.915419"
latitude = "34.226139"
/>
<car
longitude = "108.917072"
latitude = "34.225465"
/>
<car
longitude = "108.917501"
latitude = "34.22511"
/>
<car
longitude = "108.917093"
latitude = "34.224968"
/>
<car
longitude = "108.91675"
latitude = "34.224542"
/>
<car
longitude = "108.916621"
latitude = "34.224028"
/>
<car
longitude = "108.916428"
latitude = "34.223744"
/>
<car
longitude = "108.916278"
latitude = "34.223549"
/>
<car
longitude = "108.91602"
latitude = "34.223265"
/>
<car
longitude = "108.915527"
latitude = "34.22252"
/>
<car
longitude = "108.915269"
latitude = "34.222484"
/>
<car
longitude = "108.915505"
latitude = "34.222733"
/>
<car
longitude = "108.915441"
latitude = "34.2222"
/>
</track>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<trend>
<car
speed = "50.00"
time = "2020-11-24 01:33:44"
courseOverGround = "10.00"
/>
<car
speed = "85.00"
time = "2020-11-24 02:33:44"
courseOverGround = "40.00"
/>
<car
speed = "110.00"
time = "2020-11-24 03:33:44"
courseOverGround = "40.00"
/>
<car
speed = "150.00"
time = "2020-11-24 04:33:44"
courseOverGround = "50.00"
/>
<car
speed = "150.00"
time = "2020-11-24 05:33:44"
courseOverGround = "55.00"
/>
<car
speed = "150.00"
time = "2020-11-24 06:33:44"
courseOverGround = "40.00"
/>
<car
speed = "180.00"
time = "2020-11-24 07:33:44"
courseOverGround = "40.00"
/>
<car
speed = "200.00"
time = "2020-11-24 08:33:44"
courseOverGround = "40.00"
/>
<car
speed = "220.00"
time = "2020-11-24 09:33:44"
courseOverGround = "52.00"
/>
<car
speed = "250.00"
time = "2020-11-24 10:33:44"
courseOverGround = "63.00"
/>
<car
speed = "190.00"
time = "2020-11-24 11:33:44"
courseOverGround = "60.00"
/>
<car
speed = "150.00"
time = "2020-11-24 12:33:44"
courseOverGround = "63.00"
/>
<car
speed = "120.00"
time = "2020-11-24 13:33:44"
courseOverGround = "70.00"
/>
<car
speed = "100.00"
time = "2020-11-24 14:33:44"
courseOverGround = "80.00"
/>
<car
speed = "130.00"
time = "2020-11-24 15:33:44"
courseOverGround = "75.00"
/>
<car
speed = "190.00"
time = "2020-11-24 16:33:44"
courseOverGround = "89.00"
/>
<car
speed = "140.00"
time = "2020-11-24 17:33:44"
courseOverGround = "95.00"
/>
<car
speed = "100.00"
time = "2020-11-24 18:33:44"
courseOverGround = "86.00"
/>
<car
speed = "205.00"
time = "2020-11-24 19:33:44"
courseOverGround = "105.00"
/>
<car
speed = "40.00"
time = "2020-11-24 20:33:44"
courseOverGround = "255.00"
/>
<car
speed = "140.00"
time = "2020-11-24 21:33:44"
courseOverGround = "95.00"
/>
<car
speed = "110.00"
time = "2020-11-24 22:33:44"
courseOverGround = "95.00"
/>
<car
speed = "150.00"
time = "2020-11-24 23:33:44"
courseOverGround = "60.00"
/>
<car
speed = "120.00"
time = "2020-11-25 00:33:44"
courseOverGround = "150.00"
/>
</trend>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
<include file="wl-3.0.1.xml" relativeToChangelogFile="true"/>
<!--全量包含视图和函数-->
<include file="sql-task-all.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
-- ----------------------------
-- View structure for v_today_alarm_confirm_jcs
-- ----------------------------
DROP VIEW IF EXISTS `v_today_alarm_confirm_jcs`;
CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_today_alarm_confirm_jcs` AS select (select count(1) from `wl_equipment_specific_alarm_log` `a` where (((to_days(`a`.`create_date`) - to_days(now())) = 0) and (`a`.`confirm_type` <> ''))) AS `have`,(select count(1) from `wl_equipment_specific_alarm_log` `a` where (((to_days(`a`.`create_date`) - to_days(now())) = 0) and isnull(`a`.`confirm_type`))) AS `wait`;
DROP VIEW IF EXISTS `v_equipment_num_fbwg_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equipment_num_fbwg_jcs` AS select count(1) AS `total` from ((select `b`.`id` AS `id`,`b`.`system_id` AS `system_id` from (`wl_equipment_detail` `a` join `wl_equipment_specific` `b`) where ((`a`.`id` = `b`.`equipment_detail_id`) and (`b`.`system_id` <> '') and (`a`.`code` = '92040300RJZ44'))) `s` join `f_fire_fighting_system` `fs`) where (find_in_set(`fs`.`id`,`s`.`system_id`) and (`fs`.`code` = '029026401813010000000016'));
DROP VIEW IF EXISTS `v_equipment_num_fhz_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equipment_num_fhz_jcs` AS select count(1) AS `total` from ((select `b`.`id` AS `id`,`b`.`system_id` AS `system_id` from (`wl_equipment_detail` `a` join `wl_equipment_specific` `b`) where ((`a`.`id` = `b`.`equipment_detail_id`) and (`b`.`system_id` <> '') and (`a`.`code` = '92160200J4244'))) `s` join `f_fire_fighting_system` `fs`) where (find_in_set(`fs`.`id`,`s`.`system_id`) and (`fs`.`code` = '029026401813010000000061'));
DROP VIEW IF EXISTS `v_equipment_num_gwdl_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equipment_num_gwdl_jcs` AS select count(1) AS `total` from ((select `b`.`id` AS `id`,`b`.`system_id` AS `system_id` from (`wl_equipment_detail` `a` join `wl_equipment_specific` `b`) where ((`a`.`id` = `b`.`equipment_detail_id`) and (`b`.`system_id` <> '') and (`a`.`code` = '92040700PEM44'))) `s` join `f_fire_fighting_system` `fs`) where (find_in_set(`fs`.`id`,`s`.`system_id`) and (`fs`.`code` = '029026401813010000000016'));
DROP VIEW IF EXISTS `v_equipment_num_hwds_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equipment_num_hwds_jcs` AS select count(1) AS `total` from ((select `b`.`id` AS `id`,`b`.`system_id` AS `system_id` from (`wl_equipment_detail` `a` join `wl_equipment_specific` `b`) where ((`a`.`id` = `b`.`equipment_detail_id`) and (`b`.`system_id` <> '') and (`a`.`code` = '92040800CZU44'))) `s` join `f_fire_fighting_system` `fs`) where (find_in_set(`fs`.`id`,`s`.`system_id`) and (`fs`.`code` = '029026401813010000000016'));
DROP VIEW IF EXISTS `v_equipment_num_kqcy_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equipment_num_kqcy_jcs` AS select count(1) AS `total` from ((select `b`.`id` AS `id`,`b`.`system_id` AS `system_id` from (`wl_equipment_detail` `a` join `wl_equipment_specific` `b`) where ((`a`.`id` = `b`.`equipment_detail_id`) and (`b`.`system_id` <> '') and (`a`.`code` = '920405002O544'))) `s` join `f_fire_fighting_system` `fs`) where (find_in_set(`fs`.`id`,`s`.`system_id`) and (`fs`.`code` = '029026401813010000000016'));
DROP VIEW IF EXISTS `v_equipment_num_sdbja_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equipment_num_sdbja_jcs` AS select count(1) AS `total` from ((select `b`.`id` AS `id`,`b`.`system_id` AS `system_id` from (`wl_equipment_detail` `a` join `wl_equipment_specific` `b`) where ((`a`.`id` = `b`.`equipment_detail_id`) and (`b`.`system_id` <> '') and (`a`.`code` = '920404002PU44'))) `s` join `f_fire_fighting_system` `fs`) where (find_in_set(`fs`.`id`,`s`.`system_id`) and (`fs`.`code` = '029026401813010000000016'));
DROP VIEW IF EXISTS `v_equipment_num_sgbjq_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equipment_num_sgbjq_jcs` AS select count(1) AS `total` from ((select `b`.`id` AS `id`,`b`.`system_id` AS `system_id` from (`wl_equipment_detail` `a` join `wl_equipment_specific` `b`) where ((`a`.`id` = `b`.`equipment_detail_id`) and (`b`.`system_id` <> '') and (`a`.`code` = '92041000LCW44'))) `s` join `f_fire_fighting_system` `fs`) where (find_in_set(`fs`.`id`,`s`.`system_id`) and (`fs`.`code` = '029026401813010000000016'));
DROP VIEW IF EXISTS `v_equipment_num_xfzj_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equipment_num_xfzj_jcs` AS select count(1) AS `total` from ((select `b`.`id` AS `id`,`b`.`system_id` AS `system_id` from (`wl_equipment_detail` `a` join `wl_equipment_specific` `b`) where ((`a`.`id` = `b`.`equipment_detail_id`) and (`b`.`system_id` <> '') and (`a`.`code` = '92040900VUA44'))) `s` join `f_fire_fighting_system` `fs`) where (find_in_set(`fs`.`id`,`s`.`system_id`) and (`fs`.`code` = '029026401813010000000016'));
DROP VIEW IF EXISTS `v_equipment_num_yjgb_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equipment_num_yjgb_jcs` AS select count(1) AS `total` from ((select `b`.`id` AS `id`,`b`.`system_id` AS `system_id` from (`wl_equipment_detail` `a` join `wl_equipment_specific` `b`) where ((`a`.`id` = `b`.`equipment_detail_id`) and (`b`.`system_id` <> '') and (`a`.`code` = '92120300CAA44'))) `s` join `f_fire_fighting_system` `fs`) where (find_in_set(`fs`.`id`,`s`.`system_id`) and (`fs`.`code` = '029026401813010000000061'));
DROP VIEW IF EXISTS `v_equipment_num_ywtcq_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equipment_num_ywtcq_jcs` AS select count(1) AS `total` from ((select `b`.`id` AS `id`,`b`.`system_id` AS `system_id` from (`wl_equipment_detail` `a` join `wl_equipment_specific` `b`) where ((`a`.`id` = `b`.`equipment_detail_id`) and (`b`.`system_id` <> '') and (`a`.`code` = '920402009EM44'))) `s` join `f_fire_fighting_system` `fs`) where (find_in_set(`fs`.`id`,`s`.`system_id`) and (`fs`.`code` = '029026401813010000000016'));
DROP VIEW IF EXISTS `v_water_sys_status_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_water_sys_status_jcs` AS
SELECT
fs.`name` AS fightSysName,
fs.`code` AS fightSysCode,
CASE
WHEN IFNULL( COUNT( DISTINCT es.id ), 0 ) = 0 THEN
'正常' ELSE '异常'
END AS amount
FROM
f_fire_fighting_system fs
LEFT JOIN wl_equipment_specific es ON FIND_IN_SET( fs.id, es.system_id )
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment_specific_alarm sa ON es.id = sa.equipment_specific_id
WHERE
fs.`code` = '029026401813010000000047'
AND UPPER( sa.equipment_specific_index_value ) = 'TRUE'
AND ( ed.`code` LIKE '92010800%' OR ed.`code` LIKE '92010300%' OR ed.`code` LIKE '92010600%' );
DROP VIEW IF EXISTS `v_other_sys_status_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_other_sys_status_jcs` AS
SELECT
fs.`name` AS fightSysName,
fs.`code` AS fightSysCode,
CASE
WHEN IFNULL( COUNT( DISTINCT es.id ), 0 ) = 0 THEN
'正常' ELSE '异常'
END AS amount
FROM
f_fire_fighting_system fs
LEFT JOIN wl_equipment_specific es ON FIND_IN_SET( fs.id, es.system_id )
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment_specific_alarm sa ON es.id = sa.equipment_specific_id
WHERE
fs.`code` = '029026401813010000000061'
AND UPPER( sa.equipment_specific_index_value ) = 'TRUE';
DROP VIEW IF EXISTS `v_fire_sys_status_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_sys_status_jcs` AS
SELECT
fs.`name` AS fightSysName,
fs.`code` AS fightSysCode,
CASE
WHEN IFNULL( COUNT( DISTINCT es.id ), 0 ) = 0 THEN
'正常' ELSE '异常'
END AS amount
FROM
f_fire_fighting_system fs
LEFT JOIN wl_equipment_specific es ON FIND_IN_SET( fs.id, es.system_id )
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment_specific_alarm sa ON es.id = sa.equipment_specific_id
WHERE
fs.`code` = '029026401813010000000016'
AND UPPER( sa.equipment_specific_index_value ) = 'TRUE'
AND (
ed.`code` LIKE '92040200%'
OR ed.`code` LIKE '92041000%'
OR ed.`code` LIKE '92040800%'
OR ed.`code` LIKE '92040400%'
OR ed.`code` LIKE '92040700%'
OR ed.`code` LIKE '92160200%'
OR ed.`code` LIKE '92040500%'
OR ed.`code` LIKE '92041900%'
);
DROP VIEW IF EXISTS `v_ecms_sys_status_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_ecms_sys_status_jcs` AS
SELECT
fs.`name` AS fightSysName,
fs.`code` AS fightSysCode,
CASE
WHEN IFNULL( COUNT( DISTINCT es.id ), 0 ) = 0 THEN
'正常' ELSE '异常'
END AS amount
FROM
f_fire_fighting_system fs
LEFT JOIN wl_equipment_specific es ON FIND_IN_SET( fs.id, es.system_id )
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment_specific_alarm sa ON es.id = sa.equipment_specific_id
WHERE
fs.`code` = '029026401813010000000030'
AND UPPER( sa.equipment_specific_index_value ) = 'TRUE'
AND ( ed.`code` LIKE '92010800%' OR ed.`code` LIKE '92010300%' OR ed.`code` LIKE '92010600%' );
DROP VIEW IF EXISTS `v_fire_fas_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_fas_jcs` AS select (select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '920402009EM44') and (`wei`.`name_key` = 'FAS_SmokeAlarm_Shield') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `ywtcqpb`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '920402009EM44') and (`wei`.`name_key` = 'FAS_SmokeAlarm_Fault') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `ywtcqgz`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '920402009EM44') and (`wei`.`name_key` = 'FAS_SmokeAlarm_FireAlarm') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `ywtcqhj`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92041000LCW44') and (`wei`.`name_key` = 'FAS_SoundLightAlarm_Shield') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `sgbjqpb`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92041000LCW44') and (`wei`.`name_key` = 'FAS_SoundLightAlarm_Fault') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `sgbjqgz`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92041000LCW44') and (`wei`.`name_key` = 'FAS_SoundLightAlarm_FireAlarm') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `sgbjqhj`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92040800CZU44') and (`wei`.`name_key` = 'FAS_InfraredLight_Shield') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `hwdspb`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92040800CZU44') and (`wei`.`name_key` = 'FAS_InfraredLight_Fault') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `hwdsgz`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92040800CZU44') and (`wei`.`name_key` = 'FAS_InfraredLight_FireAlarm') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `hwdshj`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '920404002PU44') and (`wei`.`name_key` = 'FAS_ManualAlarm_Shield') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `sdbjapb`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '920404002PU44') and (`wei`.`name_key` = 'FAS_ManualAlarm_Fault') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `sdbjagz`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '920404002PU44') and (`wei`.`name_key` = 'FAS_ManualAlarm_FireAlarm') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `sdbjahj`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92040700PEM44') and (`wei`.`name_key` = 'FAS_TemperatureCable_Shield') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `gwdlpb`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92040700PEM44') and (`wei`.`name_key` = 'FAS_TemperatureCable_Fault') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `gwdlgz`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92040700PEM44') and (`wei`.`name_key` = 'FAS_TemperatureCable_FireAlarm') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `gwdlhj`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000061') and (`wd`.`code` = '92160200J4244') and (`wei`.`name_key` = 'SCS_FireDamper_Shield') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `fhfpb`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000061') and (`wd`.`code` = '92160200J4244') and (`wei`.`name_key` = 'SCS_FireDamper_Fault') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `fhfgz`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000061') and (`wd`.`code` = '92160200J4244') and (`wei`.`name_key` = 'SCS_FireDamper_FireAlarm') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `fhfhj`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92040300RJZ44') and (`wei`.`name_key` = 'FAS_TemperatureAlarm_Shield') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `fbwgpb`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92040300RJZ44') and (`wei`.`name_key` = 'FAS_TemperatureAlarm_Fault') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `fbwggz`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92040300RJZ44') and (`wei`.`name_key` = 'FAS_TemperatureAlarm_FireAlarm') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `fbwghj`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '920405002O544') and (`wei`.`name_key` = 'FAS_AirSampler_Shield') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `kqcypb`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '920405002O544') and (`wei`.`name_key` = 'FAS_AirSampler_Fault') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `kqcygz`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '920405002O544') and (`wei`.`name_key` = 'FAS_AirSampler_Alarm') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `kqcyhj`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000061') and (`wd`.`code` = '92120300CAA44') and (`wei`.`name_key` = 'FAS_UltravioletLight_Shield') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `yjgbpb`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000061') and (`wd`.`code` = '92120300CAA44') and (`wei`.`name_key` = 'FAS_UltravioletLight_Fault') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `yjgbgz`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000061') and (`wd`.`code` = '92120300CAA44') and (`wei`.`name_key` = 'FAS_UltravioletLight_FireAlarm') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `yjgbhj`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92040900VUA44') and (`wei`.`name_key` = 'FAS_UltravioletLight_Shield') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `zwhypb`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92040900VUA44') and (`wei`.`name_key` = 'FAS_UltravioletLight_Fault') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `zwhygz`,(select count(distinct `wes`.`id`) from ((((`wl_equipment_specific_index` `wesi` left join `wl_equipment_specific` `wes` on((`wes`.`id` = `wesi`.`equipment_specific_id`))) left join `wl_equipment_detail` `wd` on((`wd`.`id` = `wes`.`equipment_detail_id`))) left join `wl_equipment_index` `wei` on((`wei`.`id` = `wesi`.`equipment_index_id`))) left join `f_fire_fighting_system` `ffs` on(find_in_set(`ffs`.`id`,`wes`.`system_id`))) where ((`ffs`.`code` = '029026401813010000000016') and (`wd`.`code` = '92040900VUA44') and (`wei`.`name_key` = 'FAS_UltravioletLight_FireAlarm') and (upper(`wesi`.`value`) like '%TRUE%'))) AS `zwhyhj`;
DROP VIEW IF EXISTS `v_fire_monitor_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_monitor_jcs` AS SELECT d.*
FROM (
SELECT
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44') AS dqhzjkqNum,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_FireAlarm' AND upper(wesi.value) like '%TRUE%') AS dqhzjkqhj,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_Fault' AND upper(wesi.value) like '%TRUE%') AS dqhzjkqgz,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_Shield' AND upper(wesi.value) like '%TRUE%') AS dqhzjkqpb,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44') AS gwtcqNum,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_FireAlarm' AND upper(wesi.value) like '%TRUE%') AS gwtcqhj,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_Fault' AND upper(wesi.value) like '%TRUE%') AS gwtcqgz,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_Shield' AND upper(wesi.value) like '%TRUE%') AS gwtcqpb,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44') AS sydltcqNum,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_FireAlarm' AND upper(wesi.value) like '%TRUE%') AS sydltcqhj,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_Fault' AND upper(wesi.value) like '%TRUE%') AS sydltcqgz,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_Shield' AND upper(wesi.value) like '%TRUE%') AS sydltcqpb,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44') AS dltcqNum,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_FireAlarm' AND upper(wesi.value) like '%TRUE%') AS dltcqhj,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_Fault' AND upper(wesi.value) like '%TRUE%') AS dltcqgz,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_Shield' AND upper(wesi.value) like '%TRUE%') AS dltcqpb,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44') AS dhtcqNum,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_FireAlarm' AND upper(wesi.value) like '%TRUE%') AS dhtcqhj,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_Fault' AND upper(wesi.value) like '%TRUE%') AS dhtcqgz,
(SELECT
count(DISTINCT(wes.id))
FROM wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
LEFT JOIN f_fire_fighting_system ffs ON find_in_set(ffs.id, wes.system_id)
WHERE ffs.code = '029026401813010000000061' AND wes.code = '92120300CAA44' AND wei.name_key = 'FAS_UltravioletLight_Shield' AND upper(wesi.value) like '%TRUE%') AS dhtcqpb
) d ;
DROP VIEW IF EXISTS `v_person_onduty_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_person_onduty_jcs` AS SELECT team_name AS teamName, COUNT(id) AS num FROM wl_car WHERE team_id IS NOT NULL AND team_name IS NOT NULL GROUP BY team_id;
DROP VIEW IF EXISTS `v_equipment_firefighting_num_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equipment_firefighting_num_jcs` AS
SELECT
'个人防护装备' AS `type`,
count( `wes`.`id` ) AS `num`
FROM
(
(
( `wl_equipment_specific` `wes` LEFT JOIN `wl_equipment_detail` `wed` ON ( ( `wed`.`id` = `wes`.`equipment_detail_id` ) ) )
LEFT JOIN `wl_equipment` `we` ON ( ( `we`.`id` = `wed`.`equipment_id` ) )
)
LEFT JOIN `wl_equipment_category` `wec` ON ( ( `wec`.`id` = `we`.`category_id` ) )
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wes.id
)
WHERE
( ( `wec`.`code` LIKE '1%' ) AND ( `wec`.`industry_code` = '2' ) )
AND sd.`status` <> 7 UNION ALL
SELECT
'消防车辆' AS `type`,
count( `wes`.`id` ) AS `num`
FROM
(
(
( `wl_equipment_specific` `wes` LEFT JOIN `wl_equipment_detail` `wed` ON ( ( `wed`.`id` = `wes`.`equipment_detail_id` ) ) )
LEFT JOIN `wl_equipment` `we` ON ( ( `we`.`id` = `wed`.`equipment_id` ) )
)
LEFT JOIN `wl_equipment_category` `wec` ON ( ( `wec`.`id` = `we`.`category_id` ) )
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wes.id
)
WHERE
( ( `wec`.`code` LIKE '2%' ) AND ( `wec`.`industry_code` = '2' ) )
AND sd.`status` <> 7 UNION ALL
SELECT
'灭火器材装备' AS `type`,
count( `wes`.`id` ) AS `num`
FROM
(
(
( `wl_equipment_specific` `wes` LEFT JOIN `wl_equipment_detail` `wed` ON ( ( `wed`.`id` = `wes`.`equipment_detail_id` ) ) )
LEFT JOIN `wl_equipment` `we` ON ( ( `we`.`id` = `wed`.`equipment_id` ) )
)
LEFT JOIN `wl_equipment_category` `wec` ON ( ( `wec`.`id` = `we`.`category_id` ) )
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wes.id
)
WHERE
( ( `wec`.`code` LIKE '3%' ) AND ( `wec`.`industry_code` = '2' ) )
AND sd.`status` <> 7 UNION ALL
SELECT
'灭火药剂' AS `type`,
count( `wes`.`id` ) AS `num`
FROM
(
(
( `wl_equipment_specific` `wes` LEFT JOIN `wl_equipment_detail` `wed` ON ( ( `wed`.`id` = `wes`.`equipment_detail_id` ) ) )
LEFT JOIN `wl_equipment` `we` ON ( ( `we`.`id` = `wed`.`equipment_id` ) )
)
LEFT JOIN `wl_equipment_category` `wec` ON ( ( `wec`.`id` = `we`.`category_id` ) )
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wes.id
)
WHERE
( ( `wec`.`code` LIKE '4%' ) AND ( `wec`.`industry_code` = '2' ) )
AND sd.`status` <> 7 UNION ALL
SELECT
'抢险救援器材' AS `type`,
count( `wes`.`id` ) AS `num`
FROM
(
(
( `wl_equipment_specific` `wes` LEFT JOIN `wl_equipment_detail` `wed` ON ( ( `wed`.`id` = `wes`.`equipment_detail_id` ) ) )
LEFT JOIN `wl_equipment` `we` ON ( ( `we`.`id` = `wed`.`equipment_id` ) )
)
LEFT JOIN `wl_equipment_category` `wec` ON ( ( `wec`.`id` = `we`.`category_id` ) )
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wes.id
)
WHERE
( ( `wec`.`code` LIKE '5%' ) AND ( `wec`.`industry_code` = '2' ) )
AND sd.`status` <> 7 UNION ALL
SELECT
'消防通信指挥装备' AS `type`,
count( `wes`.`id` ) AS `num`
FROM
(
(
( `wl_equipment_specific` `wes` LEFT JOIN `wl_equipment_detail` `wed` ON ( ( `wed`.`id` = `wes`.`equipment_detail_id` ) ) )
LEFT JOIN `wl_equipment` `we` ON ( ( `we`.`id` = `wed`.`equipment_id` ) )
)
LEFT JOIN `wl_equipment_category` `wec` ON ( ( `wec`.`id` = `we`.`category_id` ) )
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wes.id
)
WHERE
( ( `wec`.`code` LIKE '6%' ) AND ( `wec`.`industry_code` = '2' ) )
AND sd.`status` <> 7 UNION ALL
SELECT
'特种消防装备' AS `type`,
count( `wes`.`id` ) AS `num`
FROM
(
(
( `wl_equipment_specific` `wes` LEFT JOIN `wl_equipment_detail` `wed` ON ( ( `wed`.`id` = `wes`.`equipment_detail_id` ) ) )
LEFT JOIN `wl_equipment` `we` ON ( ( `we`.`id` = `wed`.`equipment_id` ) )
)
LEFT JOIN `wl_equipment_category` `wec` ON ( ( `wec`.`id` = `we`.`category_id` ) )
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wes.id
)
WHERE
( ( `wec`.`code` LIKE '7%' ) AND ( `wec`.`industry_code` = '2' ) )
AND sd.`status` <> 7 UNION ALL
SELECT
'防火检查与火灾调查装备' AS `type`,
count( `wes`.`id` ) AS `num`
FROM
(
(
( `wl_equipment_specific` `wes` LEFT JOIN `wl_equipment_detail` `wed` ON ( ( `wed`.`id` = `wes`.`equipment_detail_id` ) ) )
LEFT JOIN `wl_equipment` `we` ON ( ( `we`.`id` = `wed`.`equipment_id` ) )
)
LEFT JOIN `wl_equipment_category` `wec` ON ( ( `wec`.`id` = `we`.`category_id` ) )
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wes.id
)
WHERE
( ( `wec`.`code` LIKE '8%' ) AND ( `wec`.`industry_code` = '2' ) )
AND sd.`status` <> 7 UNION ALL
SELECT
'其他类消防装备器材' AS `type`,
count( `wes`.`id` ) AS `num`
FROM
(
(
( `wl_equipment_specific` `wes` LEFT JOIN `wl_equipment_detail` `wed` ON ( ( `wed`.`id` = `wes`.`equipment_detail_id` ) ) )
LEFT JOIN `wl_equipment` `we` ON ( ( `we`.`id` = `wed`.`equipment_id` ) )
)
LEFT JOIN `wl_equipment_category` `wec` ON ( ( `wec`.`id` = `we`.`category_id` ) )
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wes.id
)
WHERE
( ( `wec`.`code` LIKE '9%' ) AND ( `wec`.`industry_code` = '2' ) )
AND sd.`status` <> 7;
DROP VIEW IF EXISTS `v_equipment_extinguishing_num_jcs`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_equipment_extinguishing_num_jcs` AS
SELECT
CASE
WHEN
'41' = LEFT ( wec.`code`, 2 ) THEN
'水灭火药剂'
WHEN '42' = LEFT ( wec.`code`, 2 ) THEN
'泡沫灭火剂'
WHEN '43' = LEFT ( wec.`code`, 2 ) THEN
'干粉灭火剂'
WHEN '44' = LEFT ( wec.`code`, 2 ) THEN
'气体灭火剂' ELSE '其他灭火剂'
END AS `type`,
count( DISTINCT `wes`.`id` ) AS `num`
FROM
`wl_equipment_specific` `wes`
LEFT JOIN `wl_equipment_detail` `wed` ON `wed`.`id` = `wes`.`equipment_detail_id`
LEFT JOIN `wl_equipment` `we` ON `we`.`id` = `wed`.`equipment_id`
LEFT JOIN `wl_equipment_category` `wec` ON `wec`.`id` = `we`.`category_id`
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wes.id
WHERE
`wec`.`code` LIKE '4%'
AND `wec`.`industry_code` = '2'
AND sd.`status` <> 7
GROUP BY
LEFT ( `wec`.`code`, 2 );
-- ----------------------------
-- View structure for v_fire_60list
-- ----------------------------
--DROP VIEW IF EXISTS `v_fire_60list`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_fire_60list` AS
SELECT
sal.id AS `id`,
`ec`.`code` AS `mRid`,
`sal`.`equipment_specific_name` AS `specificName`,
`sal`.`equipment_specific_index_key` AS `indexKey`,
`sal`.`equipment_specific_index_name` AS `indexName`,
`sal`.`equipment_specific_id` AS `specificId`,
concat(sal.equipment_specific_name,sal.equipment_specific_index_name) as alamReason,
`sal`.`iot_code` AS `iotCode`,
date_format( `sal`.`create_date`, '%m-%d %H:%i:%s' ) AS `createDate`,
(SELECT GROUP_CONCAT(id) FROM f_fire_fighting_system fs WHERE find_in_set( `fs`.`id`, `ec`.`system_id` )) AS `fightSysId`,
(SELECT GROUP_CONCAT(`code`) FROM f_fire_fighting_system fs WHERE find_in_set( `fs`.`id`, `ec`.`system_id` )) AS `fightSysMRid`,
(SELECT GROUP_CONCAT(`name`) FROM f_fire_fighting_system fs WHERE find_in_set( `fs`.`id`, `ec`.`system_id` )) AS `fightSysName`
FROM
wl_equipment_specific_alarm_log sal
LEFT JOIN wl_equipment_specific_alarm sa ON sal.equipment_specific_alarm_id = sa.id
LEFT JOIN `wl_equipment_specific` `ec` ON `sa`.`equipment_specific_id` = `ec`.`id`
ORDER BY
`sal`.`create_date` DESC
LIMIT 60;
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
<changeSet author="suhuiguang" id="1623223065754-1" runAlways="true">
<comment>`getBuildingNames`</comment>
<sql endDelimiter="#">
DROP FUNCTION IF EXISTS `getBuildingNames`#
CREATE FUNCTION `getBuildingNames` (`rootId` VARCHAR(100))
RETURNS varchar(1000)
BEGIN
DECLARE ptemp VARCHAR(1000);
DECLARE ctemp VARCHAR(1000);
DECLARE ctempName VARCHAR(1000);
SET ptemp ='';
SET ctemp = rootId;
WHILE ctemp != '0' DO
SET ptemp = concat(ptemp,',',ctemp);
SELECT GROUP_CONCAT(parentId) INTO ctemp
FROM get_building_tree
WHERE instanceId = ctemp;
END WHILE;
SET ptemp = concat(ptemp,',',rootId);
SELECT GROUP_CONCAT(instanceName) INTO ctempName
FROM get_building_tree
WHERE FIND_IN_SET(instanceId, ptemp);
RETURN REPLACE(ctempName,',','');
END#
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1623223065755-2" runAlways="true">
<comment>`getChildrend`</comment>
<sql endDelimiter="#">
DROP FUNCTION IF EXISTS `getChildrend`#
CREATE FUNCTION `getChildrend` (`p_id` VARCHAR(1000)) RETURNS varchar(1000)
BEGIN
DECLARE sTemp TEXT;
DECLARE sTempChd VARCHAR(5000);
SET sTemp='$';
SET sTempChd = CAST(p_id AS CHAR);
WHILE sTempChd IS NOT NULL DO
SET sTemp = CONCAT(sTemp,',',sTempChd);
SELECT GROUP_CONCAT(distinct id) INTO sTempChd FROM wl_equipment_category WHERE FIND_IN_SET(parent_id,sTempChd) > 0;
END WHILE;
RETURN sTemp;
END#
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1623223065754-3" runAlways="true">
<comment>`getChildrenIdsByRootId`</comment>
<sql endDelimiter="#">
DROP FUNCTION IF EXISTS `getChildrenIdsByRootId`#
CREATE FUNCTION `getChildrenIdsByRootId` (`rootId` VARCHAR(100)) RETURNS varchar(1000)
BEGIN
DECLARE ids VARCHAR(1000);
DECLARE ptemp VARCHAR(1000);
SELECT
GROUP_CONCAT(c.instanceId) INTO ids
FROM
(
SELECT
a.instanceId,
IF (
FIND_IN_SET(a.parentId ,@pids) > 0,
IF (
length(@pids) - length(
REPLACE (@pids, a.parentId, '')
) > 1,
IF (
length(@pids) - length(REPLACE(@pids, a.instanceId, '')) > 1 ,@pids ,@pids := concat(@pids, ',', a.instanceId)
) ,@pids := concat(@pids, ',', a.instanceId)
),
0
) AS 'plist',
IF (
FIND_IN_SET(a.parentId ,@pids) > 0,
@pids,
0
) AS ischild
FROM
(
SELECT
r.instanceId,
r.parentId
FROM
get_building_tree r
) a,
(SELECT @pids := rootId) b
) c
WHERE
c.ischild != 0;
IF ISNULL(ids) || LENGTH(trim(ids)) <![CDATA[ < 1 ]]> THEN
SET ptemp = rootId;
ELSE
SET ptemp = concat(rootId,',',ids);
END IF;
RETURN ptemp;
END#
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1623223065754-4" runAlways="true">
<comment>`getParent`</comment>
<sql endDelimiter="#">
DROP FUNCTION IF EXISTS `getParent`#
CREATE FUNCTION `getParent` (`rootId` VARCHAR(1000)) RETURNS varchar(1000)
BEGIN
DECLARE ptemp VARCHAR(1000);
DECLARE ctemp VARCHAR(1000);
SET ptemp ='#';
SET ctemp =rootId;
WHILE ctemp IS NOT NULL DO
SET ptemp = concat(ptemp,',',ctemp);
SELECT GROUP_CONCAT(id) INTO ctemp
FROM wl_equipment_category
WHERE id = ( SELECT parent_id FROM wl_equipment_category WHERE FIND_IN_SET(id,ctemp) > 0);
END WHILE;
RETURN ptemp;
END#
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1623223065754-5" runAlways="true">
<comment>`queryChildrenAreaInfo`</comment>
<sql endDelimiter="#">
DROP FUNCTION IF EXISTS `queryChildrenAreaInfo`#
CREATE FUNCTION `queryChildrenAreaInfo` (areaId INT) RETURNS varchar(4000)
BEGIN
DECLARE sTemp VARCHAR(4000);
DECLARE sTempChd VARCHAR(4000);
SET sTemp='$';
SET sTempChd = CAST(areaId AS CHAR);
WHILE sTempChd IS NOT NULL DO
SET sTemp= CONCAT(sTemp,',',sTempChd);
SELECT GROUP_CONCAT(id) INTO sTempChd FROM wl_equipment_category WHERE FIND_IN_SET(parentId,sTempChd)>0;
END WHILE;
RETURN sTemp;
END#
</sql>
</changeSet>
<changeSet author="gaojianqiang" id="16270125660001-1" runAlways="true">
<comment>`getMaintenanceResourceTreeById`</comment>
<sql endDelimiter="#">
DROP FUNCTION IF EXISTS `getMaintenanceResourceTreeById`#
CREATE DEFINER=`root`@`%` FUNCTION `getMaintenanceResourceTreeById`(`rootId` bigint) RETURNS varchar(1000) CHARSET utf8
BEGIN
DECLARE sTemp TEXT;
DECLARE sTempChd VARCHAR(4000);
SET sTemp='$';
SET sTempChd = CAST(rootId AS CHAR);
WHILE sTempChd IS NOT NULL DO
SET sTemp= CONCAT(sTemp,',',sTempChd);
SELECT GROUP_CONCAT(distinct id) INTO sTempChd FROM mt_maintenance_resource WHERE FIND_IN_SET(parent_id,sTempChd)>0;
END WHILE;
RETURN sTemp;
END#
</sql>
</changeSet>
<!--注释掉 不再自动刷脚本 因为现场可能调整编号或者指标编号 自动跑 会覆盖-->
<!-- <changeSet author="suhuiguang" id="1623219730755-1" runOnChange="true">-->
<!-- <comment>init view 所有的视图维护到此处view_all</comment>-->
<!-- <sqlFile path="./init/view_all.sql" relativeToChangelogFile="true"/>-->
<!-- </changeSet>-->
<!-- <changeSet author="suhuiguang" id="1623994514562-1" runOnChange="true">-->
<!-- <comment>机场 view 机场使用的视图维护到此处view_jcs</comment>-->
<!-- <sqlFile path="./init/view_jcs.sql" relativeToChangelogFile="true"/>-->
<!-- </changeSet>-->
<!--BUG 2935 初始化消防水源信息 by kongfm 2021-09-17-->
<changeSet author="kongfm" id="2021-09-17-kongfm-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="wl_equipment_category" />
<not>
<primaryKeyExists primaryKeyName="id" tableName="wl_equipment_category"/>
</not>
</preConditions>
<comment>init firewater info</comment>
<sql>
INSERT INTO `wl_equipment_category` (`id`, `parent_id`, `code`, `name`, `is_consumptive`, `description`, `remark`, `create_date`, `industry_code`) VALUES ('1438771726480601090', '1326407483682672641', '93060000', '消防水源', '0', NULL, NULL, '2021-09-17 15:48:05', '2');
INSERT INTO `wl_equipment_category` (`id`, `parent_id`, `code`, `name`, `is_consumptive`, `description`, `remark`, `create_date`, `industry_code`) VALUES ('1438771952830410753', '1438771726480601090', '93060100', '消防水池', '0', NULL, NULL, '2021-09-17 15:48:59', '2');
INSERT INTO `wl_equipment_category` (`id`, `parent_id`, `code`, `name`, `is_consumptive`, `description`, `remark`, `create_date`, `industry_code`) VALUES ('1438772365205991426', '1438771726480601090', '93060200', '消防水鹤', '0', NULL, NULL, '2021-09-17 15:50:38', '2');
INSERT INTO `wl_equipment_category` (`id`, `parent_id`, `code`, `name`, `is_consumptive`, `description`, `remark`, `create_date`, `industry_code`) VALUES ('1438772459552665602', '1438771726480601090', '93060300', '天然水源', '0', NULL, NULL, '2021-09-17 15:51:00', '2');
INSERT INTO `wl_equipment_category` (`id`, `parent_id`, `code`, `name`, `is_consumptive`, `description`, `remark`, `create_date`, `industry_code`) VALUES ('1438772584828137473', '1438771726480601090', '93060400', '水源-消火栓', '0', NULL, NULL, '2021-09-17 15:51:30', '2');
</sql>
</changeSet>
<changeSet author="chenhao" id="2021-11-03-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment_specific" columnName="agency_name"/>
</not>
</preConditions>
<comment>update data wl_equipment_specific</comment>
<sql>
ALTER TABLE wl_equipment_specific ADD agency_name varchar(100) NULL COMMENT '所属单位名称(来源于平台)';
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1638172796697-3" runAlways="true">
<comment>`alarm_equip_day_insert`</comment>
<sql endDelimiter="#">
DROP event IF EXISTS `alarm_equip_day_insert`#
CREATE DEFINER=`root`@`%` EVENT `alarm_equip_day_insert` ON SCHEDULE EVERY 1 DAY STARTS '2021-11-29 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
TRUNCATE table wl_equipment_alarm_equip_day;
INSERT into `wl_equipment_alarm_equip_day` (
`report_date`,
`system_id`,
`equipment_code`,
`equipment_name`,
`index_key`,
`index_name`,
`report_equip_num`)
SELECT
r.report_date,
f.id as system_id,
r.equipment_code,
'' as equipment_name,
r.index_type,
r.index_name,
count(DISTINCT(r.equipment_specific_id)) as `report_equip_num`
FROM
`wl_equipment_alarm_report_day` r,
f_fire_fighting_system f
where
r.index_true_num > 0
and FIND_IN_SET(f.id,r.system_ids)
GROUP BY
r.report_date,
r.system_ids,
r.equipment_code,
r.index_type,
r.index_name;
END#
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="LOG_HOME" value="/opt/log"/>
<timestamp key="startTime" datePattern="yyyyMMdd'T'HHmmss"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg [%file:%line] %n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_HOME}/equip-manage.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${LOG_HOME}/equip-manage.log.%i.zip</fileNamePattern>
<maxIndex>100</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>50MB</maxFileSize>
</triggeringPolicy>
<encoder charset="UTF-8">
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg [%file:%line] %n</pattern>
</encoder>
</appender>
<appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_HOME}/equip-manage-error.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${LOG_HOME}/equip-manage-error.log.%i.zip</fileNamePattern>
<maxIndex>50</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>50MB</maxFileSize>
</triggeringPolicy>
<encoder charset="UTF-8">
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg [%file:%line] %n</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<root>
<level value="INFO"/>
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE"/>
<appender-ref ref="ERROR"/>
</root>
<logger name="org.springframework" level="INFO"/>
<logger name="org.springframework.boot" level="INFO"/>
<logger name="org.springframework.boot.actuate" level="INFO"/>
<logger name="org.springframework.boot.web" level="INFO"/>
<logger name="org.quartz" level="INFO"/>
<logger name="org.apache.kafka" level="INFO"/>
<logger name="org.apache.zookeeper" level="INFO"/>
<logger name="org.mybatis.spring" level="INFO"/>
<logger name="org.apache.http" level="INFO"/>
<logger name="com.zaxxer.hikari" level="INFO"/>
</configuration>
<?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.equipmanage.mapper.AlarmMapper">
</mapper>
<?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.equipmanage.mapper.AnalysisReportLogMapper">
</mapper>
<?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.equipmanage.mapper.AreaMapper">
<select id="findByIsDeleted" resultType="com.yeejoin.equipmanage.common.dto.AreaDto">
SELECT
a.id,
a.`name`,
a.`code`,
a.parent_id
FROM
`wl_area` a
<where>
<if test="isDelete != null">
a.is_delete = #{isDelete}
</if>
</where>
</select>
</mapper>
<?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.equipmanage.mapper.BadManagementMapper">
</mapper>
<?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.equipmanage.mapper.BuildingMapper">
<resultMap id="BuildingLists" type="com.yeejoin.equipmanage.common.entity.vo.BuildingListVO">
<result column="full_name" property="warehouseName"></result>
<result column="name" property="equipmentName"></result>
<result column="code" property="code"></result>
<result column="category_name" property="categoryName"></result>
<result column="amount" property="amount"></result>
<result column="unit_name" property="unitName"></result>
</resultMap>
<resultMap id="EquiplistBySystemId" type="com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO">
<result property="id" column="id"></result>
<result property="equipmentName" column="equipment_name"></result>
<result property="code" column="code"></result>
<result property="categoryName" column="category_name"></result>
</resultMap>
<resultMap id="TreeAndEquipVO" type="com.yeejoin.equipmanage.common.vo.BuildingTreeAndEquipVO">
<result property="parentId" column="parentId"></result>
<result property="name" column="name"></result>
<result property="id" column="id"></result>
<result property="type" column="type"></result>
<collection property="children" select="com.yeejoin.equipmanage.mapper.BuildingMapper.getSonBuildingTree" column="id">
<result property="parentId" column="parentId"></result>
<result property="name" column="name"></result>
<result property="id" column="id"></result>
<result property="type" column="type"></result>
</collection>
</resultMap>
<resultMap id="BuildingTreeSon" type="com.yeejoin.equipmanage.common.vo.BuildingTreeAndEquipVO">
<result property="parentId" column="parentId"></result>
<result property="name" column="name"></result>
<result property="id" column="id"></result>
<result property="type" column="type"></result>
<collection property="children" select="com.yeejoin.equipmanage.mapper.BuildingMapper.getSonBuildingTree1" column="id">
<result property="parentId" column="parentId"></result>
<result property="name" column="name"></result>
<result property="id" column="id"></result>
<result property="type" column="type"></result>
</collection>
</resultMap>
<resultMap id="BuildingTreeSon1" type="com.yeejoin.equipmanage.common.vo.BuildingTreeAndEquipVO">
<result property="parentId" column="parentId"></result>
<result property="name" column="name"></result>
<result property="id" column="id"></result>
<result property="type" column="type"></result>
<collection property="children" select="com.yeejoin.equipmanage.mapper.BuildingMapper.getSonBuildingTree2" column="id">
<result property="parentId" column="parentId"></result>
<result property="name" column="name"></result>
<result property="id" column="id"></result>
<result property="type" column="type"></result>
</collection>
</resultMap>
<resultMap id="BuildingTreeSon2" type="com.yeejoin.equipmanage.common.vo.BuildingTreeAndEquipVO">
<result property="parentId" column="parentId"></result>
<result property="name" column="name"></result>
<result property="id" column="id"></result>
<result property="type" column="type"></result>
</resultMap>
<select id="getFireArchitectureEnumList"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentCategory">
SELECT
id,
`code`,
`name`
FROM
wl_equipment_category
WHERE
parent_id = (
SELECT
id
FROM
wl_equipment_category
WHERE
CODE = #{code})
</select>
<select id="getExamineList" resultMap="BuildingLists">
SELECT
wlws.full_name ,
wled.`name`,
wlesp.code,
wlec.`name` category_name,
wlsd.amount,
wlu.name unit_name
FROM
wl_warehouse_structure wlws
LEFT JOIN wl_stock_detail wlsd ON wlsd.warehouse_structure_id = wlws.id
left join wl_stock wls on wls.id=wlsd.stock_id
left join wl_equipment_detail wled on wlsd.equipment_detail_id = wled.id
left join wl_equipment_specific wlesp on wlesp.equipment_detail_id = wled.id
left join wl_equipment wlem on wled.equipment_id = wlem.id
left join wl_equipment_category wlec on wlec.id=wlem.category_id
left join wl_unit wlu on wlem.unit_id=wlu.id
WHERE
wlws.source_id = #{regionId}
</select>
<insert id="insetSourceScene">
insert into wl_source_scene
(id,
source_id,
source_name,
project_id,
scene_id,
point_in_scene,
creator_id,
create_date,
video_in_scene)
VALUES(
#{id},
#{instanceId},
#{name},
#{projectId},
#{sceneId},
null,
#{creatorId},
now(),
null)
</insert>
<update id="setSceneId">
UPDATE
wl_source_scene
SET point_in_scene=#{pointInScene},
video_in_scene = #{videoInScene}
where scene_id =#{sceneId}
</update>
<select id="getPointInScene" resultType="string">
select point_in_scene from wl_source_scene where scene_id =#{id}
</select>
<select id="getVPointInScene" resultType="string">
select video_in_scene from wl_source_scene where scene_id =#{id}
</select>
<select id="getEquipBySceneId" resultMap="EquiplistBySystemId">
SELECT
spe.id,
det.NAME equipment_name,
spe.CODE,
wlec.NAME AS category_name
FROM
wl_equipment_specific AS spe
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_category AS wlec ON wlec.id = wle.category_id
WHERE
spe.id in
<foreach item="item" collection="ids" separator="," open="(" close=")" index="">
#{item}
</foreach>
</select>
<select id="getVideoBySceneId" resultMap="EquiplistBySystemId">
SELECT
id,
name equipment_name,
code,
name AS category_name
FROM
wl_video
WHERE
id in
<foreach item="item" collection="ids" separator="," open="(" close=")" index="">
#{item}
</foreach>
</select>
<select id="getScenesList" resultType="com.yeejoin.equipmanage.common.entity.SourceScene">
select
ins.instance_id as id,
ins.field_value as sourceName,
sou.scene_id as sceneId
from
wl_form_instance as ins
left join wl_source_scene as sou on sou.source_id = ins.instance_id
where ins.field_name ='name'
and instance_id in (
<if test="groupType == 'building' ">
select
instance_id
from
wl_form_instance
where field_name ='parentId'
and group_type ='floor'
and field_value = #{id}
</if>
<if test="groupType == 'floor' ">
#{id}
</if>
<if test="groupType == 'storageTank' ">
#{id}
</if>
<if test="groupType == 'room' ">
select
field_value
from
wl_form_instance
where field_name ='parentId'
and instance_id = #{id}
</if>
)
group by ins.instance_id
</select>
<select id="getBuildList" resultType="com.yeejoin.equipmanage.common.entity.vo.PointTreeVo">
SELECT
id AS sequenceNbr,
group_name AS displayName,
- 1 AS parentId,
NULL AS equipCode
FROM
wl_form_group
WHERE
id = 0 UNION ALL
SELECT
ins.instance_id AS sequenceNbr,
nam.field_value AS displayName,
par.field_value AS parentId,
cd.field_value AS equipCode
FROM
wl_form_instance AS ins
LEFT JOIN wl_form_instance AS nam ON nam.instance_id = ins.instance_id
AND nam.field_name = 'name'
LEFT JOIN wl_form_instance AS par ON par.instance_id = ins.instance_id
AND par.field_name = 'parentId'
LEFT JOIN wl_form_instance AS cd ON cd.instance_id = ins.instance_id
AND cd.field_name = 'code'
GROUP BY
ins.instance_id
ORDER BY
parentId
</select>
<select id="get3dBuildList" resultType="com.yeejoin.equipmanage.common.entity.vo.PointTreeVo">
select
id as sequenceNbr,
group_name as displayName,
-1 as parentId
from wl_form_group where id = 0
union all
select
ins.instance_id as sequenceNbr,
nam.field_value as displayName,
par.field_value as parentId
from
wl_form_instance as ins
left join wl_form_instance as nam on nam.instance_id = ins.instance_id and nam.field_name ='name'
left join wl_form_instance as par on par.instance_id = ins.instance_id and par.field_name ='parentId'
group by ins.instance_id
order by parentId
</select>
<select id="isBuildingRoom" resultType="Long">
select
(case
when group_type ='building'
then instance_id
else null
end ) as id
from wl_form_instance
where instance_id =(
select field_value from wl_form_instance where field_name ='parentId' and instance_id = #{id})
group by instance_id
</select>
<select id="getEquipmentCount" resultType="Long">
select
if(sum(sto.amount) is null,0,sum(sto.amount)) as count from
wl_stock_detail as sto
left join wl_warehouse_structure as war on sto.warehouse_structure_id = war.id
where war.source_id in(
<if test="groupType == 'building' ">
select source_id from wl_warehouse_structure where parent_id = #{id} or source_id = #{id}
union all
select source_id from wl_warehouse_structure where parent_id in(
select source_id from wl_warehouse_structure where parent_id = #{id}
)
</if>
<if test="groupType == 'floor' ">
select instance_id from wl_form_instance where field_name ='parentId' and field_value = #{id} or instance_id = #{id}
group by instance_id
</if>
<if test="groupType == 'room' ">
#{id}
</if>
)
</select>
<select id="getFloorOrRoomCount" resultType="Long">
select count(1) from
wl_form_instance
where field_name = 'parentId'
and field_value = #{id}
<if test="groupType == 'building' ">
and group_type = 'floor'
</if>
</select>
<select id="getRoomCount" resultType="Long">
select count(1) from (
select * from wl_form_instance where field_name = 'parentId' and group_type = 'room' and field_value = #{id}
union
select * from wl_form_instance where field_name = 'parentId' and
field_value in (
select instance_id from wl_form_instance where field_name = 'parentId' and group_type = 'floor' and field_value = #{id}
)) co
</select>
<select id="getAllfloorCount" resultType="com.yeejoin.equipmanage.common.entity.FormInstance">
select
war.source_id as instanceId ,
sum(sto.amount ) as fieldValue
from
wl_warehouse_structure as war
left join wl_stock_detail as sto on war.id = sto.warehouse_structure_id
where war.source_id in (
select
instance_id
from
wl_form_instance
where field_name ='parentId'
and group_type = 'floor'
and field_value =#{id})
group by war.id
</select>
<select id="selectParentId" resultType="Long">
select field_value from wl_form_instance
where field_name ='parentId'
and instance_id = (
select source_id from wl_source_scene where scene_id = #{id}
)
</select>
<select id="selectSystemId" resultType="String">
select system_id from wl_equipment_specific where id = #{id}
</select>
<select id="getSpeids" resultType="String">
select point_in_scene from wl_source_scene where scene_id =#{id}
</select>
<select id="selectWare" resultType="com.yeejoin.equipmanage.common.entity.WarehouseStructure">
select war.* from
wl_stock_detail as det
left join wl_warehouse_structure as war on war.id = det.warehouse_structure_id
where equipment_specific_id =#{id}
</select>
<select id="getBuildingtreeAndEquip" resultMap="TreeAndEquipVO">
SELECT
*
FROM
(
SELECT
a.instance_id as id,
MAX( CASE WHEN a.field_name = 'parentId' THEN a.field_value END ) AS parentId,
MAX( CASE WHEN a.field_name = 'name' THEN a.field_value END ) AS name,
'building' as type
FROM
`wl_form_instance` a
LEFT JOIN wl_source_scene wlss ON wlss.source_id = a.instance_id
GROUP BY
a.instance_id
) sa
where sa.parentId=0
union all
select id,null as parentId,fei.`name`,'equipment' as type from f_equipment fei where fei.risk_source_id=0
</select>
<select id="getSonBuildingTree" resultMap="BuildingTreeSon">
SELECT
*
FROM
(
SELECT
a.instance_id as id,
MAX( CASE WHEN a.field_name = 'parentId' THEN a.field_value END ) AS parentId,
MAX( CASE WHEN a.field_name = 'name' THEN a.field_value END ) AS name,
'building' as type
FROM
`wl_form_instance` a
LEFT JOIN wl_source_scene wlss ON wlss.source_id = a.instance_id
GROUP BY
a.instance_id
) sa
where sa.parentId=#{id}
union all
select id,null as parentId,fei.`name`,'equipment' as type from f_equipment fei where fei.risk_source_id=#{id}
</select>
<select id="getSonBuildingTree1" resultMap="BuildingTreeSon">
SELECT
*
FROM
(
SELECT
a.instance_id as id,
MAX( CASE WHEN a.field_name = 'parentId' THEN a.field_value END ) AS parentId,
MAX( CASE WHEN a.field_name = 'name' THEN a.field_value END ) AS name,
'building' as type
FROM
`wl_form_instance` a
LEFT JOIN wl_source_scene wlss ON wlss.source_id = a.instance_id
GROUP BY
a.instance_id
) sa
where sa.parentId=#{id}
union all
select id,null as parentId,fei.`name`,'equipment' as type from f_equipment fei where fei.risk_source_id=#{id}
</select>
<select id="getSonBuildingTree2" resultMap="BuildingTreeSon">
SELECT
*
FROM
(
SELECT
a.instance_id as id,
MAX( CASE WHEN a.field_name = 'parentId' THEN a.field_value END ) AS parentId,
MAX( CASE WHEN a.field_name = 'name' THEN a.field_value END ) AS name,
'building' as type
FROM
`wl_form_instance` a
LEFT JOIN wl_source_scene wlss ON wlss.source_id = a.instance_id
GROUP BY
a.instance_id
) sa
where sa.parentId=#{id}
union all
select id,null as parentId,fei.`name`,'equipment' as type from f_equipment fei where fei.risk_source_id=#{id}
</select>
</mapper>
<?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.equipmanage.mapper.BuildingAuditMapper">
<!-- 批量删除 -->
<delete id="deleteAd" parameterType="java.util.List">
update wl_building_audit set is_delete = 1
where id in
<foreach item="id" collection="list" open="(" close=")" separator=",">
#{id}
</foreach>
</delete>
</mapper>
\ 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.equipmanage.mapper.CarConfMapper">
</mapper>
<?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.equipmanage.mapper.CarInfoMapper">
</mapper>
<?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.equipmanage.mapper.CarMapper">
<resultMap id="EquipmentOnCarAppList" type="com.yeejoin.equipmanage.common.entity.vo.EquipmentOnCarAppVO">
<result column="equipment_id" property="EquipmentId"></result>
<result column="code" property="EquipmentCode"></result>
<result column="name" property="EquipmentName"></result>
<result column="standard" property="EquipmentStandard"></result>
<result column="brand" property="EquipmentBrand"></result>
<result column="maintenance_cycle" property="maintenanceCycle"></result>
</resultMap>
<resultMap id="carIotInfoMap" type="com.yeejoin.equipmanage.common.entity.vo.CarIndexVo">
<result column="id" property="id"></result>
<result column="name" property="name"></result>
<result column="carNum" property="carNum"></result>
<result column="perfQuotaName" property="perfQuotaName"></result>
<result column="name_key" property="nameKey"></result>
<result column="value" property="value"></result>
<result column="unitName" property="unitName"></result>
<result column="group_name" property="groupName"></result>
<result column="iotCode" property="iotCode"></result>
</resultMap>
<select id="page"
resultType="com.yeejoin.equipmanage.common.entity.Car">
SELECT
c.id AS id,
c.car_num as carNum,
wec.name AS categoryName,
c.name,
c.standard,
c.maintenance_cycle
AS maintenanceCycle,
c.iot_code,
wmi.name AS
manufacturerName,
c.brand,
c.equipment_id AS equipmentId,
c.create_date AS createDate
FROM
wl_car c
LEFT JOIN
wl_equipment we ON we.id =
c.equipment_id
LEFT JOIN
wl_equipment_category wec ON wec.id =
we.category_id
LEFT JOIN
wl_manufacturer_info wmi ON wmi.id =
c.manufacturer_id
<where>
<if test="car!=null ">
<if test="car.name != null and car.name != ''">AND c.name LIKE CONCAT('%',#{car.name},'%' )</if>
<if test="car.standard != null and car.standard != ''">AND c.standard LIKE
CONCAT('%',#{car.standard},'%'
)
</if>
<if
test="car.manufacturerName != null and car.manufacturerName != ''">AND wmi.name LIKE
CONCAT('%',#{car.manufacturerName},'%' )
</if>
</if>
</where>
ORDER BY c.id DESC
LIMIT #{offset},#{size}
</select>
<select id="count"
resultType="Integer">
SELECT
COUNT(1)
FROM
wl_car c
LEFT JOIN
wl_equipment we ON we.id =
c.equipment_id
LEFT JOIN
wl_equipment_category wec ON wec.id =
we.category_id
LEFT JOIN
wl_manufacturer_info wmi ON wmi.id =
c.manufacturer_id
<where>
<if test="car!=null ">
<if test="car.name != null and car.name != ''">AND c.name LIKE CONCAT('%',#{car.name},'%' )</if>
<if test="car.standard != null and car.standard != ''">AND c.standard LIKE
CONCAT('%',#{car.standard},'%'
)
</if>
<if
test="car.manufacturerName != null and car.manufacturerName != ''">AND wmi.name LIKE
CONCAT('%',#{car.manufacturerName},'%' )
</if>
</if>
</where>
</select>
<select id="selectEquipmentOnCarAppList" resultMap="EquipmentOnCarAppList">
select * from (
select
car_id,
wed.equipment_id,
wed.name,
wes.qr_code AS code,
wed.standard,
wed.brand,
wed.maintenance_cycle
FROM
wl_equipment_on_car wleo
LEFT JOIN wl_equipment_detail wed ON wleo.equipment_detail_id = wed.id
LEFT JOIN wl_equipment_specific wes ON wleo.equipment_specific_id = wes.id
union all
select
car_id,
wed.equipment_id,
wed.name,
wsd.qr_code AS code,
wed.standard,
wed.brand,
wed.maintenance_cycle from
wl_extinguishant_on_car as wlex
left join wl_equipment_detail wed ON wlex.equipment_detail_id = wed.id
left join wl_stock_detail wsd ON wlex.stock_detail_id = wsd.id
) as dat
where car_id=#{carId} and name IS NOT NULL
</select>
<select id="getCarIndexs" resultMap="carIotInfoMap">
SELECT
c.id,
c.name,
ei.NAME AS perfQuotaName,
ei.name_key,
cp.value,
ei.unit AS unitName,
ei.group_name,
c.iot_code,
c.qr_code AS qrCode
FROM
wl_car_property cp
LEFT JOIN wl_equipment_index ei ON ei.id = cp.equipment_index_id
LEFT JOIN wl_car c ON c.id = cp.car_id
WHERE
cp.car_id = #{carId}
</select>
<select id="getCarsIotInfo" resultMap="carIotInfoMap">
SELECT
c.id,
c.name,
c.car_num AS carNum,
ei.NAME AS perfQuotaName,
ei.name_key,
cp.value,
ei.unit AS unitName,
ei.group_name,
c.iot_code AS iotCode,
c.qr_code AS qrCode
FROM
wl_car c,
wl_car_property cp,
wl_equipment_index ei
WHERE
1=1
<if test="orgCode != null and orgCode != ''">
AND c.org_code = #{orgCode}
</if>
AND c.id = cp.car_id
AND cp.equipment_index_id = ei.id
AND ei.is_iot = 1
AND c.iot_code IS NOT NULL
AND c.qr_code IS NOT NULL
ORDER BY c.id
</select>
<select id="getCarsIotInfoByIotCode" resultMap="carIotInfoMap">
SELECT
c.id,
c.name,
c.car_num,
ei.NAME AS perfQuotaName,
ei.name_key,
cp.value,
ei.unit AS unitName,
ei.group_name,
c.iot_code AS iotCode,
c.qr_code AS qrCode
FROM
wl_car c,
wl_car_property cp,
wl_equipment_index ei
WHERE
c.id = cp.car_id
AND cp.equipment_index_id = ei.id
AND c.iot_code = #{iotCode}
ORDER BY c.id
</select>
<select id="getCarEquipmentStateByCarId" resultType="com.yeejoin.equipmanage.common.vo.EquipStateOnCarVo">
SELECT
d.`name` AS equipName,
es.qr_code AS code,
es.iot_code AS iotCode,
es.code AS equipCode
FROM
wl_equipment_on_car oc,
wl_equipment_detail d,
wl_equipment_specific es
WHERE
oc.equipment_specific_id = es.id
AND es.equipment_detail_id = d.id
AND oc.car_id = #{id}
GROUP BY es.id
</select>
<select id="getIotCodeList" resultType="String">
SELECT
iot_code
FROM
wl_car
WHERE
1=1
<if test="id != null and id != ''">
AND id != #{id}
</if>
AND iot_code IS NOT NULL
</select>
<select id="getCarsByIotCode" resultType="com.yeejoin.equipmanage.common.entity.Car">
SELECT
wc.car_num
FROM
wl_car wc
WHERE
wc.iot_code IS NOT NULL
AND
wc.iot_code = #{iotCode}
</select>
<select id="getCarsInfoByOrgCode" resultMap="carIotInfoMap">
SELECT
c.id,
c.name,
ei.NAME AS perfQuotaName,
ei.name_key,
cp.value,
ei.unit AS unitName,
ei.group_name,
c.iot_code,
c.qr_code AS qrCode
FROM
wl_car c,
wl_car_property cp,
wl_equipment_index ei
WHERE
1=1
<if test="orgCode != null and orgCode != ''">
AND c.org_code = #{orgCode}
</if>
AND c.id = cp.car_id
AND cp.equipment_index_id = ei.id
ORDER BY c.id
</select>
<select id="getCarIotCodeLists" resultMap="carIotInfoMap">
SELECT
DISTINCT
wc.iot_code AS iotCode,
wc.car_num AS carNum
FROM
wl_car wc
LEFT JOIN wl_car_property AS wcp ON wcp.car_id = wc.id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wcp.equipment_index_id
WHERE TRIM(wc.iot_code) != '' AND wc.iot_code IS NOT NULL AND wei.is_iot=1
</select>
<select id="getUtilName" resultType="String">
select name from wl_unit where id = #{id}
</select>
<select id="getFireVehicleDetailById" resultType="com.yeejoin.equipmanage.common.datasync.entity.FireVehicle">
SELECT
c.id,
c.qr_code AS mrid,
f.`name` AS stationname,
f.`code` AS stationcode,
c.`name`,
c.`name` AS aliasname,
c.car_num AS number,
ec.`name` AS type,
ec.`code` AS typecode,
c.standard,
mi.`name` AS manufacturer,
c.brand,
c.country,
c.chassis_country AS chassiscountry,
c.chassis_brand AS chassisbrand,
c.iot_code AS iotcode,
c.car_state AS state,
NULL AS maintenanceunit,
NULL AS firstmaintenancedate,
NULL AS maintenancefrequency,
NULL AS maintenancephone,
c.create_date AS createdate,
NOW( ) AS updatedate
FROM
wl_car c
LEFT JOIN wl_manufacturer_info mi ON c.manufacturer_id = mi.id
LEFT JOIN wl_equipment e ON e.id = c.equipment_id
LEFT JOIN wl_equipment_category ec ON ec.id = e.category_id,
f_station_info f
<where>
<if test="id != null">
c.id = #{id}
</if>
</where>
</select>
<select id="getCarNumGroupByTeamId" resultType="map">
SELECT
team_id AS teamId,
COUNT(id) AS carNum
FROM
wl_car
where
team_id is not null
GROUP BY
team_id
ORDER BY
create_date DESC
</select>
<select id="getTeamCarList" resultType="com.yeejoin.equipmanage.common.entity.dto.CarDto">
SELECT
c.team_id,
c.team_name,
c.id AS sequenceNbr,
c.`name`,
c.car_num,
d.`name` AS car_state,
4 AS personNum,
c.iot_code,
0 AS distance
FROM
wl_car c
LEFT JOIN wl_system_dic d ON c.car_state = d.`code`
<where>
c.team_id IS NOT NULL
<if test="id != null">
AND c.team_id = #{id}
</if>
<if test="carState != null and carState != ''">
AND d.type = #{carState}
</if>
</where>
</select>
<select id="getCarPropertyList" resultType="com.yeejoin.equipmanage.common.entity.vo.CarPropertyVo">
SELECT
c.id AS carId,
i.`name`,
i.name_key,
p.`value`,
i.unit,
i.is_iot
FROM
wl_car c
LEFT JOIN wl_car_property p ON p.car_id = c.id
LEFT JOIN wl_equipment_index i ON i.id = p.equipment_index_id
<where>
<if test="idList != null and idList.size() > 0">
c.id IN
<foreach collection="idList" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<choose>
<when test="teamId != null">
AND c.team_id = #{teamId}
</when>
<otherwise>
AND c.team_id IS NOT NULL
</otherwise>
</choose>
<if test="nameKeys != null and nameKeys != ''">
AND i.name_key IN
<foreach collection="nameKeys.split(',')" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="isIot != null">
AND i.is_iot = #{isIot}
</if>
</where>
</select>
<select id="getCarResourceMapList" resultType="map">
SELECT
*
FROM
(
SELECT
eqCar.car_id carId,
eqCar.equipment_detail_id equipId,
eqDetail.NAME equipName,
"equipment" equipType,
sum( eqCar.amount ) equipCount
FROM
wl_equipment_on_car eqCar
LEFT JOIN wl_equipment_detail eqDetail ON eqDetail.id = eqCar.equipment_detail_id
WHERE
eqCar.car_id IS NOT NULL
GROUP BY
eqCar.car_id,
eqCar.equipment_detail_id
) t
WHERE
1 = 1
<if test="carId != null and carId != ''">
AND t.carId = #{carId}
</if>
UNION ALL
SELECT
*
FROM
(
SELECT
eqCar.car_id carId,
eqCar.equipment_detail_id equipId,
eqDetail.NAME equipName,
"fireAgent" equipType,
sum( eqCar.amount ) equipCount
FROM
wl_extinguishant_on_car eqCar
LEFT JOIN wl_equipment_detail eqDetail ON eqDetail.id = eqCar.equipment_detail_id
WHERE
eqCar.car_id IS NOT NULL
GROUP BY
eqCar.car_id,
eqCar.equipment_detail_id
) t
WHERE
1 = 1
<if test="carId != null and carId != ''">
AND t.carId = #{carId}
</if>
</select>
<select id="getCarStateInfoByCarNum" resultType="map">
SELECT
car.id,
car.`name` as carType,
car.car_num as carNum,
(
SELECT
(
CASE
WHEN (
DATEDIFF(CURDATE(), carm.update_date) <![CDATA[<=]]> 7
) THEN
'待命'
ELSE
'异常'
END
)
FROM
wl_car_property carm
LEFT JOIN wl_equipment_index ei ON ei.id = carm.equipment_index_id
WHERE
ei.name_key = 'FireCar_Start'
AND carm.car_id = car.id
) as 'status',
(
SELECT
(
CASE
WHEN carm.
VALUE
= 'true' THEN
'启动'
ELSE
'停止'
END
)
FROM
wl_car_property carm
LEFT JOIN wl_equipment_index ei ON ei.id = carm.equipment_index_id
WHERE
ei.name_key = 'FireCar_Start'
AND carm.car_id = car.id
) AS startup,
(
SELECT
DATE_FORMAT(
carm.update_date,
"%Y-%m-%d %H:%i:%s"
)
FROM
wl_car_property carm
LEFT JOIN wl_equipment_index ei ON ei.id = carm.equipment_index_id
WHERE
ei.name_key = 'FireCar_Start'
AND carm.car_id = car.id
) AS startdate,
(
SELECT
(
CASE
WHEN carm.`value` IS NULL THEN
'异常'
ELSE
'正常'
END
)
FROM
wl_car_property carm
LEFT JOIN wl_equipment_index ei ON ei.id = carm.equipment_index_id
WHERE
(
ei.name_key = 'FireCar_GDLatitude'
OR ei.name_key = 'FireCar_GDLongitude'
)
AND carm.car_id = car.id
LIMIT 1
) AS locationStatus,
mi.`name` manufacturer,
sd.`name` as country,
car.brand,
car.standard,
car.chassis_brand as chassisBrand,
csd.`name` as chassisCountry,
(CASE WHEN car.ccc_auth = TRUE THEN '是' ELSE '否' END) as cccAuth,
(CASE WHEN car.is_import = TRUE THEN '进口' ELSE '国产' END) as isImport
FROM
wl_car AS car
LEFT JOIN wl_manufacturer_info mi ON mi.id = car.manufacturer_id
LEFT JOIN wl_system_dic sd ON sd.id = car.country
LEFT JOIN wl_system_dic csd ON csd.id = car.chassis_country
WHERE car.car_num = #{carNum}
</select>
<select id="equipmentCarList" resultType="com.yeejoin.equipmanage.common.entity.Car">
select * from wl_car c LEFT JOIN wl_equipment w on c.equipment_id=w.id
where c.car_state in ('1','2')
<if test="teamId != null">
and c.team_id=#{teamId}
</if>
<if test="name != null">
and c.name LIKE CONCAT('%',#{name},'%' )
</if>
<if test="code != null">
and w.`code` like CONCAT(#{code},'%' )
</if>
<if test="id != null">
<if test="isNo != null and isNo">
and c.id =#{id}
</if>
<if test="isNo != null and !isNo">
and c.id !=#{id}
</if>
</if>
LIMIT #{offset},#{size}
</select>
<select id="equipmentCarListcount" resultType="int">
select count(c.id) from wl_car c LEFT JOIN wl_equipment w on c.equipment_id=w.id
where c.car_state in ('1','2')
<if test="teamId != null">
and c.team_id=#{teamId}
</if>
<if test="name != null">
and c.name LIKE CONCAT('%',#{name},'%' )
</if>
<if test="code != null">
and w.`code` like CONCAT(#{code},'%' )
</if>
<if test="id != null">
and c.id =#{id}
</if>
</select>
<resultMap id="carResultMap" type="com.yeejoin.equipmanage.common.dto.CarFusionDto">
<id column="cid" property="id"></id>
<result column="name" property="name"></result>
<result column="car_num" property="carNum"></result>
<collection property="carPropertyList" ofType="com.yeejoin.equipmanage.common.entity.vo.CarPropertyVo">
<id column="pid" property="id"></id>
<result column="equipment_index_name" property="name"></result>
<result column="equipment_index_key" property="nameKey"></result>
<result column="value" property="value"></result>
</collection>
</resultMap>
<select id="selectCarAndCarProperty" resultMap="carResultMap">
select
wc.id as cid,
wc.name,
wc.car_num,
wcp.id as pid,
wcp.equipment_index_name,
wcp.equipment_index_key,
wcp.value
from wl_car wc LEFT JOIN wl_car_property wcp on wc.id = wcp.car_id
where wcp.equipment_index_key in ('FAS_Car_Video', 'FAS_Car_GIS');
</select>
</mapper>
<?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.equipmanage.mapper.CarPropertyMapper">
<select id="getCarPropListByIotCode" resultType="com.yeejoin.equipmanage.common.entity.CarProperty">
SELECT
wcp.id AS id,
wcp.car_id AS carId,
wcp.value AS value,
wcp.remark AS remark,
wcp.equipment_index_id AS equipmentIndexId,
wei.name_key AS nameKey
FROM
wl_car_property wcp
LEFT JOIN wl_car AS wc ON wc.id = wcp.car_id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wcp.equipment_index_id
WHERE
wc.iot_code = #{iotCode}
AND
TRIM(wei.name_key) != '' AND wei.name_key IS NOT NULL
</select>
<select id="getCarPropertyList" resultType="com.yeejoin.equipmanage.common.entity.vo.CarPropertyVo">
SELECT
cp.id,
cp.car_id,
ei.`name`,
ei.name_key AS nameKey,
cp.`value`,
ei.unit,
ei.is_iot AS isIot,
ei.sort_num AS sort,
cp.create_date
FROM
wl_car_property cp
LEFT JOIN wl_equipment_index ei ON ei.id = cp.equipment_index_id
<where>
<if test="id != null">
cp.car_id = #{id}
</if>
</where>
</select>
<select id="getCarPropertyListByCarIds" resultType="com.yeejoin.equipmanage.common.entity.vo.CarPropertyVo">
SELECT
cp.id,
cp.car_id,
ei.`name`,
ei.name_key AS nameKey,
cp.`value`,
ei.unit,
ei.is_iot AS isIot,
ei.sort_num AS sort,
cp.create_date
FROM
wl_car_property cp
LEFT JOIN wl_equipment_index ei ON ei.id = cp.equipment_index_id
<where>
<if test="list != null and list.size > 0">
cp.car_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>
<?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.equipmanage.mapper.CommonTreeMapper">
</mapper>
<?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.equipmanage.mapper.CompanyBusinessMapper">
</mapper>
<?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.equipmanage.mapper.CompanyMapper">
</mapper>
<?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.equipmanage.mapper.CompanyQualificationMapper">
</mapper>
<?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.equipmanage.mapper.CompanyQualificationsMapper">
</mapper>
<?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.equipmanage.mapper.ConfirmAlarmMapper">
<select id="getDetailsById" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog">
select
ala.id,
(
SELECT
sou.scene_id
FROM
wl_source_scene sou
WHERE
find_in_set(ala.equipment_specific_id,sou.point_in_scene)>0
and EXISTS (SELECT distinct fi.instance_id from wl_form_instance fi where fi.instance_id = sou.source_id)
limit 1
) AS sceneId,
ala.equipment_specific_id,
spe.code AS equipmentSpecificCode,
ala.equipment_specific_index_name,
ala.type as equipment_specific_index_key,
concat(ala.equipment_specific_name,ala.equipment_specific_index_name) as alarmContent,
(
SELECT
ws.full_name
FROM
wl_warehouse_structure ws,wl_stock_detail sd
WHERE
ws.id = sd.warehouse_structure_id
and sd.equipment_specific_id = ala.equipment_specific_id
) AS alarmPlace,
ala.create_date as create_date,
ala.location as location,
if(spe.code is null,ala.equipment_specific_name,concat(ala.equipment_specific_name,'(',spe.code,')')) as equipmentName,
(select
group_concat(fet.`name`)
from f_equipment_fire_equipment as fefe
left join f_equipment as fet on fet.id = fefe.equipment_id
where fefe.fire_equipment_id = ala.equipment_specific_id
) as protectName,
if(confirm_type is null,'去确认','已处理') isConfirm,
confirm_type,
alarm_reason,
resolve_result,
confirm_user,
confirm_user_name,
confirm_date,
(SELECT GROUP_CONCAT(fem.name) FROM `f_fire_fighting_system` fem WHERE find_in_set(fem.id,spe.system_id)) as systemName
from
wl_equipment_specific_alarm_log as ala
left join wl_equipment_specific as spe on spe.id = ala.equipment_specific_id
<where>
<choose>
<when test="equipId != null and equipId != ''">
ala.equipment_specific_id =#{equipId}
</when>
<otherwise>
ala.id =#{id} limit 1
</otherwise>
</choose>
</where>
</select>
<update id="confirmAlam" >
update
wl_equipment_specific_alarm_log
set
confirm_date = now(),
confirm_type = #{confirmType},
alarm_reason = #{alarmReason},
resolve_result = #{resolveResult},
confirm_user = #{confirmUser},
confirm_user_name = #{confirmUserName}
<where>
confirm_date IS NULL
<if test="isBatch == 0">
AND id = #{id}
</if>
<if test="isBatch == 1">
AND equipment_specific_alarm_id = #{equipmentSpecificAlarmId}
</if>
</where>
</update>
<select id="getIdAndConfirmType" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog">
select id,confirm_type,create_date,equipment_specific_alarm_id
from wl_equipment_specific_alarm_log
where equipment_specific_id = #{id}
order by confirm_type asc,equipment_specific_index_key desc,create_date desc
limit 1
</select>
<select id="getFireAlarm" resultType="java.lang.Integer">
SELECT
count(1)
FROM
(
SELECT
wlesal.id,
wlesal.equipment_specific_alarm_id,
wles.id AS equipmentSpecificId,
wlesal.equipment_specific_id AS fireEquipmentId,
wles.CODE AS fireEquipmentCode,
wled.`name` AS fireEquipmentName,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
CASE
WHEN wlesal.confirm_type <![CDATA[<>]]> ''
THEN 'yes'
ELSE 'no'
END AS isFirm,
wlesal.confirm_type confirmType,
CASE
wlesal.equipment_specific_index_value
WHEN 'true' THEN
'是'
WHEN 'false' THEN
'否' ELSE wlesal.equipment_specific_index_value
END AS fireEquipmentPointValue,
wlesa.frequency AS frequency,
wlesa.`status`,
wlesal.type AS type,
wlesal.create_date AS createDate,
wws.full_name AS warehouseStructureName,
wlesal.confirm_user_name confirmUserName,
wlesal.system_ids systemIds,
(select
group_concat(fet.`name`)
from f_equipment_fire_equipment as fefe
left join f_equipment as fet on fet.id = fefe.equipment_id
where fefe.fire_equipment_id = wlesal.equipment_specific_id
) as equipmentName,
wlesal.confirm_date,
wlesal.alarm_reason,
wlesal.resolve_result,
wles.code
FROM
wl_equipment_specific_alarm_log wlesal
LEFT JOIN wl_equipment_specific wles ON wlesal.equipment_specific_id = wles.id
LEFT JOIN wl_stock_detail wlsd ON wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure wws ON wlsd.warehouse_structure_id = wws.id
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment_specific_alarm wlesa ON wlesa.id = wlesal.equipment_specific_alarm_id
<where>
wlesal.confirm_type is null
</where>
) d
<where>
d.fireEquipmentName IS NOT null
AND d.type = 'FIREALARM'
</where>
ORDER BY
d.createDate desc
</select>
<select id="getFaultAlarm" resultType="java.lang.Integer">
SELECT
count(1)
FROM
(
SELECT
wlesal.id,
wlesal.equipment_specific_alarm_id,
wles.id AS equipmentSpecificId,
wlesal.equipment_specific_id AS fireEquipmentId,
wles.CODE AS fireEquipmentCode,
wled.`name` AS fireEquipmentName,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
CASE
WHEN wlesal.confirm_type <![CDATA[<>]]> ''
THEN 'yes'
ELSE 'no'
END AS isFirm,
wlesal.confirm_type confirmType,
CASE
wlesal.equipment_specific_index_value
WHEN 'true' THEN
'是'
WHEN 'false' THEN
'否' ELSE wlesal.equipment_specific_index_value
END AS fireEquipmentPointValue,
wlesa.frequency AS frequency,
wlesa.`status`,
wlesal.type AS type,
wlesal.create_date AS createDate,
wws.full_name AS warehouseStructureName,
wlesal.confirm_user_name confirmUserName,
wlesal.system_ids systemIds,
(select
group_concat(fet.`name`)
from f_equipment_fire_equipment as fefe
left join f_equipment as fet on fet.id = fefe.equipment_id
where fefe.fire_equipment_id = wlesal.equipment_specific_id
) as equipmentName,
wlesal.confirm_date,
wlesal.alarm_reason,
wlesal.resolve_result,
wles.code
FROM
wl_equipment_specific_alarm_log wlesal
LEFT JOIN wl_equipment_specific wles ON wlesal.equipment_specific_id = wles.id
LEFT JOIN wl_stock_detail wlsd ON wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure wws ON wlsd.warehouse_structure_id = wws.id
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment_specific_alarm wlesa ON wlesa.id = wlesal.equipment_specific_alarm_id
<where>
wlesal.confirm_type is null
</where>
) d
<where>
d.fireEquipmentName IS NOT null
AND d.type = 'BREAKDOWN'
</where>
ORDER BY
d.createDate desc
</select>
</mapper>
<?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.equipmanage.mapper.DeviceServicingMapper">
</mapper>
<?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.equipmanage.mapper.DistrictsMapper">
</mapper>
<?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.equipmanage.mapper.DynamicFormColumnMapper">
</mapper>
<?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.equipmanage.mapper.DynamicFormGroupMapper">
</mapper>
<?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.equipmanage.mapper.DynamicFormInstanceMapper">
</mapper>
<?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.equipmanage.mapper.EquPropertyMapper">
<select id="queryListByEquipDetailId" resultType="com.yeejoin.equipmanage.common.entity.EquProperty">
SELECT
si.id,
sp.equipment_detail_id AS equipmentDetailId,
si.value,
wei.name AS perfQuotaName,
wei.unit AS unitName,
si.create_date AS createDate,
si.equipment_index_id AS equipmentIndexId
FROM
wl_equipment_specific_index si
LEFT JOIN wl_equipment_specific sp on si.equipment_specific_id = sp.id
LEFT JOIN wl_equipment_index wei ON wei.id = si.equipment_index_id
WHERE
sp.equipment_detail_id = #{id}
</select>
</mapper>
<?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.equipmanage.mapper.EquipmentAccountMapper">
<select id="getNameList" resultType="com.yeejoin.equipmanage.common.vo.EquipmentAccountFilterVo">
select * from
(
select
(select code from wl_equipment_category where id =( select category_id from wl_equipment where equipment_id = wl_equipment.id)) as id,
car.name as name
from
wl_car as car
group by car.name
union all
select
(select code from wl_equipment_category where id =( select category_id from wl_equipment where equipment_id = wl_equipment.id)) as id,
eq.name as name
from
wl_equipment_detail as eq
group by eq.name) data
where id like CONCAT(#{eType},'%')
</select>
<select id="getAccounList" resultType="com.yeejoin.equipmanage.common.vo.EquipmentAccountVo">
select * from
( select
id,
(select name from wl_equipment where equipment_id = wl_equipment.id) as equipmentType,
(select code from wl_equipment_category where id =( select category_id from wl_equipment where equipment_id = wl_equipment.id)) as equipmentTypeId,
car.name as equipmentName,
'辆' unit,
count(case when car.car_state= 1 then 1 else null end ) inLibCount,
0 onCarCount,
count(case when car.car_state= 3 then 1 else null end ) maintainCount,
count(case when car.car_state= 7 then 1 else null end ) badCount,
0 wasteCount,
'car' as dataType
from
wl_car as car
group by car.name
union all
select
eq.id,
(select name from wl_equipment where equipment_id = wl_equipment.id) as equipmentType,
(select code from wl_equipment_category where id =( select category_id from wl_equipment where equipment_id = wl_equipment.id)) as equipmentTypeId,
eq.name as equipmentName,
(select name from wl_unit where wleq.unit_id = wl_unit.id) as unit,
sum(if(sto.status= 1,sto.amount,0)) as inLibCount,
sum(if(sto.status= 10,sto.amount,0)) as onCarCount,
sum(if(sto.status= 3,sto.amount,0)) as maintainCount,
sum(if(sto.status= 7,sto.amount,0)) as badCount,
sum(if(sto.status= 11,sto.amount,0)) as wasteCount,
'acc' as dataType
from
wl_equipment_detail as eq
left join
wl_stock_detail as sto on
eq.id = sto.equipment_detail_id
left join
wl_equipment as wleq on
eq.equipment_id = wleq.id
group by eq.name) data
where 1=1
<if test="eType != null and eType != '' ">
AND equipmentTypeId like CONCAT(#{eType},'%')
</if>
<if test="eName != null and eName != '' ">
AND equipmentName = #{eName}
</if>
LIMIT #{spage},#{pageSize}
</select>
<select id="getAccounListCount" resultType="int">
select count(1) from
(
select
(select code from wl_equipment_category where id =( select category_id from wl_equipment where equipment_id = wl_equipment.id)) as equipmentTypeId,
car.name as equipmentName
from
wl_car as car
group by car.name
union all
select
(select code from wl_equipment_category where id =( select category_id from wl_equipment where equipment_id = wl_equipment.id)) as equipmentTypeId,
eq.name as equipmentName
from
wl_equipment_detail as eq
group by eq.name
) data
where 1=1
<if test="eType != null and eType != '' ">
AND equipmentTypeId like CONCAT(#{eType},'%')
</if>
<if test="eName != null and eName != '' ">
AND equipmentName = #{eName}
</if>
</select>
<select id="getMoreCarList" resultType="com.yeejoin.equipmanage.common.vo.EquipmentAccountCarVo">
select
id,
name,
(select name from wl_equipment where id = equipment_id) as type,
car_num as carNum,
if(is_import=0,'进口','国产') as isImport,
brand,
(select name from wl_manufacturer_info where id = manufacturer_id ) as facturer,
standard,
chassis_brand as carBrand
from wl_car
where
name =#{equipmentName}
and car_state = #{accType}
<if test="carNum != null and carNum != '' ">
and car_num like CONCAT(#{carNum},'%')
</if>
LIMIT #{spage},#{pageSize}
</select>
<select id="getMoreCarListCount" resultType="int">
select
count(1)
from wl_car
where
name =#{equipmentName}
and car_state = #{accType}
<if test="carNum != null and carNum != '' ">
and car_num like CONCAT(#{carNum},'%')
</if>
</select>
<select id="getMoreAccList" resultType="com.yeejoin.equipmanage.common.vo.EquipmentAccountAccVo">
select
sto.id,
eq.name,
(select name from wl_manufacturer_info where id = eq.manufacturer_id) facturer,
date_format(eq.production_date,'%Y-%m-%d') AS proDate,
eq.standard,
eq.maintenance_cycle as cycle,
eq.expiry_date AS expDate,
sto.qr_code as code,
amount
from wl_equipment_detail as eq
left join
wl_stock_detail as sto on
eq.id = sto.equipment_detail_id
where
name =#{equipmentName}
and status = #{accType}
<if test="code != null and code != '' ">
and qr_code like CONCAT(#{code},'%')
</if>
LIMIT #{spage},#{pageSize}
</select>
<select id="getMoreAccListCount" resultType="int">
select
count(1)
from wl_equipment_detail as eq
left join
wl_stock_detail as sto on
eq.id = sto.equipment_detail_id
where
name =#{equipmentName}
and status = #{accType}
<if test="code != null and code != '' ">
and qr_code like CONCAT(#{code},'%')
</if>
</select>
<select id="selectHistoryById" resultType="com.yeejoin.equipmanage.common.vo.EquipmentHistoryVo">
select
remark ,
date_format(create_date,'%Y-%m-%d') as date,
user_name as user,
department_name as deptName
from
wl_journal
where
car_id =#{id}
</select>
<select id="getaccData" resultType="String">
select
date_format(production_date,'%Y-%m-%d') AS proDate
from
wl_stock_detail as sto
left join wl_equipment_detail as eq on sto.equipment_detail_id = eq.id
where
sto.id=#{id}
</select>
<select id="selectAccHistoryById" resultType="com.yeejoin.equipmanage.common.vo.EquipmentHistoryVo">
select
remark ,
date_format(create_date,'%Y-%m-%d') as date,
user_name as user,
department_name as deptName
from
wl_journal
where
stock_detail_id =#{id}
</select>
<select id="getaccId" resultType="String">
select equipment_detail_id from wl_stock_detail where id =#{id}
</select>
</mapper>
<?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.equipmanage.mapper.EquipmentAlarmReportDayMapper">
<select id="getOneByDateAndSpeIdAndAlarmType" resultType="com.yeejoin.equipmanage.common.entity.EquipmentAlarmReportDay">
SELECT
weard.id AS id,
weard.org_code AS orgCode,
weard.report_date AS reportDate,
weard.equipment_specific_id AS equipmentSpecificId,
weard.equipment_specific_name AS equipmentSpecificName,
weard.system_ids AS systemIds,
weard.alarm_type AS alarmType,
weard.last_report_date AS lastReportDate,
weard.frequency AS frequency,
weard.create_date AS createDate,
weard.update_date AS updateDate
FROM wl_equipment_alarm_report_day weard
WHERE weard.report_date = #{reportDate} AND weard.equipment_specific_id = #{speId} AND weard.alarm_type = #{alarmType}
</select>
</mapper>
\ 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.equipmanage.mapper.EquipmentCategoryMapper">
<resultMap id="CategoryAmount" type="com.yeejoin.equipmanage.common.entity.vo.EquipTypeAmountVO">
<result column="id" property="id"></result>
<result column="amount" property="amount"></result>
<result column="categoryName" property="categoryName"></result>
<result column="equipmentName" property="equipmentName"></result>
<result column="unitName" property="unitName"></result>
</resultMap>
<resultMap id="Category" type="com.yeejoin.equipmanage.common.entity.EquipmentCategory">
<result column="id" property="id"></result>
<result column="parent_id" property="parentId"></result>
<result column="CODE" property="code"></result>
<result column="NAME" property="name"></result>
<result column="is_consumptive" property="isConsumptive"></result>
<result column="description" property="description"></result>
<result column="remark" property="remark"></result>
<result column="create_date" property="createDate"></result>
<result column="type" property="type"></result>
<result column="industry_code" property="industryCode"></result>
</resultMap>
<select id="getEquipCategoryListByParentId" resultType="Map">
SELECT
id,parent_id parentId,name 'name',code 'code',is_consumptive
isConsumptive,curLevel
FROM
(
SELECT
t1.id,t1.name,t1.parent_id,t1.code,t1.is_consumptive,
CASE
WHEN RIGHT(
code, 2 ) = "00" THEN
1
ELSE
2
END AS curLevel,
IF( find_in_set( parent_id,
@pids ) > 0, @pids := concat( @pids, ',', id
), 0 ) OR IF(t1.parent_id
= #{parentId},1,0) AS ischild
FROM
( SELECT
id,name,parent_id,code,is_consumptive,1 AS curLevel FROM
wl_equipment_category t ORDER BY id ) t1,
( SELECT @pids :=
#{parentId}) t2
) t3
WHERE
ischild != 0
</select>
<select id="getEquipCategoryListcount"
resultType="java.util.Map" parameterType="java.util.Map">
select
(select wl_equipment_category.`name` from wl_equipment_category
where
wl_equipment_category.parent_id=#{ids.id} and
left(wl_equipment_category.`code`, 2) = d.ercode) name,
d.type,
d.ercode ,SUM(d.amount) amount from statisticsequipment_view d
<where>
<if test="ids.ids != null and ids.ids.size() > 0">
and d.ercode in
<foreach item="item" collection="ids.ids" open="("
separator="," close=")">
#{item}
</foreach>
</if>
<!--区域 -->
<if
test="ids.warehouseStructureId != null and ids.warehouseStructureId != '' ">
and d.warehouseStructureId =#{ids.warehouseStructureId}
</if>
<!-- 规格型号 -->
<if test="ids.standard != null and ids.standard != '' ">
and d.standard =#{ids.standard}
</if>
<!--状态 -->
<if test="ids.StateName != null and ids.StateName != '' ">
and d.StateName =#{ids.StateName}
</if>
<!--品牌 -->
<if test="ids.brand != null and ids.brand != '' ">
and d.brand =#{ids.brand}
</if>
</where>
GROUP BY d.ercode ,d.type
</select>
<select id="getEquipmentCount" resultType="java.util.Map"
parameterType="java.util.Map">
select
d.name_mx name,
d.type,
d.ercode ,
SUM(d.amount) amount,
un.name as unit,
wle.img
from
statisticsequipment_view d
left join wl_equipment as wle on d.code = wle.code
left join wl_unit as un on wle.unit_id = un.id
where
d.ercode =#{date.ercode}
<!--区域 -->
<if
test="date.warehouseStructureId != null and date.warehouseStructureId != '' ">
and d.warehouseStructureId =#{date.warehouseStructureId}
</if>
<!-- 规格型号 -->
<if test="date.standard != null and date.standard != '' ">
and d.standard =#{date.standard}
</if>
<!--状态 -->
<if test="date.StateName != null and date.StateName != '' ">
and d.StateName =#{date.StateName}
</if>
<!--品牌 -->
<if test="date.brand != null and date.brand != '' ">
and d.brand =#{date.brand}
</if>
GROUP BY d.name_mx,d.type
</select>
<select id="getDetailed" resultType="java.util.Map"
parameterType="java.util.Map">
select
d.name_mx name,
IFNULL(d.StateName,'') StateName,
IFNULL(
d.brand,'') brand,
IFNULL( d.standard,'')standard,
IFNULL(
d.qr_code,'')qr_code,
d.ercode ,
d.id_mx id,
d.amount,
wle.img,
wu.name as utname
from
statisticsequipment_view d
left join wl_equipment as wle on d.code = wle.code
left join wl_unit as wu on wu.id = wle.unit_id
where d.ercode =#{date.ercode}
<!--区域 -->
<if
test="date.warehouseStructureId != null and date.warehouseStructureId != '' ">
and d.warehouseStructureId =#{date.warehouseStructureId}
</if>
<!-- 规格型号 -->
<if test="date.standard != null and date.standard != '' ">
and d.standard =#{date.standard}
</if>
<!--状态 -->
<if test="date.StateName != null and date.StateName != '' ">
and d.StateName =#{date.StateName}
</if>
<!--品牌 -->
<if test="date.brand != null and date.brand != '' ">
and d.brand =#{date.brand}
</if>
<!--名称-->
<if test="date.name != null and date.name != '' ">
and d.name_mx =#{date.name}
</if>
</select>
<select id="getEquipCategoryLevelByParentId" resultType="int">
SELECT
(count(1)) as 'Level' FROM wl_equipment_category WHERE
FIND_IN_SET(id,getParent(#{parentId}));
</select>
<select id="getEquipCategoryCodeListByParentId" resultType="Map">
SELECT
temp.*,
CONCAT((CASE
WHEN temp.curLevel = 1 THEN
IFNULL(max(c.
CODE), temp. CODE) + 1000000
WHEN temp.curLevel = 2 THEN
IFNULL(max(c.
CODE), temp. CODE) + 10000
WHEN temp.curLevel = 3 THEN
IFNULL(max(c.
CODE), temp. CODE) + 100
WHEN temp.curLevel = 4 THEN
IFNULL(max(c.
CODE), temp. CODE) + 1
END),'') AS newCode
FROM
(
SELECT
ec.*, IFNULL(
(
SELECT
count(1) + 1 AS LEVEL
FROM
wl_equipment_category
WHERE
FIND_IN_SET(id, getParent(ec.parent_id))
),
1
) curLevel
FROM
wl_equipment_category ec
WHERE
ec.id = #{parentId}
) temp
LEFT JOIN
wl_equipment_category c ON temp.id = c.parent_id
WHERE
temp.curLevel <![CDATA[ < ]]>
5
AND c. NAME NOT LIKE '%其他%'
OR c. NAME IS NULL
</select>
<select id="selectCategoryAmount" resultType="java.lang.Integer">
SELECT
ifnull(sum( wlst.amount),0)
FROM
wl_equipment wle
LEFT JOIN wl_equipment_detail wled ON wle.id = wled.equipment_id
LEFT JOIN wl_stock wlst ON wlst.equipment_detail_id = wled.id
LEFT JOIN wl_equipment_category wec on wec.id = wle.category_id
WHERE
LEFT ( wle.CODE, 1 ) = #{codeHead}
AND wlst.org_code = #{orgCode}
AND wec.industry_code = #{industryCode}
</select>
<select id="CategoryAmountList" resultMap="CategoryAmount">
SELECT
wled.id,
wled.name equipmentName,
wlec.name categoryName,
wlun.name unitName,
sum(ifnull(wlst.amount,0)) amount
FROM
wl_equipment_detail wled
LEFT JOIN wl_equipment wle ON wle.id = wled.equipment_id
left join wl_equipment_category wlec on wlec.id = wle.category_id
LEFT JOIN wl_stock wlst ON wlst.equipment_detail_id = wled.id
left join wl_unit wlun on wle.unit_id = wlun.id
WHERE
LEFT (wle.CODE, #{hierarchy}) = #{codeHead}
AND wlst.org_code = #{orgCode}
<if test="equipmentName!=null and equipmentName!=''">
AND wle.name like concat('%',#{equipmentName},'%')
</if>
group by equipmentName
</select>
<select id="checkFather" resultType="int">
select sum(cut) from
( select
count(1) as cut from
wl_equipment_category
where parent_id = #{id}
union
select
count(1) as cut from
wl_equipment
where category_id= #{id}
) as cuts
</select>
<select id="islvlOne" resultType="int">
select
count(1)
from wl_equipment_category
where id =#{id}
and parent_id is null
</select>
<select id="checkUsed" resultType="int">
select sum(tt) from (
select count(1)as tt from wl_equipment where category_id = #{id}
union all
select count(1)as tt from f_fire_fighting_system where system_type = #{id} ) as tdata
</select>
<select id="getEquipmentCategoryList" resultMap="Category">
SELECT ec.id,
ec.parent_id,
ec.CODE,
ec.NAME,
ec.is_consumptive,
ec.description,
ec.industry_code,
ec.remark,
ec.create_date,
i.`name` as industryName,
-- industry_code = 2代表消防设备
IF(LEFT(ec.CODE, 1) = #{head} and ec.industry_code = 2, 'car', 'equipment')
AS type
FROM wl_equipment_category ec
left join wl_industry i on ec.industry_code = i.code
</select>
<select id="getEquipmentCategoryCarList" resultMap="Category">
SELECT
id,
parent_id,
CODE,
NAME,
is_consumptive,
description,
remark,
create_date
FROM
wl_equipment_category
where LEFT ( CODE, 1 ) = '2' and industry_code = '2' -- industry_code = 2(消防行业code)
</select>
<select id="getEquipmentCategoryEquipmentList" resultMap="Category">
SELECT
id,
parent_id,
CODE,
NAME,
is_consumptive,
description,
remark,
create_date
FROM
wl_equipment_category
where LEFT ( CODE, 1 ) != '2' and industry_code = '2' -- industry_code = 2(消防行业code)
</select>
<select id="getByEqpDetailId" resultType="com.yeejoin.equipmanage.common.entity.EquipmentCategory">
SELECT
ec.*
FROM
wl_equipment_detail ed
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
LEFT JOIN wl_equipment_category ec ON ec.id = e.category_id
WHERE 1=1
<if test="eqpDetailId != null">
and ed.id = #{eqpDetailId}
</if>
</select>
<select id="getAllChildCategoryIdList" resultType="Long">
SELECT
id
FROM
(
SELECT
t1.id,
IF
( FIND_IN_SET( parent_id, @pids ) > 0, @pids := concat( @pids, ',', id ), 0 ) AS isChild
FROM
( SELECT id, parent_id FROM wl_equipment_category ORDER BY id ) t1,
( SELECT @pids := #{categoryId} ) t2
) t3
WHERE
t3.isChild != 0
</select>
<select id="getColaEquipmentCategoryList" resultMap="Category">
SELECT
id,
parent_id,
CODE,
NAME,
is_consumptive,
description,
remark,
create_date,
CASE
LEFT ( CODE, 1 )
WHEN #{head} THEN 'car'
ELSE 'equipment'
end
AS type,
industry_code
FROM
wl_equipment_category
WHERE 1=1
<if test="industryCode!=null and industryCode!=''">
AND wl_equipment_category.industry_code = #{industryCode}
</if>
</select>
</mapper>
<?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.equipmanage.mapper.EquipmentDetailMapper">
<select id="page"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentDetail">
SELECT
wed.id AS id,
wec.name AS categoryName,
wed.name,
wed.code,
wed.standard,
wed.maintenance_cycle
AS maintenanceCycle,
wmi.name AS
manufacturerName,
wed.brand,
wed.equipment_id AS equipmentId,
wed.create_date AS createDate,
wed.update_date AS
updateDate,
wlu.name unitName
FROM
wl_equipment_detail wed
LEFT JOIN
wl_equipment we ON we.id =
wed.equipment_id
LEFT JOIN
wl_equipment_category wec ON wec.id =
we.category_id
LEFT JOIN
wl_manufacturer_info wmi ON wmi.id =
wed.manufacturer_id
LEFT JOIN
wl_unit wlu ON we.unit_id= wlu.id
<where>
<if test="equip!=null ">
<if test="equip.name != null and equip.name != ''"> AND wed.name LIKE CONCAT('%',#{equip.name},'%' )</if>
<if test="equip.standard != null and equip.standard != ''"> AND wed.standard LIKE CONCAT('%',#{equip.standard},'%'
)
</if>
<if
test="equip.manufacturerName != null and equip.manufacturerName != ''"> AND wmi.name LIKE CONCAT('%',#{equip.manufacturerName},'%' )
</if>
</if>
</where>
ORDER BY wed.id DESC
LIMIT #{offset},#{size}
</select>
<select id="count" resultType="Integer">
SELECT
COUNT(1)
FROM
wl_equipment_detail wed
LEFT JOIN wl_equipment we ON
we.id =
wed.equipment_id
LEFT JOIN wl_equipment_category wec ON wec.id =
we.category_id
LEFT JOIN wl_manufacturer_info wmi ON wmi.id =
wed.manufacturer_id
<where>
<if test="equip!=null ">
<if test="equip.name != null and equip.name != ''"> AND wed.name LIKE CONCAT('%',#{equip.name},'%' )</if>
<if test="equip.standard != null and equip.standard != ''"> AND wed.standard LIKE CONCAT('%',#{equip.standard},'%'
)
</if>
<if
test="equip.manufacturerName != null and equip.manufacturerName != ''"> AND wmi.name LIKE CONCAT('%',#{equip.manufacturerName},'%' )
</if>
</if>
</where>
</select>
<select id="pageCategory"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentDetail">
SELECT
wed.id AS id,
wec.name AS categoryName,
wed.name,
wed.code,
wed.standard,
wed.maintenance_cycle
AS maintenanceCycle,
wmi.name AS
manufacturerName,
wed.brand,
wed.equipment_id AS equipmentId,
wed.create_date AS
createDate,
wed.update_date AS updateDate
FROM
wl_equipment_detail wed
LEFT JOIN
wl_equipment we ON we.id =
wed.equipment_id
LEFT JOIN
wl_equipment_category wec ON wec.id =
we.category_id
LEFT JOIN
wl_manufacturer_info wmi ON wmi.id =
wed.manufacturer_id
<where>
<if test="list!=null">
AND we.category_id IN
<foreach item="item" collection="list" separator=","
open="(" close=")" index=""> #{item.id}
</foreach>
</if>
</where>
LIMIT #{offset},#{size}
</select>
<select id="countCategory" resultType="Integer">
SELECT
COUNT(1)
FROM
wl_equipment_detail wed
LEFT JOIN
wl_equipment we ON
we.id =
wed.equipment_id
LEFT JOIN
wl_equipment_category wec ON wec.id =
we.category_id
LEFT JOIN
wl_manufacturer_info wmi ON wmi.id =
wed.manufacturer_id
<where>
<if test="list!=null">
AND we.category_id IN
<foreach item="item" collection="list" separator=","
open="(" close=")" index=""> #{item.id}
</foreach>
</if>
</where>
LIMIT #{offset},#{size}
</select>
<update id="quotaUpdate">
update
wl_equipment_index
set perf_value =#{value}
where id =#{equipmentIndexId}
</update>
<select id="getPref" resultType="String">
select
pref_quota
from
wl_equipment
where id=#{id}
</select>
<select id="checkDelete" resultType="String">
select
(select name from wl_equipment_detail eq where eq.id = sto.equipment_detail_id) as name
from wl_stock_detail as sto
where
equipment_detail_id = #{id}
group by equipment_detail_id
</select>
<select id="getWareId" resultType="Long">
select id from wl_warehouse_structure where parent_id in(
select id from
wl_warehouse_structure
where
id = #{id}
or parent_id = #{id}
)
</select>
</mapper>
<?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.equipmanage.mapper.EquipmentIndexMapper">
<resultMap id="Page" type="com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO">
<result property="id" column="id"></result>
<result property="perfQuotaName" column="prefQuotaNAME"></result>
<result property="perfQuotaDefinitionId" column="perf_quota_definition_id"></result>
<result property="unitName" column="unitName"></result>
<result property="unitId" column="unitId"></result>
<result property="groupName" column="group_name"></result>
<result property="isImportentParameter" column="is_importent_parameter"></result>
</resultMap>
<select id="queryEquipmentIndexListByEquipId" resultType="Map">
SELECT * FROM(
SELECT
wei.id AS id,
we.id AS equipDefId,
'' AS perfQuotaStr,
wei.unit AS measureUnitName,
wei.name AS performanceIndexName,
'true' AS isImportentParameter
FROM
wl_equipment_index wei
LEFT JOIN wl_equipment we ON wl.equipment_id = we.id
WHERE
we.id = #{equipmentId}
UNION ALL
SELECT
equipment.id AS id,
'' AS perfQuotaDefinitionId,
equipment.id AS equipDefId,
equipment.pref_quota AS perfQuotaStr,
'' AS measureUnitName,
equipment.pref_quota AS performanceIndexName,
'false' AS isImportentParameter
FROM
wl_equipment equipment
WHERE
equipment.pref_quota IS NOT NULL
AND equipment.id =#{equipmentId}
)temp
LIMIT #{start},#{page}
</select>
<select id="queryEquipmentIndexCountByEquipId" resultType="Integer">
SELECT COUNT(1) FROM(
SELECT
wei.id AS id,
we.id AS equipDefId,
'' AS perfQuotaStr,
wei.unit AS measureUnitName,
wei.name AS performanceIndexName,
'true' AS isImportentParameter
FROM
wl_equipment_index wei
LEFT JOIN wl_equipment we ON wl.equipment_id = we.id
WHERE
we.id = #{equipmentId}
UNION ALL
SELECT
equipment.id AS id,
'' AS perfQuotaDefinitionId,
equipment.id AS equipDefId,
equipment.pref_quota AS perfQuotaStr,
'' AS measureUnitName,
equipment.pref_quota AS performanceIndexName,
'false' AS isImportentParameter
FROM
wl_equipment equipment
WHERE
equipment.pref_quota IS NOT NULL
AND equipment.id =#{equipmentId}
)temp
</select>
<select id="getPage" resultMap="Page">
select
* from
( select
null as equipment_id,
null as id,
pref_quota as prefQuotaNAME,
null as perf_quota_definition_id,
null AS unitName,
0 as is_iot,
null as type_name,
null as type_code,
null as group_name,
null as index_id,
0 as is_importent_parameter,
0 as sort_num
from wl_equipment
where
id = #{id}
and pref_quota is not null
and pref_quota !=''
UNION all
select * from (select
equipment_id,
id,
name,
name_key,
unit,
is_iot ,
type_name ,
type_code ,
group_name,
index_definition_id,
1 as is_importent_parameter,
sort_num
from
wl_equipment_index
where equipment_id = #{id}
order by group_name,sort_num ) impor) data
where prefQuotaNAME like concat('%',#{groupName},'%')
</select>
<select id="getPerfQutoaList" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO">
select
* from
( select
pref_quota as perfQuotaName,
null as perfQuotaDefinitionId,
0 as isIot
from wl_equipment
where
id = #{id}
and pref_quota is not null
and pref_quota !=''
UNION all
select * from (select
name as perfQuotaName,
name_key as perfQuotaDefinitionId,
is_iot as isIot
from
wl_equipment_index
where equipment_id = #{id}
order by group_name,sort_num ) impor) data
</select>
<select id="getOnePrefQuota" resultMap="Page">
SELECT
equipment_id ,
id,
name as prefQuotaNAME,
name_key as perf_quota_definition_id,
unit as unitName,
is_iot ,
type_name ,
type_code ,
group_name ,
index_definition_id as index_id,
1 as is_importent_parameter,
sort_num,
type
from
wl_equipment_index
where id = #{id}
</select>
<select id="checkName" resultType="int">
select count(1) from wl_equipment_index where
index_definition_id=#{id}
and equipment_id = #{fId}
<if test="dataId != null and dataId !='' ">
and id != #{dataId}
</if>
</select>
<update id="updateE">
UPDATE
wl_equipment
SET
pref_quota = ''
where id = #{id}
</update>
<insert id="savePerfQuota" >
insert into wl_equipment_index
VALUES(
#{id},
#{equipmentId},
#{perfQuotaName},
#{perfQuotaDefinitionId},
#{unitName},
#{indexId},
#{isIot},
#{typeName},
#{typeCode},
#{groupName},
#{sortNum},
#{type},
now())
</insert>
<select id="checkUnit" resultType="int">
select count(1) from wl_equipment_index where
unit=#{unitName}
</select>
<select id="getEquipmentIndexByIot" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO">
SELECT
wei.id AS id,
wei.name_key AS nameKey
FROM
wl_equipment_index wei
WHERE
wei.is_iot = 1
AND
wei.name_key != ""
</select>
<select id="getGruopName" resultType="java.lang.String">
SELECT
group_name
FROM
wl_equipment_index
WHERE
group_name != ' '
AND group_name IS NOT NULL
AND equipment_id = #{equipmentId}
GROUP BY
group_name
</select>
</mapper>
<?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.equipmanage.mapper.EquipmentManageMapper">
<select id="queryEquipmenInfo" resultType="com.yeejoin.equipmanage.common.vo.EquipmentManageVo">
select
id as id,
name as name,
code as code,
form_group_id,
instance_id,
date_format(install_date,'%Y-%m-%d') AS installDate,
date_format(first_maintenance_date,'%Y-%m-%d') AS firstMaintenanceDate,
charge_person as chargePerson,
(select name from wl_manufacturer_info where id = construction_unit) as constructionUnit,
(select name from wl_manufacturer_info where id = maintenance_unit) as maintenanceUnit,
(select name from wl_equipment_category where id = system_type) as systemType,
system_type as systemTypeCode,
construction_unit as constructionUnitCode,
maintenance_unit as maintenanceUnitCode,
maintenance_frequency as maintenanceFrequency,
scene_id as sceneId,
(select count(1) from `wl_equipment_specific` es where find_in_set(sys.id,es.system_id) and es.single = true ) equipCount
from
f_fire_fighting_system as sys
where 1=1
<if test="equimentName != 'null' ">
AND NAME like CONCAT('%',#{equimentName},'%')
</if>
<if test="equimentCode != 'null' ">
AND CODE like CONCAT('%',#{equimentCode},'%')
</if>
<if test="construction != 'all' ">
AND CONSTRUCTION_UNIT = #{construction}
</if>
<if test="maintenance != 'all' ">
AND MAINTENANCE_UNIT = #{maintenance}
</if>
order by id DESC
LIMIT #{spage},#{pageSize}
</select>
<select id="queryEquipmenCount" resultType="long">
select
count(1)
from
f_fire_fighting_system
where 1=1
<if test="equimentName != 'null' ">
AND name like CONCAT('%',#{equimentName},'%')
</if>
<if test="equimentCode != 'null' ">
AND code like CONCAT('%',#{equimentCode},'%')
</if>
<if test="construction != 'all' ">
AND construction_unit = #{construction}
</if>
<if test="maintenance != 'all' ">
AND maintenance_unit = #{maintenance}
</if>
</select>
<select id="getUtils" resultType="com.yeejoin.equipmanage.common.vo.EquipmentManageVo">
select
id ,
name as name
from
wl_manufacturer_info
order by id
</select>
<select id="getSystemList" resultType="com.yeejoin.equipmanage.common.vo.EquipmentManageVo">
SELECT
id,
`name`,
`code`
FROM
wl_equipment_category
WHERE
parent_id = (
SELECT
CONCAT(id, '')
FROM
wl_equipment_category
WHERE
`code` = '92000000'
)
ORDER BY
`code`
</select>
<delete id="deleteByid">
DELETE FROM f_fire_fighting_system WHERE id = #{param}
</delete>
<select id="checkCode" resultType="int">
select
count(1) from f_fire_fighting_system
where CODE=#{param}
</select>
<insert id="insertEquipment">
INSERT INTO
f_fire_fighting_system
(id,
name,
code,
system_type,
install_date,
charge_person,
construction_unit,
maintenance_unit,
maintenance_frequency,
first_maintenance_date,
rec_user_id,
rec_date,
sort)
VALUES(
#{id},
#{name},
#{code},
#{systemType},
STR_TO_DATE(#{installDate},'%Y-%m-%d'),
#{chargePerson},
#{constructionUnit},
#{maintenanceUnit},
#{maintenanceFrequency},
STR_TO_DATE(#{firstMaintenanceDate},'%Y-%m-%d'),
#{recUserId},
now(),
#{sort})
</insert>
<insert id="insertFile">
insert into wl_upload_file
(id,
url,
name,
user_id,
file_type,
object_id,
create_date)
VALUES(
#{id},
#{url},
#{name},
#{userId},
#{fileType},
#{objectId},
now())
</insert>
<select id="getFiles" resultType="com.yeejoin.equipmanage.common.vo.FileUploadVo">
select
id,
url,
name,
file_type as fileType,
object_id as objectId,
date_format(create_date,'%Y-%m-%d') AS createDate
from
wl_upload_file
where
object_id =#{id}
and file_type=#{type}
</select>
<update id="updateEquipment">
UPDATE
f_fire_fighting_system
SET
NAME = #{name},
system_type =#{systemType} ,
install_date =STR_TO_DATE(#{installDate},'%Y-%m-%d'),
charge_person =#{chargePerson},
construction_unit =#{constructionUnit},
maintenance_unit =#{maintenanceUnit},
maintenance_frequency =#{maintenanceFrequency},
first_maintenance_date =STR_TO_DATE(#{firstMaintenanceDate},'%Y-%m-%d'),
rec_user_id =#{recUserId},
rec_date = now()
where id = #{id}
</update>
<update id="updateFile">
UPDATE
wl_upload_file
SET
url = #{url},
create_date= now()
where
object_id =#{objectId}
and file_type=#{fileType}
</update>
<delete id="deleteFilre">
delete from wl_upload_file WHERE object_id = #{id}
</delete>
<select id="chekcName" resultType="int">
select count(1)
from f_fire_fighting_system
where NAME=#{name}
<if test="id != null ">
and id !=#{id}
</if>
</select>
<select id="getNotFireSystemList" resultType="hashmap">
SELECT
fs.id AS systemId,
fs.`name` AS systemName
FROM
f_fire_fighting_system fs
JOIN wl_equipment_category ec ON ec.id = fs.system_type
AND ec.`code` != #{alarmSystemCode}
</select>
</mapper>
<?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.equipmanage.mapper.EquipmentMapper">
<resultMap id="EquipmentAppMessage" type="com.yeejoin.equipmanage.common.entity.vo.EquipmentBaseAppVO">
<result column="equip_id" property="equipId"></result>
<result column="equipment_detail_id" property="equipDetailId"></result>
<result column="standard" property="standard"></result>
<result column="country" property="country"></result>
<result column="manufacturer_name" property="manufacturerName"></result>
<result column="brand" property="brand"></result>
<result column="category_name" property="categoryName"></result>
<result column="description" property="description"></result>
<result column="create_date" property="createTime"></result>
<result column="manufacturer_id" property="manufacturerId"></result>
<result column="equip_name" property="equipName"></result>
<result column="equip_code" property="equipCode"></result>
<result column="expiry_date" property="expiryDate"></result>
<result column="maintenance_cycle" property="maintenanceCycle"></result>
<result column="full_name" property="description"></result>
<result column="name" property="sysName"></result>
</resultMap>
<resultMap id="ImportantEquipmentVO" type="com.yeejoin.equipmanage.common.entity.vo.ImportantEquipmentVO">
<result column="id" property="id"></result>
<result column="name" property="name"></result>
<result column="code" property="code"></result>
<result column="address" property="address"></result>
<result column="charge_dept_id" property="chargeDeptId"></result>
<result column="charge_user_id" property="chargeUserId"></result>
<result column="fire_station" property="fireStation"></result>
<result column="room" property="room"></result>
<result column="risk_source" property="riskSource"></result>
<result column="building" property="building"></result>
<result column="is_indoor" property="isIndoor"></result>
<collection property="images" select="com.yeejoin.equipmanage.mapper.EquipmentMapper.getPreplanPicture" column="id">
<result column="type" property="type"></result>
<result column="picture" property="picture"></result>
</collection>
</resultMap>
<resultMap id="PreplanPictureVO" type="com.yeejoin.equipmanage.common.entity.vo.PreplanPictureVO">
<result column="type" property="type"></result>
<result column="picture" property="picture"></result>
</resultMap>
<resultMap id="DownloadEquipmentData" type="com.yeejoin.equipmanage.common.entity.vo.DownloadEquipmentDataVO">
<result column="equipment_specific_id" property="equipmentSpecificId"></result>
<result column="equipment_specific_qr_code" property="equipmentSpecificQrCode"></result>
<result column="equipment_specific_single" property="equipmentSpecificSingle"></result>
<result column="equipment_specific_code" property="equipmentSpecificCode"></result>
<result column="equipment_detail_name" property="equipmentDetailName"></result>
<result column="equipment_detail_perf_quota_str" property="equipmentDetailPerfQuotaStr"></result>
<result column="warehouse_structure_name" property="warehouseStructureName"></result>
<result column="description" property="description"></result>
<result column="equipment_pref_quota" property="equipmentPrefQuota"></result>
<result column="stock_detail_amount" property="stockDetailAmount"></result>
<result column="stock_detail_warehouse_structure_id" property="stockDetailWarehouseStructureId"></result>
<result column="stock_detail_warehouse_id" property="stockDetailWarehouseId"></result>
<result column="stock_detail_status" property="stockDetailStatus"></result>
<result column="unit_id" property="unitId"></result>
<result column="unit_name" property="unitName"></result>
<result column="category_code" property="categoryCode"></result>
<result column="stock_detail_id" property="stockDetailId"></result>
</resultMap>
<select id="getEquipmentList" resultType="Map">
SELECT
cate.CODE AS categoryCode,
cate.NAME AS categoryName,
( CASE WHEN LEFT ( cate.CODE, 1 ) = '2' THEN 'car' ELSE 'equip' END ) AS type,
cate.is_consumptive isConsumptive,
eq.category_id categoryId,
eq.code,
eq.name,
eq.remark,
eq.id,
eq.is_iot isIot,
unit.NAME AS unitName
FROM
wl_equipment eq
LEFT JOIN wl_unit unit ON unit.id = eq.unit_id
LEFT JOIN wl_equipment_category cate ON cate.id = eq.category_id
<where>
<if test="whereConditionStr != null and whereConditionStr != '' ">
eq.name like CONCAT("%",#{whereConditionStr},"%" )
</if>
<if test="isIot != null and isIot != '' ">
eq.is_iot = #{isIot}
</if>
</where>
ORDER BY eq.id DESC
LIMIT #{start},#{page}
</select>
<select id="getEquipmentCount" resultType="Integer">
SELECT
COUNT(1)
FROM
wl_equipment eq
LEFT JOIN wl_unit unit ON unit.id = eq.unit_id
LEFT JOIN wl_equipment_category cate ON cate.id = eq.category_id
<where>
<if test="whereConditionStr != null and whereConditionStr != '' ">
eq.name like CONCAT("%",#{whereConditionStr},"%" )
</if>
</where>
</select>
<select id="getEquipmentAppMessage" resultMap="EquipmentAppMessage">
SELECT DISTINCT
wle.id as equip_id,
wleq.id as equipmentSpecificId,
wleq.equipment_detail_id,
wled.name as equip_name,
wled.code as equip_code,
wled.expiry_date,
wled.standard,
wlsd.name AS country,
wled.brand,
wleq.qr_code AS qrCode,
wlec.NAME AS category_name,
wlsbd.description,
wlsbd.create_date,
wled.manufacturer_id,
wled.maintenance_cycle,
stru.full_name,
(select group_concat(sys.name) from `f_fire_fighting_system` sys where find_in_set(sys.id, wleq.system_id)) as name
FROM
wl_equipment_specific wleq
left join wl_equipment_detail wled on wleq.equipment_detail_id = wled.id
LEFT JOIN wl_equipment wle ON wle.id = wled.equipment_id
LEFT JOIN wl_manufacturer_info wlai ON wled.manufacturer_id = wlai.id
LEFT JOIN wl_equipment_category wlec ON wle.category_id = wlec.id
left join wl_stock_detail wlsbd on wleq.qr_code = wlsbd.qr_code
LEFT JOIN wl_system_dic wlsd ON wlsd.id = wled.country
left join wl_warehouse_structure as stru on wlsbd.warehouse_structure_id = stru.id
where wleq.qr_code=#{qrCode}
</select>
<select id="getImportantEquipmentList" resultMap="ImportantEquipmentVO">
select
fe.id,
fe.name,
fe.code,
fe.address,
wlfi.field_value fire_station,
wlfi1.name risk_source,
fe.charge_dept_id,
fe.room,
fe.building,
fe.is_indoor,
fe.charge_user_id
from f_equipment fe
left join wl_form_instance wlfi on fe.fire_station_id=wlfi.instance_id
left join wl_warehouse_structure wlfi1 on fe.risk_source_id = wlfi1.id
where fe.id in
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
<select id="getPreplanPicture" resultMap="PreplanPictureVO">
select
type,picture
from f_preplan_picture where equipment_id = #{id}
</select>
<select id="getDownloadEquipmentData" resultMap="DownloadEquipmentData">
SELECT
wles.id AS equipment_specific_id,
wles.equipment_detail_id AS equipment_specific_equipment_detail_id,
wles.qr_code AS equipment_specific_qr_code,
wles.single AS equipment_specific_single,
wles.CODE AS equipment_specific_code,
wled.NAME AS equipment_detail_name,
wled.perf_quota_str AS equipment_detail_perf_quota_str,
wle.id AS equipmentId,
wle.NAME AS equipment_name,
wle.CODE AS equipment_code,
wle.pref_quota AS equipment_pref_quota,
wlsd.amount AS stock_detail_amount,
wlsd.warehouse_structure_id AS stock_detail_warehouse_structure_id,
wlsd.warehouse_id AS stock_detail_warehouse_id,
wlsd.STATUS AS stock_detail_status,
wlsd.id as stock_detail_id,
wlu.id AS unit_id,
wlsd.description,
wlws.name as warehouse_structure_name,
wlu.NAME AS unit_name,
wlec.`code` category_code
FROM
wl_equipment_specific wles
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment wle ON wled.equipment_id = wle.id
LEFT JOIN wl_unit wlu ON wle.unit_id = wlu.id
LEFT JOIN wl_stock_detail wlsd ON wles.id = wlsd.equipment_specific_id
left join wl_warehouse_structure wlws on wlsd.warehouse_structure_id = wlws.id
left join wl_equipment_category wlec on wlec.id = wle.category_id
</select>
<select id="getEquipListBySpecific" resultType="com.yeejoin.equipmanage.common.vo.EquipmentVo">
<![CDATA[
SELECT
e.id,
e.`name`,
e.category_id,
e.`code`,
'fireEquipment' AS type
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
WHERE
e.id IS NOT NULL
GROUP BY
e.id
]]>
</select>
<select id="querySpecificIndexList" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO">
SELECT
WI.id,
WI.unit as unitName,
WI.name as perfQuotaName,
si.`value`,
WI.group_name
FROM
wl_equipment_specific_index si,
wl_equipment_index WI
where SI.equipment_index_id = WI.id and si.equipment_specific_id = #{equipmentSpecificId}
</select>
<select id="getEquipBySpecific" resultType="com.yeejoin.equipmanage.common.vo.EquipmentVo">
<![CDATA[
SELECT
e.id,
e.`name`,
e.category_id,
e.`code`,
e.is_iot
FROM
wl_equipment e
LEFT JOIN wl_equipment_detail ed ON ed.equipment_id = e.id
LEFT JOIN wl_equipment_specific es ON ed.id = es.equipment_detail_id
WHERE
es.id = #{equipmentSpecificId}
]]>
</select>
<select id="listLikePage" resultType="Map">
SELECT
eq.id,
eq.category_id categoryId,
eq.name,
cate.NAME AS unitName
FROM
wl_equipment eq
LEFT JOIN wl_equipment_category cate ON cate.id = eq.category_id
<where>
<if test="code != null and code != '' ">
eq.code like CONCAT(#{code},"%" )
</if>
</where>
</select>
</mapper>
<?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.equipmanage.mapper.EquipmentOnCarMapper">
<select id="onCarIPage" resultType="com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo">
SELECT
e.`name` AS equipmentName,
ed.`name` AS equipmentSpecificName,
oc.amount,
ed.area,
oc.id AS equipmentOnCarId,
sd.warehouse_id AS warehouseId,
sd.warehouse_structure_id AS warehouseStructureId,
sd.id AS stockDetailId,
es.code equipmentSpecificCode,
CASE
sd.`status`
WHEN 10 THEN
'车载' ELSE ''
END AS `status`,
oc.create_date
FROM
wl_equipment_on_car oc
LEFT JOIN wl_equipment_specific es ON oc.equipment_specific_id = es.id
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
LEFT JOIN wl_stock_detail sd ON sd.id = oc.stock_detail_id
<where>
<if test="dto.carId != null">
oc.car_id = #{dto.carId}
</if>
<if test="dto.teamId != null">
AND es.team_id = #{dto.teamId}
</if>
<if test="dto.equipmentSpecificName != null and dto.equipmentSpecificName !=''">
AND ed.`name` LIKE CONCAT( '%', #{dto.equipmentSpecificName}, '%' )
</if>
<if test="dto.createDate != null">
AND TO_DAYS( oc.create_date ) = TO_DAYS( #{dto.createDate} )
</if>
</where>
</select>
</mapper>
<?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.equipmanage.mapper.EquipmentPointMapper">
<select id="listBySearchMap" resultType="com.yeejoin.equipmanage.common.entity.EquipmentPoint">
select
a.id,
a.name,
a.code,
a.equipment_id as fireEquipmentId,
a.create_by as createBy,
a.create_date as createDate,
a.remark,
a.type,
a.value,
a.unit,
a.unit_name as unitName,
a.org_code as orgCode,
fd.name as alarmName,
a.equipment_name as equipmentName,
a.equipment_code as equipmentCode
from
wl_equipment_point as a
left join wl_system_dic fd on fd.id = a.alarm_type
<where>
a.org_code = #{compCode}
<if test="searchValue!=null and searchValue.trim() != ''">
and (a.name like concat('%',#{searchValue},'%') or a.code like concat('%',#{searchValue},'%'))
</if>
<if test="type!=null and type.trim() != ''">
and a.type = #{type}
</if>
</where>
order by a.create_date desc
</select>
</mapper>
<?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.equipmanage.mapper.EquipmentQrcodeMapper">
<select id="page"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentQrcode">
SELECT
weq.id AS id,
weq.equipment_detail_id AS equipmentDetailId,
weq.q_r_code AS
qRCode,
weq.car_id AS carId,
weq.product_date AS productDate,
wsd.STATUS,
wsd.update_date AS updateDate,
wsd.create_date AS createDate,
wws.full_name AS location
FROM
wl_equipment_qrcode weq
LEFT
JOIN wl_stock_detail wsd ON
wsd.qr_code =
weq.q_r_code
LEFT JOIN
wl_warehouse_structure wws ON wws.id =
wsd.warehouse_structure_id
<where>
<if test="equipment.qRCode != null and equipment.qRCode != ''">
AND weq.q_r_code LIKE CONCAT('%',#{equipment.qRCode},'%')
</if>
<if
test="equipment.equipmentDetailId != null and equipment.equipmentDetailId != ''">
AND weq.equipment_detail_id = #{equipment.equipmentDetailId}
</if>
<if test="equipment.status != null and equipment.status != ''">
AND find_in_set(wsd.status,#{equipment.status})
</if>
</where>
LIMIT #{start},#{size}
</select>
<select id="count" resultType="Integer">
SELECT
COUNT(1)
FROM
wl_equipment_qrcode weq
LEFT JOIN wl_stock_detail wsd
ON
wsd.qr_code = weq.q_r_code
LEFT JOIN
wl_warehouse_structure wws ON wws.id = wsd.warehouse_structure_id
<where>
<if test="equipment.qRCode != null and equipment.qRCode != ''">
AND weq.q_r_code LIKE CONCAT('%',#{equipment.qRCode},'%')
</if>
<if
test="equipment.equipmentDetailId != null and equipment.equipmentDetailId != ''">
AND weq.equipment_detail_id = #{equipment.equipmentDetailId}
</if>
<if test="equipment.status != null and equipment.status != ''">
AND find_in_set(wsd.status,#{equipment.status})
</if>
</where>
</select>
</mapper>
<?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.equipmanage.mapper.EquipmentSpecificAlarmLogMapper">
<update id="updateAlarmLogByIotCodeAndIndexKey">
UPDATE wl_equipment_specific_alarm_log wesal
SET wesal.confirm_type = #{dto.confirmType},
wesal.resolve_result = #{dto.resolveResult},
wesal.confirm_user_name = #{dto.confirmUserName},
wesal.confirm_date = now()
WHERE
wesal.equipment_specific_alarm_id IN (
SELECT
id
FROM
wl_equipment_specific_alarm wesa
WHERE
wesa.iot_code = #{dto.iotCode}
AND wesa.equipment_specific_index_key = #{dto.equipmentSpecificIndexKey}
)
</update>
<select id="findByIdList" resultType="com.yeejoin.equipmanage.common.datasync.vo.AppAlarmExtVo">
SELECT
CONCAT(sal.create_date) AS time,
IFNULL(a.`code`,' ') AS areaid,
IFNULL(a.`name`,' ') AS areaname,
f.`code` AS stationid,
f.`name` AS stationname,
s.`code` AS deviceid,
s.`name` AS devicename,
sal.equipment_specific_code AS partid,
sal.equipment_specific_name AS partname,
s.`system_type_code` AS type,
IF
( sal.confirm_type = 'FIREALARM', 0, 1 ) AS eventlevel,
-- CONCAT( sal.equipment_specific_name, ' ', sal.equipment_specific_index_name ) AS eventdesc,
CONCAT( '位于', a.`name`, '的', sal.equipment_specific_name, '(', sal.equipment_specific_code, ')在', sal.create_date, '发生', sal.equipment_specific_index_name, ',请相关人员进行核实确认现场情况!') AS eventdesc,
sal.equipment_specific_index_name AS eventaction,
IF
( sal.confirm_date IS NULL, FALSE, TRUE ) AS isreport ,
CONCAT(sal.confirm_date) AS confirmtime,
sal.alarm_reason AS eventreason
FROM
wl_equipment_specific_alarm_log sal
LEFT JOIN wl_form_instance i ON sal.build_id = i.instance_id
LEFT JOIN wl_area a ON a.id = i.field_value
LEFT JOIN f_fire_fighting_system s ON s.id = IF(LOCATE(',' , sal.system_ids) > 0,SUBSTRING(sal.system_ids,1,LOCATE(',' , sal.system_ids)-1),sal.system_ids),
f_station_info f
WHERE
i.field_name = "belongAreaId"
<if test="list != null and list.size() >0">
AND sal.id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY
sal.id
</select>
<select id="findByIdListNoBuildId" resultType="com.yeejoin.equipmanage.common.datasync.vo.AppAlarmExtVo">
SELECT
CONCAT(sal.create_date) AS time,
' ' AS areaid,
' ' AS areaname,
f.`code` AS stationid,
f.`name` AS stationname,
s.`code` AS deviceid,
s.`name` AS devicename,
sal.equipment_specific_code AS partid,
sal.equipment_specific_name AS partname,
s.`system_type_code` AS type,
IF
( sal.confirm_type = 'FIREALARM', 0, 1 ) AS eventlevel,
-- CONCAT( sal.equipment_specific_name, ' ', sal.equipment_specific_index_name ) AS eventdesc,
CONCAT(sal.equipment_specific_name, '(', sal.equipment_specific_code, ')在', sal.create_date, '发生', sal.equipment_specific_index_name, ',请相关人员进行核实确认现场情况!') AS eventdesc,
sal.equipment_specific_index_name AS eventaction,
IF
( sal.confirm_date IS NULL, FALSE, TRUE ) AS isreport ,
CONCAT(sal.confirm_date) AS confirmtime,
sal.alarm_reason AS eventreason
FROM
wl_equipment_specific_alarm_log sal
LEFT JOIN wl_equipment_specific_alarm sa ON sa.id = sal.equipment_specific_alarm_id
LEFT JOIN f_fire_fighting_system s ON s.id = IF(LOCATE(',' , sal.system_ids) > 0,SUBSTRING(sal.system_ids,1,LOCATE(',' , sal.system_ids)-1),sal.system_ids),
f_station_info f
<where>
<if test="list != null and list.size() >0">
AND sal.id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
GROUP BY
sal.id
</select>
<select id="getIsConfirmByAlarmId" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog">
SELECT
*
FROM
wl_equipment_specific_alarm_log weal
<where>
<if test="equipmentSpecificAlarmId != null">
weal.equipment_specific_alarm_id = #{equipmentSpecificAlarmId}
</if>
<if test="isConfirm != null and isConfirm != '' and isConfirm == 0">
AND weal.confirm_date IS NULL
</if>
<if test="isConfirm != null and isConfirm != '' and isConfirm == 1">
AND weal.confirm_date IS NOT NULL
</if>
</where>
</select>
</mapper>
\ 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.equipmanage.mapper.EquipmentSpecificAlarmMapper">
<resultMap id="resultMapDto" type="com.yeejoin.equipmanage.common.entity.dto.EquipSpecificAlarmDTO">
<result column="id" property="id"/>
<result column="equipmentSpecificId" property="equipmentSpecificId"/>
<result column="fireEquipmentCode" property="fireEquipmentCode"/>
<result column="fireEquipmentName" property="fireEquipmentName"/>
<result column="warehouseStructureName" property="warehouseStructureName"/>
<result column="fireEquipmentSpecificIndexName" property="fireEquipmentSpecificIndexName"/>
<result column="createDate" property="createDate"/>
<result column="status" property="status"/>
<result column="confirmType" property="confirmType"/>
</resultMap>
<select id="getEquipmentSpecAlarmByIotCode"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm">
SELECT
wes.org_code AS orgCode,
wed.name AS equipmentSpecificName,
wes.id AS equipmentSpecificId,
wes.iot_code AS iotCode,
wei.name AS equipmentSpecificIndexName,
wei.name_key AS equipmentSpecificIndexKey,
wesi.value AS equipmentSpecificIndexValue,
wesi.id as equipmentSpecificIndexId,
wei.type_name AS type,
wei.id AS equipmentIndexId,
wei.type_code AS alarmCode,
wes.qr_code as qrCode
FROM
wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
WHERE
wes.iot_code = #{iotCode}
AND
wei.is_iot = 1
</select>
<select id="getCount" resultType="int">
SELECT
COUNT(DISTINCT(wesa.id))
FROM
wl_equipment_specific_alarm wesa
LEFT JOIN wl_equipment_specific wes ON wes.id = wesa.equipment_specific_id
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
LEFT JOIN wl_equipment_specific_index wesi ON wesi.equipment_specific_id = wes.id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
WHERE
wes.iot_code = #{iotCode}
AND
wei.is_iot = 1
</select>
<select id="getEquipmentSpecAlarmVoListByEquipIndexId"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm">
SELECT
*
FROM
wl_equipment_specific_alarm wesa
LEFT JOIN wl_equipment_index wei ON wei.id = wesa.equipment_index_id
WHERE
wesa.equipment_index_id = #{equipmentIndex.id}
</select>
<select id="checkIfExist" resultType="int">
SELECT
COUNT(1)
FROM
wl_equipment_specific_alarm wesa
LEFT JOIN wl_equipment_index wei ON wei.id = wesa.equipment_index_id
WHERE
wesa.equipment_index_id = #{equipmentIndex.id}
</select>
<select id="getAlarmDataByIndexId" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm">
SELECT
*
FROM
wl_equipment_specific_alarm wesa
WHERE
wesa.equipment_index_id = #{indexId}
ORDER BY wesa.id
</select>
<select id="getEquipmentSpecAlarmByIot" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentIotAlarmVO">
SELECT
wei.id AS equipmentIndexId,
wei.name_key AS equipmentSpecificIndexKey
FROM
wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_specific wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
LEFT JOIN wl_equipment_index wei ON wei.id = wesi.equipment_index_id
WHERE
wes.iot_code = #{iotCode}
AND
wei.is_iot = 1
</select>
<select id="getByIndexId" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm">
SELECT
*
FROM
wl_equipment_specific_alarm wesa
WHERE
wesa.equipment_index_id = #{indexId}
</select>
<select id="getEquipListBySpecific" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm">
<![CDATA[
SELECT
*
FROM
wl_equipment_specific_alarm
WHERE
status = #{status}
AND equipment_specific_id = #{equipmentSpecificId}
ORDER BY
create_date DESC
]]>
</select>
<select id="findEquipmentSpecificAlarmByEquipmentSpecificIdAndEquipmentIndexIdAndStatusIstrue"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm">
SELECT
*
FROM
wl_equipment_specific_alarm
WHERE
STATUS = 1
AND equipment_index_id = #{equipmentIndexId}
AND equipment_specific_id = #{equipmentSpecificId}
</select>
<select id="checkIfExistByIotCode" resultType="int">
SELECT
count(1)
FROM
wl_equipment_specific_alarm
WHERE
status = 1 and iot_code = #{iotCode}
</select>
<select id="getAlarmByEquipmentSpecificIdAndEquipmentIndexId"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm">
SELECT
*
FROM
wl_equipment_specific_alarm
WHERE
STATUS = 1
AND equipment_index_id = #{equipmentIndexId}
AND equipment_specific_id = #{equipmentSpecificIndexId}
</select>
<select id="getAlarmByIotCode" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm">
SELECT
*
FROM
wl_equipment_specific_alarm
WHERE
iot_code = #{iotCode}
</select>
<select id="page" resultType="java.util.HashMap">
SELECT
d.*
FROM
(
SELECT
wlesal.id,
wlesal.org_code,
wlesal.equipment_specific_id AS fireEquipmentId,
wles.equipment_detail_id AS equipDetailId,
wles.code AS fireEquipmentCode,
wles.system_id AS systemId,
if(wles.code is null,wlesal.equipment_specific_name,concat(wlesal.equipment_specific_name,'(',wles.code,')')) as
fireEquipmentName,
concat(wlesal.equipment_specific_name,wlesal.equipment_specific_index_name) as alamContent,
if(confirm_type is null,'未处理','已处理') handleStatus,
confirm_type as handleType,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
wlesal.build_id AS buildId,
we.img AS imgUrl,
CASE
wlesal.equipment_specific_index_value
WHEN 'true' THEN '是'
WHEN 'false' THEN '否'
ELSE wlesal.equipment_specific_index_value END
AS fireEquipmentPointValue,
wlesal.type AS type,
wlesal.create_date AS createDate,
CONCAT_WS(' ',ware.full_name,wsd.description) AS warehouseStructureName,
(select
group_concat(fet.`name`)
from f_equipment_fire_equipment as fefe
left join f_equipment as fet on fet.id = fefe.equipment_id
where fefe.fire_equipment_id = wlesal.equipment_specific_id
) as equipmentName
FROM wl_equipment_specific_alarm_log wlesal
LEFT JOIN wl_equipment_specific wles ON wlesal.equipment_specific_id = wles.id
left join wl_stock_detail as wsd on wsd.equipment_specific_id = wlesal.equipment_specific_id
left join wl_warehouse_structure as ware on wsd.warehouse_structure_id = ware.id
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment we ON wled.equipment_id = we.id
) d
<where>
<if test="param.warehouseStructureName != null and param.warehouseStructureName != ''">and d.warehouseStructureName like
concat(concat("%",#{param.warehouseStructureName}),"%")
</if>
<if test="param.equipCode != null and param.equipCode != ''">AND d.fireEquipmentCode like
concat(concat("%",#{param.equipCode}),"%")
</if>
<if test="param.beginDate!=null">AND d.createDate <![CDATA[>=]]> #{param.beginDate}</if>
<if test="param.endDate!=null">AND d.createDate <![CDATA[<=]]> #{param.endDate}</if>
<if test="param.alarmType == 'BREAKDOWN'">AND d.type = #{param.alarmType}</if>
<if test="param.alarmType == 'FIREALARM'">AND d.type = #{param.alarmType}</if>
<if test="param.orgCode != null and param.orgCode != ''">AND d.org_code = #{param.orgCode}</if>
<if test="param.type != null and param.type != ''">AND d.type = #{param.type}</if>
<if test="param.handleStatus != null and param.handleStatus != '' and param.handleStatus == 1">AND d.handleStatus = '已处理' </if>
<if test="param.handleStatus != null and param.handleStatus != '' and param.handleStatus == 2">AND d.handleStatus = '未处理' </if>
<if test="param.system != null and param.system != ''">
AND find_in_set(#{param.system},d.systemId)
</if>
<if test="param.buildIds!=null">
AND d.buildId IN
<foreach item="item" collection="param.buildIds" separator=","
open="(" close=")" index=""> #{item}
</foreach>
</if>
</where>
ORDER BY d.createDate DESC
</select>
<select id="count" resultType="java.lang.Integer">
SELECT
count(1) AS total_num
FROM
(
SELECT
wlesa.id,
wlesa.equipment_specific_id AS fireEquipmentId,
wles.code AS fireEquipmentCode,
wlesa.equipment_index_id AS fireEquipmentIndexId,
wlesa.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesa.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
wlesa.type AS type,
wlesa.create_date AS createDate,
CONCAT_WS(' ',wws.full_name,wlsd.description) AS warehouseStructureName
FROM wl_equipment_specific_alarm_log wlesa
left join wl_equipment_specific wles ON wlesa.equipment_specific_id = wles.id
left join wl_stock_detail wlsd ON wlsd.equipment_specific_id=wles.id
left join wl_warehouse_structure wws ON wlsd.warehouse_structure_id = wws.id
) d
<where>
<if test="warehouseStructureName != null and warehouseStructureName != ''">and d.warehouseStructureName like
concat(concat("%",#{warehouseStructureName}),"%")
</if>
<if test="equipCode != null and equipCode != ''">AND d.fireEquipmentCode like
concat(concat("%",#{equipCode}),"%")
</if>
<if test="beginDate!=null">AND d.createDate >= #{beginDate}</if>
<if test="endDate!=null">AND d.createDate <![CDATA[<=]]> #{endDate}</if>
<if test="alarmType == 'BREAKDOWN'">AND d.type = #{alarmType}</if>
<if test="alarmType == 'FIREALARM'">AND d.type = #{alarmType}</if>
</where>
</select>
<select id="pageAlarmsInfo" resultType="java.util.HashMap">
SELECT
d.*
FROM
(
SELECT
wlesal.id AS alarmId,
wlesal.org_code,
wlesal.equipment_specific_id AS fireEquipmentId,
wlesal.equipment_detail_id AS equipDetailId,
wlesal.equipment_specific_code AS fireEquipmentCode,
wlesal.equipment_specific_name AS fireEquipmentName,
concat(
wlesal.equipment_specific_name,
wlesal.equipment_specific_index_name
) AS alamContent,
IF (
wlesal.confirm_type <![CDATA[<>]]> '',
'已处理',
'去确认'
) handleStatus,
wlesal.confirm_type AS handleType,
wlesal.system_codes AS systemCodes,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
we.img AS imgUrl,
CASE wlesal.equipment_specific_index_value
WHEN 'true' THEN
'是'
WHEN 'false' THEN
'否'
ELSE
wlesal.equipment_specific_index_value
END AS fireEquipmentPointValue,
wlesa.frequency AS frequency,
wlesa.status AS status,
wlesal.type AS type,
wlesal.create_date AS createDate,
wlesal.build_id AS buildId,
wlesa.recovery_date AS recoveryDate,
wlesal.location AS warehouseStructureName,
(
SELECT
group_concat(fet.`name`)
FROM
f_equipment_fire_equipment AS fefe
LEFT JOIN f_equipment AS fet ON fet.id = fefe.equipment_id
WHERE
fefe.fire_equipment_id = wlesal.equipment_specific_id
) AS equipmentName
FROM
wl_equipment_specific_alarm_log wlesal
LEFT JOIN wl_equipment we ON wlesal.equipment_code = we.code
LEFT JOIN wl_equipment_specific_alarm wlesa ON wlesa.id = wlesal.equipment_specific_alarm_id) d
WHERE 1=1
AND d.fireEquipmentName IS NOT NULL
<if test="param.warehouseStructureName != null and param.warehouseStructureName != ''">and d.warehouseStructureName like
concat(concat("%",#{param.warehouseStructureName}),"%")
</if>
<if test="param.equipCode != null and param.equipCode != ''">AND d.fireEquipmentCode like
concat(concat("%",#{param.equipCode}),"%")
</if>
<choose>
<when test="param.confirmType != null and param.confirmType != '' and param.confirmType == 1">
AND d.handleType <![CDATA[<>]]> ''
</when>
<when test="param.confirmType != null and param.confirmType != '' and param.confirmType == 0">
AND d.handleType IS NULL
</when>
</choose>
<if test="param.beginDate!=null">AND d.createDate <![CDATA[>=]]> #{param.beginDate}</if>
<if test="param.endDate!=null">AND d.createDate <![CDATA[<=]]> #{param.endDate}</if>
<if test="param.alarmType == 'BREAKDOWN' or param.alarmType == 'FIREALARM'">AND d.type = #{param.alarmType}</if>
<if test="param.systemCode != null and param.systemCode != ''">
AND find_in_set(#{param.systemCode},d.systemCodes)
</if>
<if test="param.buildId != null and param.buildId != ''">
and (d.buildId=#{param.buildId}
or find_in_set(d.fireEquipmentId,(SELECT s.point_in_scene FROM `wl_source_scene` s where s.source_id = #{param.buildId})))
</if>
ORDER BY d.createDate DESC
</select>
<select id="getAlarmList" resultType="java.util.HashMap">
SELECT
d.*
FROM
(
SELECT
wlesal.id AS id,
wlesal.equipment_specific_id AS fireEquipmentId,
wles.equipment_detail_id AS equipDetailId,
wles.`code` AS fireEquipmentCode,
IF (
wles.`code` IS NULL,
wlesal.equipment_specific_name,
concat(
wlesal.equipment_specific_name,
'(',
wles.`code`,
')'
)
) AS fireEquipmentName,
concat(
wlesal.equipment_specific_name,
wlesal.equipment_specific_index_name
) AS alarmContent,
IF (
wlesal.confirm_type IS NULL,
'未处理',
'已处理'
) handleStatus,
wlesal.confirm_type AS handleType,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
wlesal.resolve_result as resolveResult,
wlesal.confirm_date as confirmDate,
wlesal.alarm_reason as alarmReason,
CASE wlesal.equipment_specific_index_value
WHEN 'true' THEN
'是'
WHEN 'false' THEN
'否'
ELSE
wlesal.equipment_specific_index_value
END AS fireEquipmentPointValue,
wlesal.type AS type,
wlesal.create_date AS createDate,
wlesal.location AS warehouseStructureName,
(
SELECT
group_concat(fet.`name`)
FROM
f_equipment_fire_equipment AS fefe
LEFT JOIN f_equipment AS fet ON fet.id = fefe.equipment_id
WHERE
fefe.fire_equipment_id = wlesal.equipment_specific_id
) AS equipmentName
FROM
wl_equipment_specific_alarm_log wlesal
LEFT JOIN wl_equipment_specific wles ON wlesal.equipment_specific_id = wles.id
) d
<where>
<if test="warehouseStructureName != null and warehouseStructureName != ''">
and d.warehouseStructureName like
concat(concat("%",#{warehouseStructureName}),"%")
</if>
<if test="equipCode != null and equipCode != ''">AND d.fireEquipmentCode like
concat(concat("%",#{equipCode}),"%")
</if>
<if test="beginDate!=null">AND d.createDate >= #{beginDate}</if>
<if test="endDate!=null">AND d.createDate <![CDATA[<=]]> #{endDate}</if>
<if test="alarmType != null and alarmType != ''">AND d.type = #{alarmType}</if>
<if test="id != null and id != ''">AND d.id = #{id}</if>
</where>
ORDER BY d.createDate DESC
</select>
<select id="getAlarmDetail" resultType="java.util.HashMap">
SELECT
d.*
FROM
(
SELECT
wlesa.id,
wlesa.equipment_specific_id AS fireEquipmentId,
wles.equipment_detail_id AS equipDetailId,
wles.code AS fireEquipmentCode,
if(wles.code is null,wlesa.equipment_specific_name,concat(wlesa.equipment_specific_name,'(',wles.code,')')) as fireEquipmentName,
concat(wlesa.equipment_specific_name,wlesa.equipment_specific_index_name) as alamContent,
if(confirm_type is null,'去确认','已处理') handleStatus,
confirm_type as handleType,
wlesa.equipment_index_id AS fireEquipmentIndexId,
wlesa.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesa.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
we.img AS imgUrl,
CASE
wlesa.equipment_specific_index_value
WHEN 'true' THEN '是'
WHEN 'false' THEN '否'
ELSE wlesa.equipment_specific_index_value END
AS fireEquipmentPointValue,
wlesa.frequency AS frequency,
wlesa.status AS status,
wlesa.type AS type,
wlesa.create_date AS createDate,
wlesa.recovery_date AS recoveryDate,
CONCAT_WS(' ',ware.full_name,wlsd.description) AS warehouseStructureName,
(select
group_concat(fet.`name`)
from f_equipment_fire_equipment as fefe
left join f_equipment as fet on fet.id = fefe.equipment_id
where fefe.fire_equipment_id = wlesa.equipment_specific_id
) as equipmentName
FROM wl_equipment_specific_alarm wlesa
LEFT JOIN wl_equipment_specific wles ON wlesa.equipment_specific_id = wles.id
left join wl_stock_detail wlsd ON wlsd.equipment_specific_id=wles.id
left join wl_warehouse_structure as ware on wlsd.warehouse_structure_id = ware.id
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment we ON wled.equipment_id = we.id
) d
WHERE 1=1
AND d.fireEquipmentName IS NOT NULL
AND d.id = #{id}
AND d.type = #{alarmType}
ORDER BY d.createDate DESC
</select>
<select id="getEquipmentDetails" resultType="java.util.HashMap">
SELECT
d.*
FROM
(
SELECT
wlesa.id,
wlesa.equipment_specific_id AS equipmentSpecificId,
wles.equipment_detail_id AS equipDetailId,
wled.`name` AS fireEquipmentName,
we.img AS imgUrl,
wlesa.type AS type,
wled.brand AS brand,
wled.standard AS batchNum,
wles.qr_code AS qrCode,
(
SELECT
GROUP_CONCAT(ffs.name)
FROM
f_fire_fighting_system ffs
WHERE
find_in_set(ffs.id, wles.system_id)
) AS systemName,
CONCAT_WS(' ',ware.full_name,wlsd.description) AS warehouseStructureName
FROM
wl_equipment_specific_alarm wlesa
LEFT JOIN wl_equipment_specific wles ON wlesa.equipment_specific_id = wles.id
left join wl_stock_detail wlsd ON wlsd.equipment_specific_id=wles.id
left join wl_warehouse_structure as ware on wlsd.warehouse_structure_id = ware.id
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment we ON wled.equipment_id = we.id
) d
WHERE
1 = 1
AND d.fireEquipmentName IS NOT NULL
AND d.equipmentSpecificId = #{id}
AND d.type = #{alarmType}
</select>
<select id="getEquipmentAlarmCount" resultType="int">
SELECT
count(1)
FROM
(
SELECT
wlesa.id,
wlesa.type,
wled.name as fireEquipmentName,
wles.id as equipmentSpecificId
FROM
wl_equipment_specific_alarm wlesa
LEFT JOIN wl_equipment_specific wles ON wlesa.equipment_specific_id = wles.id
LEFT JOIN wl_stock_detail wlsd ON wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure wws ON wlsd.warehouse_structure_id = wws.id
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment we ON wled.equipment_id = we.id
) d
WHERE
d.fireEquipmentName <![CDATA[<>]]> ''
AND d.equipmentSpecificId = #{id}
AND d.type = #{alarmType}
</select>
<select id="findByTypeAndDate" resultMap="resultMapDto">
SELECT
d.id,
d.equipmentSpecificId,
d.fireEquipmentCode,
d.fireEquipmentName,
d.warehouseStructureName,
d.fireEquipmentSpecificIndexName,
d.createDate,
d.`status`,
d.type,
d.confirmType
FROM
(
SELECT
wlesa.id,
wles.id as equipmentSpecificId,
wlesa.equipment_specific_id AS fireEquipmentId,
wles.CODE AS fireEquipmentCode,
wled.`name` AS fireEquipmentName,
wlesa.equipment_index_id AS fireEquipmentIndexId,
wlesa.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesa.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
CASE
WHEN wlesa.confirm_type IS NULL THEN
0
ELSE 1
END AS confirmType,
CASE
wlesa.equipment_specific_index_value
WHEN 'true' THEN
'是'
WHEN 'false' THEN
'否' ELSE wlesa.equipment_specific_index_value
END AS fireEquipmentPointValue,
wlesa.frequency AS frequency,
wlesa.`status`,
wlesa.type AS type,
wlesa.create_date AS createDate,
CONCAT_WS(' ',wws.full_name,wlsd.description) AS warehouseStructureName,
(select
group_concat(fet.`name`)
from f_equipment_fire_equipment as fefe
left join f_equipment as fet on fet.id = fefe.equipment_id
where fefe.fire_equipment_id = wlesa.equipment_specific_id
) as equipmentName
FROM
wl_equipment_specific_alarm wlesa
LEFT JOIN wl_equipment_specific wles ON wlesa.equipment_specific_id = wles.id
LEFT JOIN wl_stock_detail wlsd ON wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure wws ON wlsd.warehouse_structure_id = wws.id
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
<where>
<if test="dto.status != null and dto.status != ''">
wlesa.`status`= #{dto.status}
</if>
<if test='dto.createDate != null and dto.createDate == "1"'>
AND wlesa.create_date LIKE CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d' ), '%' )
</if>
<if test='dto.createDate != null and dto.createDate == "7"'>
AND wlesa.create_date BETWEEN CONCAT( DATE_ADD( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), INTERVAL - 7 DAY ),
'00:00:00' )
AND CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), '%', '23:59:59' )
</if>
<if test='dto.createDate != null and dto.createDate == "30"'>
AND wlesa.create_date BETWEEN CONCAT( DATE_ADD( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), INTERVAL - 30 DAY ),
'00:00:00' )
AND CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), '%', '23:59:59' )
</if>
<if test="dto.createDate != null and dto.createDate.length() > 7">
AND wlesa.create_date LIKE CONCAT( #{dto.createDate}, '%' )
</if>
<if test="dto.isFirm == 'yes' ">
and wlesa.confirm_type is not null
</if>
<if test="dto.isFirm == 'no' ">
and wlesa.confirm_type is null
</if>
</where>
) d
<where>
d.fireEquipmentName IS NOT NULL
<choose>
<when test="dto.type != null and dto.type != ''">
AND d.type = #{dto.type}
</when>
<otherwise>
AND ( d.type = 'FIREALARM' OR d.type = 'BREAKDOWN' OR d.type = 'SHIELD' )
</otherwise>
</choose>
</where>
ORDER BY
d.createDate DESC
</select>
<select id="getFireEquipAlarmDetailsByAlarmId"
resultType="com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFireAlarm">
SELECT
sal.id,
es.id AS fireEquipmentId,
si.id AS equipmentMeasurementId,
ei.name_key AS fieldName,
ei.`name` AS fieldLabel,
si.`value`,
sa.frequency,
sa.`status`,
sa.type,
es.CODE AS fireEquipmentMRid,
NULL AS equipmentMeasurementMRid,
ed.`name` AS fireEquipmentName,
sa.recovery_date,
sal.create_date,
sal.update_date,
sal.alarm_reason AS description,
sal.equipment_specific_name AS `name`,
sal.equipment_specific_code AS mrid
FROM
wl_equipment_specific_alarm_log sal
LEFT JOIN wl_equipment_specific_alarm sa ON sal.equipment_specific_alarm_id = sa.id
LEFT JOIN wl_equipment_specific es ON sa.equipment_specific_id = es.id
LEFT JOIN wl_equipment_specific_index si ON es.id = si.equipment_specific_id
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment_index ei ON si.equipment_index_id = ei.id
<where>
<if test="list != null and list.size > 0">
sal.equipment_specific_alarm_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="indexIds != null and indexIds.size > 0">
AND si.equipment_index_id IN
<foreach collection="indexIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
<select id="findInfoByTypeAndDate" resultMap="resultMapDto">
SELECT
d.id,
d.equipmentSpecificId,
d.fireEquipmentCode,
d.fireEquipmentName,
d.warehouseStructureName,
d.fireEquipmentSpecificIndexName,
d.createDate,
d.`status`,
d.type,
d.confirmType
FROM
(
SELECT
wlesal.id,
wles.id as equipmentSpecificId,
wlesal.equipment_specific_id AS fireEquipmentId,
wles.CODE AS fireEquipmentCode,
wled.`name` AS fireEquipmentName,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
CASE
WHEN wlesal.confirm_type IS NULL THEN
0
ELSE 1
END AS confirmType,
CASE
wlesal.equipment_specific_index_value
WHEN 'true' THEN
'是'
WHEN 'false' THEN
'否' ELSE wlesal.equipment_specific_index_value
END AS fireEquipmentPointValue,
wlesa.frequency AS frequency,
wlesa.`status`,
wlesal.type AS type,
wlesal.create_date AS createDate,
CONCAT_WS(' ',wws.full_name,wlsd.description) AS warehouseStructureName,
(select
group_concat(fet.`name`)
from f_equipment_fire_equipment as fefe
left join f_equipment as fet on fet.id = fefe.equipment_id
where fefe.fire_equipment_id = wlesal.equipment_specific_id
) as equipmentName
FROM
wl_equipment_specific_alarm_log wlesal
LEFT JOIN wl_equipment_specific wles ON wlesal.equipment_specific_id = wles.id
LEFT JOIN wl_stock_detail wlsd ON wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure wws ON wlsd.warehouse_structure_id = wws.id
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment_specific_alarm wlesa ON wlesa.id = wlesal.equipment_specific_alarm_id
<where>
<if test="dto.status != null and dto.status != ''">
wlesa.`status`= #{dto.status}
</if>
<if test='dto.createDate != null and dto.createDate == "1"'>
AND wlesal.create_date LIKE CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d' ), '%' )
</if>
<if test='dto.createDate != null and dto.createDate == "7"'>
AND wlesal.create_date BETWEEN CONCAT( DATE_ADD( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), INTERVAL - 7 DAY ), '00:00:00' )
AND CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), '%', '23:59:59' )
</if>
<if test='dto.createDate != null and dto.createDate == "30"'>
AND wlesal.create_date BETWEEN CONCAT( DATE_ADD( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), INTERVAL - 30 DAY ), '00:00:00' )
AND CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), '%', '23:59:59' )
</if>
<if test="dto.createDate != null and dto.createDate.length() > 7">
AND wlesal.create_date LIKE CONCAT( #{dto.createDate}, '%' )
</if>
<if test="dto.isFirm == 'yes' ">
and wlesal.confirm_type is not null
</if>
<if test="dto.isFirm == 'no' ">
and wlesal.confirm_type is null
</if>
</where>
) d
<where>
d.fireEquipmentName IS NOT NULL
<choose>
<when test="dto.type != null and dto.type != ''">
AND d.type = #{dto.type}
</when>
<otherwise>
AND ( d.type = 'FIREALARM' OR d.type = 'BREAKDOWN' OR d.type = 'SHIELD' )
</otherwise>
</choose>
</where>
ORDER BY
d.createDate DESC
LIMIT 10
</select>
<select id="getProObject" resultType="java.util.HashMap">
select
fet.*
from f_equipment_fire_equipment as fefe
left join f_equipment as fet on fet.id = fefe.equipment_id
where fefe.fire_equipment_id = #{id}
</select>
<select id="getCountAlarm" resultType="java.util.HashMap">
select
count(wl_equipment_specific_alarm.id) num,
wl_equipment_specific_alarm.type
from wl_equipment_specific_alarm where wl_equipment_specific_alarm.`status`=1
GROUP BY wl_equipment_specific_alarm.type
</select>
<select id="getCountAlarmEquipment" resultType="int">
select
count(wl_equipment_specific_alarm.id) num
from wl_equipment_specific_alarm where wl_equipment_specific_alarm.`status`=1
</select>
<select id="getCountEquipment" resultType="int">
select sum(wl_stock.amount) num from wl_equipment_detail
LEFT JOIN (select DISTINCT wl_equipment_index.equipment_id from wl_equipment_index where wl_equipment_index.is_iot=1) b on b.equipment_id=wl_equipment_detail.equipment_id
LEFT JOIN wl_stock on wl_equipment_detail.id =wl_stock.equipment_detail_id
</select>
<select id="getAlarmPage" resultType="com.yeejoin.equipmanage.common.entity.dto.EquipSpecificAlarmDTO">
SELECT
d.id,
d.equipment_specific_alarm_id,
d.equipmentSpecificId,
d.fireEquipmentCode,
d.fireEquipmentName,
d.warehouseStructureName,
d.fireEquipmentSpecificIndexName,
d.createDate,
d.`status`,
(CASE WHEN d.type='FIREALARM' THEN '火警'
WHEN d.type ='BREAKDOWN' THEN '故障'
WHEN d.type='SHIELD' THEN '屏蔽'
WHEN d.type='NOTICE' THEN '预警'
ELSE '' END) AS type,
d.confirmUserName,
d.systemIds,
d.confirmType,
d.isFirm,
d.confirm_date,
d.alarm_reason,
d.resolve_result,
d.code
FROM
(
SELECT
wlesal.id,
wlesal.equipment_specific_alarm_id,
wles.id AS equipmentSpecificId,
wlesal.equipment_specific_id AS fireEquipmentId,
wles.CODE AS fireEquipmentCode,
wled.`name` AS fireEquipmentName,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
CASE
WHEN wlesal.confirm_type <![CDATA[<>]]> ''
THEN 'yes'
ELSE 'no'
END AS isFirm,
wlesal.confirm_type confirmType,
CASE
wlesal.equipment_specific_index_value
WHEN 'true' THEN
'是'
WHEN 'false' THEN
'否' ELSE wlesal.equipment_specific_index_value
END AS fireEquipmentPointValue,
wlesa.frequency AS frequency,
wlesa.`status`,
wlesal.type AS type,
wlesal.create_date AS createDate,
CONCAT_WS(' ',wws.full_name,wlsd.description) AS warehouseStructureName,
wlesal.confirm_user_name confirmUserName,
wlesal.system_ids systemIds,
(select
group_concat(fet.`name`)
from f_equipment_fire_equipment as fefe
left join f_equipment as fet on fet.id = fefe.equipment_id
where fefe.fire_equipment_id = wlesal.equipment_specific_id
) as equipmentName,
wlesal.confirm_date,
wlesal.alarm_reason,
wlesal.resolve_result,
wles.code
FROM
wl_equipment_specific_alarm_log wlesal
LEFT JOIN wl_equipment_specific wles ON wlesal.equipment_specific_id = wles.id
LEFT JOIN wl_stock_detail wlsd ON wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure wws ON wlsd.warehouse_structure_id = wws.id
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment_specific_alarm wlesa ON wlesa.id = wlesal.equipment_specific_alarm_id
<where>
<if test="dto.status != null and dto.status != ''">
wlesa.`status`= #{dto.status} <!--状态-->
</if>
<if test='dto.createDate != null and dto.createDate == "1"'>
AND to_days(now()) = to_days(wlesal.create_date) <!--今天-->
</if>
<if test='dto.createDate != null and dto.createDate == "2"'>
AND to_days(now()) - to_days(wlesal.create_date) = 1 <!--昨天-->
</if>
<if test='dto.createDate != null and dto.createDate == "3"'>
AND wlesal.create_date &gt;= subdate(curdate(),date_format(curdate(),'%w')-1) and wlesal.create_date &lt;= subdate(curdate(),date_format(curdate(),'%w')-7) <!--本周-->
</if>
<if test='dto.createDate != null and dto.createDate == "4"'>
AND wlesal.create_date &gt;= subdate(curdate(),date_format(curdate(),'%w')+6) and wlesal.create_date &lt;= subdate(curdate(),date_format(curdate(),'%w')-0)<!--上周-->
</if>
<if test='dto.createDate != null and dto.createDate == "5"'>
AND date_format(wlesa.create_date,'%y-%m')=date_format(curdate(),'%y-%m')<!--本月-->
</if>
<if test='dto.createDate != null and dto.createDate == "6"'>
AND date_format(wlesa.create_date,'%y-%m')=date_format(date_sub(curdate(), interval 1 month),'%y-%m') <!--上月-->
</if>
<if test='dto.startDate != null and dto.endDate != null '>
AND DATE_FORMAT(wlesa.create_date, '%Y-%m-%d ' ) between DATE_FORMAT(#{dto.startDate}, '%Y-%m-%d ' ) and DATE_FORMAT(#{dto.endDate}, '%Y-%m-%d ' )
</if>
<if test="dto.isFirm == 'yes'">
and wlesal.confirm_type <![CDATA[<>]]> ''
</if>
<if test="dto.isFirm == 'no'">
and wlesal.confirm_type is null
</if>
</where>
) d
<where>
d.fireEquipmentName IS NOT NULL
<choose>
<when test="dto.type != null and dto.type != ''">
AND d.type = #{dto.type}
</when>
<otherwise>
AND ( d.type = 'FIREALARM' OR d.type = 'BREAKDOWN' OR d.type = 'SHIELD' OR d.type = 'NOTICE' )
</otherwise>
</choose>
<if test='dto.fireEquipmentName != null '>
AND d.fireEquipmentName LIKE CONCAT('%', #{dto.fireEquipmentName}, '%' )
</if>
<if test='dto.systemIds != null '>
AND d.systemIds in (#{dto.systemIds})
</if>
<if test='dto.confirmUserName != null '>
AND d.confirmUserName LIKE CONCAT('%', #{dto.confirmUserName}, '%' )
</if>
<if test="dto.code != null">
and d.code like CONCAT('%', #{dto.code}, '%' )
</if>
</where>
ORDER BY
d.createDate DESC
</select>
<select id="getEqPage" resultType="com.yeejoin.equipmanage.common.entity.dto.EquipSpecificAlarmDTO">
select * from (
select
b.address warehouseStructureName,
b.eqname fireEquipmentName,
b.qrcode fireEquipmentCode,
b.eqimg eqimg,
IFNULL(( select DISTINCT wl_equipment_specific_alarm.`status` from wl_equipment_specific_alarm where wl_equipment_specific_alarm.`status`=1 and wl_equipment_specific_alarm.equipment_detail_id=b.eqid ), 0) `status`
from
(select
wl_warehouse_structure.full_name address,
wl_equipment_detail.name eqname,
wl_stock_detail.qr_code qrcode,
wl_equipment_detail.img eqimg,
wl_equipment_detail.id eqid,
wl_equipment_specific.system_id
from wl_equipment_detail
LEFT JOIN wl_equipment_specific ON wl_equipment_specific.equipment_detail_id = wl_equipment_detail.id
LEFT JOIN (select DISTINCT wl_equipment_index.equipment_id from wl_equipment_index where wl_equipment_index.is_iot=1) b on b.equipment_id=wl_equipment_detail.equipment_id
LEFT JOIN wl_stock_detail on wl_equipment_detail.id =wl_stock_detail.equipment_detail_id
LEFT JOIN wl_warehouse_structure on wl_stock_detail.warehouse_structure_id = wl_warehouse_structure.id
)b
)m
<where>
<if test="dto.status != null and dto.status != ''">
AND `status`= #{dto.status}
</if>
<if test="dto.warehouseStructureName != null and dto.warehouseStructureName != ''">
AND warehouseStructureName LIKE CONCAT('%', #{dto.warehouseStructureName}, '%' )
</if>
<if test="dto.fireEquipmentCode != null and dto.fireEquipmentCode!= ''">
AND fireEquipmentCode LIKE CONCAT('%', #{dto.fireEquipmentCode}, '%' )
</if>
<if test="dto.fireEquipmentName != null and dto.fireEquipmentName!= ''">
AND fireEquipmentName LIKE CONCAT('%', #{dto.fireEquipmentName}, '%' )
</if>
<if test="dto.systemIds != null and dto.systemIds!= ''">
AND systemIds in (#{dto.systemIds})
</if>
</where>
ORDER BY status DESC
</select>
<select id="getbyqrCode" resultType="com.yeejoin.equipmanage.common.entity.dto.EquipSpecificAlarmDTO">
SELECT
(
CASE
WHEN d.type = 'FIREALARM' THEN
'火警'
WHEN d.type = 'BREAKDOWN' THEN
'故障'
WHEN d.type = 'SHIELD' THEN
'屏蔽'
WHEN d.type = 'NOTICE' THEN
'预警' ELSE ''
END
) AS type,
( CASE WHEN d.update_date = NULL THEN d.create_date ELSE d.update_date END ) AS createDate
FROM
wl_equipment_specific_alarm d LEFT JOIN wl_equipment_specific on wl_equipment_specific.id=d.equipment_specific_id
where wl_equipment_specific.qr_code=#{code}
ORDER BY d.create_date ,d.update_date LIMIT 1
</select>
<select id="getcountAlarmtype" resultType="int">
select
count(wl_equipment_specific_alarm.id) num
from wl_equipment_specific_alarm where wl_equipment_specific_alarm.`status`=1
<if test="tyep != null and tyep!= ''">
AND wl_equipment_specific_alarm.type = #{tyep}
</if>
</select>
<select id="getcountAlarmHandle" resultType="int">
select
count(wl_equipment_specific_alarm.id) num
from wl_equipment_specific_alarm where wl_equipment_specific_alarm.`status`=1
<if test="tyep == 'yes'">
and wl_equipment_specific_alarm.confirm_type <![CDATA[<>]]> '' AND wl_equipment_specific_alarm.confirm_type IS NOT NULL
</if>
<if test="tyep == 'no'">
and wl_equipment_specific_alarm.confirm_type is null
</if>
</select>
</mapper>
\ 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.equipmanage.mapper.EquipmentSpecificIndexMapper">
<resultMap id="EquipmentDetail" type="com.yeejoin.equipmanage.common.entity.vo.EquipmentSecificDetailVO">
<result property="qrCode" column="qr_code"></result>
<result property="code" column="CODE"></result>
<result property="systemName" column="System_name"></result>
<result property="categoryName" column="category_name"></result>
<result property="warehouseName" column="warehouse_name"></result>
<result property="standard" column="standard"></result>
<result property="country" column="country"></result>
<result property="remark" column="remark"></result>
<result property="maintenanceCycle" column="maintenance_cycle"></result>
<result property="isImport" column="is_import"></result>
<result property="brand" column="brand"></result>
<result property="unitName" column="unit_name"></result>
<result property="manufacturerName" column="manufacturer_name"></result>
<result property="serviceTel" column="service_tel"></result>
<result property="salesTel" column="sales_tel"></result>
<result property="address" column="address"></result>
<result property="equipmentName" column="equipment_name"></result>
<result property="status" column="status"></result>
<result property="img" column="img"></result>
<result property="equipId" column="equip_id"></result>
<result property="equipDetailId" column="equip_detail_id"></result>
</resultMap>
<update id="updateIndexValueBatch">
<foreach collection="list" item="item" index="index" separator=";">
update wl_equipment_specific_index set
value = #{item.value}
where equipment_specific_id = #{item.equipmentSpecificId}
and equipment_index_id = #{item.equipmentIndexId}
</foreach>
</update>
<select id="getEquipmentSpeIndexBySpeIotCode"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT
wesi.id AS id,
wei.name_key AS nameKey,
wesi.value AS value,
wesi.equipment_specific_id AS equipmentSpecificId,
wesi.equipment_index_id AS equipmentIndexId,
wesi.equipment_index_name AS equipmentIndexName,
wesi.value_label AS valueLabel,
wei.type_code AS typeCode,
wei.type_name AS typeName,
wei.name AS indexName,
wei.unit AS indexUnitName,
wes.org_code AS orgCode,
ed.`name` AS equipmentSpecificName,
wes.iot_code AS iotCode,
wei.`name` AS equipmentSpecificIndexName,
wei.`value_enum` AS valueEnum,
wes.qr_code AS qrCode,
wesi.update_date AS updateDate,
ed.code AS equipmentCode,
ed.equipment_id AS equipmentId,
ed.id AS equipmentDetailId
FROM
wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_detail ed ON ed.id = wes.equipment_detail_id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
WHERE
wes.iot_code = #{iotCode}
</select>
<select id="getEquipmentSpeIndexByIotCode"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT
wesi.id AS id,
wei.name_key AS nameKey,
wesi.value AS value,
wesi.equipment_specific_id AS equipmentSpecificId,
wesi.equipment_index_id AS equipmentIndexId,
wes.org_code AS code,
wes.iot_code AS iotCode,
wes.org_code AS orgCode,
wei.type_code AS typeCode,
wei.name AS indexName,
wei.unit AS indexUnitName
FROM
wl_equipment_specific_index AS wesi
LEFT JOIN wl_equipment_specific AS wes ON wes.id = wesi.equipment_specific_id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
WHERE
wes.iot_code = #{iotCode}
</select>
<select id="getEquipmentSpeIndexByEquipmentSecificId"
resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT
wesi.id,
wesi.equipment_specific_id,
wesi.VALUE,
wesi.create_date,
wesi.equipment_index_id,
wli.`name` nameKey
FROM
wl_equipment_specific_index wesi
LEFT JOIN wl_equipment_index wli ON wesi.equipment_index_id = wli.id
where wesi.equipment_specific_id=#{id}
</select>
<select id="getVideoByEquipmentSecificId" resultType="com.yeejoin.equipmanage.common.entity.Video">
SELECT
ip,
`port`,
url,
`name`,
token,
`code`,
preset_position
FROM
wl_video wlv
LEFT JOIN wl_video_equipment_specific wlves ON wlv.id = wlves.video_id
WHERE
wlves.equipment_specific_id = #{id}
</select>
<select id="getEquipmentDetailBySecificId" resultMap="EquipmentDetail">
SELECT
wled.NAME equipment_name,
wle.id equip_id,
wled.id equip_detail_id,
wles.qr_code,
wles. CODE,
(
select
GROUP_CONCAT(fs.name)
from
f_fire_fighting_system fs
where
FIND_IN_SET(fs.id,wles.system_id)
) as System_name,
wlec. NAME category_name,
wlws.full_name warehouse_name,
wled.standard,
sd.`name` country,
wled.remark,
wled.maintenance_cycle,
wled.is_import,
wled.brand,
wlun.`name` unit_name,
wlmi.`name` manufacturer_name,
wlmi.service_tel,
wlmi.sales_tel,
wlmi.address,
wlmi.img,
wleias.`value` STATUS
FROM
wl_equipment_specific wles
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_system_dic sd ON sd.id = wled.country
LEFT JOIN wl_equipment wle ON wled.equipment_id = wle.id
LEFT JOIN wl_equipment_category wlec ON wle.category_id = wlec.id
LEFT JOIN wl_stock_detail wlsd ON wlsd.qr_code = wles.qr_code
LEFT JOIN wl_warehouse_structure wlws ON wlsd.warehouse_structure_id = wlws.id
LEFT JOIN wl_unit wlun ON wle.unit_id = wlun.id
LEFT JOIN wl_manufacturer_info wlmi ON wlmi.id = wled.manufacturer_id
LEFT JOIN (
SELECT
wlei.equipment_id,
wlesi.`value`
FROM
wl_equipment_index wlei
LEFT JOIN wl_equipment_specific_index wlesi ON wlei.id = wlesi.equipment_index_id
WHERE
wlei.name_key = 'runState'
) wleias ON wle.id = wleias.equipment_id
WHERE wles.id=#{id}
</select>
<select id="selectEquProperty" resultType="java.util.HashMap">
SELECT
wlei. NAME,
wlesi.`value`
FROM
wl_equipment_specific_index wlesi
LEFT JOIN wl_equipment_specific wleqs ON wleqs.id = wlesi.equipment_specific_id
LEFT JOIN wl_equipment_index wlei ON wlesi.equipment_index_id = wlei.id
where wleqs.id=#{id}
</select>
<select id="selectEquList" resultType="java.util.HashMap">
SELECT
de.id,
de.name,
a.image,
de.standard,
(case wsd.`status`
when '1' then '在位'
when '2' then '执勤'
when '3' then '维修'
when '6' then '退役'
when '7' then '报废'
when '10' then '车载'
when '11' then '损耗'
else '未入库' END) statusName,
(case LEFT(ca.`code`,1)
when '4' then '04#'
else '01#' END) typen,
IFNULL(wsd.amount,0)amount,
info.name manufacturerName,
dic.name country,
wesp.qr_code qrcode
FROM
wl_equipment_specific wesp
LEFT JOIN wl_equipment_detail de on wesp.equipment_detail_id=de.id
LEFT JOIN wl_manufacturer_info info on de.manufacturer_id=info.id
LEFT JOIN wl_system_dic dic on dic.id=de.country
LEFT JOIN wl_equipment ca on ca.id=de.equipment_id
LEFT JOIN (SELECT object_id,
(CASE `file_type` WHEN 'image' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'image',
(CASE `file_type` WHEN 'video' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'video',
(CASE `file_type` WHEN 'instruction' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'instruction',
(CASE `file_type` WHEN 'certificate' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'certificate',
(CASE `file_type` WHEN 'face' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'face'
FROM wl_upload_file
GROUP BY object_id) a on a.object_id=de.id
LEFT JOIN wl_stock_detail wsd ON wsd.qr_code = wesp.qr_code
<if test="name!= null and name!=''">
AND de.name like CONCAT('%',#{name},'%')
</if>
<if test="standard!= null and standard!='' ">
AND de.standard like CONCAT('%',#{standard},'%')
</if>
<if test="manufacturerName != null and manufacturerName!='' ">
AND info.name like CONCAT('%',#{manufacturerName},'%')
</if>
LIMIT #{pageNum},#{pageSize}
</select>
<select id="selectEquListcount" resultType="java.util.HashMap">
SELECT
de.name
FROM
wl_equipment_specific wesp
LEFT JOIN wl_equipment_detail de on wesp.equipment_detail_id=de.id
LEFT JOIN wl_manufacturer_info info on de.manufacturer_id=info.id
LEFT JOIN wl_system_dic dic on dic.id=de.country
LEFT JOIN wl_equipment ca on ca.id=de.equipment_id
LEFT JOIN (SELECT object_id,
(CASE `file_type` WHEN 'image' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'image',
(CASE `file_type` WHEN 'video' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'video',
(CASE `file_type` WHEN 'instruction' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'instruction',
(CASE `file_type` WHEN 'certificate' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'certificate',
(CASE `file_type` WHEN 'face' THEN GROUP_CONCAT(url SEPARATOR ',') ELSE '' END) as 'face'
FROM wl_upload_file
GROUP BY object_id) a on a.object_id=de.id
LEFT JOIN wl_stock_detail wsd ON wsd.qr_code = wesp.qr_code
LEFT JOIN wl_warehouse wwa ON wsd.warehouse_id = wwa.id
LEFT JOIN wl_warehouse_structure wws ON wsd.warehouse_structure_id = wws.id
LEFT JOIN wl_warehouse_structure wws1 ON wws.parent_id = wws1.id
<if test="name!= null and name!='' ">
AND de.name like CONCAT('%',#{name},'%')
</if>
<if test="standard!= null and standard!='' ">
AND de.standard like CONCAT('%',#{standard},'%')
</if>
<if test="manufacturerName != null and manufacturerName!='' ">
AND info.name like CONCAT('%',#{manufacturerName},'%')
</if>
</select>
<select id="getEquipmentSpeIndexList" resultType="hashmap">
SELECT
wles.equipment_specific_id AS speId,
wles.`value` AS speIndexValue,
wlei.type_name AS typeName,
wlei.type_code AS typeCode,
wlei.name_key AS nameKey,
wlei.`name` as indexName
FROM
wl_equipment_specific_index wles
JOIN wl_equipment_index wlei ON wlei.id = wles.equipment_index_id
WHERE
wlei.is_iot = 1
AND (
wlei.type_code IN ( 'BREAKDOWN', 'SHIELD' ))
AND (wles.`value` IS NOT NULL AND LENGTH(TRIM(wles.`value`)) > 1 )
</select>
<select id="getEquipSpecificIndexList" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO">
SELECT
si.equipment_specific_id AS equipmentId,
ei.id,
ei.name_key,
ei.`name` AS perfQuotaName,
si.`value`,
ei.is_iot,
ei.unit AS unitName,
ei.sort_num,
si.create_date,
si.update_date
FROM
wl_equipment_specific_index si
LEFT JOIN wl_equipment_index ei ON si.equipment_index_id = ei.id
<where>
<if test="equipmentId != null and equipmentId !=''">
si.equipment_specific_id = #{equipmentId}
</if>
<if test="isIot != null and isIot !=''">
AND ei.is_iot = #{isIot}
</if>
</where>
</select>
<select id="getEquipIndexBySpecificIdIn" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO">
SELECT
si.id,
si.equipment_specific_id AS equipmentId,
ei.name_key,
ei.`name` AS perfQuotaName,
si.`value`,
ei.is_iot,
ei.unit AS unitName,
ei.sort_num,
si.create_date,
si.update_date,
ei.type_code AS typeCode,
ei.type_name AS typeName,
es.`code` AS indexId
FROM
wl_equipment_specific_index si
LEFT JOIN wl_equipment_index ei ON si.equipment_index_id = ei.id
LEFT JOIN wl_equipment_specific es ON si.equipment_specific_id = es.id
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
<where>
<if test="list != null and list.size > 0 and type = 'id'">
si.equipment_specific_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
<select id="getEquipIndexByIndexId" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO">
SELECT
si.id,
si.equipment_specific_id AS equipmentId,
IFNULL(si.value_label, si.`value`) AS 'value',
si.create_date,
si.update_date
FROM
wl_equipment_specific_index si
<where>
<if test="id != null">
si.equipment_index_id = #{id}
</if>
<if test="equipmentSpecificId!= null">
AND si.equipment_specific_id = #{equipmentSpecificId}
</if>
</where>
</select>
<select id="getEquipIndexByIdIn" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentIndexVO">
SELECT
si.equipment_specific_id AS equipmentId,
si.id,
ei.name_key,
ei.`name` AS perfQuotaName,
si.`value`,
ei.is_iot,
ei.unit AS unitName,
ei.sort_num,
si.create_date,
si.update_date,
ei.type_code AS typeCode,
ei.type_name AS typeName,
es.`code` AS indexId
FROM
wl_equipment_specific_index si
LEFT JOIN wl_equipment_index ei ON si.equipment_index_id = ei.id
LEFT JOIN wl_equipment_specific es ON si.equipment_specific_id = es.id
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
<where>
<if test="list != null and list.size > 0 and type = 'id'">
si.id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>
\ 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.equipmanage.mapper.EquipmentSpecificMapper">
<resultMap id="ComplementCode" type="com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO">
<result property="id" column="id"></result>
<result property="qrcode" column="qrcode"></result>
<result property="iotCode" column="iot_code"></result>
<result property="systemId" column="system_id"></result>
<result property="single" column="single"></result>
<result property="equipmentDetailId" column="equipment_detail_id"></result>
<result property="warehouseStructureId" column="warehouse_structure_id"></result>
<result property="status" column="status"></result>
<result property="location" column="location"></result>
<result property="stockId" column="stock_id"></result>
<result property="stockDetailId" column="stock_detail_id"></result>
<result property="code" column="code"></result>
<result property="systemName" column="system_name"></result>
</resultMap>
<resultMap type="com.yeejoin.equipmanage.common.entity.vo.PageSecurityVideoVO" id="menuTree">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="name" property="name"/>
<result column="full_name" property="fullName"/>
<collection property="children" ofType="com.yeejoin.equipmanage.common.entity.vo.PageSecurityVideoVO"
column="id" select="getMenuChildren"/>
</resultMap>
<select id="getEquipmentSpe" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo">
select * from
(select
spe.id ,
det.name,
spe.iot_code as code,
(SELECT
GROUP_CONCAT(d.name)
FROM
f_fire_fighting_system d
WHERE
find_in_set(d.id, spe.system_id)) as systemName
from
wl_equipment_specific as spe
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
where equipment_detail_id
in (select id from wl_equipment_detail where equipment_id in
<foreach item="item" collection="ids" separator="," open="(" close=")" index="">
#{item, jdbcType=NUMERIC}
</foreach>
)
) data
where 1=1
<if test="name != null ">
AND name like CONCAT('%',#{name},'%')
</if>
<if test="code != null ">
AND code like CONCAT('%',#{code},'%')
</if>
limit #{sPage},#{size}
</select>
<select id="getEquipmentSpeCount" resultType="int">
select COUNT(1) from
(select
spe.id ,
det.name,
spe.iot_code as code
from
wl_equipment_specific as spe
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
where equipment_detail_id
in (select id from wl_equipment_detail where equipment_id in
<foreach item="item" collection="ids" separator="," open="(" close=")" index="">
#{item, jdbcType=NUMERIC}
</foreach>
)
) data
where 1=1
<if test="name != null ">
AND name like CONCAT('%',#{name},'%')
</if>
<if test="code != null ">
AND code like CONCAT('%',#{code},'%')
</if>
</select>
<select id="selectEquipmentSpecific" resultMap="ComplementCode">
SELECT
wesp.id id,
wesp.code,
wesp.qr_code qrcode,
wesp.iot_code,
wesp.system_id,
wesp.single,
wesp.equipment_detail_id,
wsd.`status`,
wsd.warehouse_structure_id,
wsd.id stock_detail_id,
wsd.stock_id,
(SELECT GROUP_CONCAT(fem.name) FROM `f_fire_fighting_system` fem WHERE find_in_set(fem.id,wesp.system_id)) as
system_name,
wws.full_name location
FROM
wl_equipment_specific wesp
LEFT JOIN wl_stock_detail wsd ON wsd.equipment_specific_id = wesp.id
LEFT JOIN wl_warehouse_structure wws ON wsd.warehouse_structure_id = wws.id
WHERE
wesp.equipment_detail_id = #{equipmentSpecificDTO.equipmentDetailId}
<if test="equipmentSpecificDTO.status != null and equipmentSpecificDTO.status.size()>0">
and wsd.`status` in
<foreach collection="equipmentSpecificDTO.status" item="status" index="index" open="(" close=")"
separator=",">
#{status}
</foreach>
</if>
<if test="equipmentSpecificDTO.qrcode != null and equipmentSpecificDTO.qrcode!=''">
and wesp.qr_code like CONCAT('%',#{equipmentSpecificDTO.qrcode},'%' )
</if>
order by wesp.create_date desc
</select>
<select id="getEquipmentSpecificIotCode" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo">
SELECT
DISTINCT
wes.iot_code AS iotCode
FROM
wl_equipment_specific AS wes
LEFT JOIN wl_equipment_specific_index AS wesi ON wesi.equipment_specific_id = wes.id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
WHERE TRIM(wes.iot_code) != '' AND wes.iot_code IS NOT NULL AND wei.is_iot=1
UNION ALL
SELECT
DISTINCT
wc.iot_code AS iotCode
FROM
wl_car AS wc
LEFT JOIN wl_car_property AS wcp ON wcp.car_id = wc.id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wcp.equipment_index_id
WHERE TRIM(wc.iot_code) != '' AND wc.iot_code IS NOT NULL AND wei.is_iot=1
</select>
<select id="getEquipIotCodeLists" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo">
SELECT
DISTINCT
wes.iot_code AS iotCode
FROM
wl_equipment_specific AS wes
LEFT JOIN wl_equipment_specific_index AS wesi ON wesi.equipment_specific_id = wes.id
LEFT JOIN wl_equipment_index AS wei ON wei.id = wesi.equipment_index_id
WHERE TRIM(wes.iot_code) != '' AND wes.iot_code IS NOT NULL AND wei.is_iot=1
</select>
<select id="getEquipOrCarByIotCode" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo">
SELECT
temp.*
FROM
(
SELECT
wes.id,
wes.iot_code AS iotCode,
'equip' AS type,
(SELECT GROUP_CONCAT(fs.system_type_code) FROM f_fire_fighting_system fs WHERE find_in_set(
`fs`.`id`,
`wes`.`system_id`
)) AS `code`
FROM
wl_equipment_specific AS wes
where TRIM(wes.iot_code) != '' AND wes.iot_code IS NOT NULL
UNION ALL
SELECT
wc.id,
wc.iot_code AS iotCode,
'car' AS type,
wc.car_num AS `code`
FROM
wl_car wc
where TRIM(wc.iot_code) != '' AND wc.iot_code IS NOT NULL
) temp
<where>
<if test="iotCode!='' and iotCode !=null">
temp.iotCode = #{iotCode}
</if>
</where>
</select>
<select id="getPointData" resultType="com.yeejoin.equipmanage.common.entity.vo.PointTreeVo">
select
'component' as template,
true as openStatus,
spe.is_binding as isBinding,
if(spe.code is null,eqdet.name,concat(eqdet.name,'(',spe.code,')')) as displayName,
'{\"width\": 42, \"height\": 42}'as initStyle,
'CommonEquip' as componentName,
spe.id as sequenceNbr,
'equipment' as componentKey,
equ.img as imgPath,
spe.qr_code as equipCode,
stru.source_id as parentId,
cat.id as equipId,
cat.name as equipName,
spe.system_id as equipSyetemId,
spe.iot_code as iotCode,
equ.id as groupId,
equ.name as groupName
from wl_stock_detail as det
left join wl_warehouse_structure as stru on det.warehouse_structure_id = stru.id
left join wl_equipment_specific as spe on det.qr_code = spe.qr_code
left join wl_equipment_detail as eqdet on det.equipment_detail_id = eqdet.id
left join wl_equipment as equ on eqdet.equipment_id = equ.id
left join wl_equipment_category as cat on equ.category_id = cat.id
where det.amount > 0
and spe.single = true
and stru.source_id is not null
</select>
<select id="getSystemEquList" resultType="com.yeejoin.equipmanage.common.entity.vo.PointTreeVo">
select
catt.id as equipId,
catt.name as displayName
from
wl_equipment_specific as spe
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
left join wl_equipment as equ on det.equipment_id = equ.id
left join wl_equipment_category as catt on equ.category_id = catt.id
where
spe.org_code = #{orgCode}
and find_in_set(#{id},spe.system_id)
group by catt.id
order by catt.code
</select>
<select id="getFirstCanvas" resultType="string">
select
sce.scene_id
from
f_risk_source as sou
left join wl_risk_source_scene as sce on sou.id = sce.risk_source_id
where
sou.parent_id = 0
and sce.org_code = #{orgCode}
</select>
<select id="getSceneName" resultType="string">
select
name
from
f_risk_source
where id = #{id}
</select>
<select id="getSystemmeanLsit" resultType="com.yeejoin.equipmanage.common.entity.vo.PointTreeVo">
select
id as sequenceNbr,
NAME as displayName,
SORT as sort,
SCENE_ID as sceneId
from
f_fire_fighting_system
order by SORT
</select>
<select id="getSceList" resultType="com.yeejoin.equipmanage.common.entity.vo.PointTreeVo">
select scene_id as sceneId from wl_risk_source_scene
where org_code =#{orgCode}
</select>
<select id="getEquipMentStatus" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
select
ind.type_code as type,
spein.value as value
from wl_equipment_specific as spe
left join wl_equipment_specific_index as spein on spe.id = spein.equipment_specific_id
left join wl_equipment_index as ind on spein.equipment_index_id = ind.id
where spe.qr_code =#{id}
AND spe.iot_code is not null
AND spe.iot_code != ''
AND ind.type_code !='' AND ind.type_code is not null
AND value is not null
ORDER BY spein.update_date DESC
</select>
<select id="getEquipIndexLatestStatus" resultType="com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex">
SELECT
equipindex.`value`,
ei.type_code AS 'typeCode',
es.qr_code AS 'qrCode'
FROM
(
SELECT
esi.equipment_index_id,
esi.equipment_specific_id,
esi.`value`
FROM
wl_equipment_specific_index esi,
(
SELECT
equipment_specific_id,
MAX(update_date) AS update_date
FROM
wl_equipment_specific_index
GROUP BY
equipment_specific_id
) esii
WHERE
esi.`value` IS NOT NULL
AND esi.equipment_specific_id = esii.equipment_specific_id
AND esi.update_date = esii.update_date
GROUP BY
esi.equipment_specific_id
) equipindex,
wl_equipment_specific es,
wl_equipment_index ei
WHERE
equipindex.equipment_specific_id = es.id
AND equipindex.equipment_index_id = ei.id
</select>
<select id="getEquipmentIotCodeLists" resultType="String">
SELECT
iot_code
FROM
wl_equipment_specific
where iot_code is not null
</select>
<select id="getEquipBySourceId" resultType="java.util.HashMap">
SELECT
Cast( spec.id as char) as equipmentId,
spec.name AS name,
structure.source_id AS sourceId,
structure.source_code AS sourceCode,
spec.system_id AS systemId,
spec.code AS code,
spec.id AS id,
category.NAME AS categoryName,
category.CODE AS categoryCode,
equipment_detail.area AS address,
CONCAT(area.prevName,'-',structure.NAME) AS acre,
we.inspection_spec as inspectionSpecId,
0 as orderNo
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail equipment_detail ON equipment_detail.id = spec.equipment_detail_id
LEFT JOIN (
SELECT
DISTINCT equipment_specific_id
, warehouse_structure_id
FROM
wl_stock_detail
) AS detail ON detail.equipment_specific_id = spec.id
LEFT JOIN wl_warehouse_structure structure ON detail.warehouse_structure_id = structure.id
LEFT JOIN (
SELECT
s.id,
s.name AS prevName
FROM
wl_warehouse_structure s
) AS area ON area.id = structure.parent_id
LEFT JOIN wl_equipment we ON we.id = equipment_detail.equipment_id
LEFT JOIN wl_equipment_category category ON category.id = we.category_id
WHERE 1=1
<if test="sourceIds != null">and structure.id IN
<foreach collection="sourceIds" item="sourceIds" index="index" open="(" close=")" separator=",">
#{sourceIds}
</foreach>
</if>
<if test="categoryId != null and categoryId.size() > 0">
and category.id in
<foreach collection="categoryId" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test="equipCode != '' and equipCode != null">and spec.code like concat("%", #{equipCode}, "%")</if>
<if test="equipName != '' and equipName != null">
and equipment_detail.name like CONCAT("%", #{equipName},'%')
</if>
</select>
<select id="findAllParents" resultMap="menuTree">
SELECT
wws.id AS id,
wws.parent_id AS parentId,
wws.name AS name,
wws.full_name AS fullName
FROM
wl_warehouse_structure wws
WHERE
wws.parent_id = 0
</select>
<select id="getMenuChildren" resultMap="menuTree">
SELECT
wws.id AS id,
wws.parent_id AS parentId,
wws.name AS name,
wws.full_name AS fullName
FROM
wl_warehouse_structure wws
WHERE
wws.parent_id = #{id}
</select>
<select id="getEquipsBySourceId" resultType="java.util.HashMap">
SELECT
Cast( spec.id as char) as equipmentId,
we.name AS name,
structure.source_id AS sourceId,
structure.source_code AS sourceCode,
spec.system_id AS systemId,
spec.code AS code,
category.id AS id,
category.NAME AS categoryName,
category.CODE AS categoryCode,
structure.full_name AS address,
structure.NAME AS acre,
we.inspection_spec as inspectionSpecId,
0 as orderNo
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail equipment_detail ON equipment_detail.id = spec.equipment_detail_id
LEFT JOIN wl_stock_detail detail ON detail.equipment_specific_id = spec.id
LEFT JOIN wl_warehouse_structure structure ON detail.warehouse_structure_id = structure.id
LEFT JOIN f_fire_fighting_system AS manage ON manage.id = spec.system_id
LEFT JOIN wl_equipment we ON we.id = equipment_detail.equipment_id
LEFT JOIN wl_equipment_category category ON category.id = we.category_id
WHERE 1=1
<if test="sourceId !='' and sourceId != null and sourceId != 'null'">and structure.id = #{sourceId}</if>
<if test="categoryId !='' and categoryId != null">and category.id = #{categoryId}</if>
<if test="equipCode !='' and equipCode != null">and spec.code = #{equipCode}</if>
<if test="equipName !='' and equipName != null">and equipment_detail.name like CONCAT(#{equipName},'%')</if>
</select>
<select id="findAllMenuChildren" resultMap="menuTree">
SELECT
wws.id,
wws.parent_id,
wws.name,
wws.full_name
FROM
wl_warehouse_structure wws
</select>
<select id="getEquipBySourceIdBycount" resultType="java.lang.Long">
SELECT
COUNT(1)
FROM
wl_stock_detail detail
LEFT JOIN wl_warehouse_structure structure ON detail.warehouse_structure_id = structure.id
LEFT JOIN wl_equipment_detail equipment_detail ON equipment_detail.id = detail.equipment_detail_id
LEFT JOIN wl_equipment_specific spec ON spec.equipment_detail_id = detail.equipment_detail_id
LEFT JOIN wl_equipment we ON we.id = equipment_detail.equipment_id
LEFT JOIN wl_equipment_category category ON category.id = we.category_id
WHERE 1=1
<if test="sourceId!=''">and structure.id = #{sourceId}</if>
<if test="categoryId!=''">and category.id = #{categoryId}</if>
<if test="equipCode!=''">and spec.code = #{equipCode}</if>
<if test="equipName!=''">and equipment_detail.name like CONCAT(#{equipName},'%')</if>
</select>
<select id="getEquipmentNameByIotCode" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo">
SELECT
wed.name AS name
FROM
wl_equipment_specific AS wes,
wl_equipment_detail AS wed
WHERE
wed.id = wes.equipment_detail_id
AND
wes.iot_code = #{iotCode}
</select>
<select id="getIotCodeList" resultType="String">
SELECT
iot_code
FROM
wl_equipment_specific
WHERE
1=1
<if test="id != null and id != ''">
AND id != #{id}
</if>
AND
iot_code IS NOT NULL
</select>
<select id="getOneCard" resultType="java.util.Map">
SELECT
a.key,
a.value
FROM
(
SELECT
wles.id,
'名称' AS 'key',
wled.NAME AS
value
FROM
wl_equipment_specific wles
LEFT JOIN wl_stock_detail wlsd ON wles.id = wlsd.equipment_specific_id
LEFT JOIN wl_equipment_detail wled ON wled.id = wles.equipment_detail_id
LEFT JOIN wl_equipment wle ON wled.equipment_id = wle.id
LEFT JOIN wl_unit wlu ON wlu.id = wle.unit_id
LEFT JOIN wl_manufacturer_info wlmi ON wlmi.id = wled.manufacturer_id UNION ALL
SELECT
wles.id,
'型号' AS 'key',
wled.standard AS
value
FROM
wl_equipment_specific wles
LEFT JOIN wl_stock_detail wlsd ON wles.id = wlsd.equipment_specific_id
LEFT JOIN wl_equipment_detail wled ON wled.id = wles.equipment_detail_id
LEFT JOIN wl_equipment wle ON wled.equipment_id = wle.id
LEFT JOIN wl_unit wlu ON wlu.id = wle.unit_id
LEFT JOIN wl_manufacturer_info wlmi ON wlmi.id = wled.manufacturer_id UNION ALL
SELECT
wles.id,
'品牌' AS 'key',
wled.brand AS
value
FROM
wl_equipment_specific wles
LEFT JOIN wl_stock_detail wlsd ON wles.id = wlsd.equipment_specific_id
LEFT JOIN wl_equipment_detail wled ON wled.id = wles.equipment_detail_id
LEFT JOIN wl_equipment wle ON wled.equipment_id = wle.id
LEFT JOIN wl_unit wlu ON wlu.id = wle.unit_id
LEFT JOIN wl_manufacturer_info wlmi ON wlmi.id = wled.manufacturer_id UNION ALL
SELECT
wles.id,
'生产厂家' AS 'key',
wlmi.NAME AS
value
FROM
wl_equipment_specific wles
LEFT JOIN wl_stock_detail wlsd ON wles.id = wlsd.equipment_specific_id
LEFT JOIN wl_equipment_detail wled ON wled.id = wles.equipment_detail_id
LEFT JOIN wl_equipment wle ON wled.equipment_id = wle.id
LEFT JOIN wl_unit wlu ON wlu.id = wle.unit_id
LEFT JOIN wl_manufacturer_info wlmi ON wlmi.id = wled.manufacturer_id UNION ALL
SELECT
wles.id,
'数量' AS 'key',
concat(cast(wlsd.amount as SIGNED), wlu.NAME) AS
value
FROM
wl_equipment_specific wles
LEFT JOIN wl_stock_detail wlsd ON wles.id = wlsd.equipment_specific_id
LEFT JOIN wl_equipment_detail wled ON wled.id = wles.equipment_detail_id
LEFT JOIN wl_equipment wle ON wled.equipment_id = wle.id
LEFT JOIN wl_unit wlu ON wlu.id = wle.unit_id
LEFT JOIN wl_manufacturer_info wlmi ON wlmi.id = wled.manufacturer_id UNION ALL
SELECT
wles.id,
'状态' AS 'key',
CASE
wlsd.`status`
WHEN '1' THEN
'在位'
WHEN '2' THEN
'执勤'
WHEN '3' THEN
'维修'
WHEN '6' THEN
'退役'
WHEN '7' THEN
'报废'
WHEN '10' THEN
'车载'
WHEN '11' THEN
'损耗' ELSE '未入库'
END AS
value
FROM
wl_equipment_specific wles
LEFT JOIN wl_stock_detail wlsd ON wles.id = wlsd.equipment_specific_id
LEFT JOIN wl_equipment_detail wled ON wled.id = wles.equipment_detail_id
LEFT JOIN wl_equipment wle ON wled.equipment_id = wle.id
LEFT JOIN wl_unit wlu ON wlu.id = wle.unit_id
LEFT JOIN wl_manufacturer_info wlmi ON wlmi.id = wled.manufacturer_id
) a
WHERE
a.id = #{id}
</select>
<select id="getQrCodeAndPic" resultType="java.util.Map">
SELECT
CONCAT( '01#', wles.qr_code ) AS qrCode,
wle.img AS pic
FROM
wl_equipment_specific wles
LEFT JOIN wl_equipment_detail wled ON wled.id = wles.equipment_detail_id
LEFT JOIN wl_equipment wle ON wled.equipment_id = wle.id
WHERE
wles.id = #{id}
</select>
<select id="getEquipmentList" resultType="hashmap">
SELECT
a.systemId AS systemId,
es.id AS speId,
esd.`name` AS speName,
ifnull(sd.amount,0) AS amount,
wlwa.full_name AS address
FROM
(
SELECT
fs.id as systemId,
fs.`name` as systemName,
fs.system_type as systemType,
ec.`code` as systemCode
FROM
f_fire_fighting_system fs
JOIN wl_equipment_category ec ON ec.id = fs.system_type
AND ec.`code` != #{alarmSystemCode}
) a
LEFT JOIN wl_equipment_specific es ON FIND_IN_SET(a.systemId,es.system_id)
LEFT JOIN wl_equipment_detail esd ON esd.id = es.equipment_detail_id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = es.id
LEFT JOIN wl_warehouse_structure wlwa ON wlwa.id = sd.warehouse_structure_id
where es.system_id <![CDATA[<>''
]]>
</select>
<select id="selectSystemList" resultType="String">
SELECT
sys.NAME
FROM
wl_equipment_specific AS spe
LEFT JOIN f_fire_fighting_system AS sys ON FIND_IN_SET(sys.id, spe.system_id)
WHERE
spe.id = #{id} and spe.system_id <![CDATA[<>''
]]>
</select>
<select id="selectBuildList" resultType="String">
select source_name from wl_source_scene
where point_in_scene like CONCAT('%',#{id},'%' )
</select>
<select id="getAlarmEquipmentById" resultType="hashmap">
SELECT
a.systemId AS systemId,
a.systemCode AS systemCode,
es.id AS speId,
esd.`name` AS speName,
sd.amount AS amount,
wlwa.full_name AS address,
wlwa.id as areaId
FROM
(
SELECT
fs.id as systemId,
fs.`name` as systemName,
fs.system_type as systemType,
ec.`code` as systemCode
FROM
f_fire_fighting_system fs
JOIN wl_equipment_category ec ON ec.id = fs.system_type
) a
JOIN wl_equipment_specific es ON find_in_set(a.systemId,es.system_id)
LEFT JOIN wl_equipment_detail esd ON esd.id = es.equipment_detail_id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = es.id
LEFT JOIN wl_warehouse_structure wlwa ON wlwa.id = sd.warehouse_structure_id
where es.id=#{id}
</select>
<select id="getSourceNameByEquipSpeId"
resultType="com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO">
SELECT
wlec.`name` categoryName,
frs.`name` sourceName,
wlws.name warehouseStructureName,
wled.area area,
wlws.full_name AS fullName
FROM
wl_equipment_specific wles
left join wl_equipment_detail wled on wles.equipment_detail_id = wled.id
left join wl_equipment wle on wled.equipment_id = wle.id
LEFT JOIN wl_equipment_category wlec on wlec.id = wle.category_id
left join wl_stock_detail wlstd on wlstd.qr_code = wles.qr_code
LEFT JOIN wl_warehouse_structure wlws ON wlws.id = wlstd.warehouse_structure_id
left join f_risk_source frs on frs.source_id = wlws.source_id
where wles.id=#{id}
</select>
<select id="getSourceNameList"
resultType="com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO">
SELECT
wles.code,
wled.`name` equipmentName,
wlec.`name` categoryName,
frs.`name` sourceName,
wlws.NAME warehouseStructureName
FROM
wl_equipment_specific wles
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment wle ON wled.equipment_id = wle.id
LEFT JOIN wl_equipment_category wlec ON wlec.id = wle.category_id
LEFT JOIN wl_stock_detail wlstd ON wlstd.qr_code = wles.qr_code
LEFT JOIN wl_warehouse_structure wlws ON wlws.id = wlstd.warehouse_structure_id
LEFT JOIN f_risk_source frs ON frs.id = wlws.source_id
WHERE
wlws.id=#{warehouseStructureId}
<if test="sourceId!=null">
and wlws.source_id=#{sourceId}
</if>
<if test="equipmentName!=null and equipmentName!=''">
and wled.`name` like CONCAT('%',#{equipmentName},'%')
</if>
<if test="equipmentCode!=null and equipmentCode!=''">
and wles.code like CONCAT('%',#{equipmentCode},'%')
</if>
</select>
<select id="getEquipSpecificDetail"
resultType="com.yeejoin.equipmanage.common.datasync.entity.FireEquipment">
SELECT
es.id,
es.`code` AS mrid,
ed.`name`,
ed.`name` AS aliasname,
es.`code`,
e.`name` AS categoryname,
e.`code` AS categorycode,
( SELECT GROUP_CONCAT( url ) FROM wl_upload_file WHERE file_type = 'image' AND object_type = 'equipment' AND object_id = ed.id ) AS img,
es.iot_code AS iotcode,
f.`name` AS stationname,
f.`code` AS stationcode,
ws.source_id AS buildid,
es.system_id AS fightingsystemids,
TRIM(CONCAT_WS(' ',ws.full_name,sd.description)) AS position,
es.create_date AS inusedate,
'正常' AS `status`,
'在位' AS inusestate,
es.create_date AS createdate,
NOW( ) AS updatedate,
es.area_id AS areaid,
ws.`name` AS buildname,
a.`name` AS workarea
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = es.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
LEFT JOIN wl_area a ON es.area_id = a.id,
f_station_info f
WHERE
es.id = #{id}
</select>
<select id="getEquipSpecificDetailsByEquipmentId"
resultType="com.yeejoin.equipmanage.common.datasync.entity.FireEquipment">
SELECT
es.id,
ed.`name`,
es.`code`,
es.`code` AS mRid,
es.system_id AS fightingSystemIds,
es.iot_code AS iotCode,
e.`name` AS categoryName,
e.`code` AS categoryCode,
ws.source_id AS buildId,
ws.`name` AS buildName,
TRIM( CONCAT( IFNULL( ws.full_name, '' ), ' ', IFNULL( sd.description, '' ) ) ) AS position
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
LEFT JOIN f_fire_fighting_system fs ON fs.id = es.system_id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = es.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
<where>
<if test="equipmentId != null">
ed.equipment_id = #{equipmentId}
</if>
</where>
</select>
<select id="getEquipSpeTypeByQrcode" resultType="com.yeejoin.equipmanage.common.entity.EquipmentCategory">
SELECT
wlec.code AS code
FROM
wl_equipment_specific wles
LEFT JOIN wl_equipment_detail wled ON wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment wle ON wled.equipment_id = wle.id
LEFT JOIN wl_equipment_category wlec ON wlec.id = wle.category_id
WHERE wles.qr_code = #{qrCode}
AND wlec.industry_code='2'
</select>
<select id="selectEquipCategoryNumber" resultType="com.yeejoin.equipmanage.common.vo.EquipCategoryVo">
select
b.id,
b.`name`,
b.img as photo,
(SELECT
count(1)
FROM
`wl_equipment_specific` es,
wl_equipment_detail ed
where es.equipment_detail_id = ed.id
and ed.equipment_id = b.id
and FIND_IN_SET(#{systemId},es.system_id)) as number
from
(SELECT
distinct ed.equipment_id
FROM
`wl_equipment_specific` es,
wl_equipment_detail ed
where es.equipment_detail_id = ed.id
and FIND_IN_SET(#{systemId},es.system_id)
) a,
wl_equipment b
where a.equipment_id = b.id order by b.id
</select>
<select id="get3dFightingSysEquipList" resultType="com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo">
SELECT
es.id,
ed.`name`,
es.`code`,
IF
( SUM( IF ( a.equipment_specific_index_value = 'true', 1, 0 ) ) > 0, 0, 1 ) AS `status`,
ws.full_name AS position,
fs.`name` AS fightingName
FROM
wl_equipment_specific es
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, es.system_id )
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment_specific_index esi ON esi.equipment_specific_id = es.id
LEFT JOIN wl_equipment_index ei ON ei.id = esi.equipment_index_id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = es.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
LEFT JOIN wl_equipment_specific_alarm a ON a.equipment_specific_id = es.id
WHERE
esi.`value` IS NOT NULL AND es.system_id IS NOT NULL
<if test="id != null">
AND fs.id = #{id}
</if>
<if test="name != null and name != ''">
AND (es.`code` LIKE CONCAT('%', #{name}, '%') OR ed.`name` LIKE CONCAT('%', #{name}, '%'))
</if>
GROUP BY
es.id
ORDER BY
esi.update_date DESC
</select>
<select id="listPage" resultType="com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo">
SELECT d.* FROM (
SELECT
es.id,
ed.`name`,
es.`code`,
IF
( SUM( IF ( a.equipment_specific_index_value = 'true', 1, 0 ) ) > 0, 0, 1 ) AS `status`,
ws.full_name AS position,
fs.`name` AS fightingName
FROM
wl_equipment_specific es
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, es.system_id )
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment_specific_index esi ON esi.equipment_specific_id = es.id
LEFT JOIN wl_equipment_index ei ON ei.id = esi.equipment_index_id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = es.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
LEFT JOIN wl_equipment_specific_alarm a ON a.equipment_specific_id = es.id
WHERE
esi.`value` IS NOT NULL AND es.system_id IS NOT NULL
<if test="equipment.id != null and equipment.id != 0">
AND fs.id = #{equipment.id}
</if>
<if test="equipment.name != null and equipment.name != ''">
AND (es.`code` LIKE CONCAT('%', #{equipment.name}, '%') OR ed.`name` LIKE CONCAT('%', #{equipment.name},
'%'))
</if>
GROUP BY
es.id
ORDER BY
esi.update_date DESC
) d
where 1 = 1
<if test="equipment.status != null">
AND d.status = #{equipment.status}
</if>
LIMIT #{start},#{size}
</select>
<select id="listCount" resultType="int">
SELECT
count(1)
FROM (
SELECT
es.id,
IF
( SUM( IF ( a.equipment_specific_index_value = 'true', 1, 0 ) ) > 0, 0, 1 ) AS `status`
FROM
wl_equipment_specific es
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, es.system_id )
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment_specific_index esi ON esi.equipment_specific_id = es.id
LEFT JOIN wl_equipment_index ei ON ei.id = esi.equipment_index_id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = es.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
LEFT JOIN wl_equipment_specific_alarm a ON a.equipment_specific_id = es.id
WHERE
esi.`value` IS NOT NULL AND es.system_id IS NOT NULL
<if test="equipment.id != null and equipment.id != 0">
AND fs.id = #{equipment.id}
</if>
<if test="equipment.name != null and equipment.name != ''">
AND (es.`code` LIKE CONCAT('%', #{equipment.name}, '%') OR ed.`name` LIKE CONCAT('%', #{equipment.name}, '%'))
</if>
GROUP BY
es.id
ORDER BY
esi.update_date DESC
) d
where 1 = 1
<if test="equipment.status != null">
AND d.status = #{equipment.status}
</if>
</select>
<select id="get3dFightingSysEquipCount" resultType="java.util.LinkedHashMap">
SELECT
e.`name`,
COUNT( DISTINCT es.id ) AS amount
FROM
wl_equipment_specific es
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, es.system_id )
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
LEFT JOIN wl_equipment_specific_index esi ON esi.equipment_specific_id = es.id
LEFT JOIN wl_equipment_index ei ON ei.id = esi.equipment_index_id
LEFT JOIN wl_equipment_specific_alarm a ON a.equipment_specific_id = es.id
WHERE
esi.`value` IS NOT NULL AND es.system_id IS NOT NULL
<if test="id != null">
AND fs.id = #{id}
</if>
<if test="name != null and name != ''">
AND (es.`code` LIKE CONCAT('%', #{name}, '%') OR ed.`name` LIKE CONCAT('%', #{name}, '%'))
</if>
<if test="status != null">
<choose>
<when test="status == 1">
AND a.`status` = #{status}
</when>
<otherwise>
AND a.`status` = #{status}
</otherwise>
</choose>
</if>
GROUP BY
ed.equipment_id
</select>
<select id="getAirEquipSpecificList" resultType="com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo">
SELECT
ed.`name` AS equipmentSpecificName,
es.`code` AS equipmentSpecificCode,
es.id AS equipmentSpecificId,
sd.id AS stockDetailId,
ed.id AS equipmentDetailId,
SUM( sd.amount ) AS amount
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
LEFT JOIN wl_equipment_category ec ON ec.id = e.category_id
LEFT JOIN wl_stock_detail sd ON es.id = sd.equipment_specific_id
<where>
<if test="vo.like != null and vo.like !=''">
(ed.`name` LIKE CONCAT('%', #{vo.like}, '%') OR ec.`code` LIKE CONCAT('%', #{vo.like}, '%'))
</if>
<if test="status != null">
AND sd.`status` = #{status}
</if>
<if test="arr != null and arr.length > 0">
AND
<foreach collection="arr" item="item" index="index" open="(" close=")" separator=" AND ">
ec.`code` NOT LIKE CONCAT(#{item}, '%')
</foreach>
</if>
AND sd.amount > 0
</where>
GROUP BY
ed.id
</select>
<select id="onCarVoIPage" resultType="com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo">
SELECT
ed.`name` AS equipmentSpecificName,
e.name AS equipDefinitionName,
es.`code` AS equipmentSpecificCode,
es.id AS equipmentSpecificId,
sd.id AS stockDetailId,
ed.id AS equipmentDetailId,
SUM( sd.amount ) AS amount,
sd.status as status
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
LEFT JOIN wl_equipment_category ec ON ec.id = e.category_id
LEFT JOIN wl_stock_detail sd ON es.id = sd.equipment_specific_id
<where>
<if test="vo.like != null and vo.like !=''">
ed.`name` LIKE CONCAT('%', #{vo.like}, '%')
</if>
<if test="vo.categories != null and vo.categories != ''">
AND ec.`code` LIKE '1%' and ec.industry_code='2'
<!-- AND cast(ec.`code` AS SIGNED INTEGER) BETWEEN 10000000 AND 12999900
<foreach collection="vo.categories" item="categorie" index="index" open="(" close=")" separator=",">-->
<!-- #{categorie}-->
<!-- </foreach>-->
</if>
<if test="vo.status != null">
AND sd.`status` = #{vo.status}
</if>
<!-- <if test="vo.codes != null and vo.codes != ''">
AND
<foreach collection="vo.codes" item="item" index="index" open="(" close=")" separator=" AND ">
ec.`code` NOT LIKE CONCAT(#{item}, '%')
</foreach>
</if> -->
<if test="vo.teamId != null and vo.teamId != ''">
AND es.`team_id` = #{vo.teamId}
</if>
<if test="vo.agencyId != null and vo.agencyId != ''">
AND es.`agency_id` = #{vo.agencyId}
</if>
AND sd.amount > 0
</where>
GROUP BY
ed.id
</select>
<select id="getAirEquipSpecificDetail" resultType="com.yeejoin.equipmanage.common.vo.EquipmentDetailVo">
SELECT
sd.id,
ed.`name` AS equipmentSpecificName,
es.team_id as teamId,
es.team_name AS teamName,
mi.`name` AS manufacturer,
ed.standard AS model,
e.area,
e.img,
CONCAT_WS ("",ws.full_name,ed.area) AS location,
sd.create_date
FROM
wl_stock_detail sd
LEFT JOIN wl_equipment_specific es ON sd.equipment_specific_id = es.id
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
LEFT JOIN wl_warehouse_structure ws ON sd.warehouse_structure_id = ws.id
LEFT JOIN wl_manufacturer_info mi ON mi.id = ed.manufacturer_id
<where>
<if test="stockDetailId != null">
sd.id = #{stockDetailId}
</if>
</where>
</select>
<select id="getSysEquipClassifyList" resultType="com.yeejoin.equipmanage.common.vo.MaintenanceResourceDataVo">
<![CDATA[
SELECT
e.id AS classifyId,
e.`code` AS classifyCode,
e.`name` AS classifyName,
IFNULL(fs.id,-2) AS fireFightSysId,
fs.`code` AS fireFightSysCode,
IFNULL(fs.`name`,'其他') AS fireFightSysName
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, es.system_id )
WHERE
e.id IS NOT NULL
GROUP BY
fs.id,
e.id
]]>
</select>
<select id="getSysEquipClassifyDataList" resultType="com.yeejoin.equipmanage.common.entity.MaintenanceResourceData">
<![CDATA[
SELECT
es.id AS fireFacilityId,
es.`code` AS fire_facility_code,
ed.`name` AS fireFacilityName,
e.id AS classifyId,
e.`code` AS classifyCode,
e.`name` AS classifyName,
IFNULL( fs.id, -2 ) AS fireFightSysId,
fs.`code` AS fireFightSysCode,
IFNULL( fs.`name`, '其他' ) AS fireFightSysName
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, es.system_id )
WHERE
e.id IS NOT NULL
GROUP BY
es.id
]]>
</select>
<select id="getSysEquipClassifyDataPage" resultType="com.yeejoin.equipmanage.common.vo.MaintenanceResourceDataVo">
SELECT
es.id AS fireFacilityId,
es.`qr_code` AS fire_facility_code,
ed.`name` AS fireFacilityName,
e.id AS classifyId,
e.`code` AS classifyCode,
e.`name` AS classifyName,
IFNULL( fs.id, -2 ) AS fireFightSysId,
fs.`code` AS fireFightSysCode,
IFNULL( fs.`name`, '其他' ) AS fireFightSysName,
'equip' AS fireFacilityType,
ws.source_id AS buildingId,
ws.`name` AS buildingName,
ed.maintenance_cycle,
ed.area AS location
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, es.system_id )
LEFT JOIN wl_stock_detail sd ON es.id = sd.equipment_specific_id
LEFT JOIN wl_warehouse_structure ws ON sd.warehouse_structure_id = ws.id
<where>
e.id IS NOT NULL
<if test="fireFightSysId != null">
AND fs.id = #{fireFightSysId}
</if>
<if test="classifyId != null and classifyId != ''">
AND e.`id` = #{classifyId}
</if>
<if test="fireFacilityId != null">
AND es.id = #{fireFacilityId}
</if>
<if test="fireFacilityName != null and fireFacilityName != ''">
AND (ed.`name` LIKE CONCAT('%', #{fireFacilityName}, '%') OR es.`code` LIKE CONCAT('%', #{fireFacilityName}, '%'))
</if>
<if test="buildingId != null and buildingId.size() > 0">
AND ws.source_id IN
<foreach collection="buildingId" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
GROUP BY
es.id
</select>
<select id="getEquipClassifyDataPage" resultType="com.yeejoin.equipmanage.common.vo.MaintenanceResourceDataVo">
SELECT
es.id AS fireFacilityId,
es.`qr_code` AS fire_facility_code,
ed.`name` AS fireFacilityName,
e.id AS classifyId,
e.`code` AS classifyCode,
e.`name` AS classifyName,
-2 AS fireFightSysId,
NULL AS fireFightSysCode,
'其他' AS fireFightSysName,
'equip' AS fireFacilityType,
ws.source_id AS buildingId,
ws.`name` AS buildingName,
ed.area AS location
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN wl_stock_detail sd ON es.id = sd.equipment_specific_id
LEFT JOIN wl_warehouse_structure ws ON sd.warehouse_structure_id = ws.id
<where>
e.id IS NOT NULL
<if test="fireFightSysId != null and fireFightSysId == -2">
AND (es.system_id IS NULL OR es.system_id = '')
</if>
<if test="classifyId != null and classifyId != ''">
AND e.`id` = #{classifyId}
</if>
<if test="fireFacilityId != null">
AND es.id = #{fireFacilityId}
</if>
<if test="fireFacilityName != null and fireFacilityName != ''">
AND (ed.`name` LIKE CONCAT('%', #{fireFacilityName}, '%') OR es.`code` LIKE CONCAT('%', #{fireFacilityName}, '%'))
</if>
<if test="buildingId != null and buildingId.size() > 0">
AND ws.source_id IN
<foreach collection="buildingId" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
GROUP BY
es.id
</select>
<select id="getEquipSpecificLocationInfo" resultType="com.yeejoin.equipmanage.common.dto.UserDto">
SELECT
ws.full_name AS personName,
fi.field_name AS fieldCode,
fi.field_value
FROM
wl_stock_detail sd
LEFT JOIN wl_warehouse_structure ws ON sd.warehouse_structure_id = ws.id
LEFT JOIN wl_form_instance fi ON fi.instance_id = ws.source_id
<where>
<if test="equipmentSpecificId != null">
sd.equipment_specific_id = #{equipmentSpecificId}
</if>
<if test="fieldName != null and fieldName.length > 0">
AND fi.field_name IN
<foreach collection="fieldName" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
<select id="getEquipSpeInfo" resultType="Map">
SELECT
es.id,
ed.`name`,
es.`code`,
es.`qr_code` AS qrCde,
es.system_id,
ws.full_name as location
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_stock_detail sd ON es.id = sd.equipment_specific_id
LEFT JOIN wl_warehouse_structure ws ON sd.warehouse_structure_id = ws.id
WHERE es.id = #{equipmentSpecificId}
</select>
<delete id="deleteEquipDataBySpecificId">
DELETE es, ed, esi, ves, esr, esa, esal, eard FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment_specific_index esi ON es.id = esi.equipment_specific_id
LEFT JOIN wl_video_equipment_specific ves ON es.id = ves.equipment_specific_id
LEFT JOIN wl_equipment_specific_relation esr ON ed.id = esr.equipment_specific_id
LEFT JOIN wl_equipment_specific_alarm esa ON ed.id = esa.equipment_specific_id
LEFT JOIN wl_equipment_specific_alarm_log esal ON ed.id = esal.equipment_specific_id
LEFT JOIN wl_equipment_alarm_report_day eard ON ed.id = eard.equipment_specific_id
WHERE es.id = #{specificId}
</delete>
<delete id="deleteEquipDataByStockDetailId">
DELETE
sd, ws, swr, sbd, sb, wln, wb, md, wm, wlrd, wlr, weoc, eoc, wj
FROM
wl_stock_detail sd
LEFT JOIN wl_stock ws ON ws.id = sd.stock_id
LEFT JOIN wl_stock_warning_rule swr ON ws.id = swr.stock_id
LEFT JOIN wl_stock_bill_detail sbd ON sd.id = sbd.stock_bill_id
LEFT JOIN wl_stock_bill sb ON sb.id = sbd.stock_bill_id
LEFT JOIN wl_notice wln ON sb.id = wln.stock_bill_id
LEFT JOIN wl_wastage_bill_detail wbd ON sd.id = wbd.stock_detail_id
LEFT JOIN wl_wastage_bill wb ON wb.id = wbd.wastage_bill_id
LEFT JOIN wl_maintain_detail md ON sd.id = md.stock_detail_id
LEFT JOIN wl_maintain wm ON wm.id = md.maintain_id
LEFT JOIN wl_repair_detail wlrd ON sd.id = wlrd.stock_detail_id
LEFT JOIN wl_repair wlr ON wlr.id = wlrd.repair_id
LEFT JOIN wl_equipment_on_car weoc ON sd.id = weoc.stock_detail_id
LEFT JOIN wl_extinguishant_on_car eoc ON sd.id = eoc.stock_detail_id
LEFT JOIN wl_journal wj ON sd.id = wj.stock_detail_id
WHERE sd.id = #{stockDetailId};
</delete>
<select id="getRainRoomIndexDetails" resultType="java.util.Map">
SELECT
fi.instance_id id,
MAX(
CASE
WHEN fi.field_name = 'name' THEN
fi.field_value
END
) `name`,
(
SELECT
CONCAT_WS(',', i.value, i.update_date)
FROM
`wl_equipment_specific_index` i
LEFT JOIN `wl_equipment_specific` s ON i.equipment_specific_id = s.id
WHERE
s.warehouse_structure_id = fi.instance_id
AND i.equipment_index_key = 'FESS_TemperatureProbes_Value'
LIMIT 1
) AS realTemperature,
(
SELECT
CONCAT_WS(',', i.value, i.update_date)
FROM
`wl_equipment_specific_index` i
LEFT JOIN `wl_equipment_specific` s ON i.equipment_specific_id = s.id
WHERE
s.warehouse_structure_id = fi.instance_id
AND i.equipment_index_key = 'FESS_Humidity_Value'
LIMIT 1
) AS realHumidity,
(
SELECT
CONCAT_WS(',', i.value, i.update_date)
FROM
`wl_equipment_specific_index` i
LEFT JOIN `wl_equipment_specific` s ON i.equipment_specific_id = s.id
WHERE
s.warehouse_structure_id = fi.instance_id
AND i.equipment_index_key = 'FESS_Heater_RunStatus'
LIMIT 1
) AS heaterStatus
FROM
`wl_form_instance` `fi`
WHERE
fi.group_code = 'rainRoom'
OR fi.group_code = 'r_rainRoom'
group by fi.instance_id
</select>
<select id="getTropicsIndexDetails" resultType="java.util.Map">
SELECT
s.id,
s.`name`,
(
SELECT
CONCAT_WS(',', i.value, i.update_date)
FROM
`wl_equipment_specific_index` i
WHERE
i.equipment_specific_id = s.id
AND i.equipment_index_key = 'FESS_TropicsTemperature_Value'
) AS realTemperature,
(
SELECT
CONCAT_WS(',', i.value, i.update_date)
FROM
`wl_equipment_specific_index` i
WHERE
i.equipment_specific_id = s.id
AND i.equipment_index_key = 'FESS_Tropics_RunStatus'
) AS runStatus,
(
SELECT
CONCAT_WS(',', i.value, i.update_date)
FROM
`wl_equipment_specific_index` i
WHERE
i.equipment_specific_id = s.id
AND i.equipment_index_key = 'FESS_Tropics_LoseFault'
) AS loseFault,
(
SELECT
CONCAT_WS(',', i.value, i.update_date)
FROM
`wl_equipment_specific_index` i
WHERE
i.equipment_specific_id = s.id
AND i.equipment_index_key = 'FESS_Tropics_HotFault'
) AS hotFault
FROM
`wl_equipment_specific` s
WHERE
s.equipment_code = '11010300DFU44'
</select>
<select id="getChoiceRoomIndexDetails" resultType="java.util.Map">
SELECT
fi.instance_id id,
MAX(
CASE
WHEN fi.field_name = 'name' THEN
fi.field_value
END
) `name`,
(
SELECT
CONCAT_WS(',', i.value, i.update_date)
FROM
`wl_equipment_specific_index` i
LEFT JOIN `wl_equipment_specific` s ON s.id = i.equipment_specific_id
WHERE
s.warehouse_structure_id = fi.instance_id
AND i.equipment_index_key = 'FESS_Hightemperature_Alarm'
LIMIT 1
) AS highTemperatureAlarm,
(
SELECT
CONCAT_WS(',', i.value, i.update_date)
FROM
`wl_equipment_specific_index` i
LEFT JOIN `wl_equipment_specific` s ON s.id = i.equipment_specific_id
WHERE
s.warehouse_structure_id = fi.instance_id
AND i.equipment_index_key = 'FESS_Lowtemperature_Alarm'
LIMIT 1
) AS lowTemperatureAlarm
FROM
`wl_form_instance` `fi`
WHERE
fi.group_code = 'fireFoamRoom' OR fi.group_code = 'r_fireFoamRoom'
group by fi.instance_id
</select>
<select id="getBoxTropicsIndexDetails" resultType="java.util.Map">
SELECT
s.id,
s.`name`,
(
SELECT
CONCAT_WS(',', i.value, i.update_date)
FROM
`wl_equipment_specific_index` i
WHERE
i.equipment_specific_id = s.id
AND i.equipment_index_key = 'FESS_BoxTropics_RunStatus'
) AS runStatus,
(
SELECT
CONCAT_WS(',', i.value, i.update_date)
FROM
`wl_equipment_specific_index` i
WHERE
i.equipment_specific_id = s.id
AND i.equipment_index_key = 'FESS_BoxTropics_LoseFault'
) AS loseFault
FROM
`wl_equipment_specific` s
WHERE
s.equipment_code = '92251100TZE44'
</select>
</mapper>
\ 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.equipmanage.mapper.EquipmentSpecificRelationMapper">
<resultMap id="associatedEquipmentList" type="com.yeejoin.equipmanage.common.entity.vo.AssociatedEquipmentVO">
<result column="id" property="id"></result>
<result column="fullqrCode" property="fullqrCode"></result>
<result column="amount" property="amount"></result>
<result column="equipmentName" property="equipmentName"></result>
<result column="unitName" property="unitName"></result>
<result property="qrCode" column="qr_code"></result>
<result property="standard" column="standard"></result>
<result property="img" column="img"></result>
<result property="warehouseStructureName" column="full_name"></result>
<result property="systemName" column="systemName"></result>
<result property="amount" column="amount"></result>
<result property="manufacturerName" column="manufacturerName"></result>
<result property="status" column="status"></result>
<result property="type" column="type"></result>
<result property="code" column="code"></result>
<result property="iotCode" column="iotCode"></result>
<result property="associateType" column="associateType"></result>
<result property="eqpSpecificId" column="eqpSpecificId"></result>
</resultMap>
<select id="getAssociatedEquipmentPageList" resultMap="associatedEquipmentList">
SELECT
esr.type associateType,
ed.id,
es.qr_code,
es.id eqpSpecificId,
CONCAT( '01#', es.qr_code ) fullqrCode,
ed.standard,
eqp.img,
ed.name equipmentName,
ws.full_name,
u.`name` unitName,
(select group_concat(ffs.name) from `f_fire_fighting_system` ffs where ffs.id = es.system_id) as systemName,
sd.amount,
'equipment' AS type,
mi.`name` manufacturerName,
es.code,
es.iot_code iotCode,
CASE
sd.`status`
WHEN '1' THEN
'在位'
WHEN '2' THEN
'执勤'
WHEN '3' THEN
'维修'
WHEN '6' THEN
'退役'
WHEN '7' THEN
'报废'
WHEN '10' THEN
'车载'
WHEN '11' THEN
'损耗' ELSE '未入库'
END AS STATUS
FROM
wl_equipment_specific_relation esr
LEFT JOIN wl_equipment_specific es ON es.id = esr.relation_equipment_specific_id
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = es.equipment_detail_id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
LEFT JOIN wl_equipment eqp ON eqp.id = ed.equipment_id
LEFT JOIN wl_unit u ON u.id = eqp.unit_id
LEFT JOIN wl_manufacturer_info mi ON mi.id = ed.manufacturer_id
WHERE 1=1
<if test="equipId != null and equipId != ''">
AND esr.equipment_specific_id = #{equipId}
</if>
<if test="type != null and type != -1">
AND esr.type = #{type}
</if>
ORDER BY
esr.id
</select>
<select id="getAssociatedEqpList"
resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailVO">
SELECT
ed.id eqpId,
ed.name eqpName,
ed.code,
es.id eqpSpecificId
FROM
wl_equipment_specific_relation esr
LEFT JOIN wl_equipment_specific es ON es.id = esr.relation_equipment_specific_id
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
WHERE 1=1
<if test="eqpSpecificId != null and eqpSpecificId != ''">
AND esr.equipment_specific_id = #{eqpSpecificId}
</if>
<if test="type != null and type != -1">
AND esr.type = #{type}
</if>
ORDER BY
esr.id
</select>
<select id="queryByRelatedEqpSpecIds" resultType="java.lang.Long">
SELECT id
FROM wl_equipment_specific_relation
WHERE relation_equipment_specific_id = #{eqpSpecificId}
and equipment_specific_id IN (SELECT relation_equipment_specific_id
FROM wl_equipment_specific_relation
WHERE equipment_specific_id = #{eqpSpecificId})
</select>
<select id="getEqpDetailCategoryIdAndName"
resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentDetailVO">
SELECT
ed.id eqpId,
ed.NAME eqpName,
ed.CODE,
es.id eqpSpecificId
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
WHERE
1 = 1
<if test="eqpName != null and eqpName != ''">
AND ed.name LIKE CONCAT('%', #{eqpName}, '%')
</if>
<if test="categoryIdList != null and categoryIdList.size() > 0">
AND e.category_id in
<foreach collection="categoryIdList" item="categoryId" open="(" separator="," close=")">
#{categoryId}
</foreach>
</if>
</select>
</mapper>
<?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.equipmanage.mapper.EquipmentStandardMapper">
<resultMap id="EquipmentStandardDetail" type="com.yeejoin.equipmanage.common.entity.vo.EquipmentStandardVO">
<result column="id" property="id"></result>
<result column="equipmentId" property="equipment_id"></result>
<result column="equipmentName" property="equipment_name"></result>
<result column="equipmentStyleCode" property="equipment_style_code"></result>
<result column="equipmentStyleName" property="equipment_style_name"></result>
<result column="standardName" property="standard_name"></result>
<result column="standardKey" property="standard_key"></result>
</resultMap>
<select id="findEquipmentStandardList"
resultMap="EquipmentStandardDetail" >
select
equ_stand.id as id,
equ.code as equipment_code,
equ.name as equipment_name,
equ_cate.code as equipment_style_code,
equ_cate.name as equipment_style_name,
equ_stand.standard_name as standard_name
from wl_equipment_standard equ_stand
left join wl_equipment equ on equ_stand.equipment_id = equ.`id`
left join wl_equipment_category equ_cate on equ.category_id = equ_cate.id
where equ_stand.org_code=#{orgCode}
<if test="standardKey != null and standardKey != ''">
AND equ_stand.standard_key = #{standardKey}
</if>
<if test="equipmentName != null and equipmentName != ''">
AND equ.name like CONCAT('%',#{equipmentName},'%')
</if>
order by equ_stand.create_date desc
</select>
<select id="findById"
resultMap="EquipmentStandardDetail" >
select
equ_stand.id as id,
equ_stand.equipment_id as equipment_id,
equ.name as equipment_name,
equ_cate.code as equipment_style_code,
equ_cate.name as equipment_style_name,
equ_stand.standard_name as standard_name,
equ_stand.standard_key as standard_key
from wl_equipment_standard equ_stand
left join wl_equipment equ
on equ_stand.equipment_id = equ.`id`
left join wl_equipment_category equ_cate
on equ.category_id = equ_cate.id
where equ_stand.id=#{id}
</select>
<select id="getNoAddEquipmentStandardNameList"
resultType="java.util.Map" parameterType="java.lang.String">
SELECT equ.id,equ.code ,equ.`name` from wl_equipment equ
where not EXISTS (select euq_stand.equipment_id from wl_equipment_standard euq_stand where euq_stand.org_code=#{orgCode} and equ.id = euq_stand.equipment_id)
</select>
</mapper>
<?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.equipmanage.mapper.EquipmentStandardRelationsMapper">
</mapper>
<?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.equipmanage.mapper.EquipmentStandardWarningMapper">
</mapper>
<?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.equipmanage.mapper.EquipmentSystemSourceStatisticsMapper">
<select id="getEquipmentSystemSourceStatisticsCount"
resultType="com.yeejoin.equipmanage.common.entity.vo.MainIotMonitorItemVo">
SELECT
wlesst.id,
wlws.id as sourceId,
wlws.name title,
wlesst.status status,
( select id from wl_equipment_specific_alarm
where equipment_specific_id = wlesst.equipment_specific_id
order by confirm_type asc,equipment_specific_index_key desc,create_date desc
limit 1) as alamId,
( select confirm_type from wl_equipment_specific_alarm
where equipment_specific_id = wlesst.equipment_specific_id
order by confirm_type asc,equipment_specific_index_key desc,create_date desc
limit 1) as confirmType,
( select create_date from wl_equipment_specific_alarm
where equipment_specific_id = wlesst.equipment_specific_id
order by confirm_type asc,equipment_specific_index_key desc,create_date desc
limit 1) as `time`
FROM
wl_equipment_system_source_statistics wlesst
LEFT JOIN f_fire_fighting_system fffs ON find_in_set(fffs.id,wlesst.system_id)
left join wl_warehouse_structure wlws on wlesst.source_id = wlws.id
left join wl_equipment_specific_alarm as ala on ala.equipment_specific_id = wlesst.equipment_specific_id
where fffs.id=#{id}
-- group by sourceId
order by wlesst.update_time desc
</select>
<select id="getEquipmentAlarmSystemList" resultType="com.yeejoin.equipmanage.common.entity.vo.MainIotMonitorItemVo">
SELECT
wlesst.id,
wlesst.equipment_specific_id AS speId,
wlws.id AS sourceId,
wlws.NAME title,
wlesst.`status`,
( SELECT id FROM wl_equipment_specific_alarm WHERE equipment_specific_id = wlesst.equipment_specific_id ORDER BY confirm_type ASC, equipment_specific_index_key DESC, create_date DESC LIMIT 1 ) AS alamId,
( SELECT confirm_type FROM wl_equipment_specific_alarm WHERE equipment_specific_id = wlesst.equipment_specific_id ORDER BY confirm_type ASC, equipment_specific_index_key DESC, create_date DESC LIMIT 1 ) AS confirmType
FROM
wl_equipment_system_source_statistics wlesst
LEFT JOIN f_fire_fighting_system fffs ON find_in_set(fffs.id,wlesst.system_id)
LEFT JOIN wl_warehouse_structure wlws ON wlesst.source_id = wlws.id
LEFT JOIN wl_equipment_specific_alarm AS ala ON ala.equipment_specific_id = wlesst.equipment_specific_id
WHERE wlesst.source_id=#{areaId}
and wlesst.system_id=#{systemId}
ORDER BY
wlesst.update_time DESC
</select>
<select id="getBingspeId" resultType="String">
select point_in_scene from wl_source_scene where source_id =#{id}
</select>
</mapper>
<?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.equipmanage.mapper.ExtinguishantOnCarMapper">
<select id="queryExtinguishantOnCarlist" resultType="Map" >
SELECT car.id as 'carId', (CASE WHEN car.car_num IS NOT NULL AND car.car_num != ''
THEN car.car_num ELSE '无车牌号' END) as 'carNum' FROM wl_car car
WHERE car.car_state NOT IN
<foreach collection="list" item="names" open="(" close=")" separator=",">
#{names}
</foreach>
<!-- LEFT JOIN wl_system_dic system_dic ON car.car_state_id = system_dic.id
WHERE system_dic.code NOT IN ('03','04','06','07','08') -->
</select>
<select id="getCarExtinguishants" resultType="Map" >
SELECT table_1.car_id,
equipment_detail.name equipmentName, unit.name unitName, table_1.amount, table_1.equipment_detail_id equipmentDetailId,
(CASE WHEN equipment_detail.img IS NULL OR equipment_detail.img = '' THEN equipment.img ELSE equipment_detail.img END) img
FROM (SELECT SUM(amount) amount, equipment_detail_id, car_id FROM wl_extinguishant_on_car WHERE car_id =#{carId}
GROUP BY equipment_detail_id,car_id ) table_1
INNER JOIN wl_equipment_detail equipment_detail ON equipment_detail.id = table_1.equipment_detail_id
INNER JOIN wl_equipment equipment ON equipment.id = equipment_detail.equipment_id
INNER JOIN wl_unit unit ON unit.id = equipment.unit_id
<where>
<if test="code != null and code != '' ">
equipment_detail.code like CONCAT(#{code},"%" )
</if>
<if test="codedate != null and codedate != '' ">
and equipment_detail.code like CONCAT(#{codedate},"%" )
</if>
</where>
LIMIT #{start},#{page}
</select>
<select id="getCarExtinguishantscount" resultType="Integer" >
SELECT
COUNT(1)
FROM (SELECT SUM(amount) amount, equipment_detail_id, car_id FROM wl_extinguishant_on_car WHERE car_id =#{carId}
GROUP BY equipment_detail_id,car_id ) table_1
INNER JOIN wl_equipment_detail equipment_detail ON equipment_detail.id = table_1.equipment_detail_id
INNER JOIN wl_equipment equipment ON equipment.id = equipment_detail.equipment_id
INNER JOIN wl_unit unit ON unit.id = equipment.unit_id
<where>
<if test="code != null and code != '' ">
equipment_detail.code like CONCAT(#{code},"%" )
</if>
<if test="codedate != null and codedate != '' ">
and equipment_detail.code like CONCAT(#{codedate},"%" )
</if>
</where>
</select>
</mapper>
<?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.equipmanage.mapper.FireFightingSystemMapper">
<resultMap id="EquiplistBySystemId" type="com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO">
<result property="id" column="id"></result>
<result property="equipmentName" column="equipment_name"></result>
<result property="code" column="code"></result>
<result property="categoryName" column="category_name"></result>
</resultMap>
<resultMap id="EquipCountBySystemId" type="com.yeejoin.equipmanage.common.entity.vo.EquipCountBySystemVO">
<result property="equipmentId" column="equipment_id"></result>
<result property="equipmentName" column="equipment_name"></result>
<result property="equipmentNum" column="num"></result>
<result property="unitName" column="unit_name"></result>
</resultMap>
<resultMap id="CategoryAmountList" type="com.yeejoin.equipmanage.common.entity.vo.EquipTypeImgAmountVO">
<result column="id" property="id"></result>
<result column="fullqrCode" property="fullqrCode"></result>
<result column="amount" property="amount"></result>
<result column="equipmentName" property="equipmentName"></result>
<result column="unitName" property="unitName"></result>
<result property="qrCode" column="qr_code"></result>
<result property="standard" column="standard"></result>
<result property="img" column="img"></result>
<result property="warehouseStructureName" column="full_name"></result>
<result property="systemName" column="systemName"></result>
<result property="amount" column="amount"></result>
<result property="manufacturerName" column="manufacturerName"></result>
<result property="status" column="status"></result>
<result property="type" column="type"></result>
<result property="code" column="code"></result>
<result property="iotCode" column="iotCode"></result>
<result property="eqtype" column="eqtype"></result>
</resultMap>
<select id="getEquiplistBySystemId" resultMap="EquiplistBySystemId">
SELECT
spe.id,
det.`name` equipment_name,
spe.`code`,
wle.`name` AS category_name
FROM
wl_equipment_specific AS spe
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
find_in_set(#{systemId},spe.system_id) and spe.single = true
</select>
<!-- 任务 3711 by litw 2021年9月17日 新增装备分类名称-->
<select id="getEquipCountBySystemId" resultMap="EquipCountBySystemId">
SELECT
wle.id equipment_id,
det.NAME equipment_name,
count(spe.id) num,
unit.name unit_name,
cate.NAME AS equipmentCateGoryName
FROM
wl_equipment_specific AS spe
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_category cate ON cate.id = wle.category_id
LEFT JOIN wl_unit as unit ON wle.unit_id = unit.id
where
find_in_set(#{systemId},spe.system_id) and spe.single = true
group by wle.id
</select>
<insert id="save">
INSERT INTO
f_fire_fighting_system
(id,
name,
code,
system_type,
form_group_id,
install_date,
charge_person,
charge_person_name,
construction_unit,
maintenance_unit,
maintenance_frequency,
first_maintenance_date,
rec_user_id,
rec_date,
sort,
charge_person_phone,
maintenance_phone,
org_code,
contro_box_build,
pro_object,
instance_id,
pro_code,
factory,
contro_box_address
)
VALUES(
#{id},
#{name},
#{code},
#{systemType},
#{formGroupId},
STR_TO_DATE(#{installDate},'%Y-%m-%d'),
#{chargePerson},
#{chargePersonName},
#{constructionUnit},
#{maintenanceUnit},
#{maintenanceFrequency},
STR_TO_DATE(#{firstMaintenanceDate},'%Y-%m-%d'),
#{recUserId},
now(),
#{sort},
#{chargePersonPhone},
#{maintenancePhone},
#{orgCode},
#{controBoxBuild},
#{proObject},
#{instanceId},
#{proCode},
#{factory},
#{controBoxAddress}
)
</insert>
<insert id="insertFile">
insert into wl_upload_file
(id,
url,
name,
user_id,
file_type,
object_id,
create_date)
VALUES(
#{id},
#{url},
#{name},
#{userId},
#{fileType},
#{objectId},
now())
</insert>
<!-- BUG 2938 更新系统没有更新系统编号 by kongfm 2021-09-17 -->
<!-- BUG 2938 更新系统类型 by chenzhao 2021-09-26 -->
<update id="update">
UPDATE
f_fire_fighting_system
SET
name = #{name},
install_date =STR_TO_DATE(#{installDate},'%Y-%m-%d'),
charge_person =#{chargePerson},
charge_person_name=#{chargePersonName},
construction_unit =#{constructionUnit},
maintenance_unit =#{maintenanceUnit},
maintenance_frequency =#{maintenanceFrequency},
first_maintenance_date =STR_TO_DATE(#{firstMaintenanceDate},'%Y-%m-%d'),
rec_user_id =#{recUserId},
rec_date = now(),
charge_person_phone=#{chargePersonPhone},
maintenance_phone =#{maintenancePhone},
contro_box_build=#{controBoxBuild},
pro_object=#{proObject},
pro_code=#{proCode},
factory=#{factory},
code=#{code},
form_group_id =#{formGroupId},
contro_box_address = #{controBoxAddress}
where id = #{id}
</update>
<delete id="deleteFilre">
delete from wl_upload_file WHERE object_id = #{id}
</delete>
<update id="setSceneId">
UPDATE
f_fire_fighting_system
SET scene_id=#{sceneId}
where id =#{id}
</update>
<select id="getPointData" resultType="com.yeejoin.equipmanage.common.entity.vo.PointTreeVo">
select * from (
select
'component' as template,
true as openStatus,
<if test="id == null">
if((select count(1) from `wl_source_scene` ss where find_in_set(spe.id, ss.point_in_scene) and EXISTS
(SELECT es.instance_id FROM `wl_form_instance` es WHERE ss.source_id = es.instance_id)) = 0,0,1) as
isBinding, -- 一个装备只能在一个建筑使用
</if>
<if test="id != null and id !=''">
if((SELECT count(1) FROM `wl_source_scene` ss where ss.source_id = #{id} and
FIND_IN_SET(spe.id,ss.point_in_scene)) = 0,0,1) as isBinding,-- 一个装备可在多个系统使用
</if>
if(spe.code is null,eqdet.name,concat(eqdet.name,'(',spe.code,')')) as displayName,
'{\"width\": 42, \"height\": 42}'as initStyle,
'CommonEquip' as componentName,
spe.id as sequenceNbr,
'equipment' as componentKey,
'equipment' as `key`,
equ.img as imgPath,
spe.qr_code as equipCode,
stru.source_id as parentId,
cat.id as equipId,
cat.code as categoryCode,
cat.name as equipName,
spe.system_id as equipSyetemId,
spe.iot_code as iotCode,
equ.id as groupId,
equ.name as groupName,
null as ip,
null as token,
null as address
from wl_stock_detail as det
join wl_warehouse_structure as stru on det.warehouse_structure_id = stru.id
join wl_equipment_specific as spe on det.qr_code = spe.qr_code
join wl_equipment_detail as eqdet on det.equipment_detail_id = eqdet.id
join wl_equipment as equ on eqdet.equipment_id = equ.id
join wl_equipment_category as cat on equ.category_id = cat.id
where det.amount > 0
and spe.single = true) as da
<if test="id != null and id !=''">
where find_in_set(#{id}, da.equipSyetemId)
</if>
<if test="id == null">
union all
select
'component' as template,
true as openStatus,
if(sou.id is null,0,1) as isBinding,
if(vid.code is null,vid.name,concat(vid.name,'(',vid.code,')')) as displayName,
'{\"width\": 42, \"height\": 42}'as initStyle,
'CommonEquip' as componentName,
vid.id as sequenceNbr,
'equipment' as componentKey,
'video' as `key`,
img as imgPath,
vid.code as equipCode,
vis.source_id as parentId,
vid.id as equipId,
vid.code as categoryCode,
vid.name as equipName,
'' as equipSyetemId,
'' as iotCode,
'1000000000000000'as groupId,
'监控摄像' as groupName,
url as ip ,
token,
stru.full_name as address
from
wl_video as vid
join wl_video_source as vis on vid.id = vis.video_id
join wl_source_scene as sou on sou.video_in_scene like CONCAT('%',vid.id ,'%' )
join wl_warehouse_structure as stru on stru.id = sou.source_id
</if>
</select>
<select id="get3dPointData" resultType="com.yeejoin.equipmanage.common.entity.vo.PointTreeVo">
SELECT
*
FROM
(
SELECT
IF
( spe.CODE IS NULL, eqdet.NAME, concat( eqdet.NAME, '(', spe.CODE, ')' ) ) AS displayName,
spe.id AS sequenceNbr,
'equipment' AS componentKey,
'equipment' AS `key`,
spe.CODE AS equipCode,
stru.source_id AS parentId,
cat.id AS equipId,
cat.CODE AS categoryCode,
cat.NAME AS equipName,
spe.system_id AS equipSyetemId,
spe.iot_code AS iotCode,
equ.id AS groupId,
equ.NAME AS groupName
FROM
wl_stock_detail AS det
LEFT JOIN wl_warehouse_structure AS stru ON det.warehouse_structure_id = stru.id
LEFT JOIN wl_equipment_specific AS spe ON det.qr_code = spe.qr_code
LEFT JOIN wl_equipment_detail AS eqdet ON det.equipment_detail_id = eqdet.id
LEFT JOIN wl_equipment AS equ ON eqdet.equipment_id = equ.id
LEFT JOIN wl_equipment_category AS cat ON equ.category_id = cat.id
WHERE
det.amount > 0
AND spe.single = TRUE
AND stru.source_id IS NOT NULL
) AS da UNION ALL
SELECT
IF
( vid.CODE IS NULL, vid.NAME, concat( vid.NAME, '(', vid.CODE, ')' ) ) AS displayName,
vid.id AS sequenceNbr,
'video' AS componentKey,
'video' AS `key`,
vid.CODE AS equipCode,
vis.source_id AS parentId,
vid.id AS equipId,
vid.type_code AS categoryCode,
vid.NAME AS equipName,
'' AS equipSyetemId,
'' AS iotCode,
vid.type_code AS groupId,
vid.type AS groupName
FROM
wl_video AS vid
LEFT JOIN wl_video_source AS vis ON vid.id = vis.video_id
LEFT JOIN wl_source_scene AS sou ON sou.video_in_scene LIKE CONCAT( '%', vid.id, '%' )
LEFT JOIN wl_warehouse_structure AS stru ON stru.id = sou.source_id UNION ALL
SELECT
IF
( p.point_no IS NULL, p.NAME, concat( p.NAME, '(', p.point_no, ')' ) ) AS displayName,
p.id AS sequenceNbr,
'patrol' AS componentKey,
'patrol' AS `key`,
p.point_no AS equipCode,
p.risk_source_id AS parentId,
p.id AS equipId,
'99999999' AS categoryCode,
p.NAME AS equipName,
'' AS equipSyetemId,
'' AS iotCode,
'99999999' AS groupId,
'巡检点' AS groupName
FROM
p_point p
</select>
<select id="getSpeIndex" resultType="com.yeejoin.equipmanage.common.vo.SpeIndexVo">
select * from (
select
eqin.name_key as `key`,
eqin.name as name,
eqin.type_code,
spein.update_date as updateDate,
if (eqin.unit is null, spein.value,concat(spein.value,eqin.unit)) as value
from
wl_equipment_specific_index as spein
left join wl_equipment_index as eqin on spein.equipment_index_id = eqin.id
where
spein.equipment_specific_id = #{id}
order by eqin.sort_num) as dat
where `key` is not null and `key` != ''
ORDER BY dat.updateDate DESC
</select>
<select id="getSpeIndexIn" resultType="com.yeejoin.equipmanage.common.vo.SpeIndexVo">
select * from (
select
eqin.name_key as `key`,
eqin.name as name,
eqin.type_code,
spein.update_date as updateDate,
if (eqin.unit is null, spein.value,concat(spein.value,eqin.unit)) as value,
spein.equipment_specific_id
from
wl_equipment_specific_index as spein
left join wl_equipment_index as eqin on spein.equipment_index_id = eqin.id
<where>
<if test="list != null and list.size() >0">
AND spein.equipment_specific_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
order by eqin.sort_num) as dat
where `key` <![CDATA[<>]]> ''
ORDER BY dat.updateDate DESC
</select>
<select id="getSystemById" resultType="com.yeejoin.equipmanage.common.vo.AlarmDataVO">
select a.key,a.value,a.isHref from(SELECT
fffs.id,
'系统名称' AS 'key',
IFNULL(fffs.name,'') AS
VALUE,
true as isHref,
1 as sort
FROM
f_fire_fighting_system fffs
LEFT JOIN wl_equipment_category wlec ON fffs.system_type = wlec.id
left join wl_manufacturer_info wlmi on wlmi.id=fffs.maintenance_unit
left join wl_manufacturer_info wlmi1 on wlmi1.id=fffs.construction_unit
union all
SELECT
fffs.id,
'系统编号' AS 'key',
IFNULL(fffs.CODE,'') AS
VALUE,
false as isHref,
2 as sort
FROM
f_fire_fighting_system fffs
LEFT JOIN wl_equipment_category wlec ON fffs.system_type = wlec.id
left join wl_manufacturer_info wlmi on wlmi.id=fffs.maintenance_unit
left join wl_manufacturer_info wlmi1 on wlmi1.id=fffs.construction_unit
union all
SELECT
fffs.id,
'系统类别' AS 'key',
IFNULL(wlec.NAME,'') AS
VALUE,
false as isHref,
3 as sort
FROM
f_fire_fighting_system fffs
LEFT JOIN wl_equipment_category wlec ON fffs.system_type = wlec.id
left join wl_manufacturer_info wlmi on wlmi.id=fffs.maintenance_unit
left join wl_manufacturer_info wlmi1 on wlmi1.id=fffs.construction_unit
union all
SELECT
fffs.id,
'安装日期' AS 'key',
IFNULL(DATE_FORMAT(fffs.install_date,'%Y年%m月%d日'),'') AS
VALUE,
false as isHref,
4 as sort
FROM
f_fire_fighting_system fffs
LEFT JOIN wl_equipment_category wlec ON fffs.system_type = wlec.id
left join wl_manufacturer_info wlmi on wlmi.id=fffs.maintenance_unit
left join wl_manufacturer_info wlmi1 on wlmi1.id=fffs.construction_unit
union all
SELECT
fffs.id,
'责任人电话' AS 'key',
IFNULL(fffs.charge_person_phone,'') AS
VALUE,
false as isHref,
5 as sort
FROM
f_fire_fighting_system fffs
LEFT JOIN wl_equipment_category wlec ON fffs.system_type = wlec.id
left join wl_manufacturer_info wlmi on wlmi.id=fffs.maintenance_unit
left join wl_manufacturer_info wlmi1 on wlmi1.id=fffs.construction_unit
union all
SELECT
fffs.id,
'维保单位' AS 'key',
IFNULL(wlmi.name,'') AS VALUE,
false as isHref,
6 as sort
FROM
f_fire_fighting_system fffs
LEFT JOIN wl_equipment_category wlec ON fffs.system_type = wlec.id
left join wl_manufacturer_info wlmi on wlmi.id=fffs.maintenance_unit
left join wl_manufacturer_info wlmi1 on wlmi1.id=fffs.construction_unit
union all
SELECT
fffs.id,
'施工单位' AS 'key',
IFNULL(wlmi1.name,'') AS
VALUE,
false as isHref,
7 as sort
FROM
f_fire_fighting_system fffs
LEFT JOIN wl_equipment_category wlec ON fffs.system_type = wlec.id
left join wl_manufacturer_info wlmi on wlmi.id=fffs.maintenance_unit
left join wl_manufacturer_info wlmi1 on wlmi1.id=fffs.construction_unit
union all
SELECT
fffs.id,
'维保周期' AS 'key',
IFNULL(fffs.maintenance_frequency,'') AS
VALUE,
false as isHref,
8 as sort
FROM
f_fire_fighting_system fffs
LEFT JOIN wl_equipment_category wlec ON fffs.system_type = wlec.id
left join wl_manufacturer_info wlmi on wlmi.id=fffs.maintenance_unit
left join wl_manufacturer_info wlmi1 on wlmi1.id=fffs.construction_unit) a where a.id=#{id} order by sort
</select>
<select id="getEquipmentAlarmBySystemIdOrSourceIdVO"
resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentAlarmBySystemIdOrSourceIdVO">
SELECT
d.id,d.fireEquipmentCode,
d.equipmentSpecificId,
d.fireEquipmentName,
d.warehouseStructureName,
d.fireEquipmentSpecificIndexName,
d.createDate,d.confirmType,
d.type
FROM
(
SELECT
wlesal.id,
wlesal.equipment_specific_id AS equipmentSpecificId,
IFNULL(wlesal.equipment_specific_code,'') AS fireEquipmentCode,
wlesal.equipment_specific_name AS fireEquipmentName,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
if(wlesal.confirm_type IS NULL,0,1) AS confirmType,
CASE
wlesal.equipment_specific_index_value
WHEN 'true' THEN
'是'
WHEN 'false' THEN
'否' ELSE wlesal.equipment_specific_index_value
END AS fireEquipmentPointValue,
wlesa.frequency AS frequency,
wlesa.STATUS AS STATUS,
wlesal.type AS type,
wlesal.create_date AS createDate,
wlesa.recovery_date AS recoveryDate,
wlesal.location AS warehouseStructureName,
(select
group_concat(fet.`name`)
from f_equipment_fire_equipment as fefe
left join f_equipment as fet on fet.id = fefe.equipment_id
where fefe.fire_equipment_id = wlesal.equipment_specific_id
) as equipmentName
FROM
wl_equipment_specific_alarm_log wlesal
LEFT JOIN wl_equipment_specific_alarm wlesa ON wlesa.id = wlesal.equipment_specific_alarm_id
<where>
<if test="systemId!=null">
and find_in_set(#{systemId},wlesal.system_ids)
</if>
<if test="sourceId!=null">
and (wlesal.build_id=#{sourceId}
or find_in_set(wlesal.equipment_specific_id,(SELECT s.point_in_scene FROM `wl_source_scene` s where s.source_id = #{sourceId})))
</if>
<if test='createDate != null and createDate == "1"'>
AND wlesal.create_date LIKE CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d' ), '%' )
</if>
<if test='createDate != null and createDate == "7"'>
AND wlesal.create_date BETWEEN CONCAT( DATE_ADD( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), INTERVAL - 7 DAY ), '00:00:00' )
AND CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), '%', '23:59:59' )
</if>
<if test='createDate != null and createDate == "30"'>
AND wlesal.create_date BETWEEN CONCAT( DATE_ADD( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), INTERVAL - 30 DAY ), '00:00:00' )
AND CONCAT( DATE_FORMAT( NOW( ), '%Y-%m-%d ' ), '%', '23:59:59' )
</if>
<if test='confirmType != null and confirmType == 0'>
and wlesal.confirm_type IS NULL
</if>
<if test='confirmType != null and confirmType == 1'>
and wlesal.confirm_type IS NOT NULL
</if>
</where>
) d
<where>
d.fireEquipmentName IS NOT NULL
<choose>
<when test="type != null and type != ''">
AND d.type = #{type}
</when>
<otherwise>
AND ( d.type = 'FIREALARM' OR d.type = 'BREAKDOWN' OR d.type = 'SHIELD' )
</otherwise>
</choose>
</where>
ORDER BY d.createDate DESC
</select>
<select id="getColaCategoryAmountList" resultMap="CategoryAmountList">
<if test="equipTypeAmountPage.type == 'equipment' or codeHead==null or codeHead=='' or codeHead==' '">
SELECT
wles.id,
wles.qr_code,
CONCAT('01#',wles.qr_code) fullqrCode,
wled.standard,
wle.img,
wled.NAME equipmentName,
concat_ws('-',wlws.full_name,wled.area) as full_name,
wlun.NAME unitName,
(SELECT GROUP_CONCAT(fem.name) FROM `f_fire_fighting_system` fem WHERE find_in_set(fem.id,wles.system_id))
as systemName,
wlsd.amount,
wlsd.id as stockDetailId,
'equipment' as type,
wlai.`name` manufacturerName,
wles.code,
wles.iot_code as iotCode,
case wlsd.`status`
when '1' then '在位'
when '2' then '执勤'
when '3' then '维修'
when '6' then '退役'
when '7' then '报废'
when '10' then '车载'
when '11' then '损耗'
when '12' then '配装'
else '未入库' END as status,
wles.create_date as createDate,
wled.code as eqtype
FROM
(select id,qr_code,code ,iot_code ,create_date ,equipment_detail_id ,system_id from wl_equipment_specific) wles
LEFT JOIN (select id,amount,status,equipment_specific_id,warehouse_structure_id from wl_stock_detail ) wlsd on wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure wlws on wlsd.warehouse_structure_id = wlws.id
LEFT JOIN (select id,standard ,name ,area ,code, equipment_id ,manufacturer_id,is_import from wl_equipment_detail) wled on wles.equipment_detail_id = wled.id
LEFT JOIN wl_equipment wle ON wle.id = wled.equipment_id
LEFT JOIN wl_unit wlun ON wle.unit_id = wlun.id
LEFT JOIN wl_manufacturer_info wlai on wled.manufacturer_id=wlai.id
LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id
WHERE 1=1
<if test="codeHead!=null and codeHead!='' and codeHead!=' '">
and LEFT (wle.CODE, #{hierarchy}) = #{codeHead}
</if>
<if test="equipTypeAmountPage.industryCode!=null">
and wec.industry_code = #{equipTypeAmountPage.industryCode}
</if>
<if test="equipTypeAmountPage.systemId!=null">
and wles.system_id = #{equipTypeAmountPage.systemId}
</if>
<if test="equipTypeAmountPage.manufacturerId!=null">
and wled.manufacturer_id = #{equipTypeAmountPage.manufacturerId}
</if>
<if test="equipTypeAmountPage.isImport!=null">
and wled.is_import = #{equipTypeAmountPage.isImport}
</if>
<if test="equipTypeAmountPage.warehouseStructureId!=null">
and wlsd.warehouse_structure_id in (
select id from wl_warehouse_structure where parent_id in(
select id from wl_warehouse_structure where parent_id = #{equipTypeAmountPage.warehouseStructureId})
union
select id from wl_warehouse_structure where parent_id = #{equipTypeAmountPage.warehouseStructureId} or
id = #{equipTypeAmountPage.warehouseStructureId}
)
</if>
<if test="equipTypeAmountPage.status == 1">
and wlsd.warehouse_structure_id is null
</if>
<if test="equipTypeAmountPage.status == 0">
and wlsd.warehouse_structure_id is not null
</if>
<if test="equipTypeAmountPage.equipmentName!=null and equipTypeAmountPage.equipmentName!=''">
AND wled.name LIKE CONCAT('%',#{equipTypeAmountPage.equipmentName},'%')
</if>
<if test="equipTypeAmountPage.code!=null and equipTypeAmountPage.code!=''">
AND wles.code LIKE CONCAT('%',#{equipTypeAmountPage.code},'%')
</if>
<if test="equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''">
AND wles.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%')
</if>
</if>
<if test="(codeHead==null or codeHead=='' or codeHead==' ') and equipTypeAmountPage.status == null and equipTypeAmountPage.warehouseStructureId==null and equipTypeAmountPage.systemId==null">
union all
</if>
<if test="(equipTypeAmountPage.type == 'car' or codeHead==null or codeHead=='' or codeHead==' ') and equipTypeAmountPage.status == null and equipTypeAmountPage.warehouseStructureId==null and equipTypeAmountPage.systemId==null">
SELECT
wlc.id,
wlc.qr_code,
CONCAT('03#',wlc.qr_code) fullqrCode,
wlc.standard,
wle.img,
wlc.`NAME` equipmentName,
NULL AS full_name,
wlun.NAME unitName,
NULL AS systemName,
1 AS amount,
'' as stockDetailId,
'car' as type,
wlai.`name` manufacturerName,
wlc.car_num as code,
wlc.iot_code as iotCode,
CASE
wlc.car_state
WHEN '1' THEN
'在位'
WHEN '2' THEN
'执勤'
WHEN '3' THEN
'维修'
WHEN '6' THEN
'退役'
WHEN '7' THEN
'报废' ELSE '未入库'
END AS STATUS,
wlc.create_date as createDate,
'2' as eqtype
FROM
wl_car wlc
LEFT JOIN wl_equipment wle ON wle.id = wlc.equipment_id
LEFT JOIN wl_unit wlun ON wle.unit_id = wlun.id
LEFT JOIN wl_manufacturer_info wlai ON wlc.manufacturer_id = wlai.id
LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id
WHERE 1=1
<if test="codeHead!=null and codeHead!='' and codeHead!=' '">
and LEFT (wec.CODE, #{hierarchy}) = #{codeHead}
</if>
<if test="equipTypeAmountPage.industryCode!=null">
and wec.industry_code = #{equipTypeAmountPage.industryCode}
</if>
<if test="equipTypeAmountPage.equipmentName!=null and equipTypeAmountPage.equipmentName!=''">
And wlc.`NAME` LIKE CONCAT('%',#{equipTypeAmountPage.equipmentName},'%')
</if>
<if test="equipTypeAmountPage.manufacturerId!=null">
and wlc.manufacturer_id = #{equipTypeAmountPage.manufacturerId}
</if>
<if test="equipTypeAmountPage.isImport!=null">
and wlc.is_import = #{equipTypeAmountPage.isImport}
</if>
<if test="equipTypeAmountPage.code!=null and equipTypeAmountPage.code!=''">
AND wlc.car_num LIKE CONCAT('%',#{equipTypeAmountPage.code},'%')
</if>
<if test="equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''">
AND wlc.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%')
</if>
</if>
order by createDate DESC
</select>
<select id="getFireFightingSystemDetail"
resultType="com.yeejoin.equipmanage.common.datasync.entity.FireFightingSystem">
SELECT
fs.id,
f.`name` AS stationname,
f.`code` AS stationcode,
fs.`name`,
fs.`name` AS aliasname,
fs.`code`,
fg.group_name AS systemtype,
fs.install_date AS installdate,
p.`name` AS chargeperson,
fs.charge_person_phone AS chargepersonphone,
mi.`name` AS constructionunit,
mi1.`name` AS maintenanceunit,
fs.first_maintenance_date AS firstmaintenancedate,
fs.maintenance_frequency AS maintenancefrequency,
fs.maintenance_phone AS maintenancephone,
fs.rec_date AS createdate,
NOW( ) AS updatedate,
fs.`code` AS mrid,
fs.remark AS description
FROM
f_fire_fighting_system fs
LEFT JOIN wl_dynamic_form_group fg ON fg.relation_id = fs.system_type
LEFT JOIN wl_manufacturer_info mi ON mi.id = fs.construction_unit
LEFT JOIN wl_manufacturer_info mi1 ON mi1.id = fs.maintenance_unit
LEFT JOIN rpm_person p ON p.id = fs.charge_person,
f_station_info f
<where>
<if test="id != null and id !=''">
fs.id = #{id}
</if>
</where>
</select>
<select id="getFightingSysByCodes" resultType="com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity">
SELECT
*
FROM
`f_fire_fighting_system`a
<where>
<if test="ids != null and ids.length > 0">
a.code IN
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
<select id="getFightingSysByIds" resultType="com.yeejoin.equipmanage.common.entity.FireFightingSystemEntity">
SELECT
*
FROM
`f_fire_fighting_system`fffs
<where>
<if test="ids != null and ids.length > 0">
fffs.id IN
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
<select id="get3dFightingSystemList" resultType="com.yeejoin.equipmanage.common.vo.FireFightingSystem3dVo">
SELECT
fs.id,
fs.`name`,
fs.code AS mRid,
fs.core_component_ids,
IF
(
SUM(
IF
(
a.equipment_specific_index_value = 'true'
<if test="list != null and list.size() >0">
AND
<foreach collection="list" item="item" index="index" open="(" close=")" separator=" OR ">
ei.type_code = #{item}
</foreach>
</if>
,
1,
0
)
) > 0,
0,
1
) AS `status`,
fs.charge_person_phone,
fs.charge_person_name
FROM
f_fire_fighting_system fs
LEFT JOIN wl_equipment_specific es ON FIND_IN_SET( fs.id, es.system_id )
LEFT JOIN wl_equipment_specific_index esi ON esi.equipment_specific_id = es.id
LEFT JOIN wl_equipment_index ei ON ei.id = esi.equipment_index_id
LEFT JOIN wl_equipment_specific_alarm a ON a.equipment_specific_id = es.id
GROUP BY
fs.id;
</select>
<select id="getFireSystemState" resultType="Map">
select * from v_fire_system_state
</select>
<select id="getFireOnlSystem" resultType="Map">
select * from v_fire_onl_num
</select>
<select id="getFireCafsSystem" resultType="Map">
select * from v_fire_cafs_num
</select>
<select id="getFireFfsSystem" resultType="Map">
select * from v_fire_ffs_num
</select>
<select id="getFireFasSystem" resultType="Map">
select * from v_fire_fas_num
</select>
<select id="getFireAcsSystem" resultType="Map">
select * from v_fire_acs_num
</select>
<select id="getFireFhsSystem" resultType="Map">
select * from v_fire_fhs_num
</select>
<select id="getTodayConfirmAlarmInfo" resultType="Map">
select * from v_equip_alarm_today_statistics
</select>
<select id="getPoolInfo" resultType="Map">
select * from v_fire_fhs_yl_num
</select>
<select id="getFightingSysInfo" resultType="com.yeejoin.equipmanage.common.vo.FireFightingSystemVo">
select * from v_fire_system_info fs
<where>
<if test="id != null and id !=''">
and fs.id = #{id}
</if>
<if test="code != null and code !=''">
and fs.code = #{code}
</if>
</where>
</select>
<select id="getFireOnlSystemThreeSmall" resultType="Map">
select * from v_fire_onl_three_small
</select>
<select id="fireAlarmSysEquipmentNumber" resultType="java.util.Map">
select
(SELECT
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'FAS_SmokeAlarm_FireAlarm') as ywtcqnum,
(SELECT
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'FAS_AirSampler_FireAlarm') as sgbjqnum,
(SELECT
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'FAS_InfraredLight_FireAlarm') as hwdsnum,
(SELECT
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'FAS_ManualAlarm_FireAlarm') as sdbjanum,
(SELECT
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'FAS_TemperatureCable_FireAlarm') as gwdlnum,
(SELECT
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'FAS_TemperatureFireDetector_FireAlarm') as fbwgnum,
(SELECT
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'FAS_AirSampler_FireAlarm') as kqcynum,
(SELECT
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'FAS_UltravioletLight_FireAlarm') as zwhynum
</select>
<select id="fireAlarmSysIndexNumber" resultType="java.util.Map">
select
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_SmokeAlarm_Shield'
and s.`value` = 'true') as ywtcqpb,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_SmokeAlarm_Fault'
and s.`value` = 'true') as ywtcqgz,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_SmokeAlarm_FireAlarm'
and s.`value` = 'true') as ywtcqhj,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_SoundLightAlarm_Shield'
and s.`value` = 'true') as sgbjqpb,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_SoundLightAlarm_Fault'
and s.`value` = 'true') as sgbjqgz,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_SoundLightAlarm_FireAlarm'
and s.`value` = 'true') as sgbjqhj,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_InfraredLight_Shield'
and s.`value` = 'true') as hwdspb,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_InfraredLight_Fault'
and s.`value` = 'true') as hwdsgz,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_InfraredLight_FireAlarm'
and s.`value` = 'true') as hwdshj,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_ManualAlarm_Shield'
and s.`value` = 'true') as sdbjapb,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_ManualAlarm_Fault'
and s.`value` = 'true') as sdbjagz,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_ManualAlarm_FireAlarm'
and s.`value` = 'true') as sdbjahj,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_TemperatureCable_Shield'
and s.`value` = 'true') as gwdlpb,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_TemperatureCable_Fault'
and s.`value` = 'true') as gwdlgz,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_TemperatureCable_FireAlarm'
and s.`value` = 'true') as gwdlhj,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_TemperatureFireDetector_Shield'
and s.`value` = 'true') as fbwgpb,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_TemperatureFireDetector_Fault'
and s.`value` = 'true') as fbwggz,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_TemperatureFireDetector_FireAlarm'
and s.`value` = 'true') as fbwgqhj,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_AirSampler_Shield'
and s.`value` = 'true') as kqcypb,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_AirSampler_Fault'
and s.`value` = 'true') as kqcygz,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_AirSampler_FireAlarm'
and s.`value` = 'true') as kqcyhj,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_UltravioletLight_Shield'
and s.`value` = 'true') as zwhypb,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_UltravioletLight_Fault'
and s.`value` = 'true') as zwhygz,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_UltravioletLight_FireAlarm'
and s.`value` = 'true') as zwhyhj
</select>
<select id="fireWaterSysHydrant" resultType="java.util.Map">
SELECT
xhsanhj,
xhsangz,
xhsanpb,
(xhsan - xhsanhj- xhsangz-xhsanpb) as xhszc,
xhsan
from
(select
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_FireHydrantButton_FireAlarm'
and s.`value` = 'true') as xhsanhj,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_FireHydrantButton_Fault'
and s.`value` = 'true') as xhsangz,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FAS_FireHydrantButton_Shield'
and s.`value` = 'true') as xhsanpb,
(SELECT
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'FAS_FireHydrantButton_FireAlarm') as xhsan
) as hydrant
</select>
<select id="fireWaterSysCollectingDevice" resultType="java.util.Map">
SELECT
sbfcjzzyc,
sbfcjzzbs,
(sbfcjzz-sbfcjzzyc-sbfcjzzbs) as sbfcjzzzc,
sbfcjzz
from
(select
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FHS_CollectingDevice_DeviceAbnormal'
and s.`value` = 'true') as sbfcjzzyc,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FHS_CollectingDevice_DeviceLock'
and s.`value` = 'true') as sbfcjzzbs,
(SELECT
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'FHS_CollectingDevice_DeviceAbnormal') as sbfcjzz
) as collectingDevice
</select>
<select id="fireWaterSysWaterPump" resultType="java.util.Map">
select
-- 总数
(SELECT
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'FHS_FirePump_RunStatus') as xfsbzs,
-- 消防水泵指标
(SELECT
count(1)
FROM
`wl_equipment_specific_index` si,
`wl_equipment_specific` s
where
si.equipment_index_key = 'FHS_FirePump_RunStatus'
and si.`value` = 'true'
and si.equipment_specific_id = s.id ) as xfsbjt,
(SELECT
count(1)
FROM
`wl_equipment_specific_index` si,
`wl_equipment_specific` s
where
si.equipment_index_key = 'FHS_FirePump_Stop'
and si.`value` = 'true'
and si.equipment_specific_id = s.id ) as xfsbqd,
(SELECT
count(1)
FROM
`wl_equipment_specific_index` si,
`wl_equipment_specific` s
where
si.equipment_index_key = 'FHS_FirePump_FeedbackModuleShield'
and si.`value` = 'true'
and si.equipment_specific_id = s.id ) as xfsbpb,
(SELECT
count(1)
FROM
`wl_equipment_specific_index` si,
`wl_equipment_specific` s
where
si.equipment_index_key = 'FHS_FirePump_Fault'
and si.`value` = 'true'
and si.equipment_specific_id = s.id ) as xfsbgz,
-- 稳压泵
-- 总数
(SELECT
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'FHS_PressurePump_RunStatus') as wybzs,
-- 稳压泵指标
(SELECT
count(1)
FROM
`wl_equipment_specific_index` si,
`wl_equipment_specific` s
where
si.equipment_index_key = 'FHS_PressurePump_RunStatus'
and si.`value` = 'true'
and si.equipment_specific_id = s.id ) as wybjt,
(SELECT
count(1)
FROM
`wl_equipment_specific_index` si,
`wl_equipment_specific` s
where
si.equipment_index_key = 'FHS_PressurePump_Stop'
and si.`value` = 'true'
and si.equipment_specific_id = s.id ) as wybqd,
(SELECT
count(1)
FROM
`wl_equipment_specific_index` si,
`wl_equipment_specific` s
where
si.equipment_index_key = 'FHS_PressurePump_Fault'
and si.`value` = 'true'
and si.equipment_specific_id = s.id ) as wybgz,
(SELECT
count(1)
FROM
`wl_equipment_specific_index` si,
`wl_equipment_specific` s
where
si.equipment_index_key = 'FHS_PressurePump_RunShield'
and si.`value` = 'true'
and si.equipment_specific_id = s.id ) as wybpb
</select>
<select id="fireWaterSysPool" resultType="java.util.Map">
select * from v_fire_pool_water_level
</select>
<select id="fireFoamSysEquipmentIndexNumber" resultType="java.util.Map">
select * from v_fire_equip_ffs_num
</select>
<select id="otherSysIndexNumAndTotal" resultType="java.util.Map">
SELECT
`d`.`sffjnum` AS `sffjnum`,
`d`.`sffjqd` AS `sffjqd`,
`d`.`sffjgz` AS `sffjgz`,
`d`.`sffjpb` AS `sffjpb`,
`d`.`pffjnum` AS `pffjnum`,
`d`.`pffjqd` AS `pffjqd`,
`d`.`pffjgz` AS `pffjgz`,
`d`.`pffjpb` AS `pffjpb`,
`d`.`dtnum` AS `dtnum`,
`d`.`dtqd` AS `dtqd`,
`d`.`dtgz` AS `dtgz`,
`d`.`dtpb` AS `dtpb`,
`d`.`ktnum` AS `ktnum`,
`d`.`ktqd` AS `ktqd`,
`d`.`ktgz` AS `ktgz`,
`d`.`ktpb` AS `ktpb`,
`d`.`ntnum` AS `ntnum`,
`d`.`ntqd` AS `ntqd`,
`d`.`ntgz` AS `ntgz`,
`d`.`ntpb` AS `ntpb`,
`d`.`mjnum` AS `mjnum`,
`d`.`mjqd` AS `mjqd`,
`d`.`mjgz` AS `mjgz`,
`d`.`mjpb` AS `mjpb`,
d.fhznum,
d.fhzpb,
d.fhzgz,
d.fhzhj,
d.yjgbnum,
d.yjgbpb,
d.yjgbgz,
d.yjgbqd
FROM
(
SELECT
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'SCS_Blower_Start'
) AS `sffjnum`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'SCS_Blower_Start'
and si.`value` = 'true'
) AS `sffjqd`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'SCS_Blower_Fault'
and si.`value` = 'true'
) AS `sffjgz`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'SCS_Blower_Shield'
) AS `sffjpb`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'SCS_SmokeExhaust_Start'
) AS `pffjnum`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'SCS_SmokeExhaust_Start'
and si.`value` = 'true'
) AS `pffjqd`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'SCS_SmokeExhaust_Fault'
and si.`value` = 'true'
) AS `pffjgz`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'SCS_SmokeExhaust_Shield'
and si.`value` = 'true'
) AS `pffjpb`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'ES_Elevator_Start'
) AS `dtnum`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'ES_Elevator_Start'
and si.`value` = 'true'
) AS `dtqd`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'ES_Elevator_Fault'
and si.`value` = 'true'
) AS `dtgz`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'ES_Elevator_Shield'
and si.`value` = 'true'
) AS `dtpb`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'AIRCS_AirCondition_Start'
) AS `ktnum`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'AIRCS_AirCondition_Start'
and si.`value` = 'true'
) AS `ktqd`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'AIRCS_AirCondition_Fault'
and si.`value` = 'true'
) AS `ktgz`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'AIRCS_AirCondition_Shield'
and si.`value` = 'true'
) AS `ktpb`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'AIRCS_HVAC_Start'
) AS `ntnum`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'AIRCS_HVAC_Start'
and si.`value` = 'true'
) AS `ntqd`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'AIRCS_HVAC_Fault'
and si.`value` = 'true'
) AS `ntgz`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'AIRCS_HVAC_Shield'
and si.`value` = 'true'
) AS `ntpb`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'ACS_AccessControl_Start'
) AS `mjnum`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'ACS_AccessControl_Start'
and si.`value` = 'true'
) AS `mjqd`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'ACS_AccessControl_Fault'
and si.`value` = 'true'
) AS `mjgz`,
(
select
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'ACS_AccessControl_Shield'
and si.`value` = 'true'
) AS `mjpb`,
(SELECT
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'SCS_FireDamper_FireAlarm') as fhznum,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'SCS_FireDamper_Shield'
and s.`value` = 'true') as fhzpb,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'SCS_FireDamper_Fault'
and s.`value` = 'true') as fhzgz,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'SCS_FireDamper_FireAlarm'
and s.`value` = 'true') as fhzhj,
(SELECT
count(1)
from
`wl_equipment_specific_index` si
where
si.equipment_index_key = 'FES_FireBroadcast_Start') as yjgbnum,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FES_FireBroadcast_Shield'
and s.`value` = 'true') as yjgbpb,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FES_FireBroadcast_Fault'
and s.`value` = 'true') as yjgbgz,
(SELECT
count(1)
FROM `wl_equipment_specific_index` s
where s.equipment_index_key = 'FES_FireBroadcast_Start'
and s.`value` = 'true') as yjgbqd
) `d`
</select>
<select id="fireFoamSysEquipmentNumber" resultType="java.util.Map">
SELECT
d.dcfzs,
d.dcfqd,
d.dcfgz,
d.dcfpb,
d.qdpzs,
d.qdpqd,
d.qdpgz,
d.qdppb,
d.dlqzs,
d.dlqqd,
ABS (d.dlqzs - d.dlqqd) AS dlqjt,
d.dlqgz,
d.dlqpb
FROM
(
SELECT
(
SELECT
count(1)
FROM
wl_equipment_specific_index si
WHERE
si.equipment_index_key = 'FFS_SolenoidValve_Start'
) AS dcfzs,
(
SELECT
count(1)
FROM
wl_equipment_specific_index s
WHERE
s.equipment_index_key = 'FFS_SolenoidValve_Start'
AND s.`value` = 'true'
) AS dcfqd,
(
SELECT
count(1)
FROM
wl_equipment_specific_index s
WHERE
s.equipment_index_key = 'FFS_SolenoidValve_Fault'
AND s.`value` = 'true'
) AS dcfgz,
(
SELECT
count(1)
FROM
wl_equipment_specific_index s
WHERE
s.equipment_index_key = 'FFS_SolenoidValve_Shield'
AND s.`value` = 'true'
) AS dcfpb,
(
SELECT
count(1)
FROM
wl_equipment_specific_index si
WHERE
si.equipment_index_key = 'FFS_Startbottle_Start'
) AS qdpzs,
(
SELECT
count(1)
FROM
wl_equipment_specific_index s
WHERE
s.equipment_index_key = 'FFS_Startbottle_Start'
AND s.`value` = 'true'
) AS qdpqd,
(
SELECT
count(1)
FROM
wl_equipment_specific_index s
WHERE
s.equipment_index_key = 'FFS_Startbottle_StartupModuleFault'
AND s.`value` = 'true'
) AS qdpgz,
(
SELECT
count(1)
FROM
wl_equipment_specific_index s
WHERE
s.equipment_index_key = 'FFS_Startbottle_StartupModuleShield'
AND s.`value` = 'true'
) AS qdppb,
(
SELECT
count(1)
FROM
wl_equipment_specific_index si
WHERE
si.equipment_index_key = 'FFS_Breaker_State'
) AS dlqzs,
(
SELECT
count(1)
FROM
wl_equipment_specific_index s
WHERE
s.equipment_index_key = 'FFS_Breaker_State'
AND s.`value` = 'true'
) AS dlqqd,
(
SELECT
count(1)
FROM
wl_equipment_specific_index s
WHERE
s.equipment_index_key = 'FFS_Breaker_Fault'
AND s.`value` = 'true'
) AS dlqgz,
(
SELECT
count(1)
FROM
wl_equipment_specific_index s
WHERE
s.equipment_index_key = 'FFS_Breaker_Shield'
AND s.`value` = 'true'
) AS dlqpb
)d
</select>
</mapper>
<?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.equipmanage.mapper.FormGroupColumnMapper">
</mapper>
<?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.equipmanage.mapper.FormGroupMapper">
</mapper>
<?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.equipmanage.mapper.FormInstanceMapper">
<resultMap id="resultMapDTO" type="com.yeejoin.equipmanage.common.entity.dto.BuildSearchDTO">
<result column="instanceId" property="instanceId"/>
<result column="fieldValue" property="fieldValue"/>
<result column="groupType" property="groupType"/>
</resultMap>
<select id="queryInstancePage" resultType="map">
select
d.*
from
(
select
i.INSTANCE_ID instanceId,
i.GROUP_CODE groupCode,
<foreach collection="fieldNames" item="value" index="key" separator=",">
MAX(CASE WHEN i.FIELD_NAME = #{key} THEN i.FIELD_VALUE END) as ${key}
</foreach>
from
wl_form_instance i
where i.GROUP_CODE = #{groupCode}
GROUP by
i.INSTANCE_ID)d
<if test="params != null and params.size() > 0">
where
1=1
<foreach collection="params" index="key" item="value" separator="">
<choose>
<when test="fieldNames[key] == 'like' and value !=null and value !=''">
and d.${key} like concat('%',#{value},'%')
</when>
<when test="fieldNames[key] == 'eq' and value !=null and value !=''">
and d.${key} = #{value}
</when>
</choose>
</foreach>
</if>
order by instanceId desc
</select>
<select id="queryForMapList" resultType="map">
select
d.*
from
(
select
i.INSTANCE_ID instanceId,
i.GROUP_CODE groupCode,
<foreach collection="fieldNames" item="value" index="key" separator=",">
MAX( CASE WHEN i.FIELD_NAME = #{key} THEN i.FIELD_VALUE END) ${key}
</foreach>
from
wl_form_instance i
where i.GROUP_CODE = #{groupCode}
GROUP by
i.INSTANCE_ID)d
<if test="params != null and params.size() > 0">
where
1=1
<foreach collection="params" index="key" item="value" separator="">
<choose>
<when test="fieldNames[key] == 'like' and value !=null and value !=''">
AND d.${key} like concat('%',#{value},'%')
</when>
<when test="fieldNames[key] == 'eq' and value !=null and value !=''">
AND d.${key} = #{value}
</when>
</choose>
</foreach>
</if>
order by d.instanceId desc
</select>
<select id="querySpecialChildrenList" resultType="hashmap">
SELECT
*
FROM
(
SELECT
a.instance_id as id,
a.instance_id AS instanceId,
a.group_code AS groupCode,
a.group_type AS groupType,
wlss.scene_id as sceneId,
MAX( CASE WHEN a.field_name = 'parentId' THEN a.field_value END ) AS parentId,
MAX( CASE WHEN a.field_name = 'name' THEN a.field_value END ) AS instanceName,
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 = 'isRisk' THEN a.field_value END ) AS isRisk,
MAX( CASE WHEN a.field_name = 'address' THEN a.field_value END ) AS address
FROM
`wl_form_instance` a
LEFT JOIN wl_source_scene wlss ON wlss.source_id = a.instance_id
GROUP BY
a.instance_id
) sa
<where>
<if test="parentId != null and parentId !=''">
sa.parentId = #{parentId}
</if>
</where>
</select>
<select id="queryPage" resultType="hashmap">
select * from (SELECT
a.instance_id AS instanceId,
a.group_code AS groupCode,
a.group_type AS groupType,
a.field_value AS fieldValue,
a.field_label AS fieldLabel,
MAX(CASE WHEN a.field_name = 'parentId' THEN a.field_value END) AS parentId,
MAX(CASE WHEN a.field_name = 'name' THEN a.field_value END)AS buildName,
MAX(CASE WHEN a.field_name = 'isRisk' THEN a.field_value END)AS isRisk,
MAX(CASE WHEN a.field_name = 'code' THEN a.field_value END)AS buildCode,
MAX(CASE WHEN a.field_name = 'certificatesPersonNum' THEN a.field_value END)AS certificatesPersonNum,
MAX(CASE WHEN a.field_name = 'dutyUser' THEN a.field_value END)AS dutyUser,
MAX(CASE WHEN a.field_name = 'hasFirePlan' THEN a.field_value END)AS hasFirePlan,
MAX(CASE WHEN a.field_name = 'installLoc' THEN a.field_value END)AS installLoc,
MAX(CASE WHEN a.field_name = 'inwhichBuild' THEN a.field_value END)AS inwhichBuild,
MAX(CASE WHEN a.field_name = 'maintenanceUnit' THEN a.field_value END)AS maintenanceUnit
FROM
`wl_form_instance` a
GROUP BY
a.instance_id) sa
<where>
sa.parentId in
<foreach item="item" index="index" collection="query.instanceIds" open="(" separator="," close=")">
#{item}
</foreach>
<if test="query.fieldValue != null and query.fieldValue !=''">
AND sa.fieldValue = #{query.fieldValue}
</if>
</where>
ORDER BY sa.instanceId DESC
</select>
<select id="roomPage" resultType="hashmap">
select * from (SELECT
a.instance_id AS instanceId,
a.group_code AS groupCode,
a.group_type AS groupType,
a.field_value AS fieldValue,
a.field_label AS fieldLabel,
MAX(CASE WHEN a.field_name = 'parentId' THEN a.field_value END) AS parentId,
MAX(CASE WHEN a.field_name = 'name' THEN a.field_value END)AS buildName,
MAX(CASE WHEN a.field_name = 'isRisk' THEN a.field_value END)AS isRisk
FROM
`wl_form_instance` a
GROUP BY
a.instance_id) sa
<where>
sa.instanceId in
<foreach item="item" index="index" collection="query.instanceIds" open="(" separator="," close=")">
#{item}
</foreach>
<if test="query.fieldValue != null and query.fieldValue !=''">
AND sa.fieldValue = #{query.fieldValue}
</if>
</where>
ORDER BY sa.instanceId DESC
</select>
<select id="queryFloorRoom" resultType="hashmap">
SELECT * FROM (SELECT
a.instance_id AS instanceId,
a.group_type AS groupType,
MAX(
CASE
WHEN a.field_name = 'parentId' THEN
a.field_value
END
) AS parentId
FROM
`wl_form_instance` a
GROUP BY
a.instance_id) sa
WHERE sa.parentId in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="getBuildFloorList" resultMap="resultMapDTO">
SELECT
sa.instanceId,
sa.groupType,
sa.fieldValue
FROM
(
SELECT
a.instance_id AS instanceId,
a.group_type AS groupType,
MAX( CASE WHEN a.field_name = 'parentId' THEN a.field_value END ) AS parentId,
MAX( CASE WHEN a.field_name = 'name' THEN a.field_value END ) AS fieldValue
FROM
`wl_form_instance` a
GROUP BY
a.instance_id
) sa
<where>
sa.parentId = #{query.instanceId}
<if test="query.groupType != null and query.groupType !=''">
AND sa.groupType = #{query.groupType}
</if>
</where>
ORDER BY
sa.instanceId DESC
</select>
<select id="findDetailByInstanceId" resultType="java.util.LinkedHashMap">
SELECT
a.field_label AS `key`,
a.field_value AS `value`
FROM
`wl_form_instance` a
WHERE
a.instance_id = #{instanceId}
AND
a.field_label != '父级id'
ORDER BY a.group_column_id
</select>
<select id="findByInstanceId" resultType="java.util.LinkedHashMap">
SELECT
fi.NAME AS '建筑名称',
fi.dutyUser AS '负责人',
fi.buildType AS '建筑结构',
fi.dutyUserPhone AS '负责人电话',
fi.buildUseType AS '使用性质',
fi.structureType AS '结构类型',
fi.address AS '详细地址'
FROM
(
SELECT
a.instance_id,
MAX( CASE WHEN a.field_name = 'name' THEN a.field_value END ) AS NAME,
MAX( CASE WHEN a.field_name = 'dutyUser' THEN a.field_value END ) AS dutyUser,
MAX( CASE WHEN a.field_name = 'buildType' THEN a.field_value END ) AS buildType,
MAX( CASE WHEN a.field_name = 'dutyUserPhone' THEN a.field_value END ) AS dutyUserPhone,
MAX( CASE WHEN a.field_name = 'buildUseType' THEN a.field_value END ) AS buildUseType,
MAX( CASE WHEN a.field_name = 'structureType' THEN a.field_value END ) AS structureType,
MAX( CASE WHEN a.field_name = 'address' THEN a.field_value END ) AS address
FROM
`wl_form_instance` a
WHERE
a.instance_id = #{instanceId}
GROUP BY
a.instance_id
) fi
</select>
<select id="getFormInstanceById" resultType="java.util.Map">
SELECT
a.instance_id AS instanceId,
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,
MAX( CASE WHEN a.field_name = 'riskPointId' THEN a.field_value END ) AS riskSourceId
FROM
`wl_form_instance` a
<where>
<if test="instanceId != null">
a.instance_id = #{instanceId}
</if>
</where>
</select>
<!-- 消防建筑视屏监控统计树 -->
<select id="getBuildVideoListCount" resultType="hashmap">
SELECT
sa.*,
b.total
FROM
(
SELECT
a.instance_id AS instanceId,
a.group_code AS groupCode,
a.group_type AS groupType,
MAX( CASE WHEN a.field_name = 'parentId' THEN a.field_value END ) AS parentId,
MAX( CASE WHEN a.field_name = 'name' THEN a.field_value END ) AS instanceName
FROM
`wl_form_instance` a
GROUP BY
a.instance_id
) sa
LEFT JOIN ( SELECT wlv.source_id, count( wlv.source_id ) AS total FROM `wl_video_source` wlv GROUP BY wlv.source_id ) b ON b.source_id = sa.instanceId
union all
select
123456789123456789 as instanceId,
'else' as groupCode,
'else' as groupType,
0 as parentId,
'其他' as instanceName,
count(1) as total
from
wl_video where id not in (select video_id from wl_video_source)
</select>
<select id="getColaBuildVideoListCount" resultType="hashmap">
SELECT
sa.*,
b.total
FROM
(
SELECT
wws.id AS instanceId,
CONCAT(wws.parent_id,'') AS parentId,
wws.name AS instanceName
FROM
`wl_warehouse_structure` wws
GROUP BY
wws.id
) sa
LEFT JOIN (
SELECT
wws.id AS buildId,
COUNT(wws.id) AS total
FROM
wl_stock_detail wsd,
wl_equipment_detail wed,
wl_equipment we,
wl_equipment_category wec,
wl_warehouse_structure wws
WHERE
wsd.equipment_detail_id = wed.id
AND wed.equipment_id = we.id
AND wec.id = we.category_id
AND wws.id = wsd.warehouse_structure_id
and wec.code in
<foreach collection="dto.monitorCodes" item="dto.monitorCodes" index="index" open="(" close=")" separator=",">
#{dto.monitorCodes}
</foreach>
GROUP BY wws.id
) b ON b.buildId = sa.instanceId
</select>
<insert id="saveStucture">
insert into wl_warehouse_structure
(id,
code,
name,
full_name,
parent_id,
warehouse_id,
create_date,
source_id)
VALUES(
#{instanceId},
#{code},
#{name},
#{address},
#{parentId},
0,
now(),
#{instanceId})
</insert>
<select id="getStuctureName" resultType="String">
select full_name from wl_warehouse_structure
where id = #{id}
</select>
<select id="getStuName" resultType="String">
select name from wl_warehouse_structure
where id = #{id}
</select>
<select id="getStructureParentId" resultType="Long">
select parent_id from wl_warehouse_structure
where id = #{id}
</select>
<delete id="deleteStuById">
DELETE FROM wl_warehouse_structure WHERE id = #{id}
</delete>
<update id="updateStr">
update wl_warehouse_structure
set name = #{name} ,
full_name = #{fullName},
parent_id = #{parentId},
code = #{code}
where id = #{id}
</update>
<update id="updateStrFullName">
update wl_warehouse_structure
set full_name=replace(full_name,#{name},#{fullName})
where
id in (
select instance_id from wl_form_instance where field_name = 'parentId' and field_value = #{id}
union all
select instance_id from wl_form_instance where field_name = 'parentId' and field_value in (
select instance_id from wl_form_instance where field_name = 'parentId' and field_value = #{id}
)
)
</update>
<update id="clearSystemId">
update wl_form_instance
set field_value = null
where field_name like '%system%'
and field_value = #{id}
</update>
<select id="getChildrenNotIsRiskList" resultType="com.yeejoin.equipmanage.common.entity.dto.BuildIsRiskDTO">
select * from (SELECT
a.instance_id AS instanceId,
MAX(
CASE
WHEN a.field_name = 'parentId' THEN
a.field_value
END
) AS parentId,
MAX(
CASE
WHEN a.field_name = 'isRisk' THEN
a.field_value
END
) AS isRisk
FROM
`wl_form_instance` a
GROUP BY
a.instance_id) sa where sa.parentId = #{instanceId} and sa.isRisk = 'false' and sa.isRisk is not null
</select>
<update id="clearRegionBind">
UPDATE
wl_form_instance
SET field_value = (
CASE field_name
WHEN 'isRisk' THEN
'false'
WHEN 'riskPointId' THEN
''
END
)
WHERE
instance_id = #{instanceId} and (field_name = 'isRisk' or field_name = 'riskPointId')
</update>
<select id="getIdAndType" resultType="hashmap">
select
ins.field_value as id,
inst.group_code as type,
str.full_name as address
from
wl_form_instance as ins
left join wl_form_instance as inst on ins.field_value = inst.instance_id
left join wl_warehouse_structure as str on ins.instance_id = str.source_id
where ins.instance_id =#{id}
and ins.field_name ='parentId'
group by ins.field_value
</select>
<!-- // 需求958 导出模板需要列表获取建筑 by kongfm 2021-09-15-->
<select id="getAllBuilding" resultType="hashmap">
select * from (SELECT
a.instance_id AS instanceId,
a.group_code AS groupCode,
a.group_type AS groupType,
a.field_value AS fieldValue,
a.field_label AS fieldLabel,
MAX(CASE WHEN a.field_name = 'parentId' THEN a.field_value END) AS parentId,
MAX(CASE WHEN a.field_name = 'name' THEN a.field_value END)AS buildName
FROM
`wl_form_instance` a
where a.group_type = 'building'
GROUP BY
a.instance_id) sa
ORDER BY sa.instanceId DESC
</select>
<select id="getBuildingToLongitudeAndLatitude" resultType="hashmap">
SELECT
max(CASe WHEN field_name = 'latitude' THEN field_value end ) AS latitude,
max(CASe WHEN field_name = 'longitude' THEN field_value end ) AS longitude
FROM
wl_form_instance
WHERE
instance_id = #{instanceId}
</select>
</mapper>
<?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.equipmanage.mapper.IllegalAttachmentMapper">
</mapper>
<?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.equipmanage.mapper.IllegalMapper">
</mapper>
<?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.equipmanage.mapper.IndustryMapper">
</mapper>
<?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.equipmanage.mapper.JournalMapper">
</mapper>
<?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.equipmanage.mapper.LochusEquipmentMapper">
</mapper>
<?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.equipmanage.mapper.LochusStandardMapper">
</mapper>
<?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.equipmanage.mapper.MaintainResultMapper">
</mapper>
<?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.equipmanage.mapper.MaintainWithinSevenDaysMapper">
</mapper>
<?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.equipmanage.mapper.MaintenanceResourceDataMapper">
<resultMap type="com.yeejoin.equipmanage.common.entity.MaintenanceResourceData" id="MaintenanceResourceDataResult">
<result property="id" column="id"/>
<result property="maintenanceCompanyId" column="maintenance_company_id"/>
<result property="maintenanceCompanyCode" column="maintenance_company_code"/>
<result property="maintenanceCompanyName" column="maintenance_company_name"/>
<result property="ownerUnitId" column="owner_unit_id"/>
<result property="ownerUnitCode" column="owner_unit_code"/>
<result property="ownerUnitName" column="owner_unit_name"/>
<result property="fireFightSysId" column="fire_fight_sys_id"/>
<result property="fireFightSysCode" column="fire_fight_sys_code"/>
<result property="fireFightSysName" column="fire_fight_sys_name"/>
<result property="classifyId" column="classify_id"/>
<result property="classifyCode" column="classify_code"/>
<result property="classifyName" column="classify_name"/>
<result property="classifyType" column="classify_type"/>
<result property="fireFacilityId" column="fire_facility_id"/>
<result property="fireFacilityCode" column="fire_facility_code"/>
<result property="fireFacilityName" column="fire_facility_name"/>
<result property="fireFacilityType" column="fire_facility_type"/>
<result property="maintenanceExpirationTime" column="maintenance_expiration_time"/>
<result property="location" column="location"/>
<result property="createDate" column="create_date"/>
</resultMap>
<sql id="selectMaintenanceResourceDataVo">
select id, maintenance_company_id, maintenance_company_code, maintenance_company_name, owner_unit_id, owner_unit_code, owner_unit_name, fire_fight_sys_id, fire_fight_sys_code, fire_fight_sys_name, classify_id, classify_code, classify_name, classify_type, fire_facility_id, fire_facility_code, fire_facility_name, fire_facility_type, maintenance_expiration_time, maintenance_time, maintenance_cycle, create_date from mt_maintenance_resource_data
</sql>
<select id="selectMaintenanceResourceDataList"
parameterType="com.yeejoin.equipmanage.common.entity.MaintenanceResourceData"
resultMap="MaintenanceResourceDataResult">
<include refid="selectMaintenanceResourceDataVo"/>
<where>
<if test="maintenanceCompanyId != null ">and maintenance_company_id = #{maintenanceCompanyId}</if>
<if test="maintenanceCompanyCode != null and maintenanceCompanyCode != ''">and maintenance_company_code =
#{maintenanceCompanyCode}
</if>
<if test="maintenanceCompanyName != null and maintenanceCompanyName != ''">and maintenance_company_name
like concat('%', #{maintenanceCompanyName}, '%')
</if>
<if test="ownerUnitId != null and ownerUnitId != ''">and owner_unit_id = #{ownerUnitId}</if>
<if test="ownerUnitCode != null and ownerUnitCode != ''">and owner_unit_code = #{ownerUnitCode}</if>
<if test="ownerUnitName != null and ownerUnitName != ''">and owner_unit_name like concat('%',
#{ownerUnitName}, '%')
</if>
<if test="fireFightSysId != null ">and fire_fight_sys_id = #{fireFightSysId}</if>
<if test="fireFightSysCode != null and fireFightSysCode != ''">and fire_fight_sys_code =
#{fireFightSysCode}
</if>
<if test="fireFightSysName != null and fireFightSysName != ''">and fire_fight_sys_name like concat('%',
#{fireFightSysName}, '%')
</if>
<if test="classifyId != null ">and classify_id = #{classifyId}</if>
<if test="classifyCode != null and classifyCode != ''">and classify_code = #{classifyCode}</if>
<if test="classifyName != null and classifyName != ''">and classify_name like concat('%', #{classifyName},
'%')
</if>
<if test="classifyType != null and classifyType != ''">and classify_type = #{classifyType}</if>
<if test="fireFacilityId != null ">and fire_facility_id = #{fireFacilityId}</if>
<if test="fireFacilityCode != null and fireFacilityCode != ''">and fire_facility_code =
#{fireFacilityCode}
</if>
<if test="fireFacilityName != null and fireFacilityName != ''">and fire_facility_name like concat('%',
#{fireFacilityName}, '%')
</if>
<if test="fireFacilityType != null and fireFacilityType != ''">and fire_facility_type =
#{fireFacilityType}
</if>
<if test="maintenanceExpirationTime != null ">and maintenance_expiration_time =
#{maintenanceExpirationTime}
</if>
<if test="location != null and location != ''">and location = #{location}</if>
<if test="createDate != null ">and create_date = #{createDate}</if>
</where>
</select>
<select id="selectMaintenanceResourceDataById" parameterType="Long" resultMap="MaintenanceResourceDataResult">
<include refid="selectMaintenanceResourceDataVo"/>
where id = #{id}
</select>
<insert id="insertMaintenanceResourceData"
parameterType="com.yeejoin.equipmanage.common.entity.MaintenanceResourceData">
insert into mt_maintenance_resource_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="maintenanceCompanyId != null">maintenance_company_id,</if>
<if test="maintenanceCompanyCode != null">maintenance_company_code,</if>
<if test="maintenanceCompanyName != null">maintenance_company_name,</if>
<if test="ownerUnitId != null and ownerUnitId != ''">owner_unit_id,</if>
<if test="ownerUnitCode != null">owner_unit_code,</if>
<if test="ownerUnitName != null">owner_unit_name,</if>
<if test="fireFightSysId != null">fire_fight_sys_id,</if>
<if test="fireFightSysCode != null">fire_fight_sys_code,</if>
<if test="fireFightSysName != null">fire_fight_sys_name,</if>
<if test="classifyId != null">classify_id,</if>
<if test="classifyCode != null">classify_code,</if>
<if test="classifyName != null">classify_name,</if>
<if test="classifyType != null">classify_type,</if>
<if test="fireFacilityId != null">fire_facility_id,</if>
<if test="fireFacilityCode != null">fire_facility_code,</if>
<if test="fireFacilityName != null">fire_facility_name,</if>
<if test="fireFacilityType != null">fire_facility_type,</if>
<if test="maintenanceExpirationTime != null">maintenance_expiration_time,</if>
<if test="maintenanceTime != null">maintenance_time = #{maintenanceTime},</if>
<if test="maintenanceCycle != null">maintenance_cycle = #{maintenanceCycle},</if>
<if test="location != null">location,</if>
<if test="createDate != null">create_date,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="maintenanceCompanyId != null">#{maintenanceCompanyId},</if>
<if test="maintenanceCompanyCode != null">#{maintenanceCompanyCode},</if>
<if test="maintenanceCompanyName != null">#{maintenanceCompanyName},</if>
<if test="ownerUnitId != null and ownerUnitId != ''">#{ownerUnitId},</if>
<if test="ownerUnitCode != null">#{ownerUnitCode},</if>
<if test="ownerUnitName != null">#{ownerUnitName},</if>
<if test="fireFightSysId != null">#{fireFightSysId},</if>
<if test="fireFightSysCode != null">#{fireFightSysCode},</if>
<if test="fireFightSysName != null">#{fireFightSysName},</if>
<if test="classifyId != null">#{classifyId},</if>
<if test="classifyCode != null">#{classifyCode},</if>
<if test="classifyName != null">#{classifyName},</if>
<if test="classifyType != null">#{classifyType},</if>
<if test="fireFacilityId != null">#{fireFacilityId},</if>
<if test="fireFacilityCode != null">#{fireFacilityCode},</if>
<if test="fireFacilityName != null">#{fireFacilityName},</if>
<if test="fireFacilityType != null">#{fireFacilityType},</if>
<if test="maintenanceExpirationTime != null">#{maintenanceExpirationTime},</if>
<if test="maintenanceTime != null">#{maintenanceTime},</if>
<if test="maintenanceCycle != null">#{maintenanceCycle},</if>
<if test="location != null">#{location},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createDate != null">#{createDate},</if>
</trim>
</insert>
<update id="updateMaintenanceResourceData"
parameterType="com.yeejoin.equipmanage.common.entity.MaintenanceResourceData">
update mt_maintenance_resource_data
<trim prefix="SET" suffixOverrides=",">
<if test="maintenanceCompanyId != null">maintenance_company_id = #{maintenanceCompanyId},</if>
<if test="maintenanceCompanyCode != null">maintenance_company_code = #{maintenanceCompanyCode},</if>
<if test="maintenanceCompanyName != null">maintenance_company_name = #{maintenanceCompanyName},</if>
<if test="ownerUnitId != null and ownerUnitId != ''">owner_unit_id = #{ownerUnitId},</if>
<if test="ownerUnitCode != null">owner_unit_code = #{ownerUnitCode},</if>
<if test="ownerUnitName != null">owner_unit_name = #{ownerUnitName},</if>
<if test="fireFightSysId != null">fire_fight_sys_id = #{fireFightSysId},</if>
<if test="fireFightSysCode != null">fire_fight_sys_code = #{fireFightSysCode},</if>
<if test="fireFightSysName != null">fire_fight_sys_name = #{fireFightSysName},</if>
<if test="classifyId != null">classify_id = #{classifyId},</if>
<if test="classifyCode != null">classify_code = #{classifyCode},</if>
<if test="classifyName != null">classify_name = #{classifyName},</if>
<if test="classifyType != null">classify_type = #{classifyType},</if>
<if test="fireFacilityId != null">fire_facility_id = #{fireFacilityId},</if>
<if test="fireFacilityCode != null">fire_facility_code = #{fireFacilityCode},</if>
<if test="fireFacilityName != null">fire_facility_name = #{fireFacilityName},</if>
<if test="fireFacilityType != null">fire_facility_type = #{fireFacilityType},</if>
<if test="maintenanceExpirationTime != null">maintenance_expiration_time = #{maintenanceExpirationTime},
</if>
<if test="maintenanceTime != null">maintenance_time = #{maintenanceTime},</if>
<if test="maintenanceCycle != null">maintenance_cycle = #{maintenanceCycle},</if>
<if test="location != null">location = #{location},</if>
<if test="createDate != null">create_date = #{createDate},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMaintenanceResourceDataById" parameterType="Long">
delete from mt_maintenance_resource_data where id = #{id}
</delete>
<delete id="deleteMaintenanceResourceDataByIds" parameterType="String">
delete from mt_maintenance_resource_data where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getMaintenanceResourceDataList"
resultType="com.yeejoin.equipmanage.common.entity.MaintenanceResourceData">
</select>
<select id="getRelationKey" resultType="java.lang.String">
SELECT
CONCAT(m.fire_facility_id,'-',m.fire_facility_type)
FROM
mt_maintenance_resource_data m
<where>
<choose>
<when test="list != null and list.size() >0">
CONCAT(m.fire_facility_id,'-',m.fire_facility_type) IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</when>
<otherwise>
m.id = -1
</otherwise>
</choose>
</where>
</select>
<select id="getClassifyPage" resultType="com.yeejoin.equipmanage.common.dto.MaintenanceResourceDataDto">
SELECT
m.maintenance_company_id,
m.maintenance_company_name,
m.owner_unit_id,
m.owner_unit_name,
m.fire_fight_sys_id,
m.fire_fight_sys_name,
m.classify_id,
m.classify_name,
m.classify_type,
m.classify_code,
COUNT( 1 ) AS amount,
SUM(IF(m.maintenance_expiration_time &lt;= CURRENT_DATE,1,0)) AS expirationAmount
FROM
`mt_maintenance_resource_data` m
<where>
<if test="maintenanceCompanyId != null">
m.maintenance_company_id = #{maintenanceCompanyId}
</if>
<if test="ownerUnitId != null">
m.owner_unit_id = #{ownerUnitId}
</if>
<if test="fireFightSysId != null">
m.fire_fight_sys_id = #{fireFightSysId}
</if>
</where>
GROUP BY
m.classify_code
</select>
<select id="getFireFacilityPage" resultType="com.yeejoin.equipmanage.common.dto.MaintenanceResourceDataDto">
SELECT
m.maintenance_company_id,
m.maintenance_company_name,
m.owner_unit_id,
m.owner_unit_name,
m.fire_fight_sys_id,
m.fire_fight_sys_name,
m.classify_id,
m.classify_name,
m.classify_type,
m.classify_code,
m.fire_facility_id,
m.fire_facility_code,
m.fire_facility_name,
m.fire_facility_type,
m.maintenance_time,
m.maintenance_cycle,
m.`status`,
IF(m.maintenance_expiration_time IS NOT NULL , IF(m.maintenance_expiration_time &lt;= CURRENT_DATE,'已到期','正常'), '') AS `statusText`,
m.location
FROM
`mt_maintenance_resource_data` m
<where>
<if test="maintenanceCompanyId != null">
m.maintenance_company_id = #{maintenanceCompanyId}
</if>
<if test="ownerUnitId != null">
AND m.owner_unit_id = #{ownerUnitId}
</if>
<if test="fireFightSysId != null">
AND m.fire_fight_sys_id = #{fireFightSysId}
</if>
<if test="classifyId != null">
AND m.classify_id = #{classifyId}
</if>
<if test="buildingId != null and buildingId.size() > 0">
AND m.building_id IN
<foreach collection="buildingId" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="status != null and status != ''">
AND m.`status` = #{status}
</if>
</where>
</select>
<select id="getFireFacilityList" resultType="com.yeejoin.equipmanage.common.entity.MaintenanceResourceData">
SELECT
m.maintenance_company_id,
m.maintenance_company_name,
m.owner_unit_id,
m.owner_unit_name,
m.fire_fight_sys_id,
m.fire_fight_sys_name,
m.classify_id,
m.classify_name,
m.classify_type,
m.classify_code,
m.fire_facility_id,
m.fire_facility_code,
m.fire_facility_name,
m.fire_facility_type,
m.`status`
FROM
`mt_maintenance_resource_data` m
<where>
m.maintenance_expiration_time &lt;= CURRENT_DATE
<if test="type != null">
<if test="id != null and type == 1">
AND m.maintenance_company_id = #{id}
</if>
<if test="id != null and type == 2">
AND m.owner_unit_id = #{id}
</if>
<if test="id != null and type == 3">
AND m.fire_fight_sys_id = #{id}
</if>
<if test="id != null and type == 4">
AND m.fire_facility_id = #{id}
</if>
</if>
</where>
</select>
<select id="deleteBeforeMainResCount" resultType="com.yeejoin.equipmanage.common.dto.MaintenanceResourceDataDto">
SELECT
m.maintenance_company_id,
m.owner_unit_id,
m.fire_fight_sys_id,
m.classify_id,
COUNT( m.fire_facility_id ) AS amount
FROM
`mt_maintenance_resource_data` m
<where>
<if test="list != null and list.length >0">
m.id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
GROUP BY
m.maintenance_company_id,
m.owner_unit_id,
m.fire_fight_sys_id,
m.classify_id;
</select>
<delete id="deleteClassifyList" parameterType="java.util.List">
delete from mt_maintenance_resource where
<foreach collection="list" item="item" separator=" or " index="index">
(id= #{item.classifyId} and parent_id= #{item.fireFightSysId})
</foreach>
</delete>
<delete id="deleteFireFightSysList" parameterType="java.util.List">
delete from mt_maintenance_resource where
<foreach collection="list" item="item" separator=" or " index="index">
(id= #{item.fireFightSysId} and parent_id= #{item.ownerUnitId})
</foreach>
</delete>
</mapper>
\ 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.equipmanage.mapper.MaintenanceResourceMapper">
<resultMap type="com.yeejoin.equipmanage.common.entity.MaintenanceResource" id="MaintenanceResourceResult">
<result property="id" column="id"/>
<result property="code" column="code"/>
<result property="name" column="name"/>
<result property="type" column="type"/>
<result property="parentId" column="parent_id"/>
<result property="createDate" column="create_date"/>
</resultMap>
<sql id="selectMaintenanceResourceVo">
select id, maintenance_company_id, maintenance_company_code, maintenance_company_name, owner_unit_id, owner_unit_code, owner_unit_name, fire_fight_sys_id, fire_fight_sys_code, fire_fight_sys_name, classify_id, classify_code, classify_name, classify_type, parent_id, create_date from mt_maintenance_resource
</sql>
<select id="selectMaintenanceResourceList" parameterType="com.yeejoin.equipmanage.common.entity.MaintenanceResource"
resultMap="MaintenanceResourceResult">
<include refid="selectMaintenanceResourceVo"/>
<where>
</where>
</select>
<select id="selectMaintenanceResourceById" parameterType="Long" resultMap="MaintenanceResourceResult">
<include refid="selectMaintenanceResourceVo"/>
where id = #{id}
</select>
<insert id="insertMaintenanceResource" parameterType="com.yeejoin.equipmanage.common.entity.MaintenanceResource">
insert into mt_maintenance_resource
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="maintenanceCompanyId != null">maintenance_company_id,</if>
<if test="maintenanceCompanyCode != null">maintenance_company_code,</if>
<if test="maintenanceCompanyName != null">maintenance_company_name,</if>
<if test="ownerUnitId != null">owner_unit_id,</if>
<if test="ownerUnitCode != null">owner_unit_code,</if>
<if test="ownerUnitName != null">owner_unit_name,</if>
<if test="fireFightSysId != null">fire_fight_sys_id,</if>
<if test="fireFightSysCode != null">fire_fight_sys_code,</if>
<if test="fireFightSysName != null">fire_fight_sys_name,</if>
<if test="classifyId != null">classify_id,</if>
<if test="classifyCode != null">classify_code,</if>
<if test="classifyName != null">classify_name,</if>
<if test="classifyType != null">classify_type,</if>
<if test="parentId != null">parent_id,</if>
<if test="createDate != null">create_date,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="maintenanceCompanyId != null">#{maintenanceCompanyId},</if>
<if test="maintenanceCompanyCode != null">#{maintenanceCompanyCode},</if>
<if test="maintenanceCompanyName != null">#{maintenanceCompanyName},</if>
<if test="ownerUnitId != null">#{ownerUnitId},</if>
<if test="ownerUnitCode != null">#{ownerUnitCode},</if>
<if test="ownerUnitName != null">#{ownerUnitName},</if>
<if test="fireFightSysId != null">#{fireFightSysId},</if>
<if test="fireFightSysCode != null">#{fireFightSysCode},</if>
<if test="fireFightSysName != null">#{fireFightSysName},</if>
<if test="classifyId != null">#{classifyId},</if>
<if test="classifyCode != null">#{classifyCode},</if>
<if test="classifyName != null">#{classifyName},</if>
<if test="classifyType != null">#{classifyType},</if>
<if test="parentId != null">#{parentId},</if>
<if test="createDate != null">#{createDate},</if>
</trim>
</insert>
<update id="updateMaintenanceResource" parameterType="com.yeejoin.equipmanage.common.entity.MaintenanceResource">
update mt_maintenance_resource
<trim prefix="SET" suffixOverrides=",">
<if test="maintenanceCompanyId != null">maintenance_company_id = #{maintenanceCompanyId},</if>
<if test="maintenanceCompanyCode != null">maintenance_company_code = #{maintenanceCompanyCode},</if>
<if test="maintenanceCompanyName != null">maintenance_company_name = #{maintenanceCompanyName},</if>
<if test="ownerUnitId != null">owner_unit_id = #{ownerUnitId},</if>
<if test="ownerUnitCode != null">owner_unit_code = #{ownerUnitCode},</if>
<if test="ownerUnitName != null">owner_unit_name = #{ownerUnitName},</if>
<if test="fireFightSysId != null">fire_fight_sys_id = #{fireFightSysId},</if>
<if test="fireFightSysCode != null">fire_fight_sys_code = #{fireFightSysCode},</if>
<if test="fireFightSysName != null">fire_fight_sys_name = #{fireFightSysName},</if>
<if test="classifyId != null">classify_id = #{classifyId},</if>
<if test="classifyCode != null">classify_code = #{classifyCode},</if>
<if test="classifyName != null">classify_name = #{classifyName},</if>
<if test="classifyType != null">classify_type = #{classifyType},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="createDate != null">create_date = #{createDate},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMaintenanceResourceById" parameterType="Long">
delete from mt_maintenance_resource where id = #{id}
</delete>
<delete id="deleteMaintenanceResourceByIds" parameterType="String">
delete from mt_maintenance_resource where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="findTierKeyByParentId" resultType="java.util.Map">
SELECT
CONCAT( m.id, '-', m.parent_id ) AS `key`,
m.id AS `value`
FROM
`mt_maintenance_resource` m
<where>
<if test="parentId != null">
m.parent_id <![CDATA[ <> ]]> #{parentId}
</if>
</where>
GROUP BY
m.id,
m.parent_id
</select>
<select id="selectAll" resultType="com.yeejoin.equipmanage.common.dto.MaintenanceResourceDto">
<![CDATA[
SELECT
m.*
FROM
`mt_maintenance_resource` m
]]>
</select>
<select id="findTreeById" resultType="com.yeejoin.equipmanage.common.dto.MaintenanceResourceDto">
<![CDATA[
SELECT
m.*
FROM
`mt_maintenance_resource` m
]]>
<where>
<if test="id != null">
FIND_IN_SET(m.id, getMaintenanceResourceTreeById(#{id}))
</if>
</where>
</select>
<select id="findByIds" resultType="com.yeejoin.equipmanage.common.vo.MaintenanceResourceDataVo">
<![CDATA[
SELECT
m.fire_facility_name,
m.location,
m.classify_name,
m.fire_fight_sys_name,
m.maintenance_expiration_time,
m.fire_facility_code,
m.owner_unit_name,
m.create_date
FROM
mt_maintenance_resource_data m
]]>
<where>
<if test="list != null and list.size() >0">
AND m.id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
<select id="getFireFightSysPage" resultType="com.yeejoin.equipmanage.common.vo.MaintenanceResourceVo">
<![CDATA[
SELECT
m.*
FROM
`mt_maintenance_resource` m
]]>
<where>
<if test="maintenanceCompanyId != null">
FIND_IN_SET(m.id, getMaintenanceResourceTreeById(#{maintenanceCompanyId}))
</if>
<if test="ownerUnitId != null">
FIND_IN_SET(m.id, getMaintenanceResourceTreeById(#{ownerUnitId}))
</if>
<if test="fireFightSysId != null">
FIND_IN_SET(m.id, getMaintenanceResourceTreeById(#{fireFightSysId}))
</if>
<if test="type != null">
AND m.type = #{type}
</if>
</where>
GROUP BY
m.id
</select>
<select id="selectOwnerUnitList" resultType="com.yeejoin.equipmanage.common.dto.MaintenanceResourceDto">
<![CDATA[
SELECT
m.*
FROM
`mt_maintenance_resource` m
]]>
<where>
<if test="type != null">
m.type = #{type}
<if test="id != null">
<choose>
<when test="type == 1">
AND FIND_IN_SET(m.id, getMaintenanceResourceTreeById(#{id}))
</when>
<otherwise>
AND m.id = #{id}
</otherwise>
</choose>
</if>
</if>
</where>
GROUP BY
m.id
</select>
<select id="findByTypeIn" resultType="com.yeejoin.equipmanage.common.dto.MaintenanceResourceDto">
<![CDATA[
SELECT
m.*
FROM
`mt_maintenance_resource` m
]]>
<where>
<if test="ids != null and ids.length >0">
m.type IN
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
<update id="updateBatch" parameterType="list">
<if test="list != null and list.size() >0">
REPLACE INTO mt_maintenance_resource ( id, `name`, `code`, type, parent_id, create_date ) VALUES
<foreach collection="list" item="item" index="index" open="" close=";" separator=",">
(#{item.id},#{item.name},#{item.code},#{item.type},#{item.parentId}, NOW())
</foreach>
</if>
</update>
</mapper>
\ 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.equipmanage.mapper.MaintianQueryMapper">
</mapper>
<?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.equipmanage.mapper.ManufacturerInfoMapper">
<select id="finduseManufacturer" resultType="int">
select sum(count) from
(
select
count(1) as count
from
wl_car a
where a.manufacturer_id =#{id}
union
select
count(1) as count
from
wl_equipment_detail a
where a.manufacturer_id =#{id}
)data
</select>
<select id="checkName" resultType="int">
select count(1) from wl_manufacturer_info
where name = #{name}
<if test="id != null and id != ''">
and id != #{id}
</if>
</select>
<select id="checkDelete" resultType="string">
select name from wl_equipment_detail where equipment_id = #{id}
union
select name from wl_car where equipment_id = #{id}
</select>
</mapper>
<?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.equipmanage.mapper.MonitorEventMapper">
<insert id="saveEvent">
INSERT INTO wl_monitor_event(
id,
event_content,
event_type,
video_id,
video_name,
video_code,
video_position,
video_monitor_position,
event_state,
snap_pictures,
event_date,
onduty,
disposal_record,
disposal_user_id,
disposal_user_name,
disposal_date,
create_date)
value (
#{id},
#{eventContent},
#{eventType},
#{videoId},
#{videoName},
#{videoCode},
#{videoPosition},
#{videoMonitorPosition},
#{eventState},
#{snapPictures},
sysdate(),
#{onduty},
null,
null,
null,
null,
sysdate()
)
</insert>
</mapper>
<?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.equipmanage.mapper.MonitorViewVideoMapper">
<delete id="deleteMonitorViewVideo">
DELETE from wl_monitor_view_video where view_id = #{viewId};
</delete>
</mapper>
<?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.equipmanage.mapper.NoticeMapper">
</mapper>
<?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.equipmanage.mapper.RiskSourceMapper">
<select id="findByIsRegion" resultType="com.yeejoin.equipmanage.common.dto.FireRiskSourceDto">
SELECT
a.id,
a.`name`,
a.parent_id,
a.`code` AS mrid
FROM
`f_risk_source` a
<where>
<choose>
<when test="isRegion">
a.is_region = 'TRUE'
</when>
<otherwise>
a.is_region = 'FALSE'
</otherwise>
</choose>
</where>
</select>
<select id="findAll" resultType="com.yeejoin.equipmanage.common.dto.FireRiskSourceDto">
SELECT
a.id,
a.`name`,
a.parent_id,
a.`code` AS mrid
FROM
`f_risk_source` a
</select>
</mapper>
\ 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.equipmanage.mapper.RiskSourceSceneMapper">
<resultMap id="riskSourceMap" type="com.yeejoin.equipmanage.common.entity.vo.RiskSourceTreeVO">
<result property="id" column="id"/>
<result property="parentId" column="parent_id"/>
<result property="code" column="code"/>
<result property="name" column="name"/>
<result property="level" column="level"/>
<result property="riskLevelId" column="risk_level_id"/>
<result property="rpn" column="rpn"/>
<result property="rpni" column="rpni"/>
<result property="isRegion" column="is_region"/>
<result property="isIndoor" column="is_indoor"/>
<result property="status" column="status"/>
<result property="count" column="ccount"/>
<result property="qualified" column="qualified"/>
<result property="unqualified" column="unqualified"/>
<result property="omission" column="omission"/>
<result property="unplan" column="unplan"/>
<result property="position3d" column="position3d"/>
<result property="tube" column="tube"/>
<result property="port" column="port"/>
<result property="password" column="password"/>
<result property="account" column="account"/>
<result property="ip" column="ip"/>
<result property="rtspAddress" column="rtsp_address"/>
<result property="url" column="url"/>
<result property="carmeraType" column="carmera_type"/>
<result property="token" column="token"/>
<result property="riskSourceType" column="riskSourceType"/>
<result property="sceneId" column="sceneId"/>
</resultMap>
<select id="getRiskSources" resultMap="riskSourceMap">
SELECT
id,
`code`,
parent_id,
`name`,
risk_level_id,
rpn,
rpni,
is_region,
position3d,
floor3d,
status,
is_indoor,
'menu' riskSourceType
FROM
`f_risk_source`
where org_code = #{compCode} and is_region='TRUE'
ORDER BY sort_num,id ASC
</select>
<select id="getVideo" resultMap="riskSourceMap">
select
wlv.name,
wlvs.id,
wlv.token,
wlv.carmera_type,
wlv.url,
wlv.rtsp_address,
wlv.ip,
wlv.account,
wlv.password,
wlv.port,
wlv.position3d,
wlv.tube,
'video' riskSourceType,
wlvs.source_id as sceneId
from wl_video wlv
left join wl_video_source wlvs on wlv.id = wlvs.video_id
where wlvs.source_id=#{sourceId}
</select>
<select id="getImportantEquip" resultMap="riskSourceMap">
select id,name,'false' is_region from f_equipment where risk_source_id=#{sourceId}
</select>
<select id="getAllImportantEquip" resultType="com.yeejoin.equipmanage.common.entity.vo.PointTreeVo">
select
feq.id as sequenceNbr,
feq.name as displayName ,
feq.risk_source_id as parentId,
'equip' as template
from f_equipment as feq
</select>
</mapper>
<?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.equipmanage.mapper.ScrapDetailMapper">
</mapper>
<?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.equipmanage.mapper.ScrapMapper">
<select id="getImgById" resultType="String">
<if test="type != 2">
select
eq.img
from
wl_scrap_detail as det
left join wl_stock_detail as stdet on det.stock_detail_id =stdet .id
left join wl_equipment_detail as eqdet on stdet.equipment_detail_id = eqdet .id
left join wl_equipment as eq on eqdet.equipment_id =eq.id
where det.scrap_id =#{id}
</if>
<if test="type == 2">
select
eq.img
from
wl_scrap_detail as det
left join wl_car as wc on det.car_id =wc.id
left join wl_equipment as eq on wc.equipment_id =eq.id
where det.scrap_id =#{id}
</if>
limit 1
</select>
<select id="getOneByQrcode" resultType="java.lang.Integer">
select count(1)
from
wl_scrap_detail as wsd
left join wl_stock_detail as stdet on wsd.stock_detail_id = stdet.id
where
stdet.qr_code = #{qrCode}
and
stdet.status = 7
</select>
<select id="getCarByQrcode" resultType="java.lang.Integer">
select count(1)
from
wl_scrap_detail as wsd
left join wl_car as wc on wsd.car_id = wc.id
where
wc.qr_code = #{qrCode}
and
wc.car_state = 7
</select>
<select id="geteqTypeAndAmount" resultType="java.util.Map">
select
wsd.amount as amount ,
substring( wed.code,1,1) as eqType,
IFNULL(wu.name, '') as unitName
from
wl_scrap_detail as wsd
left join wl_stock_detail as wskd on wskd.id = wsd.stock_detail_id
left join wl_equipment_detail as wed on wed.id = wskd.equipment_detail_id
left join wl_equipment as we on we.id = wed.equipment_id
left join wl_unit as wu on wu.id = we.unit_id
where
wsd.scrap_id = #{id}
and wsd.car_id is null
union all
select
wsd.amount,
'2' as code,
IFNULL(wu.name, '') as unitName
from
wl_scrap_detail as wsd
left join wl_car as wc on wc.id = wsd.car_id
left join wl_equipment as we on we.id = wc.equipment_id
left join wl_unit as wu on wu.id = we.unit_id
where
wsd.scrap_id = #{id}
and wsd.car_id is not null
</select>
</mapper>
<?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.equipmanage.mapper.SearchMapper">
<select id="universal" resultType="Map">
SELECT
wec.NAME AS categoryName,
wed.NAME AS name,
wed.CODE AS code,
wec.CODE AS
categoryCode,
COUNT( wed.NAME ) AS count,
SUM( wsd.amount ) AS sum,
warehouse_structure_id AS warehouseStructureId,
wws.full_name AS
warehouseStructureName,
wsd.equipment_detail_id AS equipmentDetailId,
wed.standard,
wmi.NAME AS manufacturerName,
wed.brand,
wed.equipment_id
AS equipmentId,
"" AS carNum
FROM
wl_stock_detail wsd
LEFT JOIN
wl_equipment_detail wed ON wed.id = wsd.equipment_detail_id
LEFT JOIN
wl_equipment we ON we.id = wed.equipment_id
LEFT JOIN
wl_equipment_category wec ON wec.id = we.category_id
LEFT JOIN
wl_manufacturer_info wmi ON wmi.id = wed.manufacturer_id
LEFT JOIN
wl_warehouse_structure wws ON wws.id =
wsd.warehouse_structure_id
<where>
AND wsd.warehouse_id = #{warehouseId}
AND wsd.STATUS != 7
AND wsd.STATUS != 11
<if test="keyword != null and keyword != ''">AND wed.NAME LIKE CONCAT('%',#{keyword},'%' ) </if>
</where>
GROUP BY
warehouse_structure_id,
equipment_detail_id
UNION
SELECT
wec.NAME
AS categoryName,
we.NAME AS
name,
c.car_code AS code,
wec.CODE AS
categoryCode,
1 AS count,
1 AS sum,
"" AS
warehouseStructureId,
"" AS
warehouseStructureName,
"" AS
equipmentDetailId,
"" AS standard,
wmi.NAME
AS manufacturerName,
c.brand,
c.equipment_id AS equipmentId,
c.car_num AS
carNum
FROM
wl_car c
LEFT JOIN
wl_equipment we ON we.id = c.equipment_id
LEFT JOIN
wl_equipment_category wec ON wec.id = we.category_id
LEFT JOIN
wl_manufacturer_info wmi ON wmi.id = c.manufacturer_id
<where>
AND c.org_code = #{orgcode}
<if test="keyword != null and keyword != ''">AND we.NAME LIKE CONCAT('%',#{keyword},'%' ) OR c.car_num
LIKE CONCAT('%',#{keyword},'%' ) </if>
</where>
ORDER BY NAME
LIMIT #{offset},#{size}
</select>
</mapper>
<?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.equipmanage.mapper.SourceFileMapper">
<select id="findImgByFileCategory" resultType="com.yeejoin.equipmanage.common.vo.SourceFileVo">
SELECT
f.file_category,
f.file_name,
f.file_path,
f.source_id
FROM
`wl_source_file` f
<where>
<if test="id != null">
f.source_id = #{id}
</if>
<if test="fileCategory != null and fileCategory != ''">
AND f.file_category = #{fileCategory}
</if>
</where>
</select>
</mapper>
<?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.equipmanage.mapper.SourceSceneMapper">
</mapper>
<?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.equipmanage.mapper.StockBillDetailMapper">
<resultMap id="StockBillDetail" type="com.yeejoin.equipmanage.common.entity.vo.StockBillDetailVO">
<result column="standard" property="standard"></result>
<result column="single_equip_code" property="singleEquipCode"></result>
<result column="amount" property="amount"></result>
<result column="equipment_name" property="equipmentName"></result>
<result column="equipment_type_name" property="equipmentTypeName"></result>
<result column="manufacturer_name" property="manufacturerName"></result>
<result column="unit_name" property="unitName"></result>
<result column="org_code" property="orgCode"></result>
<result column="type" property="type"></result>
</resultMap>
<select id="selectStockBillDetailPage"
resultMap="StockBillDetail">
<if test='type == "1"'>
select
wled.standard,
wlst.single_equip_code,
wlst.amount,
wled.name equipment_name,
wled.org_code,
wlec.name equipment_type_name,
wlmi.name manufacturer_name,
wlu.name unit_name
from wl_stock_bill_detail wlst
left join wl_equipment_detail wled on wlst.equipment_detail_id = wled.id
left join wl_equipment wleu on wled.equipment_id = wleu.id
left join wl_unit wlu on wleu.unit_id = wlu.id
left join wl_equipment_category wlec on wleu.category_id = wlec.id
left join wl_manufacturer_info wlmi on wled.manufacturer_id = wlmi.id
where wlst.stock_bill_id=#{id}
<if test="equipmentName != null and equipmentName != ''">
and wled.name like concat('%',#{equipmentName},'%')
</if>
<if test="manufacturerName != null and manufacturerName != ''">
and wlmi.name like concat('%',#{manufacturerName},'%')
</if>
<if test="equipmentTypeName != null and equipmentTypeName != ''">
and wlec.name like concat('%',#{equipmentTypeName},'%')
</if>
</if>
<if test='type == "2"'>
SELECT * FROM (
SELECT
wlm.repair_id,
wlcr.standard AS standard,
wlcr.qr_code AS single_equip_code,
wlcr.NAME AS equipment_name,
1 AS amount,
wlcr.org_code,
wlec.NAME AS equipment_type_name,
wlmi.NAME AS manufacturer_name,
wlu.NAME AS unit_name
FROM
wl_repair_detail wlm
LEFT JOIN wl_car wlcr ON wlcr.id = wlm.car_id
LEFT JOIN wl_equipment wleu ON wlcr.equipment_id = wleu.id
LEFT JOIN wl_equipment_category wlec ON wleu.category_id = wlec.id
LEFT JOIN wl_manufacturer_info wlmi ON wlcr.manufacturer_id = wlmi.id
LEFT JOIN wl_unit wlu ON wleu.unit_id = wlu.id
WHERE
wlm.car_id IS NOT NULL
<if test="equipmentName != null and equipmentName != ''">
and wlcr.name like concat('%',#{equipmentName},'%')
</if>
<if test="manufacturerName != null and manufacturerName != ''">
and wlmi.name like concat('%',#{manufacturerName},'%')
</if>
<if test="equipmentTypeName != null and equipmentTypeName != ''">
and wlec.name like concat('%',#{equipmentTypeName},'%')
</if>
UNION ALL
SELECT
wlm.repair_id ,
wled.standard as standard,
wleq.qr_code as single_equip_code,
wled.name AS equipment_name,
wlm.amount,
wlsd.org_code,
wlec.NAME AS equipment_type_name,
wlmi.NAME AS manufacturer_name,
wlu.NAME AS unit_name
FROM
wl_repair_detail wlm
LEFT JOIN wl_stock_detail wlsd ON wlsd.id = wlm.stock_detail_id
LEFT JOIN wl_equipment_detail wled ON wled.id = wlsd.equipment_detail_id
left join wl_equipment_specific wleq on wlsd.qr_code = wleq.qr_code
left join wl_equipment wleu on wled.equipment_id=wleu.id
LEFT JOIN wl_equipment_category wlec ON wleu.category_id = wlec.id
LEFT JOIN wl_manufacturer_info wlmi ON wled.manufacturer_id = wlmi.id
LEFT JOIN wl_unit wlu ON wleu.unit_id = wlu.id
where wlm.stock_detail_id IS NOT NULL
<if test="equipmentName != null and equipmentName != ''">
and wled.name like concat('%',#{equipmentName},'%')
</if>
<if test="manufacturerName != null and manufacturerName != ''">
and wlmi.name like concat('%',#{manufacturerName},'%')
</if>
<if test="equipmentTypeName != null and equipmentTypeName != ''">
and wlec.name like concat('%',#{equipmentTypeName},'%')
</if>
) detail WHERE detail.repair_id=#{id}
</if>
<if test='type == "3"'>
SELECT * FROM (
SELECT
wlm.maintain_id,
wlcr.standard AS standard,
wlcr.qr_code AS single_equip_code,
wlcr.NAME AS equipment_name,
1 AS amount,
wlcr.org_code,
wlec.NAME AS equipment_type_name,
wlmi.NAME AS manufacturer_name,
wlu.NAME AS unit_name
FROM
wl_maintain_detail wlm
LEFT JOIN wl_car wlcr ON wlcr.id = wlm.car_id
LEFT JOIN wl_equipment wleu ON wlcr.equipment_id = wleu.id
LEFT JOIN wl_equipment_category wlec ON wleu.category_id = wlec.id
LEFT JOIN wl_manufacturer_info wlmi ON wlcr.manufacturer_id = wlmi.id
LEFT JOIN wl_unit wlu ON wleu.unit_id = wlu.id
WHERE
wlm.car_id IS NOT NULL
<if test="equipmentName != null and equipmentName != ''">
and wlcr.name like concat('%',#{equipmentName},'%')
</if>
<if test="manufacturerName != null and manufacturerName != ''">
and wlmi.name like concat('%',#{manufacturerName},'%')
</if>
<if test="equipmentTypeName != null and equipmentTypeName != ''">
and wlec.name like concat('%',#{equipmentTypeName},'%')
</if>
UNION ALL
SELECT
wlm.maintain_id,
wled.standard,
wleq.qr_code as single_equip_code,
wled.name AS equipment_name,
wlsd.amount,
wlsd.org_code,
wlec.NAME AS equipment_type_name,
wlmi.NAME AS manufacturer_name,
wlu.NAME AS unit_name
FROM
wl_maintain_detail wlm
LEFT JOIN wl_stock_detail wlsd ON wlsd.id = wlm.stock_detail_id
LEFT JOIN wl_equipment_detail wled ON wled.id = wlsd.equipment_detail_id
left join wl_equipment_specific wleq on wlsd.qr_code = wleq.qr_code
left join wl_equipment wleu on wled.equipment_id=wleu.id
LEFT JOIN wl_equipment_category wlec ON wleu.category_id = wlec.id
LEFT JOIN wl_manufacturer_info wlmi ON wled.manufacturer_id = wlmi.id
LEFT JOIN wl_unit wlu ON wleu.unit_id = wlu.id
where wlm.stock_detail_id IS NOT NULL
<if test="equipmentName != null and equipmentName != ''">
and wled.name like concat('%',#{equipmentName},'%')
</if>
<if test="manufacturerName != null and manufacturerName != ''">
and wlmi.name like concat('%',#{manufacturerName},'%')
</if>
<if test="equipmentTypeName != null and equipmentTypeName != ''">
and wlec.name like concat('%',#{equipmentTypeName},'%')
</if>
) detail WHERE detail.maintain_id=#{id}
</if>
<if test='type == "4"'>
SELECT
wled.standard,
wleq.qr_code as single_equip_code,
wled.name AS equipment_name,
wlm.amount,
wlsd.org_code,
wlec.NAME AS equipment_type_name,
wlmi.NAME AS manufacturer_name,
wlu.NAME AS unit_name
FROM
wl_wastage_bill_detail wlm
LEFT JOIN wl_stock_detail wlsd ON wlsd.id = wlm.stock_detail_id
LEFT JOIN wl_equipment_detail wled ON wled.id = wlsd.equipment_detail_id
left join wl_equipment_specific wleq on wlsd.qr_code = wleq.qr_code
left join wl_equipment wleu on wled.equipment_id=wleu.id
LEFT JOIN wl_equipment_category wlec ON wleu.category_id = wlec.id
LEFT JOIN wl_manufacturer_info wlmi ON wled.manufacturer_id = wlmi.id
LEFT JOIN wl_unit wlu ON wleu.unit_id = wlu.id
where wlm.wastage_bill_id=#{id}
<if test="equipmentName != null and equipmentName != ''">
and wled.name like concat('%',#{equipmentName},'%')
</if>
<if test="manufacturerName != null and manufacturerName != ''">
and wlmi.name like concat('%',#{manufacturerName},'%')
</if>
<if test="equipmentTypeName != null and equipmentTypeName != ''">
and wlec.name like concat('%',#{equipmentTypeName},'%')
</if>
</if>
<if test='type == "5"'>
SELECT * FROM (
SELECT
wlm.scrap_id,
wlcr.standard AS standard,
wlcr.qr_code AS single_equip_code,
wlcr.NAME AS equipment_name,
1 AS amount,
wlcr.org_code,
wlec.NAME AS equipment_type_name,
wlmi.NAME AS manufacturer_name,
wlu.NAME AS unit_name
FROM
wl_scrap_detail wlm
LEFT JOIN wl_car wlcr ON wlcr.id = wlm.car_id
LEFT JOIN wl_equipment wleu ON wlcr.equipment_id = wleu.id
LEFT JOIN wl_equipment_category wlec ON wleu.category_id = wlec.id
LEFT JOIN wl_manufacturer_info wlmi ON wlcr.manufacturer_id = wlmi.id
LEFT JOIN wl_unit wlu ON wleu.unit_id = wlu.id
WHERE
wlm.car_id IS NOT NULL
<if test="equipmentName != null and equipmentName != ''">
and wlcr.name like concat('%',#{equipmentName},'%')
</if>
<if test="manufacturerName != null and manufacturerName != ''">
and wlmi.name like concat('%',#{manufacturerName},'%')
</if>
<if test="equipmentTypeName != null and equipmentTypeName != ''">
and wlec.name like concat('%',#{equipmentTypeName},'%')
</if>
UNION ALL
SELECT
wlm.scrap_id,
wled.standard,
wleq.qr_code as single_equip_code,
wled.name AS equipment_name,
wlm.amount,
wlsd.org_code,
wlec.NAME AS equipment_type_name,
wlmi.NAME AS manufacturer_name,
wlu.NAME AS unit_name
FROM
wl_scrap_detail wlm
LEFT JOIN wl_stock_detail wlsd ON wlsd.id = wlm.stock_detail_id
LEFT JOIN wl_equipment_detail wled ON wled.id = wlsd.equipment_detail_id
left join wl_equipment_specific wleq on wlsd.qr_code = wleq.qr_code
left join wl_equipment wleu on wled.equipment_id=wleu.id
LEFT JOIN wl_equipment_category wlec ON wleu.category_id = wlec.id
LEFT JOIN wl_manufacturer_info wlmi ON wled.manufacturer_id = wlmi.id
LEFT JOIN wl_unit wlu ON wleu.unit_id = wlu.id
where wlm.stock_detail_id IS NOT NULL
<if test="equipmentName != null and equipmentName != ''">
and wled.name like concat('%',#{equipmentName},'%')
</if>
<if test="manufacturerName != null and manufacturerName != ''">
and wlmi.name like concat('%',#{manufacturerName},'%')
</if>
<if test="equipmentTypeName != null and equipmentTypeName != ''">
and wlec.name like concat('%',#{equipmentTypeName},'%')
</if>
) detail WHERE detail.scrap_id=#{id}
</if>
</select>
<select id="selectStockBillDetailList" resultMap="StockBillDetail">
<if test='type == "1"'>
select
wled.standard,
wlst.single_equip_code,
wlst.amount,
wled.name equipment_name,
wled.org_code,
wlec.name equipment_type_name,
wlmi.name manufacturer_name,
wlu.name unit_name,
wleu.code `type`
from wl_stock_bill_detail wlst
left join wl_equipment_detail wled on wlst.equipment_detail_id = wled.id
left join wl_equipment wleu on wled.equipment_id = wleu.id
left join wl_unit wlu on wleu.unit_id = wlu.id
left join wl_equipment_category wlec on wleu.category_id = wlec.id
left join wl_manufacturer_info wlmi on wled.manufacturer_id = wlmi.id
where wlst.stock_bill_id=#{id}
</if>
<if test='type == "2"'>
select * from (
SELECT
wlm.repair_id,
wlcr.standard AS standard,
wlcr.qr_code AS single_equip_code,
wlcr.NAME AS equipment_name,
1 AS amount,
wlcr.org_code,
wlec.NAME AS equipment_type_name,
wlmi.NAME AS manufacturer_name,
wlu.NAME AS unit_name,
wleu.code as `type`
FROM
wl_repair_detail wlm
LEFT JOIN wl_car wlcr ON wlcr.id = wlm.car_id
LEFT JOIN wl_equipment wleu ON wlcr.equipment_id = wleu.id
LEFT JOIN wl_equipment_category wlec ON wleu.category_id = wlec.id
LEFT JOIN wl_manufacturer_info wlmi ON wlcr.manufacturer_id = wlmi.id
LEFT JOIN wl_unit wlu ON wleu.unit_id = wlu.id
WHERE
wlm.car_id IS NOT NULL
UNION ALL
SELECT
wlm.repair_id,
wled.standard,
wleq.qr_code as single_equip_code,
wled.name AS equipment_name,
wlm.amount,
wlsd.org_code,
wlec.NAME AS equipment_type_name,
wlmi.NAME AS manufacturer_name,
wlu.NAME AS unit_name,
wleu.code as `type`
FROM
wl_repair_detail wlm
LEFT JOIN wl_stock_detail wlsd ON wlsd.id = wlm.stock_detail_id
LEFT JOIN wl_equipment_detail wled ON wled.id = wlsd.equipment_detail_id
left join wl_equipment_specific wleq on wlsd.qr_code = wleq.qr_code
left join wl_equipment wleu on wled.equipment_id=wleu.id
LEFT JOIN wl_equipment_category wlec ON wleu.category_id = wlec.id
LEFT JOIN wl_manufacturer_info wlmi ON wled.manufacturer_id = wlmi.id
LEFT JOIN wl_unit wlu ON wleu.unit_id = wlu.id
where wlm.stock_detail_id IS NOT NULL
) detail where detail.repair_id=#{id}
</if>
<if test='type == "3"'>
SELECT * FROM (
SELECT
wlm.maintain_id,
wlcr.standard AS standard,
wlcr.qr_code AS single_equip_code,
wlcr.NAME AS equipment_name,
1 AS amount,
wlcr.org_code,
wlec.NAME AS equipment_type_name,
wlmi.NAME AS manufacturer_name,
wlu.NAME AS unit_name,
wleu.code as `type`
FROM
wl_maintain_detail wlm
LEFT JOIN wl_car wlcr ON wlcr.id = wlm.car_id
LEFT JOIN wl_equipment wleu ON wlcr.equipment_id = wleu.id
LEFT JOIN wl_equipment_category wlec ON wleu.category_id = wlec.id
LEFT JOIN wl_manufacturer_info wlmi ON wlcr.manufacturer_id = wlmi.id
LEFT JOIN wl_unit wlu ON wleu.unit_id = wlu.id
WHERE
wlm.car_id IS NOT NULL
UNION ALL
SELECT
wlm.maintain_id,
wled.standard,
wleq.qr_code as single_equip_code,
wled.name AS equipment_name,
wlsd.amount,
wlsd.org_code,
wlec.NAME AS equipment_type_name,
wlmi.NAME AS manufacturer_name,
wlu.NAME AS unit_name,
wleu.code as `type`
FROM
wl_maintain_detail wlm
LEFT JOIN wl_stock_detail wlsd ON wlsd.id = wlm.stock_detail_id
LEFT JOIN wl_equipment_detail wled ON wled.id = wlsd.equipment_detail_id
left join wl_equipment_specific wleq on wlsd.qr_code = wleq.qr_code
left join wl_equipment wleu on wled.equipment_id=wleu.id
LEFT JOIN wl_equipment_category wlec ON wleu.category_id = wlec.id
LEFT JOIN wl_manufacturer_info wlmi ON wled.manufacturer_id = wlmi.id
LEFT JOIN wl_unit wlu ON wleu.unit_id = wlu.id
where wlm.stock_detail_id IS NOT NULL
) detail WHERE detail.maintain_id=#{id}
</if>
<if test='type == "4"'>
SELECT
wled.standard,
wleq.qr_code as single_equip_code,
wled.name AS equipment_name,
wlsd.amount,
wlsd.org_code,
wlec.NAME AS equipment_type_name,
wlmi.NAME AS manufacturer_name,
wlu.NAME AS unit_name,
wleu.code as `type`
FROM
wl_wastage_bill_detail wlm
LEFT JOIN wl_stock_detail wlsd ON wlsd.id = wlm.stock_detail_id
LEFT JOIN wl_equipment_detail wled ON wled.id = wlsd.equipment_detail_id
left join wl_equipment_specific wleq on wlsd.qr_code = wleq.qr_code
left join wl_equipment wleu on wled.equipment_id=wleu.id
LEFT JOIN wl_equipment_category wlec ON wleu.category_id = wlec.id
LEFT JOIN wl_manufacturer_info wlmi ON wled.manufacturer_id = wlmi.id
LEFT JOIN wl_unit wlu ON wleu.unit_id = wlu.id
where wlm.wastage_bill_id=#{id}
</if>
<if test='type == "5"'>
SELECT * FROM(
SELECT
wlm.scrap_id,
wlcr.standard AS standard,
wlcr.qr_code AS single_equip_code,
wlcr.NAME AS equipment_name,
1 AS amount,
wlcr.org_code,
wlec.NAME AS equipment_type_name,
wlmi.NAME AS manufacturer_name,
wlu.NAME AS unit_name,
wleu.code as `type`
FROM
wl_scrap_detail wlm
LEFT JOIN wl_car wlcr ON wlcr.id = wlm.car_id
LEFT JOIN wl_equipment wleu ON wlcr.equipment_id = wleu.id
LEFT JOIN wl_equipment_category wlec ON wleu.category_id = wlec.id
LEFT JOIN wl_manufacturer_info wlmi ON wlcr.manufacturer_id = wlmi.id
LEFT JOIN wl_unit wlu ON wleu.unit_id = wlu.id
WHERE
wlm.car_id IS NOT NULL
UNION ALL
SELECT
wlm.scrap_id,
wled.standard,
wleq.qr_code as single_equip_code,
wled.name AS equipment_name,
wlsd.amount,
wlsd.org_code,
wlec.NAME AS equipment_type_name,
wlmi.NAME AS manufacturer_name,
wlu.NAME AS unit_name,
wleu.code as `type`
FROM
wl_scrap_detail wlm
LEFT JOIN wl_stock_detail wlsd ON wlsd.id = wlm.stock_detail_id
LEFT JOIN wl_equipment_detail wled ON wled.id = wlsd.equipment_detail_id
left join wl_equipment_specific wleq on wlsd.qr_code = wleq.qr_code
left join wl_equipment wleu on wled.equipment_id=wleu.id
LEFT JOIN wl_equipment_category wlec ON wleu.category_id = wlec.id
LEFT JOIN wl_manufacturer_info wlmi ON wled.manufacturer_id = wlmi.id
LEFT JOIN wl_unit wlu ON wleu.unit_id = wlu.id
where wlm.stock_detail_id IS NOT NULL
) detail WHERE detail.scrap_id=#{id}
</if>
</select>
</mapper>
<?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.equipmanage.mapper.StockBillMapper">
<resultMap id="allBill" type="com.yeejoin.equipmanage.common.entity.vo.AllBillVO">
<result column="id" property="id"></result>
<result column="bill_code" property="billCode"></result>
<result column="bill_type" property="billType"></result>
<result column="creator_name" property="creatorName"></result>
<result column="create_date" property="createDate"></result>
<result column="company_name" property="companyName"></result>
<result column="type" property="type"></result>
</resultMap>
<select id="selectAllBill" resultMap="allBill" parameterType="com.yeejoin.equipmanage.common.entity.dto.StockBillDTO">
select * from (
<if test='stockBillDTO.billType=="0" or stockBillDTO.billType=="4"'>
select id,bill_code,bill_type,creator_name,create_date,company_name,4 as type from wl_wastage_bill
where 1=1
<if test="stockBillDTO.billCode!=null and stockBillDTO.billCode!=''">
and bill_code like concat('%',#{stockBillDTO.billCode},'%')
</if>
<if test="stockBillDTO.createDateStart!=null">
and create_date &gt;= #{stockBillDTO.createDateStart}
</if>
<if test="stockBillDTO.createDateEnd!=null">
and create_date &lt;= #{stockBillDTO.createDateEnd}
</if>
</if>
<if test='stockBillDTO.billType=="0"'>
union all
</if>
<if test='stockBillDTO.billType=="0" or stockBillDTO.billType=="1"'>
select id,bill_code,bill_type,creator_name,create_date,company_name,1 as type from wl_stock_bill
where 1=1
<if test="stockBillDTO.billCode!=null and stockBillDTO.billCode!=''">
and bill_code like concat('%',#{stockBillDTO.billCode},'%')
</if>
<if test="stockBillDTO.createDateStart!=null">
and create_date &gt;= #{stockBillDTO.createDateStart}
</if>
<if test="stockBillDTO.createDateEnd!=null">
and create_date &lt;= #{stockBillDTO.createDateEnd}
</if>
</if>
<if test='stockBillDTO.billType=="0"'>
union all
</if>
<if test='stockBillDTO.billType=="0" or stockBillDTO.billType=="5"'>
select id,bill_code,bill_type,creator_name,create_date,company_name,5 as type from wl_scrap
where 1=1
<if test="stockBillDTO.billCode!=null and stockBillDTO.billCode!=''">
and bill_code like concat('%',#{stockBillDTO.billCode},'%')
</if>
<if test="stockBillDTO.createDateStart!=null">
and create_date &gt;= #{stockBillDTO.createDateStart}
</if>
<if test="stockBillDTO.createDateEnd!=null">
and create_date &lt;= #{stockBillDTO.createDateEnd}
</if>
</if>
<if test='stockBillDTO.billType=="0"'>
union all
</if>
<if test='stockBillDTO.billType=="0" or stockBillDTO.billType=="2" '>
select id,bill_code,bill_type,creator_name,create_date,company_name,2 as type from wl_repair
where 1=1
<if test="stockBillDTO.billCode!=null and stockBillDTO.billCode!=''">
and bill_code like concat('%',#{stockBillDTO.billCode},'%')
</if>
<if test="stockBillDTO.createDateStart!=null">
and create_date &gt;= #{stockBillDTO.createDateStart}
</if>
<if test="stockBillDTO.createDateEnd!=null">
and create_date &lt;= #{stockBillDTO.createDateEnd}
</if>
</if>
<if test='stockBillDTO.billType=="0"'>
union all
</if>
<if test='stockBillDTO.billType=="0" or stockBillDTO.billType=="3"'>
select id,bill_code,bill_type,creator_name,create_date,company_name,3 as type from wl_maintain
where 1=1
<if test="stockBillDTO.billCode!=null and stockBillDTO.billCode!=''">
and bill_code like concat('%',#{stockBillDTO.billCode},'%')
</if>
<if test="stockBillDTO.createDateStart!=null">
and create_date &gt;= #{stockBillDTO.createDateStart}
</if>
<if test="stockBillDTO.createDateEnd!=null">
and create_date &lt;= #{stockBillDTO.createDateEnd}
</if>
</if>) as da
order by create_date desc
</select>
</mapper>
<?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.equipmanage.mapper.StockDetailMapper">
<resultMap id="StockDetail" type="com.yeejoin.equipmanage.common.entity.StockDetail">
<id column="id" property="id"/>
<result column="batch_num" property="batchNum"/>
<result column="amount" property="amount"/>
<result column="stock_id" property="stockId"/>
<result column="warehouse_structure_id" property="warehouseStructureId"/>
<result column="rfid" property="rfid"/>
<result column="equipment_detail_id" property="equipmentDetailId"/>
<result column="org_code" property="orgCode"/>
<result column="qr_code" property="qrCode"/>
<result column="warehouse_id" property="warehouseId"/>
<result column="org_code" property="companyName"/>
<result column="status" property="status"/>
<result column="company_name" property="companyName"/>
<result column="department_name" property="departmentName"/>
<result column="department_orgcode" property="departmentOrgcode"/>
<result column="create_date" property="createDate"/>
<!-- <association column="equipment_detail_id" property="equipmentDetail" select="com.yeejoin.fireIotPlatform.common.dao.mapper.EquipmentDetailMapper.queryEquipmentDetailById"/>
<association column="shelf_cell_id" property="shelfCell" select="com.yeejoin.fireIotPlatform.common.dao.mapper.ShelfCellMapper.queryShelfCellById"/>
<association column="warehouse_id" property="warehouse" select="com.yeejoin.fireIotPlatform.common.dao.mapper.WarehouseMapper.queryWarehouseById"/>
<association column="stock_id" property="stock" select="com.yeejoin.fireIotPlatform.common.dao.mapper.StockMapper.queryStockById"/>
--> </resultMap>
<select id="findByIdInAndStatus" resultMap="StockDetail" >
SELECT * FROM wl_stock_detail WHERE wl_stock_detail.status=#{status}
<if test="ids!=null and ids.size()&gt; 0">
<foreach collection="ids" item="id" separator="," open="and id in(" close=")">
#{id}
</foreach>
</if>
</select>
<select id="findCategoryNameByID" resultType="Map" >
SELECT category.name from wl_stock_detail stock_detail INNER JOIN wl_equipment_detail equipment_detail
ON stock_detail.equipment_detail_id = equipment_detail.id
INNER JOIN wl_equipment equipment ON equipment.id = equipment_detail.equipment_id
INNER JOIN wl_equipment_category category ON category.id = equipment.category_id
WHERE stock_detail.id = #{id}
</select>
<select id="getStatisticsEquipCount"
resultType="com.yeejoin.equipmanage.common.entity.vo.StatisticsEquipCountVO">
select 'S' as code, IFNULL(sum(wlsd.amount),0) as sum from wl_stock_detail wlsd
left join wl_equipment_detail wled on wlsd.equipment_detail_id = wled.id
left join wl_equipment wle on wle.id = wled.equipment_id
left join wl_equipment_category wlec on wle.category_id=wlec.id
where left(wlec.code, 3)=410 and (wlsd.`status`=1 or wlsd.`status`=10)
union all
select 'PM' as code, IFNULL(sum(wlsd.amount),0) as sum from wl_stock_detail wlsd
left join wl_equipment_detail wled on wlsd.equipment_detail_id = wled.id
left join wl_equipment wle on wle.id = wled.equipment_id
left join wl_equipment_category wlec on wle.category_id=wlec.id
where left(wlec.code, 3)=420 and (wlsd.`status`=1 or wlsd.`status`=10)
union all
select 'GF' as code, IFNULL(sum(wlsd.amount),0) as sum from wl_stock_detail wlsd
left join wl_equipment_detail wled on wlsd.equipment_detail_id = wled.id
left join wl_equipment wle on wle.id = wled.equipment_id
left join wl_equipment_category wlec on wle.category_id=wlec.id
where left(wlec.code, 3)=430 and (wlsd.`status`=1 or wlsd.`status`=10)
union all
select 'QT' as code, IFNULL(sum(wlsd.amount),0) as sum from wl_stock_detail wlsd
left join wl_equipment_detail wled on wlsd.equipment_detail_id = wled.id
left join wl_equipment wle on wle.id = wled.equipment_id
left join wl_equipment_category wlec on wle.category_id=wlec.id
where left(wlec.code, 3)=440 and (wlsd.`status`=1 or wlsd.`status`=10)
</select>
<delete id="clearWareHouse">
delete from wl_stock_detail where warehouse_structure_id =#{id}
</delete>
<update id="updateStatus">
update wl_stock_detail
<trim prefix="set" prefixOverrides="," suffix="where id=#{bean.stockDetailId}">
amount = amount - 1,
<if test="status != null">status=#{status}</if>
</trim>
</update>
<update id="updateBatch" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update wl_stock_detail
<trim prefix="set" prefixOverrides="," suffix="where id=#{item.stockDetailId}">
amount = amount - 1,
<if test="status != null">status=#{status}</if>
</trim>
</foreach>
</update>
<!-- <update id="updateBatch" parameterType="java.util.List">-->
<!-- <foreach collection="list" item="item" index="index" open="" close="" separator=";">-->
<!-- update wl_stock_detail-->
<!-- <set>-->
<!-- status=${status},-->
<!-- amount = amount - 1-->
<!-- </set>-->
<!-- where id = ${item.stockDetailId}-->
<!-- </foreach>-->
<!-- </update>-->
</mapper>
<?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.equipmanage.mapper.StockMapper">
</mapper>
<?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.equipmanage.mapper.StockWarningRuleMapper">
</mapper>
<?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.equipmanage.mapper.SystemDicMapper">
</mapper>
<?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.equipmanage.mapper.TaskMapper">
</mapper>
<?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.equipmanage.mapper.TaskPaycheckMapper">
</mapper>
<?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.equipmanage.mapper.TaskPersonFileMapper">
</mapper>
<?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.equipmanage.mapper.TaskPersonMapper">
</mapper>
<?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.equipmanage.mapper.TaskTechDocumentMapper">
</mapper>
<?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.equipmanage.mapper.TechDocumentAttachmentMapper">
</mapper>
<?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.equipmanage.mapper.TechDocumentMapper">
</mapper>
<?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.equipmanage.mapper.UnitMapper">
<select id="getUnitClassification" resultType="Map">
SELECT
wl.id,
wl. name,
wl.code
FROM
wl_unit wl
WHERE
wl.parent_id IS NULL
</select>
<select id="getUnitFirstLevelCode" resultType="String">
SELECT
CONCAT(
(
IFNULL(MAX(unit. CODE), 0) + 100
),
''
) AS code
FROM
wl_unit unit
WHERE
unit.parent_id IS NULL
</select>
<select id="getUnitSecondLevelCode" resultType="String">
SELECT
LPAD(IFNULL(MAX(wu. CODE), wl. CODE) + 1,4,0) code
FROM
wl_unit wl
LEFT JOIN wl_unit wu ON wl.id = wu.parent_id
WHERE
wl.id = #{id}
AND wl.parent_id IS NULL;
</select>
<select id="getUnitList" resultType="com.yeejoin.equipmanage.common.entity.Unit">
SELECT
u.*
FROM
`wl_unit` u
<if test="name != null and name !=''">
LEFT JOIN wl_unit u1 ON u1.id = u.id
OR u1.parent_id = u.id
WHERE
u1.`name` LIKE concat(concat("%",#{name}),"%")
</if>
ORDER BY
u.code
</select>
<select id="getOne" resultType="com.yeejoin.equipmanage.common.entity.Unit">
SELECT
u.*
FROM
`wl_unit` u
WHERE
u.id=#{id}
</select>
</mapper>
<?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.equipmanage.mapper.UploadFileMapper">
</mapper>
<?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.equipmanage.mapper.VideoMapper">
<resultMap id="Video" type="com.yeejoin.equipmanage.common.entity.vo.PageVideoVO">
<result column="id" property="id"></result>
<result column="code" property="code"></result>
<result column="name" property="name"></result>
<result column="region" property="region"></result>
<result column="address" property="address"></result>
<result column="url" property="url"></result>
<result column="img" property="img"></result>
</resultMap>
<resultMap type="com.yeejoin.equipmanage.common.entity.vo.PageSecurityVideoVO" id="menuTree">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="name" property="name"/>
<result column="full_name" property="fullName"/>
<collection property="children" ofType="com.yeejoin.equipmanage.common.entity.vo.PageSecurityVideoVO"
column="id" select="getMenuChildren"/>
</resultMap>
<select id="pageVideo" resultMap="Video">
SELECT
wlv.id,
wlv.code,
wlv.url AS url,
wlv.name,
GROUP_CONCAT(war.full_name) as region,
wlv.address,
wlv.status,
wlv.img,
wlv.type
FROM
wl_video as wlv
left join wl_video_source as vis on vis.video_id = wlv.id
left join wl_warehouse_structure as war on vis.source_id = war.id
where 1=1
<if test="video!=null and video.name!=null and video.name!=''">
and wlv.name like concat('%',#{video.name},'%')
</if>
<if test="video!=null and video.code!=null and video.code!=''">
and wlv.code like concat('%',#{video.code},'%')
</if>
<if test="video!=null and video.typeCode!=null and video.typeCode!=''">
and wlv.type_code like concat('%',#{video.typeCode},'%')
</if>
group by wlv.id
order by wlv.create_date desc
</select>
<select id="pageBuildingVideo" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO">
SELECT
v.id AS id,
v.name AS name,
v.token AS token,
v.url AS url,
v.code AS code,
getBuildingNames(vc.source_id) as location,
v.address,
v.preset_position as presetPosition
FROM wl_video v
JOIN wl_video_source vc ON vc.video_id = v.id
<where>
<if test="dto.buildingId!=null and dto.buildingId!=''">
FIND_IN_SET(vc.source_id, getChildrenIdsByRootId(#{dto.buildingId}))
</if>
<if test="dto.equipmentName!=null and dto.equipmentName!=''">
and v.name like concat('%',#{dto.equipmentName},'%')
</if>
<if test="dto.code!=null and dto.code!=''">
and v.code like concat('%',#{dto.code},'%')
</if>
</where>
<if test="dto.buildingId ==null or dto.buildingId =='' or dto.buildingId =='123456789123456789' ">
union all
select
v.id AS id,
v.name AS name,
v.token AS token,
v.url AS url,
v.code AS code,
null as location,
v.address,
v.preset_position as presetPosition
from
wl_video v where id not in (select video_id from wl_video_source)
<if test="dto.equipmentName!=null and dto.equipmentName!=''">
and v.name like concat('%',#{dto.equipmentName},'%')
</if>
<if test="dto.code!=null and dto.code!=''">
and v.code like concat('%',#{dto.code},'%')
</if>
</if>
</select>
<select id="getFireEquipByVideoId" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingListVO">
SELECT
wle.*,
equd.`name` AS equipmentName,
wws.full_name AS equipmentAddress
FROM
wl_equipment_specific wle
JOIN wl_video_equipment_specific ve ON wle.id = ve.equipment_specific_id
LEFT JOIN wl_equipment_detail equd ON equd.id = wle.equipment_detail_id
LEFT JOIN wl_stock_detail wsd ON wsd.equipment_detail_id = equd.id
LEFT JOIN wl_warehouse_structure wws ON wws.id = wsd.warehouse_structure_id
WHERE
ve.video_id = #{videoId}
</select>
<select id="getPowerEquipByVideoId" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingListVO">
SELECT
wle.id as id,
wle.`code` AS code,
wle.`name` AS equipmentName,
wle.address AS equipmentAddress
FROM
f_equipment wle
JOIN wl_video_important_equipment ve ON wle.id = ve.important_equipment_id
WHERE
ve.video_id = #{videoId}
</select>
<select id="getVideoBySpeId" resultType="com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO">
select
vid.id,
vid.token,
vid.name,
vid.url,
vid.code,
vid.preset_position as presetPosition
from
wl_video_equipment_specific as ves
left join wl_video as vid on ves.video_id = vid.id
where equipment_specific_id = #{id}
</select>
<select id="getVideoById" resultType="com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO">
select
vid.id,
vid.token,
vid.name,
vid.url,
vid.code,
vid.preset_position as presetPosition
from
wl_video_equipment_specific as ves
left join wl_video as vid on ves.video_id = vid.id
where video_id = #{id}
</select>
<select id="pageColaBuildingVideo" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO">
SELECT
sa.equipment_specific_id AS id,
wed.name AS name,
wed.code AS code,
wws.full_name AS location,
sa.equipment_specific_id AS specificId
FROM
(
SELECT
*
FROM
wl_stock_detail wsd
WHERE
wsd.warehouse_structure_id IN
<foreach collection="dto.buildIdList" item="dto.buildIdList" index="index" open="(" close=")" separator=",">
#{dto.buildIdList}
</foreach>
) sa,
wl_equipment_detail wed,
wl_equipment we,
wl_equipment_category wec,
wl_warehouse_structure wws
WHERE
sa.equipment_detail_id = wed.id
AND wws.id = sa.warehouse_structure_id
AND wed.equipment_id = we.id
AND wec.id = we.category_id
and wec.code IN
<foreach collection="dto.monitorCodes" item="dto.monitorCodes" index="index" open="(" close=")" separator=",">
#{dto.monitorCodes}
</foreach>
<if test="dto.equipmentName!=null and dto.equipmentName!=''">
and wed.name like concat('%',#{dto.equipmentName},'%')
</if>
<if test="dto.code!=null and dto.code!=''">
and wed.code like concat('%',#{dto.code},'%')
</if>
<if test="dto.orgCode!=null and dto.orgCode!=''">
and sa.org_code = #{dto.orgCode}
</if>
</select>
<select id="listColaBuildingVideo" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO">
SELECT
wsd.equipment_specific_id AS id,
wed.name AS name,
wed.code AS code,
wws.full_name AS location,
wsd.equipment_specific_id AS specificId
FROM
wl_stock_detail wsd,
wl_equipment_detail wed,
wl_equipment we,
wl_equipment_category wec,
wl_warehouse_structure wws
WHERE
wsd.equipment_detail_id = wed.id
AND wed.equipment_id = we.id
AND wec.id = we.category_id
AND wws.id = wsd.warehouse_structure_id
and wec.code in
<foreach collection="dto.monitorCodes" item="dto.monitorCodes" index="index" open="(" close=")" separator=",">
#{dto.monitorCodes}
</foreach>
<if test="dto.equipmentName!=null and dto.equipmentName!=''">
and wed.name like concat('%',#{dto.equipmentName},'%')
</if>
<if test="dto.code!=null and dto.code!=''">
and wed.code like concat('%',#{dto.code},'%')
</if>
<if test="dto.orgCode!=null and dto.orgCode!=''">
and wsd.org_code = #{dto.orgCode}
</if>
</select>
<select id="countColaBuildVideo" resultType="java.lang.Long">
SELECT
count(1)
FROM
wl_stock_detail wsd,
wl_equipment_detail wed,
wl_equipment we,
wl_equipment_category wec,
wl_warehouse_structure wws
WHERE
wsd.equipment_detail_id = wed.id
AND wed.equipment_id = we.id
AND wec.id = we.category_id
AND wws.id = wsd.warehouse_structure_id
and wec.code in
<foreach collection="dto.monitorCodes" item="dto.monitorCodes" index="index" open="(" close=")" separator=",">
#{dto.monitorCodes}
</foreach>
</select>
<select id="findAllParents" resultMap="menuTree">
SELECT
wws.id AS id,
wws.parent_id AS parentId,
wws.name AS name,
wws.full_name AS fullName
FROM
wl_warehouse_structure wws
WHERE
wws.parent_id = 0
</select>
<select id="getMenuChildren" resultMap="menuTree">
SELECT
wws.id AS id,
wws.parent_id AS parentId,
wws.name AS name,
wws.full_name AS fullName
FROM
wl_warehouse_structure wws
WHERE
wws.parent_id = #{id}
</select>
<select id="getSecurityOrFireEquipment" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingListVO">
SELECT
wes.id AS id,
wed.name AS equipmentName,
wed.code AS code,
wws.full_name AS equipmentAddress
FROM
wl_equipment_specific wes
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
LEFT JOIN wl_stock_detail wsd ON wsd.equipment_detail_id = wed.id
LEFT JOIN wl_warehouse_structure wws ON wws.id = wsd.warehouse_structure_id
WHERE
wes.id = #{id}
</select>
<select id="selectBuildList" resultType="String">
select source_name from wl_source_scene
where video_in_scene like CONCAT('%',#{id},'%' )
</select>
<select id="selectImportantEquipment" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo">
select id,code from f_equipment
</select>
<select id="pageVideoList" resultType="com.yeejoin.equipmanage.common.entity.vo.VideoListVo">
SELECT
wle.id ,
wle.`code` ,
wle.url,
wle.position3d,
wle.token,
wle.`name` ,
wle.address ,
wle.longitude,
<if test='longitude!=null and latitude!=null '>
Round(st_distance(point(wle.longitude,wle.latitude),point(#{longitude},#{latitude}))*111195,1) AS distance
</if>
wle.latitude
FROM wl_video wle
<if test='distance!=null'>
and Round(st_distance(point(wle.longitude,wle.latitude),point(#{longitude},#{latitude}))*111195,1) &lt;=
#{distance}
</if>
<if test='longitude!=null and latitude!=null '>
ORDER BY distance
</if>
limit #{pageNum},#{pageSize}
</select>
<select id="pageVideoCount" resultType="int">
SELECT
count( wle.id ) num
FROM wl_video wle
<if test='distance!=null'>
and Round(st_distance(point(wle.longitude,wle.latitude),point(#{longitude},#{latitude}))*111195,1) &lt;=
#{distance}
</if>
</select>
<sql id="videoField" >
wlv.id,
wlv.code,
wlv.name,
wlv.address,
wlv.status,
wlv.type,
wlv.ip,
wlv.port,
wlv.token,
wlv.url,
wlv.img,
wlv.longitude,
wlv.latitude,
</sql>
<select id="listByType" resultType="com.yeejoin.equipmanage.common.entity.vo.VideoListVo">
SELECT
<include refid="videoField"/>
GROUP_CONCAT(war.full_name) as region
FROM
wl_video as wlv
left join wl_video_source as vis on vis.video_id = wlv.id
left join wl_warehouse_structure as war on vis.source_id = war.id
where 1=1
<if test="type!=null and type!=''">
and wlv.type = #{type}
</if>
group by wlv.id
</select>
<select id="listByCode" resultType="com.yeejoin.equipmanage.common.entity.Video">
SELECT
<include refid="videoField"/>
wlv.code
FROM
wl_video as wlv
where wlv.code = #{code}
</select>
</mapper>
<?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.equipmanage.mapper.WarehouseMapper">
<select id="getOneByName" resultType="int">
select count(1) from wl_warehouse where name =#{name}
<if test="id != null">
and id !=#{id}
</if>
</select>
</mapper>
<?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.equipmanage.mapper.WarehouseStructureMapper">
</mapper>
<?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.equipmanage.mapper.WastageBillDetailMapper">
</mapper>
<?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.equipmanage.mapper.WastageBillMapper">
<select id="getOneByIdDesc" resultType="Map" >
select * from wl_wastage_bill ORDER BY id DESC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?><ureport><cell expand="None" name="A1" row="1" col="1"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[系统名称]]></simple-value></cell><cell expand="None" name="B1" row="1" col="2"><cell-style font-size="10" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[设备类型]]></simple-value></cell><cell expand="None" name="C1" row="1" col="3"><cell-style font-size="10" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[设备总数]]></simple-value></cell><cell expand="None" name="D1" row="1" col="4"><cell-style font-size="10" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[无异常设备总数]]></simple-value></cell><cell expand="None" name="E1" row="1" col="5"><cell-style font-size="10" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[物联指标]]></simple-value></cell><cell expand="None" name="F1" row="1" col="6"><cell-style font-size="10" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[监测数据]]></simple-value></cell><cell expand="None" name="G1" row="1" col="7"><cell-style font-size="10" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[获取方式]]></simple-value></cell><cell expand="None" name="H1" row="1" col="8"><cell-style font-size="10" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[正常标准]]></simple-value></cell><cell expand="None" name="I1" row="1" col="9"><cell-style font-size="10" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[告警设备数]]></simple-value></cell><cell expand="None" name="J1" row="1" col="10"><cell-style font-size="10" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[告警条数]]></simple-value></cell><cell expand="Down" name="A2" row="2" col="1" row-span="3"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="system" aggregate="group" property="name" order="none" mapping-type="dataset" mapping-dataset="system" mapping-key-property="id" mapping-value-property="name"></dataset-value></cell><cell expand="Down" name="B2" row="2" col="2"><cell-style font-size="10" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="group" property="name" order="none" mapping-type="simple"><condition property="system_id" op="==" id="undefined" type="property"><value><![CDATA[system.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="C2" row="2" col="3"><cell-style font-size="10" wrap-compute="false" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="select" property="num" order="none" mapping-type="simple"></dataset-value></cell><cell expand="Down" name="D2" row="2" col="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="select" property="normalNum" order="none" mapping-type="dataset" mapping-dataset="equipment" mapping-key-property="code" mapping-value-property="normalNum"></dataset-value></cell><cell expand="Down" name="E2" row="2" col="5" left-cell="D2"><cell-style font-size="10" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="type_name" order="none" mapping-type="simple"><condition property="code" op="in" id="db5c3380-5102-11ec-809e-9fdb84be15b0" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="db5c3381-5102-11ec-809e-9fdb84be15b0" type="property" join="and"><value><![CDATA[system.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="F2" row="2" col="6"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="monitoringData" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="G2" row="2" col="7"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="acquisition" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="H2" row="2" col="8"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="normal" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="I2" row="2" col="9" left-cell="E2" top-cell="A2"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="alarmEquipNum" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="J2" row="2" col="10"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="report" aggregate="sum" property="index_true_num" order="none" mapping-type="simple"><condition property="index_type" op="==" id="undefined" type="property" join="and"><value><![CDATA[index.select(type_code)]]></value></condition><condition property="equipment_code" op="==" id="undefined" type="property" join="and"><value><![CDATA[index.select(code)]]></value></condition><condition property="system_id" op="==" id="undefined" type="property" join="and"><value><![CDATA[system.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="B3" row="3" col="2" row-span="2"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[ 总结]]></simple-value></cell><cell expand="Down" name="C3" row="3" col="3" col-span="8"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="summary" aggregate="select" property="contant" order="none" mapping-type="simple"><condition property="system_id" op="==" id="undefined" type="property"><value><![CDATA[system.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="C4" row="4" col="3" left-cell="A2" top-cell="B2" col-span="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><chart-value><dataset dataset-name="fireControlSystem" type="pie" category-property="name" series-type="text" series-text="装备" value-property="num" collect-type="select"/></chart-value></cell><cell expand="None" name="G4" row="4" col="7" col-span="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><chart-value><dataset dataset-name="summary_echars_right_FAS" type="pie" category-property="name" series-type="text" series-text="装备统计" value-property="value" collect-type="select"/></chart-value></cell><cell expand="Down" name="A5" row="5" col="1" row-span="3"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="system1" aggregate="group" property="name" order="none" mapping-type="dataset" mapping-dataset="system1" mapping-key-property="id" mapping-value-property="name"></dataset-value></cell><cell expand="Down" name="B5" row="5" col="2"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="group" property="name" order="none" mapping-type="simple"><condition property="system_id" op="==" id="undefined" type="property"><value><![CDATA[system1.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="C5" row="5" col="3"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="select" property="num" order="none" mapping-type="simple"></dataset-value></cell><cell expand="Down" name="D5" row="5" col="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="select" property="normalNum" order="none" mapping-type="simple"></dataset-value></cell><cell expand="Down" name="E5" row="5" col="5"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="type_name" order="asc" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system1.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="F5" row="5" col="6"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="monitoringData" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system1.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="G5" row="5" col="7"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="acquisition" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system1.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="H5" row="5" col="8"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="normal" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system1.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="I5" row="5" col="9" left-cell="E5" top-cell="A5"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="alarmEquipNum" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system1.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="J5" row="5" col="10"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="report" aggregate="sum" property="index_true_num" order="none" mapping-type="simple"><condition property="index_type" op="==" id="undefined" type="property" join="and"><value><![CDATA[index.select(type_code)]]></value></condition><condition property="equipment_code" op="==" id="undefined" type="property" join="and"><value><![CDATA[index.select(code)]]></value></condition><condition property="system_id" op="==" id="undefined" type="property" join="and"><value><![CDATA[system1.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="B6" row="6" col="2" row-span="2"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[总结]]></simple-value></cell><cell expand="Down" name="C6" row="6" col="3" col-span="8"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="ONL_summary" aggregate="select" property="contant" order="none" mapping-type="simple"><condition property="system_id" op="==" id="undefined" type="property"><value><![CDATA[system1.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="C7" row="7" col="3" left-cell="root" top-cell="root" col-span="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><chart-value><dataset dataset-name="summary_echars2" type="pie" category-property="name" series-type="text" series-text="装备分类" value-property="num" collect-type="select"/></chart-value></cell><cell expand="None" name="G7" row="7" col="7" col-span="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><chart-value><dataset dataset-name="summary_echars_right_ONL" type="pie" category-property="name" series-type="text" series-text="装备统计" value-property="value" collect-type="select"/></chart-value></cell><cell expand="Down" name="A8" row="8" col="1" row-span="3"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="system2" aggregate="group" property="name" order="none" mapping-type="dataset" mapping-dataset="system2" mapping-key-property="id" mapping-value-property="name"></dataset-value></cell><cell expand="Down" name="B8" row="8" col="2"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="group" property="name" order="none" mapping-type="simple"><condition property="system_id" op="==" id="undefined" type="property"><value><![CDATA[system2.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="C8" row="8" col="3"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="select" property="num" order="none" mapping-type="simple"></dataset-value></cell><cell expand="Down" name="D8" row="8" col="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="select" property="normalNum" order="none" mapping-type="simple"></dataset-value></cell><cell expand="Down" name="E8" row="8" col="5"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="type_name" order="none" mapping-type="simple"><condition property="code" op="in" id="2c343220-5104-11ec-809e-9fdb84be15b0" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="2c345930-5104-11ec-809e-9fdb84be15b0" type="property" join="and"><value><![CDATA[system2.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="F8" row="8" col="6"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="monitoringData" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system2.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="G8" row="8" col="7"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="acquisition" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system2.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="H8" row="8" col="8"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="normal" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system2.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="I8" row="8" col="9"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="alarmEquipNum" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system2.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="J8" row="8" col="10"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="report" aggregate="sum" property="index_true_num" order="none" mapping-type="simple"><condition property="index_type" op="==" id="undefined" type="property" join="and"><value><![CDATA[index.select(type_code)]]></value></condition><condition property="equipment_code" op="==" id="undefined" type="property" join="and"><value><![CDATA[index.select(code)]]></value></condition><condition property="system_id" op="==" id="undefined" type="property" join="and"><value><![CDATA[system2.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="B9" row="9" col="2" row-span="2"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[总结]]></simple-value></cell><cell expand="Down" name="C9" row="9" col="3" col-span="8"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="FFS_summary" aggregate="select" property="contant" order="none" mapping-type="simple"><condition property="system_id" op="==" id="undefined" type="property"><value><![CDATA[system2.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="C10" row="10" col="3" col-span="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><chart-value><dataset dataset-name="summary_echars3" type="pie" category-property="name" series-type="text" series-text="装备分类" value-property="num" collect-type="select"/></chart-value></cell><cell expand="None" name="G10" row="10" col="7" col-span="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><chart-value><dataset dataset-name="summary_echars_right_FFS" type="pie" category-property="name" series-type="text" series-text="装备统计" value-property="value" collect-type="select"/></chart-value></cell><cell expand="Down" name="A11" row="11" col="1" row-span="3"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="system3" aggregate="group" property="name" order="none" mapping-type="dataset" mapping-dataset="system3" mapping-key-property="id" mapping-value-property="name"></dataset-value></cell><cell expand="Down" name="B11" row="11" col="2"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="group" property="name" order="none" mapping-type="simple"><condition property="system_id" op="==" id="undefined" type="property"><value><![CDATA[system3.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="C11" row="11" col="3"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="select" property="num" order="none" mapping-type="simple"></dataset-value></cell><cell expand="Down" name="D11" row="11" col="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="select" property="normalNum" order="none" mapping-type="simple"></dataset-value></cell><cell expand="Down" name="E11" row="11" col="5"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="type_name" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system3.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="F11" row="11" col="6"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="monitoringData" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system3.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="G11" row="11" col="7"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="acquisition" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system3.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="H11" row="11" col="8"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="normal" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system3.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="I11" row="11" col="9"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="alarmEquipNum" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system3.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="J11" row="11" col="10"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="report" aggregate="sum" property="index_true_num" order="none" mapping-type="simple"><condition property="index_type" op="==" id="undefined" type="property" join="and"><value><![CDATA[index.select(type_code)]]></value></condition><condition property="equipment_code" op="==" id="undefined" type="property" join="and"><value><![CDATA[index.select(code)]]></value></condition><condition property="system_id" op="==" id="undefined" type="property" join="and"><value><![CDATA[system3.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="B12" row="12" col="2" row-span="2"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[总结]]></simple-value></cell><cell expand="Down" name="C12" row="12" col="3" col-span="8"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="FHS_summary" aggregate="select" property="contant" order="none" mapping-type="simple"><condition property="system_id" op="==" id="undefined" type="property"><value><![CDATA[system3.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="C13" row="13" col="3" col-span="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><chart-value><dataset dataset-name="summary_echars4" type="pie" category-property="name" series-type="text" series-text="装备分类统计" value-property="num" collect-type="select"/></chart-value></cell><cell expand="None" name="G13" row="13" col="7" col-span="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><chart-value><dataset dataset-name="summary_echars_right_FHS" type="pie" category-property="name" series-type="text" series-text="装备告警统计" value-property="value" collect-type="select"/></chart-value></cell><cell expand="Down" name="A14" row="14" col="1" row-span="3"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="system4" aggregate="group" property="name" order="none" mapping-type="simple"></dataset-value></cell><cell expand="Down" name="B14" row="14" col="2"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="group" property="name" order="none" mapping-type="simple"><condition property="system_id" op="==" id="undefined" type="property"><value><![CDATA[system4.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="C14" row="14" col="3"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="select" property="num" order="none" mapping-type="simple"></dataset-value></cell><cell expand="Down" name="D14" row="14" col="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="equipment" aggregate="select" property="normalNum" order="none" mapping-type="simple"></dataset-value></cell><cell expand="Down" name="E14" row="14" col="5"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="type_name" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system4.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="F14" row="14" col="6"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="monitoringData" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system4.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="G14" row="14" col="7"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="acquisition" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system4.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="H14" row="14" col="8"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="normal" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system4.select(id)]]></value></condition></dataset-value></cell><cell expand="Down" name="I14" row="14" col="9"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="index" aggregate="select" property="alarmEquipNum" order="none" mapping-type="simple"><condition property="code" op="in" id="undefined" type="property" join="and"><value><![CDATA[equipment.select(code)]]></value></condition><condition property="systemId" op="==" id="undefined" type="property" join="and"><value><![CDATA[system4.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="J14" row="14" col="10"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="report" aggregate="sum" property="index_true_num" order="none" mapping-type="simple"><condition property="index_type" op="==" id="undefined" type="property" join="and"><value><![CDATA[index.select(type_code)]]></value></condition><condition property="equipment_code" op="==" id="undefined" type="property" join="and"><value><![CDATA[index.select(code)]]></value></condition><condition property="system_id" op="==" id="undefined" type="property" join="and"><value><![CDATA[system4.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="B15" row="15" col="2" row-span="2"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><simple-value><![CDATA[总结]]></simple-value></cell><cell expand="Down" name="C15" row="15" col="3" col-span="8"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><dataset-value dataset-name="CAFS_summary" aggregate="select" property="contant" order="none" mapping-type="simple"><condition property="system_id" op="in" id="undefined" type="property"><value><![CDATA[system4.select(id)]]></value></condition></dataset-value></cell><cell expand="None" name="C16" row="16" col="3" col-span="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><chart-value><dataset dataset-name="summary_echars5" type="pie" category-property="name" series-type="text" series-text="装备分类统计" value-property="num" collect-type="select"/></chart-value></cell><cell expand="None" name="G16" row="16" col="7" col-span="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"><left-border width="1" style="solid" color="0,0,0"/><right-border width="1" style="solid" color="0,0,0"/><top-border width="1" style="solid" color="0,0,0"/><bottom-border width="1" style="solid" color="0,0,0"/></cell-style><chart-value><dataset dataset-name="summary_echars_right_CAFS" type="pie" category-property="name" series-type="text" series-text="装备告警统计" value-property="value" collect-type="select"/></chart-value></cell><cell expand="None" name="A17" row="17" col="1"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="B17" row="17" col="2"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="C17" row="17" col="3"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="D17" row="17" col="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="E17" row="17" col="5"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="F17" row="17" col="6"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="G17" row="17" col="7"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="H17" row="17" col="8"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="I17" row="17" col="9"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="J17" row="17" col="10"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="A18" row="18" col="1"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="B18" row="18" col="2"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="C18" row="18" col="3"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="D18" row="18" col="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="E18" row="18" col="5"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="F18" row="18" col="6"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="G18" row="18" col="7"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="H18" row="18" col="8"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="I18" row="18" col="9"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="J18" row="18" col="10"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="A19" row="19" col="1"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="B19" row="19" col="2"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="C19" row="19" col="3"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="D19" row="19" col="4"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="E19" row="19" col="5"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="F19" row="19" col="6"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="G19" row="19" col="7"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="H19" row="19" col="8"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="I19" row="19" col="9"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><cell expand="None" name="J19" row="19" col="10"><cell-style font-size="9" forecolor="0,0,0" font-family="宋体" align="center" valign="middle"></cell-style><simple-value><![CDATA[]]></simple-value></cell><row row-number="1" height="18" band="title"/><row row-number="2" height="18"/><row row-number="3" height="19"/><row row-number="4" height="188"/><row row-number="5" height="19"/><row row-number="6" height="19"/><row row-number="7" height="200"/><row row-number="8" height="19"/><row row-number="9" height="19"/><row row-number="10" height="203"/><row row-number="11" height="19"/><row row-number="12" height="19"/><row row-number="13" height="194"/><row row-number="14" height="19"/><row row-number="15" height="19"/><row row-number="16" height="181"/><row row-number="17" height="19"/><row row-number="18" height="19"/><row row-number="19" height="19"/><column col-number="1" width="74"/><column col-number="2" width="145"/><column col-number="3" width="107"/><column col-number="4" width="99"/><column col-number="5" width="126"/><column col-number="6" width="97"/><column col-number="7" width="107"/><column col-number="8" width="110"/><column col-number="9" width="110"/><column col-number="10" width="112"/><datasource name="safety-business-3.0.1-sx" type="jdbc" username="root" password="Amos2019Mysql8" url="jdbc:mysql://172.16.10.85:3306/autosys_business_v3.0.0.2-sx?useUnicode=true&amp;characterEncoding=utf-8&amp;useJDBCCompliantTimezoneShift=true&amp;useLegacyDatetimeCode=false&amp;serverTimezone=Asia/Shanghai" driver="com.mysql.jdbc.Driver"><dataset name="equipment" type="sql"><sql><![CDATA[select
a1.*,
(a1.num - a1.exepctionNum) as normalNum
from
(SELECT
system_id,
num,
name,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3)
or report.index_type LIKE CONCAT('%',:param4)
or report.index_type LIKE CONCAT('%',:param5)
or report.index_type LIKE CONCAT('%',:param6)
or report.index_type LIKE CONCAT('%',:param7)
)
and report.index_true_num > 0 and report.report_date >= :startDate and report.report_date <= :endDate ) as exepctionNum
FROM(
SELECT
s.id as system_id,
equipment.code,
equipment.name,
count(1) AS num
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date <= :createDate
GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1]]></sql><field name="system_id"/><field name="num"/><field name="name"/><field name="code"/><field name="exepctionNum"/><field name="normalNum"/><parameter name="startDate" type="Date" default-value="2021-05-26"/><parameter name="endDate" type="Date" default-value="2021-11-26"/><parameter name="createDate" type="Date" default-value="2021-11-26 14:44:19"/><parameter name="param1" type="String" default-value="FireAlarm"/><parameter name="param2" type="String" default-value="Fault"/><parameter name="param3" type="String" default-value="Shield"/><parameter name="param4" type="String" default-value="Open"/><parameter name="param5" type="String" default-value="OilLeak"/><parameter name="param6" type="String" default-value="Alarm"/><parameter name="param7" type="String" default-value="Abnormal"/></dataset><dataset name="system" type="sql"><sql><![CDATA[SELECT id, name FROM f_fire_fighting_system where code = :systemCode ]]></sql><field name="id"/><field name="name"/><parameter name="systemCode" type="String" default-value="011023306003010000000013"/></dataset><dataset name="index" type="sql"><sql><![CDATA[SELECT
s.id as systemId,
spec.equipment_code as code,
spec_index.equipment_index_name AS type_name,
spec_index.equipment_index_key AS type_code,
'遥信' AS monitoringData,
'自动获取' AS acquisition,
CASE
WHEN spec_index.equipment_index_key LIKE CONCAT('%', 'fault') THEN
'无故障'
WHEN spec_index.equipment_index_key LIKE CONCAT('%', 'SHIELD') THEN
'无屏蔽'
ELSE
'/'
END AS normal,
IFNULL(
(
SELECT
sum(e.report_equip_num)
FROM
wl_equipment_alarm_equip_day e
WHERE
e.system_id <> ''
and e.system_id = s.id
AND e.equipment_code = spec.equipment_code
AND e.index_key = spec_index.equipment_index_key
AND e.report_date >= DATE_FORMAT(:startDate,'%y-%m-%d')
AND e.report_date <= DATE_FORMAT(:endDate,'%y-%m-%d')
),
0
) AS alarmEquipNum
FROM
wl_equipment_specific_index spec_index
JOIN wl_equipment_specific spec ON spec_index.equipment_specific_id = spec.id
join f_fire_fighting_system s on FIND_IN_SET(s.id,spec.system_id)
WHERE
spec.system_id <> ''
GROUP BY systemId,code,type_code
]]></sql><field name="systemId"/><field name="code"/><field name="type_name"/><field name="type_code"/><field name="monitoringData"/><field name="acquisition"/><field name="normal"/><field name="alarmEquipNum"/><parameter name="startDate" type="Date" default-value="2021-11-28 18:36:05"/><parameter name="endDate" type="Date" default-value="2021-11-28 00:00:00"/></dataset><dataset name="report" type="sql"><sql><![CDATA[SELECT
report.*,
s.id as system_id
FROM
wl_equipment_alarm_report_day report
LEFT JOIN f_fire_fighting_system s ON FIND_IN_SET( s.id, report.system_ids )
LEFT JOIN wl_equipment_specific spec on report.equipment_specific_id = spec.id
where report.system_ids <> ''and report.index_true_num > 0
and (report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3)
or report.index_type LIKE CONCAT('%',:param4)
or report.index_type LIKE CONCAT('%',:param5)
or report.index_type LIKE CONCAT('%',:param6)
or report.index_type LIKE CONCAT('%',:param7)
)
and report.report_date >= :startDate and report.report_date <= :endDate
and spec.create_date <= :createDate]]></sql><field name="id"/><field name="org_code"/><field name="report_date"/><field name="equipment_specific_id"/><field name="equipment_specific_name"/><field name="equipment_detail_id"/><field name="equipment_id"/><field name="equipment_code"/><field name="system_ids"/><field name="alarm_type"/><field name="alarm_type_name"/><field name="last_report_date"/><field name="frequency"/><field name="index_true_num"/><field name="create_date"/><field name="update_date"/><field name="index_id"/><field name="index_name"/><field name="index_type"/><field name="value"/><field name="system_id"/><parameter name="startDate" type="Date" default-value="2021-05-26"/><parameter name="endDate" type="Date" default-value="2021-08-26"/><parameter name="param1" type="String" default-value="FireAlarm"/><parameter name="param2" type="String" default-value="Fault"/><parameter name="param3" type="String" default-value="Shield"/><parameter name="param4" type="String" default-value="Open"/><parameter name="param5" type="String" default-value="OilLeak"/><parameter name="param6" type="String" default-value="Alarm"/><parameter name="param7" type="String" default-value="Abnormal"/><parameter name="createDate" type="Date" default-value="2021-08-26 14:44:19"/></dataset><dataset name="fireControlSystem" type="sql"><sql><![CDATA[
SELECT
system_id,
system_code,
num,
name,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code and FIND_IN_SET(a.system_id,report.system_ids) and report.index_true_num >0 and report.alarm_type in ('BREAKDOWN','FIREALARM','SHIELD') and report.report_date >= :startDate and report.report_date <= :endDate ) as exepctionNum,
systemName
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
equipment.name,
count(1) AS num,
s.name as systemName
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id, name ORDER BY system_id, code ) a WHERE system_code = :systemCode]]></sql><field name="system_id"/><field name="system_code"/><field name="num"/><field name="name"/><field name="code"/><field name="exepctionNum"/><field name="systemName"/><parameter name="startDate" type="Date" default-value="2021-06-15"/><parameter name="endDate" type="Date" default-value="2021-06-15"/><parameter name="createDate" type="Date" default-value="2021-06-15 18:36:07"/><parameter name="systemCode" type="String" default-value="029026401813010000000016"/></dataset><dataset name="system1" type="sql"><sql><![CDATA[SELECT id, name FROM f_fire_fighting_system where code = :systemCode]]></sql><field name="id"/><field name="name"/><parameter name="systemCode" type="String" default-value="029026401813010000000030"/></dataset><dataset name="summary" type="sql"><sql><![CDATA[ SELECT
CONCAT_WS('', fs.name, '设备总数', b.equipNum, '台,今日告警设备为', b.equipNum - b.normalNum, '台,告警总数为', b.alarmNum, '条,正常设备', b.normalNum, '台,正常率', b.normalRate, '%' ) AS contant,
fs.id as system_id
FROM
f_fire_fighting_system fs left join
(
select
SUM(a1.num) AS equipNum,
SUM( (a1.num - a1.exepctionNum))as normalNum,
a1.systemName,
a1.system_id,
a1.alarmNum,
if( SUM(a1.num)>0,convert(SUM(a1.num - a1.exepctionNum)/SUM(a1.num),decimal(15,2)),SUM(a1.num - a1.exepctionNum))*100 as normalRate,
a1.create_date
from
(SELECT
system_id,
num,
name,
code,
create_date,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and report.index_true_num >0
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3) )
and report.report_date >= :startDate and report.report_date <= :endDate ) as exepctionNum,
(SELECT SUM(index_true_num)
FROM wl_equipment_alarm_report_day report
where FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3) )
and report.report_date >= :startDate
and report.report_date <= :endDate
) as alarmNum,
systemName
FROM(
SELECT
s.id as system_id,
equipment.code,
equipment.name,
count(1) AS num,
s.name as systemName,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1
GROUP BY a1.system_id
) as b
on fs.id = b.system_id]]></sql><field name="contant"/><field name="system_id"/><parameter name="createDate" type="Date" default-value="2021-08-27 14:44:19"/><parameter name="startDate" type="Date" default-value="2021-05-26"/><parameter name="endDate" type="Date" default-value="2021-08-27"/><parameter name="param1" type="String" default-value="FireAlarm"/><parameter name="param2" type="String" default-value="Fault"/><parameter name="param3" type="String" default-value="Shield"/></dataset><dataset name="summary_echars2" type="sql"><sql><![CDATA[ SELECT
system_id,
system_code,
num,
name,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code and FIND_IN_SET(a.system_id,report.system_ids) and report.index_true_num >0 and report.alarm_type in ('BREAKDOWN','FIREALARM','SHIELD') and report.report_date >= :startDate and report.report_date <= :endDate ) as exepctionNum,
systemName
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
equipment.name,
count(1) AS num,
s.name as systemName
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id, name ORDER BY system_id, code ) a WHERE system_code = :systemCode]]></sql><field name="system_id"/><field name="system_code"/><field name="num"/><field name="name"/><field name="code"/><field name="exepctionNum"/><field name="systemName"/><parameter name="systemCode" type="String" default-value="029026401813010000000030"/><parameter name="endDate" type="Date" default-value="2021-06-15"/><parameter name="startDate" type="Date" default-value="2021-06-15"/><parameter name="createDate" type="Date" default-value="2021-06-15 00:00:00"/></dataset><dataset name="system2" type="sql"><sql><![CDATA[SELECT id, name FROM f_fire_fighting_system where code =:systemCode ]]></sql><field name="id"/><field name="name"/><parameter name="systemCode" type="String" default-value="029026401813010000000054"/></dataset><dataset name="summary_echars3" type="sql"><sql><![CDATA[ SELECT
system_id,
system_code,
num,
name,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code and FIND_IN_SET(a.system_id,report.system_ids) and report.index_true_num >0 and report.alarm_type in ('BREAKDOWN','FIREALARM','SHIELD') and report.report_date >= :startDate and report.report_date <= :endDate ) as exepctionNum,
systemName
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
equipment.name,
count(1) AS num,
s.name as systemName
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id, name ORDER BY system_id, code ) a WHERE system_code = :systemCode]]></sql><field name="system_id"/><field name="system_code"/><field name="num"/><field name="name"/><field name="code"/><field name="exepctionNum"/><field name="systemName"/><parameter name="systemCode" type="String" default-value="029026401813010000000054"/><parameter name="endDate" type="Date" default-value="2021-06-15"/><parameter name="startDate" type="Date" default-value="2021-06-15"/><parameter name="createDate" type="Date" default-value="2021-06-15 00:00:00"/></dataset><dataset name="system3" type="sql"><sql><![CDATA[SELECT id, name FROM f_fire_fighting_system where code = :systemCode]]></sql><field name="id"/><field name="name"/><parameter name="systemCode" type="String" default-value="029026401813010000000047"/></dataset><dataset name="summary_echars4" type="sql"><sql><![CDATA[ SELECT
system_id,
system_code,
num,
name,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code and FIND_IN_SET(a.system_id,report.system_ids) and report.index_true_num >0 and report.alarm_type in ('BREAKDOWN','FIREALARM','SHIELD') and report.report_date >= :startDate and report.report_date <= :endDate ) as exepctionNum,
systemName
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
equipment.name,
count(1) AS num,
s.name as systemName
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id, name ORDER BY system_id, code ) a WHERE system_code = :systemCode]]></sql><field name="system_id"/><field name="system_code"/><field name="num"/><field name="name"/><field name="code"/><field name="exepctionNum"/><field name="systemName"/><parameter name="systemCode" type="String" default-value="029026401813010000000047"/><parameter name="createDate" type="Date" default-value="2021-06-15 00:00:00"/><parameter name="endDate" type="Date" default-value="2021-06-15"/><parameter name="startDate" type="Date" default-value="2021-06-15"/></dataset><dataset name="system4" type="sql"><sql><![CDATA[SELECT id, name FROM f_fire_fighting_system where code = :systemCode]]></sql><field name="id"/><field name="name"/><parameter name="systemCode" type="String" default-value="029026401813010000000023"/></dataset><dataset name="summary_echars5" type="sql"><sql><![CDATA[ SELECT
system_id,
system_code,
num,
name,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code and FIND_IN_SET(a.system_id,report.system_ids) and report.index_true_num >0 and report.alarm_type in ('BREAKDOWN','FIREALARM','SHIELD') and report.report_date >= :startDate and report.report_date <= :endDate ) as exepctionNum,
systemName
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
equipment.name,
count(1) AS num,
s.name as systemName
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id, name ORDER BY system_id, code ) a WHERE system_code = :systemCode]]></sql><field name="system_id"/><field name="system_code"/><field name="num"/><field name="name"/><field name="code"/><field name="exepctionNum"/><field name="systemName"/><parameter name="systemCode" type="String" default-value="029026401813010000000023"/><parameter name="createDate" type="String" default-value="2021-06-15 00:00:00"/><parameter name="endDate" type="String" default-value="2021-06-15"/><parameter name="startDate" type="String" default-value="2021-06-15"/></dataset><dataset name="summary_echars_right_FAS" type="sql"><sql><![CDATA[ SELECT
(
select
SUM(a1.num-a1.exepctionNum) AS num
from
(SELECT
system_id,
system_code,
num,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3) )
and report.index_true_num>0
and report.report_date >= :startDate
and report.report_date <= :endDate ) as exepctionNum,
create_date
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
count(1) AS num,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id ORDER BY system_id, code ) a) as a1
WHERE system_code = :systemCode
GROUP BY a1.system_id
) as value,
'正常设备' as name
union
SELECT
(
select
SUM(a1.exepctionNum)as exepctionNum
from
(SELECT
system_id,
system_code,
num,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3) )
and report.index_true_num>0
and report.report_date >= :startDate
and report.report_date <= :endDate ) as exepctionNum
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
count(1) AS num,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id ORDER BY system_id, code ) a) as a1
WHERE system_code = :systemCode
GROUP BY a1.system_id
) as value,
'异常设备' as name]]></sql><field name="value"/><field name="name"/><parameter name="systemCode" type="String" default-value="029026401813010000000016"/><parameter name="createDate" type="Date" default-value="2021-06-15 00:00:00"/><parameter name="endDate" type="Date" default-value="2021-06-15"/><parameter name="startDate" type="Date" default-value="2021-06-15"/><parameter name="param1" type="String" default-value="FireAlarm"/><parameter name="param2" type="String" default-value="Fault"/><parameter name="param3" type="String" default-value="Shield"/></dataset><dataset name="summary_echars_right_ONL" type="sql"><sql><![CDATA[ SELECT
(
select
SUM(a1.num-a1.exepctionNum) AS num
from
(SELECT
system_id,
system_code,
num,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1,'%')
or report.index_type LIKE CONCAT('%',:param2,'%')
or report.index_type LIKE CONCAT('%',:param3,'%') )
and report.index_true_num>0
and report.report_date >= :startDate
and report.report_date <= :endDate ) as exepctionNum,
create_date
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
count(1) AS num,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id ORDER BY system_id, code ) a) as a1
WHERE system_code = :systemCode
GROUP BY a1.system_id
) as value,
'正常设备' as name
union
SELECT
(
select
SUM(a1.exepctionNum)as exepctionNum
from
(SELECT
system_id,
system_code,
num,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1,'%')
or report.index_type LIKE CONCAT('%',:param2,'%')
or report.index_type LIKE CONCAT('%',:param3,'%') )
and report.index_true_num>0
and report.report_date >= :startDate
and report.report_date <= :endDate ) as exepctionNum
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
count(1) AS num,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id ORDER BY system_id, code ) a) as a1
WHERE system_code = :systemCode
GROUP BY a1.system_id
) as value,
'异常设备' as name]]></sql><field name="value"/><field name="name"/><parameter name="systemCode" type="String" default-value="029026401813010000000030"/><parameter name="createDate" type="Date" default-value="2021-06-15 00:00:00"/><parameter name="endDate" type="Date" default-value="2021-06-15"/><parameter name="startDate" type="Date" default-value="2021-06-15"/><parameter name="param1" type="String" default-value="Fault"/><parameter name="param2" type="String" default-value="Open"/><parameter name="param3" type="String" default-value="OilLeak"/></dataset><dataset name="summary_echars_right_FFS" type="sql"><sql><![CDATA[
SELECT
(
select
SUM(a1.num-a1.exepctionNum) AS num
from
(SELECT
system_id,
system_code,
num,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3)
or report.index_type LIKE CONCAT('%',:param4) )
and report.index_true_num>0
and report.report_date >= :startDate
and report.report_date <= :endDate ) as exepctionNum,
create_date
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
count(1) AS num,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id ORDER BY system_id, code ) a) as a1
WHERE system_code = :systemCode
GROUP BY a1.system_id
) as value,
'正常设备' as name
union
SELECT
(
select
SUM(a1.exepctionNum)as exepctionNum
from
(SELECT
system_id,
system_code,
num,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3)
or report.index_type LIKE CONCAT('%',:param4) )
and report.index_true_num>0
and report.report_date >= :startDate
and report.report_date <= :endDate ) as exepctionNum
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
count(1) AS num,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id ORDER BY system_id, code ) a) as a1
WHERE system_code = :systemCode
GROUP BY a1.system_id
) as value,
'异常设备' as name]]></sql><field name="value"/><field name="name"/><parameter name="systemCode" type="String" default-value="029026401813010000000054"/><parameter name="createDate" type="Date" default-value="2021-06-15 00:00:00"/><parameter name="endDate" type="Date" default-value="2021-06-15"/><parameter name="startDate" type="Date" default-value="2021-06-15"/><parameter name="param1" type="String" default-value="FireAlarm"/><parameter name="param2" type="String" default-value="Fault"/><parameter name="param3" type="String" default-value="Shield"/><parameter name="param4" type="String" default-value="State"/></dataset><dataset name="summary_echars_right_FHS" type="sql"><sql><![CDATA[ SELECT
(
select
SUM(a1.num-a1.exepctionNum) AS num
from
(SELECT
system_id,
system_code,
num,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3))
and report.index_true_num>0
and report.report_date >= :startDate
and report.report_date <= :endDate ) as exepctionNum,
create_date
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
count(1) AS num,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id ORDER BY system_id, code ) a) as a1
WHERE system_code = :systemCode
GROUP BY a1.system_id
) as value,
'正常设备' as name
union
SELECT
(
select
SUM(a1.exepctionNum)as exepctionNum
from
(SELECT
system_id,
system_code,
num,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3) )
and report.index_true_num>0
and report.report_date >= :startDate
and report.report_date <= :endDate ) as exepctionNum
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
count(1) AS num,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id ORDER BY system_id, code ) a) as a1
WHERE system_code = :systemCode
GROUP BY a1.system_id
) as value,
'异常设备' as name]]></sql><field name="value"/><field name="name"/><parameter name="systemCode" type="String" default-value="029026401813010000000047"/><parameter name="createDate" type="Date" default-value="2021-06-15 00:00:00"/><parameter name="endDate" type="Date" default-value="2021-06-15"/><parameter name="startDate" type="Date" default-value="2021-06-15"/><parameter name="param1" type="String" default-value="Fault"/><parameter name="param2" type="String" default-value="Shield"/><parameter name="param3" type="String" default-value="FireAlarm"/></dataset><dataset name="summary_echars_right_CAFS" type="sql"><sql><![CDATA[ SELECT
(
select
SUM(a1.num-a1.exepctionNum) AS num
from
(SELECT
system_id,
system_code,
num,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3))
and report.index_true_num>0
and report.report_date >= :startDate
and report.report_date <= :endDate ) as exepctionNum,
create_date
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
count(1) AS num,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id ORDER BY system_id, code ) a) as a1
WHERE system_code = :systemCode
GROUP BY a1.system_id
) as value,
'正常设备' as name
union
SELECT
(
select
SUM(a1.exepctionNum)as exepctionNum
from
(SELECT
system_id,
system_code,
num,
code,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3) )
and report.index_true_num>0
and report.report_date >= :startDate
and report.report_date <= :endDate ) as exepctionNum
FROM(
SELECT
s.id as system_id,
s.code as system_code,
equipment.code,
count(1) AS num,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id ORDER BY system_id, code ) a) as a1
WHERE system_code = :systemCode
GROUP BY a1.system_id
) as value,
'异常设备' as name]]></sql><field name="value"/><field name="name"/><parameter name="systemCode" type="String" default-value="029026401813010000000023"/><parameter name="createDate" type="Date" default-value="2021-06-15 00:00:00"/><parameter name="endDate" type="Date" default-value="2021-06-15"/><parameter name="startDate" type="Date" default-value="2021-06-15"/><parameter name="param1" type="String" default-value="Fault"/><parameter name="param2" type="String" default-value="Alarm"/><parameter name="param3" type="String" default-value="Abnormal"/></dataset><dataset name="ONL_summary" type="sql"><sql><![CDATA[ SELECT
CONCAT_WS('', fs.name, '设备总数', b.equipNum, '台,今日告警设备为', b.equipNum - b.normalNum, '台,告警总数为', b.alarmNum, '条,正常设备', b.normalNum, '台,正常率', b.normalRate, '%' ) AS contant,
fs.id as system_id
FROM
f_fire_fighting_system fs left join
(
select
SUM(a1.num) AS equipNum,
SUM( (a1.num - a1.exepctionNum))as normalNum,
a1.systemName,
a1.system_id,
a1.alarmNum,
if( SUM(a1.num)>0,convert(SUM(a1.num - a1.exepctionNum)/SUM(a1.num),decimal(15,2)),SUM(a1.num - a1.exepctionNum))*100 as normalRate,
a1.create_date
from
(SELECT
system_id,
num,
name,
code,
create_date,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and report.index_true_num >0
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3) )
and report.report_date >= :startDate and report.report_date <= :endDate ) as exepctionNum,
(SELECT SUM(index_true_num)
FROM wl_equipment_alarm_report_day report
where FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3) )
and report.report_date >= :startDate
and report.report_date <= :endDate
) as alarmNum,
systemName
FROM(
SELECT
s.id as system_id,
equipment.code,
equipment.name,
count(1) AS num,
s.name as systemName,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1
GROUP BY a1.system_id
) as b
on fs.id = b.system_id]]></sql><field name="contant"/><field name="system_id"/><parameter name="startDate" type="Date" default-value="2021-06-15"/><parameter name="endDate" type="Date" default-value="2021-06-15"/><parameter name="createDate" type="Date" default-value="2021-06-15 10:36:17"/><parameter name="param1" type="String" default-value="Close"/><parameter name="param2" type="String" default-value="OilLeak"/><parameter name="param3" type="String" default-value="Fault"/></dataset><dataset name="FFS_summary" type="sql"><sql><![CDATA[ SELECT
CONCAT_WS('', fs.name, '设备总数', b.equipNum, '台,今日告警设备为', b.equipNum - b.normalNum, '台,告警总数为', b.alarmNum, '条,正常设备', b.normalNum, '台,正常率', b.normalRate, '%' ) AS contant,
fs.id as system_id
FROM
f_fire_fighting_system fs left join
(
select
SUM(a1.num) AS equipNum,
SUM( (a1.num - a1.exepctionNum))as normalNum,
a1.systemName,
a1.system_id,
a1.alarmNum,
if( SUM(a1.num)>0,convert(SUM(a1.num - a1.exepctionNum)/SUM(a1.num),decimal(15,2)),SUM(a1.num - a1.exepctionNum))*100 as normalRate,
a1.create_date
from
(SELECT
system_id,
num,
name,
code,
create_date,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and report.index_true_num >0
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3) )
and report.report_date >= :startDate and report.report_date <= :endDate ) as exepctionNum,
(SELECT SUM(index_true_num)
FROM wl_equipment_alarm_report_day report
where FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3) )
and report.report_date >= :startDate
and report.report_date <= :endDate
) as alarmNum,
systemName
FROM(
SELECT
s.id as system_id,
equipment.code,
equipment.name,
count(1) AS num,
s.name as systemName,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1
GROUP BY a1.system_id
) as b
on fs.id = b.system_id]]></sql><field name="contant"/><field name="system_id"/><parameter name="param3" type="String" default-value="Fault"/><parameter name="param1" type="String" default-value="FireAlarm"/><parameter name="param2" type="String" default-value="Shield"/><parameter name="createDate" type="Date" default-value="2021-06-04 10:51:18"/><parameter name="startDate" type="Date" default-value="2021-05-26"/><parameter name="endDate" type="Date" default-value="2021-05-26"/></dataset><dataset name="FHS_summary" type="sql"><sql><![CDATA[ SELECT
CONCAT_WS('', fs.name, '设备总数', b.equipNum, '台,今日告警设备为', b.equipNum - b.normalNum, '台,告警总数为', b.alarmNum, '条,正常设备', b.normalNum, '台,正常率', b.normalRate, '%' ) AS contant,
fs.id as system_id
FROM
f_fire_fighting_system fs left join
(
select
SUM(a1.num) AS equipNum,
SUM( (a1.num - a1.exepctionNum))as normalNum,
a1.systemName,
a1.system_id,
a1.alarmNum,
if( SUM(a1.num)>0,convert(SUM(a1.num - a1.exepctionNum)/SUM(a1.num),decimal(15,2)),SUM(a1.num - a1.exepctionNum))*100 as normalRate,
a1.create_date
from
(SELECT
system_id,
num,
name,
code,
create_date,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and report.index_true_num >0
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3) )
and report.report_date >= :startDate and report.report_date <= :endDate ) as exepctionNum,
(SELECT SUM(index_true_num)
FROM wl_equipment_alarm_report_day report
where FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3) )
and report.report_date >= :startDate
and report.report_date <= :endDate
) as alarmNum,
systemName
FROM(
SELECT
s.id as system_id,
equipment.code,
equipment.name,
count(1) AS num,
s.name as systemName,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1
GROUP BY a1.system_id
) as b
on fs.id = b.system_id]]></sql><field name="contant"/><field name="system_id"/><parameter name="endDate" type="Date" default-value="2021-05-26"/><parameter name="startDate" type="Date" default-value="2021-05-26"/><parameter name="createDate" type="Date" default-value="2021-06-04 10:51:18"/><parameter name="param1" type="String" default-value="Fault"/><parameter name="param2" type="String" default-value="Shield"/><parameter name="param3" type="String" default-value="FireAlarm"/></dataset><dataset name="CAFS_summary" type="sql"><sql><![CDATA[ SELECT
CONCAT_WS('', fs.name, '设备总数', b.equipNum, '台,今日告警设备为', b.equipNum - b.normalNum, '台,告警总数为', b.alarmNum, '条,正常设备', b.normalNum, '台,正常率', b.normalRate, '%' ) AS contant,
fs.id as system_id
FROM
f_fire_fighting_system fs left join
(
select
SUM(a1.num) AS equipNum,
SUM( (a1.num - a1.exepctionNum))as normalNum,
a1.systemName,
a1.system_id,
a1.alarmNum,
if( SUM(a1.num)>0,convert(SUM(a1.num - a1.exepctionNum)/SUM(a1.num),decimal(15,2)),SUM(a1.num - a1.exepctionNum))*100 as normalRate,
a1.create_date
from
(SELECT
system_id,
num,
name,
code,
create_date,
(SELECT count(distinct equipment_specific_id)
FROM wl_equipment_alarm_report_day report
where report.equipment_code = a.code
and FIND_IN_SET(a.system_id,report.system_ids)
and report.index_true_num >0
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3) )
and report.report_date >= :startDate and report.report_date <= :endDate ) as exepctionNum,
(SELECT SUM(index_true_num)
FROM wl_equipment_alarm_report_day report
where FIND_IN_SET(a.system_id,report.system_ids)
and( report.index_type LIKE CONCAT('%',:param1)
or report.index_type LIKE CONCAT('%',:param2)
or report.index_type LIKE CONCAT('%',:param3) )
and report.report_date >= :startDate
and report.report_date <= :endDate
) as alarmNum,
systemName
FROM(
SELECT
s.id as system_id,
equipment.code,
equipment.name,
count(1) AS num,
s.name as systemName,
spec.create_date
FROM
wl_equipment_specific spec
LEFT JOIN wl_equipment_detail detail ON spec.equipment_detail_id = detail.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)
where spec.system_id <> '' and spec.create_date < :createDate
GROUP BY code,s.id, name ORDER BY system_id, code ) a) as a1
GROUP BY a1.system_id
) as b
on fs.id = b.system_id]]></sql><field name="contant"/><field name="system_id"/><parameter name="param3" type="String" default-value="Alarm"/><parameter name="param2" type="String" default-value="Fault"/><parameter name="param1" type="String" default-value="Abnormal"/><parameter name="createDate" type="Date" default-value="2021-06-15 10:51:18"/><parameter name="endDate" type="Date" default-value="2021-06-15"/><parameter name="startDate" type="Date" default-value="2021-06-15"/></dataset></datasource><paper type="A4" left-margin="90" right-margin="90"
top-margin="72" bottom-margin="72" paging-mode="fixrows" fixrows="10"
width="595" height="842" orientation="portrait" html-report-align="left" bg-image="" html-interval-refresh-value="0" column-enabled="false"></paper><search-form form-position="down"/></ureport>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
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