Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
25ebaacd
Commit
25ebaacd
authored
Mar 28, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_dl_bugfix' into develop_dl_bugfix
parents
0ec7035d
7474492a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
16 deletions
+18
-16
PluginInterceptor.java
...boot/module/common/api/interceptor/PluginInterceptor.java
+10
-9
DutyPersonShiftMapper.xml
...n-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
+0
-0
OrgUsrMapper.xml
...ule-common-api/src/main/resources/mapper/OrgUsrMapper.xml
+0
-0
PluginInterceptor.java
...oin/equipmanage/common/interceptor/PluginInterceptor.java
+8
-7
FormInstanceMapper.xml
...em-equip/src/main/resources/mapper/FormInstanceMapper.xml
+0
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/interceptor/PluginInterceptor.java
View file @
25ebaacd
...
...
@@ -24,12 +24,13 @@ import java.util.Properties;
@Intercepts
({
@Signature
(
type
=
Executor
.
class
,
method
=
"query"
,
args
=
{
MappedStatement
.
class
,
Object
.
class
,
RowBounds
.
class
,
ResultHandler
.
class
}),
@Signature
(
type
=
Executor
.
class
,
method
=
"query"
,
args
=
{
MappedStatement
.
class
,
Object
.
class
,
RowBounds
.
class
,
ResultHandler
.
class
,
CacheKey
.
class
,
BoundSql
.
class
}),
}
}
)
public
class
PluginInterceptor
implements
Interceptor
{
/**
* 进行拦截的时候要执行的方法
*
* @param invocation
* @return
* @throws Throwable
...
...
@@ -56,25 +57,25 @@ public class PluginInterceptor implements Interceptor {
cacheKey
=
(
CacheKey
)
args
[
4
];
boundSql
=
(
BoundSql
)
args
[
5
];
}
//id为执行的mapper方法的全路径名,如com.metro.dao.UserMapper.insertUser
//id为执行的mapper方法的全路径名,如com.metro.dao.UserMapper.insertUser
String
id
=
mappedStatement
.
getId
();
//获取到原始sql语句
String
sql
=
boundSql
.
getSql
();
if
(
"com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper.selectPersonListCount"
.
equals
(
id
)
||
"com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper.selectPersonList"
.
equals
(
id
))
{
if
(
"com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper.selectPersonListCount"
.
equals
(
id
)
||
"com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper.selectPersonList"
.
equals
(
id
))
{
HashMap
par
=
new
HashMap
();
if
(
parameter
instanceof
HashMap
)
{
par
=
(
HashMap
)((
HashMap
<?,
?>)
parameter
).
get
(
"map"
);
if
(
parameter
instanceof
HashMap
)
{
par
=
(
HashMap
)
((
HashMap
<?,
?>)
parameter
).
get
(
"map"
);
}
LinkedHashMap
<
String
,
String
>
fieldsValue
=
(
LinkedHashMap
<
String
,
String
>)
par
.
get
(
"fieldsValue"
);
LinkedHashMap
<
String
,
String
>
fieldsValue
=
(
LinkedHashMap
<
String
,
String
>)
par
.
get
(
"fieldsValue"
);
Iterator
<
String
>
iterator
=
fieldsValue
.
keySet
().
stream
().
iterator
();
while
(
iterator
.
hasNext
())
{
String
next
=
iterator
.
next
();
sql
=
sql
.
replaceFirst
(
"item"
,
next
).
replaceFirst
(
"ietmValue"
,
new
StringBuffer
().
append
(
"'"
).
append
(
fieldsValue
.
get
(
next
)).
append
(
"'"
).
toString
());
sql
=
sql
.
replaceFirst
(
"item"
,
next
).
replaceFirst
(
"ietmValue"
,
new
StringBuffer
().
append
(
"'"
).
append
(
fieldsValue
.
get
(
next
)).
append
(
"'"
).
toString
());
}
//通过反射修改sql语句
...
...
@@ -82,7 +83,7 @@ public class PluginInterceptor implements Interceptor {
field
.
setAccessible
(
true
);
field
.
set
(
boundSql
,
sql
);
return
executor
.
query
(
mappedStatement
,
parameter
,
rowBounds
,
resultHandler
,
cacheKey
,
boundSql
);
}
else
{
}
else
{
return
invocation
.
proceed
();
}
}
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
View file @
25ebaacd
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
25ebaacd
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/interceptor/PluginInterceptor.java
View file @
25ebaacd
...
...
@@ -22,12 +22,13 @@ import java.util.Properties;
@Intercepts
({
@Signature
(
type
=
Executor
.
class
,
method
=
"query"
,
args
=
{
MappedStatement
.
class
,
Object
.
class
,
RowBounds
.
class
,
ResultHandler
.
class
}),
@Signature
(
type
=
Executor
.
class
,
method
=
"query"
,
args
=
{
MappedStatement
.
class
,
Object
.
class
,
RowBounds
.
class
,
ResultHandler
.
class
,
CacheKey
.
class
,
BoundSql
.
class
}),
}
}
)
public
class
PluginInterceptor
implements
Interceptor
{
/**
* 进行拦截的时候要执行的方法
*
* @param invocation
* @return
* @throws Throwable
...
...
@@ -54,17 +55,17 @@ public class PluginInterceptor implements Interceptor {
cacheKey
=
(
CacheKey
)
args
[
4
];
boundSql
=
(
BoundSql
)
args
[
5
];
}
//id为执行的mapper方法的全路径名,如com.metro.dao.UserMapper.insertUser
//id为执行的mapper方法的全路径名,如com.metro.dao.UserMapper.insertUser
String
id
=
mappedStatement
.
getId
();
//获取到原始sql语句
String
sql
=
boundSql
.
getSql
();
if
(
"com.yeejoin.equipmanage.mapper.FormInstanceMapper.queryForMapList"
.
equals
(
id
))
{
if
(
"com.yeejoin.equipmanage.mapper.FormInstanceMapper.queryForMapList"
.
equals
(
id
))
{
//执行结果
HashMap
<
String
,
String
>
par
=
new
LinkedHashMap
<>();
if
(
parameter
instanceof
HashMap
)
{
par
=
(
HashMap
<
String
,
String
>)((
HashMap
<?,
?>)
parameter
).
get
(
"params"
);
HashMap
<
String
,
String
>
par
=
new
LinkedHashMap
<>();
if
(
parameter
instanceof
HashMap
)
{
par
=
(
HashMap
<
String
,
String
>)
((
HashMap
<?,
?>)
parameter
).
get
(
"params"
);
}
...
...
@@ -72,7 +73,7 @@ public class PluginInterceptor implements Interceptor {
while
(
iterator
.
hasNext
())
{
String
next
=
iterator
.
next
();
sql
=
sql
.
replace
(
"item"
,
next
);
sql
=
sql
.
replace
(
"item"
,
next
);
}
//通过反射修改sql语句
...
...
amos-boot-system-equip/src/main/resources/mapper/FormInstanceMapper.xml
View file @
25ebaacd
This diff is collapsed.
Click to expand it.
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