Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-process-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 253c9664
authored
Sep 12, 2023
by
zhouhaibao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]sop新增任务初始化
1 parent
cfadad32
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
292 additions
and
27 deletions
platform-process-api/src/main/java/cn/com/glsx/process/modules/entity/JobManager.java
platform-process-api/src/main/java/cn/com/glsx/process/modules/mapper/JobManagerMapper.java
platform-process/pom.xml
platform-process/src/main/java/cn/com/glsx/Application.java
platform-process/src/main/java/cn/com/glsx/process/job/DynamicConfig.java
platform-process/src/main/java/cn/com/glsx/process/job/DynamicTaskAdd.java
platform-process/src/main/java/cn/com/glsx/process/job/ElasticJobListener.java
platform-process/src/main/java/cn/com/glsx/process/modules/controller/TestJobController.java
platform-process/src/main/resources/mapper/JobManagerMapper.xml
platform-process/src/test/resources/generatorConfig.xml
platform-process-api/src/main/java/cn/com/glsx/process/modules/entity/JobManager.java
0 → 100644
View file @
253c966
package
cn
.
com
.
glsx
.
process
.
modules
.
entity
;
import
java.util.Date
;
import
javax.persistence.*
;
@Table
(
name
=
"job_manager"
)
public
class
JobManager
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
@Column
(
name
=
"job_name"
)
private
String
jobName
;
private
String
cron
;
@Column
(
name
=
"class"
)
private
String
className
;
private
String
parameters
;
@Column
(
name
=
"share_total_count"
)
private
Integer
shareTotalCount
;
@Column
(
name
=
"del_flag"
)
private
Integer
delFlag
;
@Column
(
name
=
"create_time"
)
private
Date
createTime
;
@Column
(
name
=
"update_time"
)
private
Date
updateTime
;
/**
* @return id
*/
public
Integer
getId
()
{
return
id
;
}
/**
* @param id
*/
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
/**
* @return job_name
*/
public
String
getJobName
()
{
return
jobName
;
}
/**
* @param jobName
*/
public
void
setJobName
(
String
jobName
)
{
this
.
jobName
=
jobName
==
null
?
null
:
jobName
.
trim
();
}
/**
* @return cron
*/
public
String
getCron
()
{
return
cron
;
}
/**
* @param cron
*/
public
void
setCron
(
String
cron
)
{
this
.
cron
=
cron
==
null
?
null
:
cron
.
trim
();
}
public
String
getClassName
()
{
return
className
;
}
public
void
setClassName
(
String
className
)
{
this
.
className
=
className
;
}
/**
* @return parameters
*/
public
String
getParameters
()
{
return
parameters
;
}
/**
* @param parameters
*/
public
void
setParameters
(
String
parameters
)
{
this
.
parameters
=
parameters
==
null
?
null
:
parameters
.
trim
();
}
/**
* @return share_total_count
*/
public
Integer
getShareTotalCount
()
{
return
shareTotalCount
;
}
/**
* @param shareTotalCount
*/
public
void
setShareTotalCount
(
Integer
shareTotalCount
)
{
this
.
shareTotalCount
=
shareTotalCount
;
}
/**
* @return del_flag
*/
public
Integer
getDelFlag
()
{
return
delFlag
;
}
/**
* @param delFlag
*/
public
void
setDelFlag
(
Integer
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
/**
* @return create_time
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* @param createTime
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* @return update_time
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
/**
* @param updateTime
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
\ No newline at end of file
\ No newline at end of file
platform-process-api/src/main/java/cn/com/glsx/process/modules/mapper/JobManagerMapper.java
0 → 100644
View file @
253c966
package
cn
.
com
.
glsx
.
process
.
modules
.
mapper
;
import
cn.com.glsx.process.modules.entity.JobManager
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
@Mapper
public
interface
JobManagerMapper
extends
CommonBaseMapper
<
JobManager
>
{
JobManager
findByName
(
@Param
(
"jobName"
)
String
jobName
);
}
\ No newline at end of file
\ No newline at end of file
platform-process/pom.xml
View file @
253c966
...
@@ -77,7 +77,6 @@
...
@@ -77,7 +77,6 @@
<version>
2.1.5
</version>
<version>
2.1.5
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
platform-process/src/main/java/cn/com/glsx/Application.java
View file @
253c966
package
cn
.
com
.
glsx
;
package
cn
.
com
.
glsx
;
import
cn.com.glsx.process.job.DynamicTaskAdd
;
import
com.glsx.plat.context.EnableRestAdmin
;
import
com.glsx.plat.context.EnableRestAdmin
;
import
org.apache.dubbo.config.spring.context.annotation.EnableDubbo
;
import
org.apache.dubbo.config.spring.context.annotation.EnableDubbo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
java.util.TimeZone
;
import
java.util.TimeZone
;
...
@@ -21,7 +26,10 @@ import static java.util.TimeZone.getTimeZone;
...
@@ -21,7 +26,10 @@ import static java.util.TimeZone.getTimeZone;
@EnableDiscoveryClient
@EnableDiscoveryClient
@EnableFeignClients
(
basePackages
=
{
"cn.com.glsx.*.api"
})
@EnableFeignClients
(
basePackages
=
{
"cn.com.glsx.*.api"
})
@SpringBootApplication
@SpringBootApplication
public
class
Application
{
public
class
Application
implements
CommandLineRunner
{
@Autowired
private
DynamicTaskAdd
dynamicTaskAdd
;
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
Application
.
class
,
args
);
SpringApplication
.
run
(
Application
.
class
,
args
);
...
@@ -32,4 +40,8 @@ public class Application {
...
@@ -32,4 +40,8 @@ public class Application {
TimeZone
.
setDefault
(
getTimeZone
(
of
(
"Asia/Shanghai"
)));
TimeZone
.
setDefault
(
getTimeZone
(
of
(
"Asia/Shanghai"
)));
}
}
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
dynamicTaskAdd
.
scanAddJob
();
}
}
}
platform-process/src/main/java/cn/com/glsx/process/job/DynamicConfig.java
View file @
253c966
...
@@ -2,13 +2,12 @@ package cn.com.glsx.process.job;
...
@@ -2,13 +2,12 @@ package cn.com.glsx.process.job;
import
com.dangdang.ddframe.job.reg.zookeeper.ZookeeperConfiguration
;
import
com.dangdang.ddframe.job.reg.zookeeper.ZookeeperConfiguration
;
import
com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter
;
import
com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter
;
import
lombok.Data
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@Configuration
@Data
public
class
DynamicConfig
{
public
class
DynamicConfig
{
@Value
(
"${elaticjob.zookeeper.dynamiczk}"
)
@Value
(
"${elaticjob.zookeeper.dynamiczk}"
)
...
@@ -16,21 +15,20 @@ public class DynamicConfig {
...
@@ -16,21 +15,20 @@ public class DynamicConfig {
@Value
(
"${elaticjob.zookeeper.namespace}"
)
@Value
(
"${elaticjob.zookeeper.namespace}"
)
private
String
dynamicnamespace
;
private
String
dynamicnamespace
;
@Bean
@Bean
public
ZookeeperConfiguration
zookeeperConfiguration
()
{
public
ZookeeperConfiguration
zookeeperConfiguration
()
{
return
new
ZookeeperConfiguration
(
dynamiczk
,
dynamicnamespace
);
return
new
ZookeeperConfiguration
(
dynamiczk
,
dynamicnamespace
);
}
}
@Bean
(
initMethod
=
"init"
)
@Bean
(
initMethod
=
"init"
)
public
ZookeeperRegistryCenter
zookeeperRegistryCenter
(
ZookeeperConfiguration
zookeeperConfiguration
){
public
ZookeeperRegistryCenter
zookeeperRegistryCenter
(
ZookeeperConfiguration
zookeeperConfiguration
)
{
return
new
ZookeeperRegistryCenter
(
zookeeperConfiguration
);
return
new
ZookeeperRegistryCenter
(
zookeeperConfiguration
);
}
}
@Bean
@Bean
public
ElasticJobListener
elasticJobListener
(){
public
ElasticJobListener
elasticJobListener
()
{
return
new
ElasticJobListener
(
100
,
100
)
;
return
new
ElasticJobListener
(
100
,
100
);
}
}
}
}
platform-process/src/main/java/cn/com/glsx/process/job/DynamicTaskAdd.java
View file @
253c966
package
cn
.
com
.
glsx
.
process
.
job
;
package
cn
.
com
.
glsx
.
process
.
job
;
import
cn.com.glsx.process.modules.entity.JobManager
;
import
cn.com.glsx.process.modules.mapper.JobManagerMapper
;
import
com.dangdang.ddframe.job.api.simple.SimpleJob
;
import
com.dangdang.ddframe.job.api.simple.SimpleJob
;
import
com.dangdang.ddframe.job.config.JobCoreConfiguration
;
import
com.dangdang.ddframe.job.config.JobCoreConfiguration
;
import
com.dangdang.ddframe.job.config.simple.SimpleJobConfiguration
;
import
com.dangdang.ddframe.job.config.simple.SimpleJobConfiguration
;
...
@@ -10,10 +12,13 @@ import com.dangdang.ddframe.job.lite.internal.schedule.JobScheduleController;
...
@@ -10,10 +12,13 @@ import com.dangdang.ddframe.job.lite.internal.schedule.JobScheduleController;
import
com.dangdang.ddframe.job.lite.spring.api.SpringJobScheduler
;
import
com.dangdang.ddframe.job.lite.spring.api.SpringJobScheduler
;
import
com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter
;
import
com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
@Component
@Component
@Slf4j
@Slf4j
...
@@ -25,13 +30,16 @@ public class DynamicTaskAdd {
...
@@ -25,13 +30,16 @@ public class DynamicTaskAdd {
@Resource
@Resource
private
ElasticJobListener
elasticJobListener
;
private
ElasticJobListener
elasticJobListener
;
@Autowired
private
JobManagerMapper
jobManagerMapper
;
private
static
LiteJobConfiguration
.
Builder
simpleJobConfigBuilder
(
String
jobName
,
private
static
LiteJobConfiguration
.
Builder
simpleJobConfigBuilder
(
String
jobName
,
Class
<?
extends
SimpleJob
>
jobClass
,
Class
<?
extends
SimpleJob
>
jobClass
,
int
shardTotalCount
,
int
shardTotalCount
,
String
cron
,
String
cron
,
String
id
)
{
String
id
)
{
return
LiteJobConfiguration
.
newBuilder
(
new
SimpleJobConfiguration
(
return
LiteJobConfiguration
.
newBuilder
(
new
SimpleJobConfiguration
(
JobCoreConfiguration
.
newBuilder
(
jobName
,
cron
,
shardTotalCount
).
jobParameter
(
id
).
build
(),
jobClass
.
getCanonicalName
()
JobCoreConfiguration
.
newBuilder
(
jobName
,
cron
,
shardTotalCount
).
jobParameter
(
id
).
build
(),
jobClass
.
getCanonicalName
()
));
));
}
}
...
@@ -43,39 +51,84 @@ public class DynamicTaskAdd {
...
@@ -43,39 +51,84 @@ public class DynamicTaskAdd {
* @param instance:定时任务实例
* @param instance:定时任务实例
* @param parameters:参数
* @param parameters:参数
*/
*/
public
void
create
(
String
jobName
,
String
cron
,
int
shardingTotalCount
,
SimpleJob
instance
,
String
parameters
){
public
void
create
(
String
jobName
,
String
cron
,
int
shardingTotalCount
,
SimpleJob
instance
,
String
parameters
)
{
LiteJobConfiguration
jobConfig
=
simpleJobConfigBuilder
(
jobName
,
instance
.
getClass
(),
shardingTotalCount
,
cron
,
parameters
)
LiteJobConfiguration
jobConfig
=
simpleJobConfigBuilder
(
jobName
,
instance
.
getClass
(),
shardingTotalCount
,
cron
,
parameters
)
.
overwrite
(
true
).
build
();
.
overwrite
(
true
).
build
();
new
SpringJobScheduler
(
instance
,
zookeeperRegistryCenter
,
jobConfig
,
elasticJobListener
).
init
();
new
SpringJobScheduler
(
instance
,
zookeeperRegistryCenter
,
jobConfig
,
elasticJobListener
).
init
();
JobManager
jobManager
=
jobManagerMapper
.
findByName
(
jobName
);
if
(
jobManager
==
null
)
{
jobManager
=
new
JobManager
();
jobManager
.
setCron
(
cron
);
jobManager
.
setJobName
(
jobName
);
jobManager
.
setCreateTime
(
new
Date
());
jobManager
.
setParameters
(
parameters
);
jobManager
.
setClassName
(
instance
.
getClass
().
getName
());
jobManager
.
setDelFlag
(
0
);
jobManager
.
setShareTotalCount
(
shardingTotalCount
);
jobManagerMapper
.
insert
(
jobManager
);
}
}
}
/**
/**
* 更新定时任务
* 更新定时任务
*
* @param jobName
* @param jobName
* @param cron
* @param cron
*/
*/
public
void
updateJob
(
String
jobName
,
String
cron
)
{
public
void
updateJob
(
String
jobName
,
String
cron
)
{
log
.
info
(
"更新定时任务:jobName = {}, cron = {}"
,
jobName
,
cron
);
log
.
info
(
"更新定时任务:jobName = {}, cron = {}"
,
jobName
,
cron
);
JobScheduleController
jobScheduleController
=
JobRegistry
.
getInstance
().
getJobScheduleController
(
jobName
);
JobScheduleController
jobScheduleController
=
JobRegistry
.
getInstance
().
getJobScheduleController
(
jobName
);
if
(
jobScheduleController
==
null
)
{
if
(
jobScheduleController
==
null
)
{
log
.
info
(
"未找到该job或者job已经下线{}"
,
jobName
);
log
.
info
(
"未找到该job或者job已经下线{}"
,
jobName
);
}
else
{
}
else
{
jobScheduleController
.
rescheduleJob
(
cron
);
jobScheduleController
.
rescheduleJob
(
cron
);
JobManager
jobManager
=
jobManagerMapper
.
findByName
(
jobName
);
if
(
jobManager
!=
null
)
{
jobManager
.
setCron
(
cron
);
jobManager
.
setUpdateTime
(
new
Date
());
jobManagerMapper
.
updateByPrimaryKeySelective
(
jobManager
);
}
}
}
}
}
/**
/**
* 删除定时任务
* 删除定时任务
*
* @param jobName
* @param jobName
*/
*/
public
void
removeJob
(
String
jobName
){
public
void
removeJob
(
String
jobName
)
{
log
.
info
(
"删除定时任务:jobName = {}"
,
jobName
);
log
.
info
(
"删除定时任务:jobName = {}"
,
jobName
);
JobScheduleController
jobScheduleController
=
JobRegistry
.
getInstance
().
getJobScheduleController
(
jobName
);
JobScheduleController
jobScheduleController
=
JobRegistry
.
getInstance
().
getJobScheduleController
(
jobName
);
if
(
jobScheduleController
==
null
)
{
if
(
jobScheduleController
==
null
)
{
log
.
info
(
"未找到该job或者job已经下线{}"
,
jobName
);
log
.
info
(
"未找到该job或者job已经下线{}"
,
jobName
);
}
else
{
}
else
{
jobScheduleController
.
shutdown
();
jobScheduleController
.
shutdown
();
JobManager
jobManager
=
jobManagerMapper
.
findByName
(
jobName
);
if
(
jobManager
!=
null
)
{
jobManager
.
setDelFlag
(-
1
);
jobManager
.
setUpdateTime
(
new
Date
());
jobManagerMapper
.
updateByPrimaryKeySelective
(
jobManager
);
}
}
}
}
}
/**
* 扫描搜索下线的服务
*/
public
void
scanAddJob
()
{
List
<
JobManager
>
jobManagers
=
jobManagerMapper
.
selectAll
();
if
(
CollectionUtils
.
isNotEmpty
(
jobManagers
))
{
for
(
JobManager
jobManager
:
jobManagers
)
{
String
className
=
jobManager
.
getClassName
();
try
{
Class
<?>
aClass
=
Class
.
forName
(
className
);
create
(
jobManager
.
getJobName
(),
jobManager
.
getCron
(),
jobManager
.
getShareTotalCount
(),
(
SimpleJob
)
aClass
.
newInstance
(),
jobManager
.
getParameters
());
}
catch
(
ClassNotFoundException
|
InstantiationException
|
IllegalAccessException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
}
}
}
platform-process/src/main/java/cn/com/glsx/process/job/ElasticJobListener.java
View file @
253c966
...
@@ -3,7 +3,10 @@ package cn.com.glsx.process.job;
...
@@ -3,7 +3,10 @@ package cn.com.glsx.process.job;
import
com.dangdang.ddframe.job.executor.ShardingContexts
;
import
com.dangdang.ddframe.job.executor.ShardingContexts
;
import
com.dangdang.ddframe.job.lite.api.listener.AbstractDistributeOnceElasticJobListener
;
import
com.dangdang.ddframe.job.lite.api.listener.AbstractDistributeOnceElasticJobListener
;
import
javax.annotation.Resource
;
public
class
ElasticJobListener
extends
AbstractDistributeOnceElasticJobListener
{
public
class
ElasticJobListener
extends
AbstractDistributeOnceElasticJobListener
{
public
ElasticJobListener
(
long
startedTimeoutMilliseconds
,
long
completedTimeoutMilliseconds
)
{
public
ElasticJobListener
(
long
startedTimeoutMilliseconds
,
long
completedTimeoutMilliseconds
)
{
super
(
startedTimeoutMilliseconds
,
completedTimeoutMilliseconds
);
super
(
startedTimeoutMilliseconds
,
completedTimeoutMilliseconds
);
}
}
...
@@ -16,5 +19,6 @@ public class ElasticJobListener extends AbstractDistributeOnceElasticJobListener
...
@@ -16,5 +19,6 @@ public class ElasticJobListener extends AbstractDistributeOnceElasticJobListener
@Override
@Override
public
void
doAfterJobExecutedAtLastCompleted
(
ShardingContexts
shardingContexts
)
{
public
void
doAfterJobExecutedAtLastCompleted
(
ShardingContexts
shardingContexts
)
{
}
}
}
}
platform-process/src/main/java/cn/com/glsx/process/modules/controller/TestJobController.java
View file @
253c966
...
@@ -21,9 +21,9 @@ public class TestJobController {
...
@@ -21,9 +21,9 @@ public class TestJobController {
@GetMapping
(
"/jobtest"
)
@GetMapping
(
"/jobtest"
)
@Operation
(
summary
=
"动态任务添加"
,
description
=
"动态任务添加"
)
@Operation
(
summary
=
"动态任务添加"
,
description
=
"动态任务添加"
)
public
void
addtest
(
@RequestParam
(
"cron"
)
String
cron
)
{
public
void
addtest
(
@RequestParam
(
"cron"
)
String
cron
,
@RequestParam
(
"jobName"
)
String
jobName
)
{
// cron表达式
// cron表达式
dynamicTaskAdd
.
create
(
"job001"
,
cron
,
1
,
new
DynamicJob
(),
"test"
);
dynamicTaskAdd
.
create
(
jobName
,
cron
,
1
,
new
DynamicJob
(),
"test"
);
}
}
...
@@ -37,7 +37,7 @@ public class TestJobController {
...
@@ -37,7 +37,7 @@ public class TestJobController {
@PostMapping
(
"/jobtestdel"
)
@PostMapping
(
"/jobtestdel"
)
@Operation
(
summary
=
"动态任务删除"
,
description
=
"动态任务删除"
)
@Operation
(
summary
=
"动态任务删除"
,
description
=
"动态任务删除"
)
public
void
deltest
(
@RequestParam
(
"jobName"
)
String
jobName
)
{
public
void
deltest
(
@RequestParam
(
"jobName"
)
String
jobName
)
{
dynamicTaskAdd
.
removeJob
(
jobName
);
dynamicTaskAdd
.
removeJob
(
jobName
);
}
}
}
}
platform-process/src/main/resources/mapper/JobManagerMapper.xml
0 → 100644
View file @
253c966
<?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=
"cn.com.glsx.process.modules.mapper.JobManagerMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.process.modules.entity.JobManager"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"job_name"
jdbcType=
"VARCHAR"
property=
"jobName"
/>
<result
column=
"cron"
jdbcType=
"VARCHAR"
property=
"cron"
/>
<result
column=
"class"
jdbcType=
"VARCHAR"
property=
"className"
/>
<result
column=
"parameters"
jdbcType=
"VARCHAR"
property=
"parameters"
/>
<result
column=
"share_total_count"
jdbcType=
"INTEGER"
property=
"shareTotalCount"
/>
<result
column=
"del_flag"
jdbcType=
"INTEGER"
property=
"delFlag"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, job_name, cron, class, parameters, share_total_count, del_flag, create_time,
update_time
</sql>
<select
id=
"findByName"
resultType=
"cn.com.glsx.process.modules.entity.JobManager"
parameterType=
"java.lang.String"
>
select * from job_manager
where job_name=#{jobName} LIMIT 1
</select>
</mapper>
\ No newline at end of file
\ No newline at end of file
platform-process/src/test/resources/generatorConfig.xml
View file @
253c966
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<!--<property name="beginningDelimiter" value="`"/>-->
<!--<property name="beginningDelimiter" value="`"/>-->
<!--<property name="endingDelimiter" value="`"/>-->
<!--<property name="endingDelimiter" value="`"/>-->
</plugin>
</plugin>
<jdbcConnection
driverClass=
"com.mysql.jdbc.Driver"
connectionURL=
"jdbc:mysql://192.168.3.22
7:3306/platform_process?characterEncoding=utf8"
userId=
"dev_admin"
password=
"1f7e1ed2
"
/>
<jdbcConnection
driverClass=
"com.mysql.jdbc.Driver"
connectionURL=
"jdbc:mysql://192.168.3.22
2:3308/platform_process_dev?characterEncoding=utf8"
userId=
"user_zhouhb"
password=
"WoWP7N1u
"
/>
<javaTypeResolver>
<javaTypeResolver>
<property
name=
"forceBigDecimals"
value=
"false"
/>
<property
name=
"forceBigDecimals"
value=
"false"
/>
</javaTypeResolver>
</javaTypeResolver>
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
<!--<table tableName="sop_data_source" domainObjectName="SopDataSource" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<!--<table tableName="sop_data_source" domainObjectName="SopDataSource" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>-->
</table>-->
<table
tableName=
"sop_tpl_node"
domainObjectName=
"SopTplNode"
enableSelectByExample=
"false"
enableCountByExample=
"false"
enableDeleteByExample=
"false"
enableUpdateByExample=
"false"
>
<!--
<table tableName="sop_tpl_node" domainObjectName="SopTplNode" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
<columnOverride column="node_param_def" javaType="java.lang.String" jdbcType="VARCHAR" />
<columnOverride column="node_param_def" javaType="java.lang.String" jdbcType="VARCHAR" />
<columnOverride column="node_content_def" javaType="java.lang.String" jdbcType="VARCHAR" />
<columnOverride column="node_content_def" javaType="java.lang.String" jdbcType="VARCHAR" />
...
@@ -77,6 +77,10 @@
...
@@ -77,6 +77,10 @@
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
<columnOverride column="inst_param" javaType="java.lang.String" jdbcType="VARCHAR" />
<columnOverride column="inst_param" javaType="java.lang.String" jdbcType="VARCHAR" />
<columnOverride column="inst_snapshot" javaType="java.lang.String" jdbcType="VARCHAR" />
<columnOverride column="inst_snapshot" javaType="java.lang.String" jdbcType="VARCHAR" />
</table>
</table>-->
<table
tableName=
"job_manager"
domainObjectName=
"JobManager"
enableSelectByExample=
"false"
enableCountByExample=
"false"
enableDeleteByExample=
"false"
enableUpdateByExample=
"false"
>
<generatedKey
column=
"id"
sqlStatement=
"MySql"
identity=
"true"
/>
</table>
</context>
</context>
</generatorConfiguration>
</generatorConfiguration>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment