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
d22d266a
Commit
d22d266a
authored
Aug 03, 2023
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
count返回数据类型问题
parent
99e094af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
17 deletions
+23
-17
MyBatisDaoSession.java
...com/brilliance/mda/support/mybatis/MyBatisDaoSession.java
+23
-17
No files found.
gjjs-bd-mybatis-support/src/main/java/com/brilliance/mda/support/mybatis/MyBatisDaoSession.java
View file @
d22d266a
...
...
@@ -72,7 +72,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
private
static
final
String
SQLID_SELECTBYID
=
"selectByInr"
;
private
static
final
String
SQLID_SELECTBYPRIMARYKEY
=
"selectByPrimaryKey"
;
private
static
boolean
isMultiDb
=
MybatisDbUtil
.
isMultilDb
();
private
static
boolean
isMultiDb
=
MybatisDbUtil
.
isMultilDb
();
@Autowired
...
...
@@ -107,7 +107,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
@Override
public
<
T
extends
IModule
>
int
dbInsert
(
T
module
)
{
if
(
isMultiDb
)
{
if
(
isMultiDb
)
{
String
moduleDB
=
MdaUtils
.
getModuleDB
(
module
);
DynamicDataSourceContextHolder
.
setDataSourceType
(
moduleDB
);
}
...
...
@@ -117,7 +117,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
@Override
public
<
T
extends
IModule
>
int
dbUpdate
(
T
module
)
{
if
(
isMultiDb
)
{
if
(
isMultiDb
)
{
String
moduleDB
=
MdaUtils
.
getModuleDB
(
module
);
DynamicDataSourceContextHolder
.
setDataSourceType
(
moduleDB
);
}
...
...
@@ -127,7 +127,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
@Override
public
<
T
extends
IModule
>
int
dbDelete
(
T
module
)
{
if
(
isMultiDb
)
{
if
(
isMultiDb
)
{
String
moduleDB
=
MdaUtils
.
getModuleDB
(
module
);
DynamicDataSourceContextHolder
.
setDataSourceType
(
moduleDB
);
}
...
...
@@ -137,7 +137,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
@Override
public
<
T
extends
IModule
>
int
dbDelete
(
T
m
,
Argument
...
args
)
{
if
(
isMultiDb
)
{
if
(
isMultiDb
)
{
String
moduleDB
=
MdaUtils
.
getModuleDB
(
m
);
DynamicDataSourceContextHolder
.
setDataSourceType
(
moduleDB
);
}
...
...
@@ -147,7 +147,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
}
public
<
T
extends
IModule
>
int
dbDelete
(
T
module
,
Serializable
...
id
)
{
if
(
isMultiDb
)
{
if
(
isMultiDb
)
{
String
moduleDB
=
MdaUtils
.
getModuleDB
(
module
);
DynamicDataSourceContextHolder
.
setDataSourceType
(
moduleDB
);
}
...
...
@@ -167,7 +167,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
@Override
public
<
T
extends
IModule
>
T
dbRead
(
T
module
,
Argument
...
args
)
{
if
(
isMultiDb
)
{
if
(
isMultiDb
)
{
String
moduleDB
=
MdaUtils
.
getModuleDB
(
module
);
DynamicDataSourceContextHolder
.
setDataSourceType
(
moduleDB
);
}
...
...
@@ -182,7 +182,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
@Override
public
<
T
extends
IModule
>
T
dbReadByInr
(
T
module
,
String
inr
)
{
if
(
isMultiDb
)
{
if
(
isMultiDb
)
{
String
moduleDB
=
MdaUtils
.
getModuleDB
(
module
);
DynamicDataSourceContextHolder
.
setDataSourceType
(
moduleDB
);
}
...
...
@@ -214,7 +214,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
@Override
public
<
T
extends
IModule
>
int
dbReadset
(
IModuleList
<
T
>[]
lists
,
CacheOption
cacheOption
,
String
whereSql
,
Object
[]
param
)
{
if
(
isMultiDb
)
{
if
(
isMultiDb
)
{
String
moduleDB
=
MdaUtils
.
getModuleListsDB
(
lists
);
DynamicDataSourceContextHolder
.
setDataSourceType
(
moduleDB
);
}
...
...
@@ -244,7 +244,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
@Override
public
<
T
extends
IModule
>
int
dbReadset
(
IModuleList
<
T
>
list
,
Argument
...
args
)
{
if
(
isMultiDb
)
{
if
(
isMultiDb
)
{
String
moduleDB
=
MdaUtils
.
getModuleListDB
(
list
);
DynamicDataSourceContextHolder
.
setDataSourceType
(
moduleDB
);
}
...
...
@@ -301,10 +301,10 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
@Override
public
<
T
extends
IModule
>
int
dbReadset
(
IModuleList
<
T
>
list
,
String
whereSql
,
Object
[]
objects
)
{
if
(
isMultiDb
)
{
String
moduleDB
=
MdaUtils
.
getModuleListDB
(
list
);
DynamicDataSourceContextHolder
.
setDataSourceType
(
moduleDB
);
}
if
(
isMultiDb
)
{
String
moduleDB
=
MdaUtils
.
getModuleListDB
(
list
);
DynamicDataSourceContextHolder
.
setDataSourceType
(
moduleDB
);
}
list
.
clear
();
MybatisArgumentAdapter
adapter
=
new
MybatisArgumentAdapter
(
SELECT
,
list
.
getDataClass
(),
whereSql
,
objects
);
List
<
T
>
result
=
this
.
dyncRead
(
list
.
getDataClass
(),
adapter
);
...
...
@@ -327,7 +327,7 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
@Override
public
void
dbExecuteSQL
(
String
sql
,
Object
...
objects
)
{
if
(
isMultiDb
)
{
if
(
isMultiDb
)
{
String
tableName
=
MdaUtils
.
getTableNameFromSQL
(
sql
);
String
tableDB
=
MdaUtils
.
getTableDB
(
tableName
);
DynamicDataSourceContextHolder
.
setDataSourceType
(
tableDB
);
...
...
@@ -343,6 +343,12 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
setNoMoreRow
();
return
;
}
for
(
int
i
=
0
;
i
<
result
.
size
();
i
++)
{
Map
<
String
,
Object
>
map1
=
result
.
get
(
i
);
if
(
map1
.
get
(
"COUNT"
)
!=
null
)
{
map1
.
put
(
"COUNT"
,
Integer
.
valueOf
(
map1
.
get
(
"COUNT"
)
+
""
));
}
}
resultLocal
.
set
(
new
ResultSet
(
result
));
}
else
{
int
cnt
=
dbExecuteMapper
.
dyncUpdateForMap
(
map
);
...
...
@@ -420,8 +426,8 @@ public class MyBatisDaoSession extends AbstractDaoSession implements IDaoSession
setNoMoreRow
();
}
return
entity
;
}
catch
(
InvocationTargetException
e
)
{
throw
new
RuntimeException
(
e
.
getMessage
());
}
catch
(
InvocationTargetException
e
)
{
throw
new
RuntimeException
(
e
.
getMessage
());
}
catch
(
InstantiationException
e
)
{
throw
new
RuntimeException
(
e
.
getMessage
());
}
catch
(
IllegalAccessException
e
)
{
...
...
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