Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjs-bd-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
s_guodong
gjjs-bd-common
Commits
cdb2d293
Commit
cdb2d293
authored
Dec 08, 2022
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉mybatis模块
parent
3979441c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
4 additions
and
369 deletions
+4
-369
pom.xml
gjjs-bd-business/pom.xml
+4
-5
pom.xml
gjjs-bd-mybatis-support/pom.xml
+0
-54
DBLocker.java
...ain/java/com/brilliance/mda/support/mybatis/DBLocker.java
+0
-42
FileDisplayManager.java
...om/brilliance/mda/support/mybatis/FileDisplayManager.java
+0
-59
MyBatisDaoSession.java
...com/brilliance/mda/support/mybatis/MyBatisDaoSession.java
+0
-0
MybatisArgumentAdapter.java
...rilliance/mda/support/mybatis/MybatisArgumentAdapter.java
+0
-0
Cnt.java
...in/java/com/brilliance/mda/support/mybatis/count/Cnt.java
+0
-8
CounterImplWithOracleTransaction.java
...pport/mybatis/count/CounterImplWithOracleTransaction.java
+0
-28
CounterImplWithSpringTransaction.java
...pport/mybatis/count/CounterImplWithSpringTransaction.java
+0
-52
CounterService.java
.../brilliance/mda/support/mybatis/count/CounterService.java
+0
-5
CounterMapper.java
...iance/mda/support/mybatis/count/mapper/CounterMapper.java
+0
-48
DbExecute.java
...va/com/brilliance/mda/support/mybatis/dync/DbExecute.java
+0
-7
DbExecuteMapper.java
...ance/mda/support/mybatis/dync/mapper/DbExecuteMapper.java
+0
-24
Column.java
...ava/com/brilliance/mda/support/mybatis/entity/Column.java
+0
-10
Table.java
...java/com/brilliance/mda/support/mybatis/entity/Table.java
+0
-10
StartListener.java
...rilliance/mda/support/mybatis/listener/StartListener.java
+0
-16
pom.xml
pom.xml
+0
-1
No files found.
gjjs-bd-business/pom.xml
View file @
cdb2d293
...
@@ -28,11 +28,6 @@
...
@@ -28,11 +28,6 @@
<version>
0.0.1
</version>
<version>
0.0.1
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.brilliance
</groupId>
<artifactId>
gjjs-bd-mybatis-support
</artifactId>
<version>
0.0.1
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
</dependency>
...
@@ -107,6 +102,10 @@
...
@@ -107,6 +102,10 @@
<artifactId>
commons-lang3
</artifactId>
<artifactId>
commons-lang3
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
</dependency>
<dependency>
<groupId>
com.google.guava
</groupId>
<groupId>
com.google.guava
</groupId>
<artifactId>
guava
</artifactId>
<artifactId>
guava
</artifactId>
</dependency>
</dependency>
...
...
gjjs-bd-mybatis-support/pom.xml
deleted
100644 → 0
View file @
3979441c
<?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"
>
<parent>
<artifactId>
gjjs-bd-common
</artifactId>
<groupId>
com.brilliance
</groupId>
<version>
0.0.1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
gjjs-bd-mybatis-support
</artifactId>
<properties>
<maven.compiler.source>
8
</maven.compiler.source>
<maven.compiler.target>
8
</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid-spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
</dependency>
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
</dependency>
<dependency>
<groupId>
com.brilliance
</groupId>
<artifactId>
gjjs-bd-runtime
</artifactId>
<version>
0.0.1
</version>
</dependency>
<dependency>
<groupId>
com.brilliance
</groupId>
<artifactId>
gjjs-mda
</artifactId>
<version>
0.0.1
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/DBLocker.java
deleted
100644 → 0
View file @
3979441c
package
com
.
brilliance
.
mda
.
support
.
mybatis
;
import
com.brilliance.mda.runtime.mda.ILocker
;
import
com.brilliance.mda.runtime.mda.LockInfo
;
import
org.springframework.stereotype.Component
;
import
java.io.Serializable
;
@Component
public
class
DBLocker
implements
ILocker
{
@Override
public
boolean
lock
(
Serializable
key
)
{
return
false
;
}
@Override
public
boolean
lock
(
Serializable
key
,
int
expireflg
)
{
return
false
;
}
@Override
public
boolean
lock
(
Serializable
key
,
long
timeout
)
{
return
false
;
}
@Override
public
LockInfo
lock
(
String
userName
,
Serializable
key
)
{
return
null
;
}
@Override
public
boolean
unlock
(
Serializable
key
)
{
return
false
;
}
@Override
public
boolean
unlock
(
String
lockname
,
Serializable
key
)
{
return
false
;
}
}
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/FileDisplayManager.java
deleted
100644 → 0
View file @
3979441c
package
com
.
brilliance
.
mda
.
support
.
mybatis
;
import
com.brilliance.mda.runtime.mda.IDisplay
;
import
org.apache.commons.io.IOUtils
;
import
org.springframework.stereotype.Component
;
import
java.io.File
;
import
java.io.FileReader
;
import
java.io.FileWriter
;
/**
* 快照保存器
* @author fukai
*
*/
@Component
public
class
FileDisplayManager
implements
IDisplay
{
@Override
public
boolean
saveDisplay
(
String
filePathOrKey
,
String
data
)
{
File
file
=
new
File
(
filePathOrKey
);
File
parentFolder
=
file
.
getParentFile
();
if
(!
parentFolder
.
exists
()
&&
!
parentFolder
.
mkdirs
())
return
false
;
FileWriter
fr
=
null
;
try
{
file
.
createNewFile
();
fr
=
new
FileWriter
(
file
);
IOUtils
.
write
(
data
,
fr
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
return
true
;
}
@SuppressWarnings
(
"deprecation"
)
@Override
public
String
readDisplay
(
String
filePathOrKey
)
{
File
file
=
new
File
(
filePathOrKey
);
if
(!
file
.
exists
())
return
null
;
FileReader
fr
=
null
;
try
{
fr
=
new
FileReader
(
file
);
return
IOUtils
.
toString
(
fr
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
IOUtils
.
closeQuietly
(
fr
);
}
return
null
;
}
}
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/MyBatisDaoSession.java
deleted
100644 → 0
View file @
3979441c
This diff is collapsed.
Click to expand it.
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/MybatisArgumentAdapter.java
deleted
100644 → 0
View file @
3979441c
This diff is collapsed.
Click to expand it.
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/count/Cnt.java
deleted
100644 → 0
View file @
3979441c
package
com
.
brilliance
.
mda
.
support
.
mybatis
.
count
;
public
class
Cnt
{
private
String
nam
;
//配置名称
private
int
val
;
//配置名称
private
int
stp
;
//配置名称
}
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/count/CounterImplWithOracleTransaction.java
deleted
100644 → 0
View file @
3979441c
package
com
.
brilliance
.
mda
.
support
.
mybatis
.
count
;
import
com.brilliance.mda.support.mybatis.count.mapper.CounterMapper
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
javax.annotation.Resource
;
/**
* @author hulei
* dbcounter基于oracle自主事务的实现
*/
//@Service
public
class
CounterImplWithOracleTransaction
implements
CounterService
{
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
().
getName
());
@Resource
public
CounterMapper
counterMapper
;
public
int
dbCounter
(
String
seqname
)
{
String
seq
=
"SEQ_"
+
seqname
.
toUpperCase
();
return
counterMapper
.
seqNextval
(
seq
);
}
}
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/count/CounterImplWithSpringTransaction.java
deleted
100644 → 0
View file @
3979441c
package
com
.
brilliance
.
mda
.
support
.
mybatis
.
count
;
import
com.brilliance.mda.runtime.mda.RuleExecuteException
;
import
com.brilliance.mda.support.mybatis.count.mapper.CounterMapper
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.concurrent.locks.ReentrantLock
;
@Service
public
class
CounterImplWithSpringTransaction
implements
CounterService
{
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
().
getName
());
@Resource
public
CounterMapper
counterMapper
;
public
ReentrantLock
lock
=
new
ReentrantLock
();
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
int
dbCounter
(
String
seqname
)
{
Integer
cnt
=
counterMapper
.
getCountValWithUpdate
(
seqname
);
if
(
cnt
==
null
)
cnt
=
0
;
if
(
cnt
==
0
)
{
lock
.
lock
();
try
{
cnt
=
counterMapper
.
getCountValWithUpdate
(
seqname
);
if
(
cnt
==
null
)
{
cnt
=
0
;
counterMapper
.
insertNewCounter
(
seqname
,
1
);
//插入新数
}
else
counterMapper
.
updateCounter
(
seqname
);
//计算器增加
}
catch
(
Exception
e
)
{
throw
(
new
RuleExecuteException
(
"主键生成异常"
,
e
));
}
finally
{
lock
.
unlock
();
}
}
else
counterMapper
.
updateCounter
(
seqname
);
//计算器增加
return
cnt
;
}
}
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/count/CounterService.java
deleted
100644 → 0
View file @
3979441c
package
com
.
brilliance
.
mda
.
support
.
mybatis
.
count
;
public
interface
CounterService
{
int
dbCounter
(
String
seqname
);
}
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/count/mapper/CounterMapper.java
deleted
100644 → 0
View file @
3979441c
package
com
.
brilliance
.
mda
.
support
.
mybatis
.
count
.
mapper
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Param
;
import
org.mybatis.spring.SqlSessionTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Component
;
@Component
public
class
CounterMapper
{
final
String
FNAME
=
this
.
getClass
().
getName
();
@Autowired
public
SqlSessionTemplate
template
;
public
Integer
getCountValWithUpdate
(
@Param
(
"nam"
)
String
seqName
){
return
template
.
selectOne
(
FNAME
+
".getCountValWithUpdate"
,
seqName
);
}
public
int
insertNewCounter
(
@Param
(
"nam"
)
String
nam
,
@Param
(
"stp"
)
int
stp
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"nam"
,
nam
);
map
.
put
(
"start"
,
1
);
map
.
put
(
"stp"
,
stp
);
return
template
.
insert
(
FNAME
+
".insertNewCounter"
,
map
);
}
public
void
updateCounter
(
@Param
(
"nam"
)
String
seqName
){
template
.
selectOne
(
FNAME
+
".updateCounter"
,
seqName
);
}
public
int
seqNextval
(
String
seqName
)
{
return
template
.
selectOne
(
FNAME
+
".seqNextval"
,
seqName
);
}
public
int
dbCounter
(
String
seqName
){
return
template
.
selectOne
(
FNAME
+
".dbCounter"
,
seqName
);
}
}
\ No newline at end of file
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/dync/DbExecute.java
deleted
100644 → 0
View file @
3979441c
package
com
.
brilliance
.
mda
.
support
.
mybatis
.
dync
;
import
com.brilliance.mda.runtime.mda.impl.AbstractModule
;
public
class
DbExecute
extends
AbstractModule
{
}
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/dync/mapper/DbExecuteMapper.java
deleted
100644 → 0
View file @
3979441c
package
com
.
brilliance
.
mda
.
support
.
mybatis
.
dync
.
mapper
;
import
org.mybatis.spring.SqlSessionTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.Map
;
@Component
public
class
DbExecuteMapper
{
@Autowired
SqlSessionTemplate
sqlSessionTemplate
;
final
String
FNAME
=
this
.
getClass
().
getName
();
public
List
<
Map
<
String
,
Object
>>
dyncReadForMap
(
Map
<
String
,
Object
>
params
){
return
sqlSessionTemplate
.
selectList
(
FNAME
+
".dyncReadForMap"
,
params
);
}
public
int
dyncUpdateForMap
(
Map
<
String
,
Object
>
params
){
return
sqlSessionTemplate
.
update
(
FNAME
+
".dyncUpdateForMap"
,
params
);
}
}
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/entity/Column.java
deleted
100644 → 0
View file @
3979441c
package
com
.
brilliance
.
mda
.
support
.
mybatis
.
entity
;
import
java.lang.annotation.*
;
@Inherited
@Target
(
ElementType
.
FIELD
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
Column
{
public
String
value
();
}
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/entity/Table.java
deleted
100644 → 0
View file @
3979441c
package
com
.
brilliance
.
mda
.
support
.
mybatis
.
entity
;
import
java.lang.annotation.*
;
@Inherited
@Target
(
ElementType
.
TYPE
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
Table
{
public
String
value
();
}
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/listener/StartListener.java
deleted
100644 → 0
View file @
3979441c
package
com
.
brilliance
.
mda
.
support
.
mybatis
.
listener
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.context.event.ContextRefreshedEvent
;
import
org.springframework.stereotype.Component
;
@Component
public
class
StartListener
implements
ApplicationListener
<
ContextRefreshedEvent
>{
@Override
public
void
onApplicationEvent
(
ContextRefreshedEvent
event
)
{
ApplicationContext
context
=
event
.
getApplicationContext
();
}
}
pom.xml
View file @
cdb2d293
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
</parent>
</parent>
<modules>
<modules>
<module>
gjjs-bd-business
</module>
<module>
gjjs-bd-business
</module>
<module>
gjjs-bd-mybatis-support
</module>
</modules>
</modules>
<groupId>
com.brilliance
</groupId>
<groupId>
com.brilliance
</groupId>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment