Browse Source

设备管理-20240827优化

thing_master
xiezw 1 year ago
parent
commit
914043d2d5
  1. 276
      application/src/main/resources/application.yml
  2. 3
      modules/equipment/src/main/java/com/thing/eq/eqmanager/dto/EqScrapDTO.java
  3. 4
      modules/equipment/src/main/java/com/thing/eq/eqmanager/mapper/IotThingBaseInfoMapper.java
  4. 1
      modules/equipment/src/main/java/com/thing/eq/eqmanager/service/impl/EqScrapServiceImpl.java
  5. 6
      modules/equipment/src/main/java/com/thing/eq/eqmanager/service/impl/IotThingBaseInfoServiceImpl.java
  6. 1
      modules/equipment/src/main/java/com/thing/eq/eqmanager/service/impl/IotThingsServiceImpl.java
  7. 10
      modules/equipment/src/main/java/com/thing/eq/tree/controller/DeviceController.java
  8. 14
      modules/equipment/src/main/resources/mapper/eqmanager/IotThingBaseInfoMapper.xml

276
application/src/main/resources/application.yml

@ -1,271 +1,541 @@
server: server:
port: 18080
port: 8070
servlet: servlet:
context-path: /thing context-path: /thing
spring: spring:
cache: cache:
type: caffeine # 支持 redis/caffeine, 当选择redis时,要在application.yml中配置redis连接信息 type: caffeine # 支持 redis/caffeine, 当选择redis时,要在application.yml中配置redis连接信息
main: main:
allow-bean-definition-overriding: true allow-bean-definition-overriding: true
allow-circular-references: true allow-circular-references: true
servlet: servlet:
multipart: multipart:
max-file-size: 100MB max-file-size: 100MB
max-request-size: 100MB max-request-size: 100MB
enabled: true enabled: true
messages: messages:
encoding: UTF-8 encoding: UTF-8
basename: i18n/messages basename: i18n/messages
data: data:
redis: redis:
host: 192.168.188.185 host: 192.168.188.185
port: 7963 port: 7963
password: Sddt8888! password: Sddt8888!
database: 5 database: 5
#项目入口签名 #项目入口签名
title: title:
sign: ck #企业签名 sign: ck #企业签名
technical: technical:
phone: phone:
map-bucket: geojson #地图文件路径 map-bucket: geojson #地图文件路径
queue: queue:
type: in-memory # 队列类型: inMemory / disruptor type: in-memory # 队列类型: inMemory / disruptor
inMemory: inMemory:
maxSize: 500 maxSize: 500
pollInterval: 100 pollInterval: 100
disruptor: disruptor:
maximumPoolSize: 8 maximumPoolSize: 8
bufferSize: 256 # 指定ringbuffer字节大小,当前值将乘1024 bufferSize: 256 # 指定ringbuffer字节大小,当前值将乘1024
partitions: partitions:
hash_function_name: murmur3_128 # murmur3_32, murmur3_128 or sha256 hash_function_name: murmur3_128 # murmur3_32, murmur3_128 or sha256
core: core:
topic: queue_core topic: queue_core
poll-interval: 1000 poll-interval: 1000
partitions: 30 partitions: 30
debug: false debug: false
log-interval: 300 log-interval: 300
rabbitmq: rabbitmq:
exchange_name: exchange_name:
host: localhost host: localhost
port: 5673 port: 5673
virtual_host: / virtual_host: /
username: guest username: guest
password: guest password: guest
automatic_recovery_enabled: false automatic_recovery_enabled: false
connection_timeout: 60000 connection_timeout: 60000
handshake_timeout: 10000 handshake_timeout: 10000
queue-properties: queue-properties:
core: x-max-length-bytes:1048576000;x-message-ttl:604800000 core: x-max-length-bytes:1048576000;x-message-ttl:604800000
#数据源配置 #数据源配置
database: database:
ts_kv: ts_kv:
type: postgresql # 时序数据存储类型 clickhouse/timescale/postgresql/tidb/mysql type: postgresql # 时序数据存储类型 clickhouse/timescale/postgresql/tidb/mysql
latest: latest:
type: postgresql # 最新数据存储类型 postgresql/timescale/mysql/tidb/clickhouse type: postgresql # 最新数据存储类型 postgresql/timescale/mysql/tidb/clickhouse
save_maximumPoolSize: 12 save_maximumPoolSize: 12
# 数据源及mybatis、mybatis-flex配置 # 数据源及mybatis、mybatis-flex配置
mybatis-flex: mybatis-flex:
typeAliasesPackage: com.thing.**.mapper typeAliasesPackage: com.thing.**.mapper
mapperLocations: classpath*:/mapper/**/*.xml mapperLocations: classpath*:/mapper/**/*.xml
#本部分(Configuration)的配置都为 MyBatis 原生支持的配置,有关配置请参考:https://mybatis.org/mybatis-3/zh/configuration.html#%E8%AE%BE%E7%BD%AE%EF%BC%88settings%EF%BC%89 #本部分(Configuration)的配置都为 MyBatis 原生支持的配置,有关配置请参考:https://mybatis.org/mybatis-3/zh/configuration.html#%E8%AE%BE%E7%BD%AE%EF%BC%88settings%EF%BC%89
configuration: configuration:
mapUnderscoreToCamelCase: true mapUnderscoreToCamelCase: true
autoMappingBehavior: FULL autoMappingBehavior: FULL
autoMappingUnknownColumnBehavior: NONE autoMappingUnknownColumnBehavior: NONE
cacheEnabled: true cacheEnabled: true
global-config: global-config:
print-banner: true print-banner: true
normal-value-of-logic-delete: 0 normal-value-of-logic-delete: 0
deleted-value-of-logic-delete: 1 deleted-value-of-logic-delete: 1
datasource: datasource:
pg: pg:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
url: jdbc:postgresql://192.168.188.185:5432/thing_v2
url: jdbc:postgresql://192.168.188.184:5432/thingbi_v3
driver-class-name: org.postgresql.Driver driver-class-name: org.postgresql.Driver
username: postgres username: postgres
password: sddt8888 password: sddt8888
postgresql: postgresql:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
url: jdbc:postgresql://192.168.188.185:5432/thing_v2
url: jdbc:postgresql://192.168.188.184:5432/thingbi_v3
driver-class-name: org.postgresql.Driver driver-class-name: org.postgresql.Driver
username: postgres username: postgres
password: sddt8888 password: sddt8888
sqlServer: sqlServer:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
url: jdbc:sqlserver://127.0.0.1:1433;databaseName=销售生产其他 url: jdbc:sqlserver://127.0.0.1:1433;databaseName=销售生产其他
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
username: czj username: czj
password: 1234 password: 1234
# 区间统计计算相关配置 # 区间统计计算相关配置
calculate: calculate:
am_total: am_total:
offset: 24 #当数据出现断点时,向后偏移查询多少小时 offset: 24 #当数据出现断点时,向后偏移查询多少小时
interval: 15 # 分区间统计,间隔时长(分)1/3/5/10/15/20/30/60 interval: 15 # 分区间统计,间隔时长(分)1/3/5/10/15/20/30/60
keys: A29,B2,C2,C6,D2,D4,E3,E4,F4,G2,G4,H2,I2,I4,K2,N2,N4,P4,Q2,R2,R4,S2,S4,F2,T2,T4,U2,U4,J2,J4,L2,A30,P2,Q4,V2,V4,A29_rush,A29_peak,A29_valley,A29_normal,A29_generate,A30_rush,A30_peak,A30_valley,A30_normal,tce_C6,tce_A29,tce_E3,CO2_A29,CO2_C6,CO2_E3,CO2_run,tce_run,tce_E3,A201,A202,A204,tce_J2 keys: A29,B2,C2,C6,D2,D4,E3,E4,F4,G2,G4,H2,I2,I4,K2,N2,N4,P4,Q2,R2,R4,S2,S4,F2,T2,T4,U2,U4,J2,J4,L2,A30,P2,Q4,V2,V4,A29_rush,A29_peak,A29_valley,A29_normal,A29_generate,A30_rush,A30_peak,A30_valley,A30_normal,tce_C6,tce_A29,tce_E3,CO2_A29,CO2_C6,CO2_E3,CO2_run,tce_run,tce_E3,A201,A202,A204,tce_J2
ddmmyy: #例如:每月1号0时0分 开始统计年/月/日用量 ddmmyy: #例如:每月1号0时0分 开始统计年/月/日用量
start_hh: 0 #小时/天/月/年 用量统计开始的分钟数(0-59) start_hh: 0 #小时/天/月/年 用量统计开始的分钟数(0-59)
start_dd: 0 #天/月/年 用量统计开始的小时(0-23) start_dd: 0 #天/月/年 用量统计开始的小时(0-23)
start_mm: 1 #月/年 用量统计开始的天(1-30) start_mm: 1 #月/年 用量统计开始的天(1-30)
start_yy: 1 #年 用量统计开始的月份(1-12) start_yy: 1 #年 用量统计开始的月份(1-12)
maximumPoolSize: 12 maximumPoolSize: 12
# 产品碳足迹 相关配置 # 产品碳足迹 相关配置
carbon: carbon:
syncButton: false syncButton: false
pub: pub:
# 公共服务侧租户标识 # 公共服务侧租户标识
tenantTag: 公共服务 tenantTag: 公共服务
api: api:
secret: nba!w^0@01 secret: nba!w^0@01
#物管理相关配置 #物管理相关配置
thing: thing:
# token 过期时间 30天 # token 过期时间 30天
token: token:
expire: 2592000 expire: 2592000
##数据解析配置 ##数据解析配置
nashorn: nashorn:
# JS Eval max request timeout. 0 - no timeout # JS Eval max request timeout. 0 - no timeout
max_requests_timeout: 0 max_requests_timeout: 0
# Specify thread pool size for javascript executor service # Specify thread pool size for javascript executor service
js_thread_pool_size: 120 js_thread_pool_size: 120
# Specify thread pool size for JavaScript sandbox resource monitor # Specify thread pool size for JavaScript sandbox resource monitor
monitor_thread_pool_size: 12 monitor_thread_pool_size: 12
# Maximum CPU time in milliseconds allowed for script execution # Maximum CPU time in milliseconds allowed for script execution
max_cpu_time: 8000 max_cpu_time: 8000
tbel: tbel:
# JS Eval max request timeout. 0 - no timeout # JS Eval max request timeout. 0 - no timeout
max_requests_timeout: 0 max_requests_timeout: 0
# Specify thread pool size for javascript executor service # Specify thread pool size for javascript executor service
thread_pool_size: 100 thread_pool_size: 100
# Maximum allowed TBEL script execution memory # Maximum allowed TBEL script execution memory
max_memory_limit_mb: 8 max_memory_limit_mb: 8
compiled_scripts_cache_size: 1000 compiled_scripts_cache_size: 1000
aviator: aviator:
# JS Eval max request timeout. 0 - no timeout # JS Eval max request timeout. 0 - no timeout
max_requests_timeout: 0 max_requests_timeout: 0
# Specify thread pool size for javascript executor service # Specify thread pool size for javascript executor service
js_thread_pool_size: 100 js_thread_pool_size: 100
# Whether to put capturing groups into passed-in env map # Whether to put capturing groups into passed-in env map
# when regular-expression pattern matches # when regular-expression pattern matches
put_capturing_groups_into_env: false put_capturing_groups_into_env: false
# Max loop count to prevent too much CPU consumption. If it's value is zero or negative, it means # Max loop count to prevent too much CPU consumption. If it's value is zero or negative, it means
# no limitation on loop count.Default is zero. # no limitation on loop count.Default is zero.
max_loop_count: 1000 max_loop_count: 1000
#队列相关配置 #队列相关配置
transport: transport:
# Enable/disable http/mqtt/... transport protocols (has higher priority than certain protocol's 'enabled' property) # Enable/disable http/mqtt/... transport protocols (has higher priority than certain protocol's 'enabled' property)
api_enabled: true api_enabled: true
sessions: sessions:
inactivity_timeout: 300000 inactivity_timeout: 300000
report_timeout: 30000 report_timeout: 30000
rate_limits: rate_limits:
enabled: false enabled: false
# 1s 10次,60s 300次 # 1s 10次,60s 300次
device: 10:1,300:60 device: 10:1,300:60
# Local HTTP transport parameters # Local HTTP transport parameters
http: http:
# Enable/disable http transport protocol. # Enable/disable http transport protocol.
enabled: false enabled: false
request_timeout: 60000 request_timeout: 60000
# Local MQTT transport parameters # Local MQTT transport parameters
mqtt: mqtt:
# Enable/disable mqtt transport protocol. # Enable/disable mqtt transport protocol.
enabled: false enabled: false
bind_address: 0.0.0.0 bind_address: 0.0.0.0
bind_port: 1883 bind_port: 1883
timeout: 10000 timeout: 10000
netty: netty:
leak_detector_level: DISABLED leak_detector_level: DISABLED
boss_group_thread_count: 1 boss_group_thread_count: 1
worker_group_thread_count: 12 worker_group_thread_count: 12
max_payload_size: 65536 max_payload_size: 65536
so_keep_alive: false so_keep_alive: false
#告警模块 配置 #告警模块 配置
alarm: alarm:
event_bus: event_bus:
queue_size: 50 queue_size: 50
core_pool_size: 5 core_pool_size: 5
max_pool_size: 20 max_pool_size: 20
#swagger 文档配置 #swagger 文档配置
springdoc: springdoc:
swagger-ui: swagger-ui:
path: /swagger-ui.html path: /swagger-ui.html
packages-to-scan: com.thing packages-to-scan: com.thing
api-docs: api-docs:
enabled: true enabled: true
# knife4j的增强配置,不需要增强可以不配 # knife4j的增强配置,不需要增强可以不配
knife4j: knife4j:
enable: true enable: true
setting: setting:
language: zh_cn language: zh_cn
#数据过滤配置 #数据过滤配置
filter: filter:
rule: rule:
enable: false enable: false
#项目状态 #项目状态
management: management:
health: health:
redis: redis:
enabled: false enabled: false
endpoints: endpoints:
enabled-by-default: true #暴露所有端点信息 enabled-by-default: true #暴露所有端点信息
web: web:
exposure: exposure:
include: '*' #以web方式暴露 include: '*' #以web方式暴露
# 缓存管理 # 缓存管理
cache-manager: cache-manager:
specs: specs:
security: security:
timeToLiveInMinutes: 10 timeToLiveInMinutes: 10
maxSize: 50 maxSize: 50
thingModel: thingModel:
timeToLiveInMinutes: 1440 timeToLiveInMinutes: 1440
maxSize: 10000 maxSize: 10000
authThingCodes: authThingCodes:
timeToLiveInMinutes: 1440 timeToLiveInMinutes: 1440
maxSize: 10000 maxSize: 10000
thingEntity: thingEntity:
timeToLiveInMinutes: 1440 timeToLiveInMinutes: 1440
maxSize: 10000 maxSize: 10000
thingDict: thingDict:
timeToLiveInMinutes: 1440 timeToLiveInMinutes: 1440
maxSize: 10000 maxSize: 10000
thingDictRelation: thingDictRelation:
timeToLiveInMinutes: 1440 timeToLiveInMinutes: 1440
maxSize: 10000 maxSize: 10000
thingDetailRelation: thingDetailRelation:
timeToLiveInMinutes: 1440 timeToLiveInMinutes: 1440
maxSize: 10000 maxSize: 10000
thingRootRelation: thingRootRelation:
timeToLiveInMinutes: 1440 timeToLiveInMinutes: 1440
maxSize: 10000 maxSize: 10000
thingCalcConfig: thingCalcConfig:
timeToLiveInMinutes: 525600 timeToLiveInMinutes: 525600
maxSize: 10000 maxSize: 10000
filterRule: filterRule:
timeToLiveInMinutes: 525600 timeToLiveInMinutes: 525600
maxSize: 10000 maxSize: 10000
alarmRule: alarmRule:
timeToLiveInMinutes: 525600 timeToLiveInMinutes: 525600
maxSize: 1000 maxSize: 1000
alarmRuleEntity: alarmRuleEntity:
timeToLiveInMinutes: 525600 timeToLiveInMinutes: 525600
maxSize: 1000 maxSize: 1000
alarmRuleAction: alarmRuleAction:
timeToLiveInMinutes: 525600 timeToLiveInMinutes: 525600
maxSize: 1000 maxSize: 1000
scriptInfo: scriptInfo:
timeToLiveInMinutes: 525600 timeToLiveInMinutes: 525600
maxSize: 1000 maxSize: 1000
mockDataConfig: mockDataConfig:
timeToLiveInMinutes: 525600 timeToLiveInMinutes: 525600
maxSize: 1000 maxSize: 1000
mockDataLatestTime: mockDataLatestTime:
timeToLiveInMinutes: 525600 timeToLiveInMinutes: 525600
maxSize: 1000 maxSize: 1000

3
modules/equipment/src/main/java/com/thing/eq/eqmanager/dto/EqScrapDTO.java

@ -1,5 +1,7 @@
package com.thing.eq.eqmanager.dto; package com.thing.eq.eqmanager.dto;
import com.thing.common.orm.dto.BaseDTO;
import com.thing.common.orm.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@ -41,5 +43,6 @@ public class EqScrapDTO implements Serializable {
private String scrapDisposal; private String scrapDisposal;
@Schema(description = "设备信息") @Schema(description = "设备信息")
private EqInfoDTO eqInfo; private EqInfoDTO eqInfo;
private Long tenantCode;
} }

4
modules/equipment/src/main/java/com/thing/eq/eqmanager/mapper/IotThingBaseInfoMapper.java

@ -35,7 +35,7 @@ public interface IotThingBaseInfoMapper extends PowerBaseMapper<IotThingBaseInfo
void updateScrap(@Param("eqId") Long eqId, @Param("scrap") String scrap, @Param("scrapDisposal") String scrapDisposal); void updateScrap(@Param("eqId") Long eqId, @Param("scrap") String scrap, @Param("scrapDisposal") String scrapDisposal);
List<IotThingsPartExcel> exportPartListByThingsId(@Param("params") Map<String, Object> params);
// List<IotThingsPartExcel> exportPartListByThingsId(@Param("params") Map<String, Object> params);
String getStock(@Param("eqId") Long eqId); String getStock(@Param("eqId") Long eqId);
@ -47,5 +47,5 @@ public interface IotThingBaseInfoMapper extends PowerBaseMapper<IotThingBaseInfo
List<IotThingsExcel> exportDeviceListByThingsId(@Param("relationTypeId") Long relationTypeId, @Param("toId") Long toId, @Param("ids") Long[] ids); List<IotThingsExcel> exportDeviceListByThingsId(@Param("relationTypeId") Long relationTypeId, @Param("toId") Long toId, @Param("ids") Long[] ids);
List<IotThingsPartExcel> exportPartListByThingsId(@Param("relationTypeId") Long relationTypeId, @Param("toId") Long toId, @Param("ids") Long[] ids);
List<IotThingsPartExcel> exportPartListByThingsId(@Param("relationTypeId") Long relationTypeId, @Param("toId") Long toId, @Param("ids") Long[] ids,@Param("keyWord")String keyWord);
} }

1
modules/equipment/src/main/java/com/thing/eq/eqmanager/service/impl/EqScrapServiceImpl.java

@ -119,6 +119,7 @@ public class EqScrapServiceImpl extends BaseServiceImpl<EqScrapMapper, EqScrapEn
} }
//报废未处理 //报废未处理
dto.setScrapDisposal("0"); dto.setScrapDisposal("0");
dto.setTenantCode(TenantContext.getTenantCode(SecurityUser.getUser()));
//更新设备报废状态设备未处理状态 //更新设备报废状态设备未处理状态
iotThingBaseInfoService.updateScrap(eqId,scrap,"0"); iotThingBaseInfoService.updateScrap(eqId,scrap,"0");
//保存记录 //保存记录

6
modules/equipment/src/main/java/com/thing/eq/eqmanager/service/impl/IotThingBaseInfoServiceImpl.java

@ -320,8 +320,12 @@ public class IotThingBaseInfoServiceImpl extends BaseServiceImpl<IotThingBaseInf
String aLong2 = params.get("toId").toString(); String aLong2 = params.get("toId").toString();
toId = new Long(aLong2); toId = new Long(aLong2);
}; };
String keyWord = null;
if (ObjectUtil.isNotEmpty(params.get("keyWord"))){
keyWord = params.get("keyWord").toString();
}
// ids.length // ids.length
List<IotThingsPartExcel> excels = iotThingBaseInfoDao.exportPartListByThingsId(relationTypeId,toId,ids);
List<IotThingsPartExcel> excels = iotThingBaseInfoDao.exportPartListByThingsId(relationTypeId,toId,ids,keyWord);
return excels; return excels;
} }

