段飞宇
2 years ago
10 changed files with 124 additions and 137 deletions
@ -1,59 +1,59 @@
|
||||
package com.hnac.hzims.scheduled.config; |
||||
|
||||
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.beans.factory.annotation.Value; |
||||
import org.springframework.context.annotation.Bean; |
||||
import org.springframework.context.annotation.ComponentScan; |
||||
import org.springframework.context.annotation.Configuration; |
||||
|
||||
/** |
||||
* @Author WL |
||||
* @Version v1.0 |
||||
* @Serial 1.0 |
||||
* @Date 2022/1/8 10:23 |
||||
*/ |
||||
@Slf4j |
||||
@Configuration |
||||
//指定任务Handler所在包路径
|
||||
public class XxlJobConfig { |
||||
|
||||
|
||||
@Value("${xxl.job.admin.addresses}") |
||||
private String adminAddresses; |
||||
|
||||
@Value("${xxl.job.executor.appname}") |
||||
private String appName; |
||||
|
||||
@Value("${xxl.job.executor.ip}") |
||||
private String ip; |
||||
|
||||
@Value("${xxl.job.executor.port}") |
||||
private int port; |
||||
|
||||
@Value("${xxl.job.accessToken}") |
||||
private String accessToken; |
||||
|
||||
@Value("${xxl.job.executor.logpath}") |
||||
private String logPath; |
||||
|
||||
@Value("${xxl.job.executor.logretentiondays}") |
||||
private int logRetentionDays; |
||||
|
||||
|
||||
@Bean(initMethod = "start", destroyMethod = "destroy") |
||||
public XxlJobSpringExecutor xxlJobExecutor() { |
||||
log.info("====xxl-job config init===="); |
||||
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); |
||||
xxlJobSpringExecutor.setAdminAddresses(adminAddresses); |
||||
xxlJobSpringExecutor.setAppName(appName); |
||||
xxlJobSpringExecutor.setIp(ip); |
||||
xxlJobSpringExecutor.setPort(port); |
||||
xxlJobSpringExecutor.setAccessToken(accessToken); |
||||
xxlJobSpringExecutor.setLogPath(logPath); |
||||
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays); |
||||
return xxlJobSpringExecutor; |
||||
} |
||||
|
||||
} |
||||
|
||||
// package com.hnac.hzims.scheduled.config;
|
||||
//
|
||||
// import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
|
||||
// import lombok.extern.slf4j.Slf4j;
|
||||
// import org.springframework.beans.factory.annotation.Value;
|
||||
// import org.springframework.context.annotation.Bean;
|
||||
// import org.springframework.context.annotation.ComponentScan;
|
||||
// import org.springframework.context.annotation.Configuration;
|
||||
//
|
||||
// /**
|
||||
// * @Author WL
|
||||
// * @Version v1.0
|
||||
// * @Serial 1.0
|
||||
// * @Date 2022/1/8 10:23
|
||||
// */
|
||||
// @Slf4j
|
||||
// @Configuration
|
||||
// //指定任务Handler所在包路径
|
||||
// public class XxlJobConfig {
|
||||
//
|
||||
//
|
||||
// @Value("${xxl.job.admin.addresses}")
|
||||
// private String adminAddresses;
|
||||
//
|
||||
// @Value("${xxl.job.executor.appname}")
|
||||
// private String appName;
|
||||
//
|
||||
// @Value("${xxl.job.executor.ip}")
|
||||
// private String ip;
|
||||
//
|
||||
// @Value("${xxl.job.executor.port}")
|
||||
// private int port;
|
||||
//
|
||||
// @Value("${xxl.job.accessToken}")
|
||||
// private String accessToken;
|
||||
//
|
||||
// @Value("${xxl.job.executor.logpath}")
|
||||
// private String logPath;
|
||||
//
|
||||
// @Value("${xxl.job.executor.logretentiondays}")
|
||||
// private int logRetentionDays;
|
||||
//
|
||||
//
|
||||
// @Bean(initMethod = "start", destroyMethod = "destroy")
|
||||
// public XxlJobSpringExecutor xxlJobExecutor() {
|
||||
// log.info("====xxl-job config init====");
|
||||
// XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
|
||||
// xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
|
||||
// xxlJobSpringExecutor.setAppName(appName);
|
||||
// xxlJobSpringExecutor.setIp(ip);
|
||||
// xxlJobSpringExecutor.setPort(port);
|
||||
// xxlJobSpringExecutor.setAccessToken(accessToken);
|
||||
// xxlJobSpringExecutor.setLogPath(logPath);
|
||||
// xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
|
||||
// return xxlJobSpringExecutor;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
|
@ -1,10 +0,0 @@
|
||||
<?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.hnac.hzims.scheduled.mapper.operation.HistoryAbnormalAlarmMapper"> |
||||
<select id="getHistoryAbnormalAlarm" resultType="com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity"> |
||||
select * from hzims_history_abnormal_alarm |
||||
where station_id = #{stationId} |
||||
and type = #{type} |
||||
and status = 0 |
||||
</select> |
||||
</mapper> |
@ -1,26 +0,0 @@
|
||||
<?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.hnac.hzims.scheduled.mapper.operation.StationMapper"> |
||||
<select id="selectStationByType" resultType="com.hnac.hzims.operational.station.entity.StationEntity"> |
||||
select * from hzims_station where IS_DELETED = 0 and REF_DEPT IS NOT NULL and `TYPE` IS NOT NULL |
||||
<if test="serveType != null"> |
||||
AND SERVE_TYPE = #{serveType} |
||||
</if> |
||||
<if test="stationType != null"> |
||||
AND `TYPE` = #{stationType} |
||||
</if> |
||||
</select> |
||||
|
||||
|
||||
<select id="selectAll" resultType="com.hnac.hzims.operational.station.entity.StationEntity"> |
||||
select * from hzims_station where IS_DELETED = 0 and REF_DEPT IS NOT NULL AND REF_DOMAIN IS NOT NULL AND `TYPE` IS NOT NULL |
||||
</select> |
||||
|
||||
|
||||
<select id="selectStationByInCode" resultType="com.hnac.hzims.operational.station.entity.StationEntity"> |
||||
SELECT * FROM hzims_station WHERE IS_DELETED = 0 and `CODE` IN |
||||
<foreach collection="list" item="item" index="index" open="(" close=")" separator=","> |
||||
#{item} |
||||
</foreach> |
||||
</select> |
||||
</mapper> |
Loading…
Reference in new issue