1
modules/equipment/src/main/java/com/thing/eq/eqmanager/service/impl/IotThingsServiceImpl.java

@ -187,6 +187,7 @@ public class IotThingsServiceImpl implements IotThingsService {
IotThingBaseInfoDTO baseInfoDTO = new IotThingBaseInfoDTO(); IotThingBaseInfoDTO baseInfoDTO = new IotThingBaseInfoDTO();
BeanUtils.copyProperties(dto,baseInfoDTO); BeanUtils.copyProperties(dto,baseInfoDTO);
//*** //***
baseInfoDTO.setId(thingEntity.getId());
baseInfoDTO.setThingId(thingEntity.getId()); baseInfoDTO.setThingId(thingEntity.getId());
baseInfoDTO.setScrap("0"); baseInfoDTO.setScrap("0");
baseInfoDTO.setScrapDisposal("0"); baseInfoDTO.setScrapDisposal("0");

10
modules/equipment/src/main/java/com/thing/eq/tree/controller/DeviceController.java

@ -108,10 +108,9 @@ public class DeviceController {
newList.add(iotThingsExcel); newList.add(iotThingsExcel);
} }
} }
} else{
newList.addAll(list);
} }
// else{
// newList.addAll(list);
// }
ExcelUtils.exportExcel(newList,null, "设备台账", IotThingsExcel.class,"设备台账.xls",response); ExcelUtils.exportExcel(newList,null, "设备台账", IotThingsExcel.class,"设备台账.xls",response);
} }
@ -148,10 +147,9 @@ public class DeviceController {
newList.add(iotThingsPartExcel); newList.add(iotThingsPartExcel);
} }
} }
} else{
newList.addAll(list);
} }
// else{
// newList.addAll(list);
// }
ExcelUtils.exportExcel(newList,null, "备件库", IotThingsPartExcel.class,"备件库.xls",response); ExcelUtils.exportExcel(newList,null, "备件库", IotThingsPartExcel.class,"备件库.xls",response);
} }

14
modules/equipment/src/main/resources/mapper/eqmanager/IotThingBaseInfoMapper.xml

@ -25,7 +25,7 @@
<result property="operator" column="operator"/> <result property="operator" column="operator"/>
</resultMap> </resultMap>
<update id="updateScrap"> <update id="updateScrap">
update iot_thing_base_info set scrap=#{scrap},scrap_disposal=#{scrapDisposal} where thing_id=#{eqId}
update iot_thing_base_info set scrap=#{scrap},scrap_disposal=#{scrapDisposal} where id=#{eqId}
</update> </update>
<delete id="deleteByThingsId"> <delete id="deleteByThingsId">
@ -130,27 +130,25 @@
FROM FROM
iot_thing_base_info baseinfo iot_thing_base_info baseinfo
LEFT JOIN iot_thing_entity things ON things.id = baseinfo.thing_id LEFT JOIN iot_thing_entity things ON things.id = baseinfo.thing_id
LEFT JOIN iot_thing_relation_detail relation on relation.to_id = baseinfo.thing_id and relation.root_id = #{params.relationTypeId} and relation.from_id =#{params.toId}
LEFT JOIN iot_thing_relation_detail relation on relation.to_id = baseinfo.thing_id
LEFT JOIN iot_thing_entity things2 ON relation.from_id = things2.id LEFT JOIN iot_thing_entity things2 ON relation.from_id = things2.id
<where> <where>
relation.root_id = #{relationTypeId}
<if test="ids !=null and ids.length >0"> <if test="ids !=null and ids.length >0">
baseinfo.thing_id in baseinfo.thing_id in
<foreach collection="ids" item="thingId" open="(" close=")" separator="," > <foreach collection="ids" item="thingId" open="(" close=")" separator="," >
#{thingId} #{thingId}
</foreach> </foreach>
</if> </if>
<if test="toId!=null and toId !=''" >
and relation.from_id =#{toId}
</if>
<if test="keyWord!=null and keyWord !=''" > <if test="keyWord!=null and keyWord !=''" >
and (things.name like concat('%',#{keyWord}::varchar,'%') and (things.name like concat('%',#{keyWord}::varchar,'%')
or things.code like concat('%',#{keyWord}::varchar,'%') or things.code like concat('%',#{keyWord}::varchar,'%')
or baseinfo.eq_code like concat('%',#{keyWord}::varchar,'%') or baseinfo.eq_code like concat('%',#{keyWord}::varchar,'%')
or baseinfo.standard like concat('%',#{keyWord}::varchar,'%')) or baseinfo.standard like concat('%',#{keyWord}::varchar,'%'))
</if> </if>
<if test="useDeptId!=null and useDeptId !=''" >
and baseinfo.use_dept_id =#{params.useDeptId}
</if>
<if test="eqTypeName!=null and eqTypeName !=''" >
and things2.name like concat('%',#{eqTypeName}::varchar,'%')
</if>
</where> </where>
order by things.create_date desc order by things.create_date desc
</select> </select>

Loading…
Cancel
Save