Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
YZG
yzg-util
Commits
ba1ad0f1
Commit
ba1ad0f1
authored
Jul 06, 2023
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表结构修改
parent
7a90bbf6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
20 deletions
+15
-20
BaseDaoSql.java
...db/src/main/java/com/yanzuoguang/dao/impl/BaseDaoSql.java
+15
-20
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/BaseDaoSql.java
View file @
ba1ad0f1
...
...
@@ -37,7 +37,7 @@ public abstract class BaseDaoSql {
/**
* 定义列表记录缓存对象
*/
protected
MemoryCache
cacheList
=
new
MemoryCache
(
0
);
protected
MemoryCache
<
Object
>
cacheList
=
new
MemoryCache
<>
(
0
);
/**
* 当前Dao的表结构SQL语句信息
...
...
@@ -60,8 +60,8 @@ public abstract class BaseDaoSql {
/**
* 自己构造
*
* @param db
* @param table
* @param db
操作
* @param table
实体表信息
*/
public
BaseDaoSql
(
DbExecute
db
,
TableSqlCache
table
)
{
this
.
db
=
db
;
...
...
@@ -77,7 +77,7 @@ public abstract class BaseDaoSql {
/**
* 获取数据库执行类
*
* @return
* @return
获取数据库执行类
*/
protected
DbExecute
getDb
()
{
return
db
;
...
...
@@ -202,16 +202,15 @@ public abstract class BaseDaoSql {
*/
public
int
updateSql
(
String
sqlName
,
Object
model
)
{
SqlData
sqlData
=
this
.
getSql
(
sqlName
);
int
ret
=
updateSql
(
sqlData
,
model
);
return
ret
;
return
updateSql
(
sqlData
,
model
);
}
/**
* 是否需要复制一个新的
*
* @param sqlData
* @param queryPara
* @param copy
* @param sqlData
原SQL语句
* @param queryPara
查询参数
* @param copy
是否复制
*/
protected
SqlData
getSqlQueryPara
(
SqlData
sqlData
,
QueryPara
queryPara
,
boolean
copy
)
{
SqlData
copyTo
=
sqlData
;
...
...
@@ -247,10 +246,9 @@ public abstract class BaseDaoSql {
* @return 查询的结果
*/
protected
<
T
>
List
<
T
>
queryData
(
Class
<
T
>
cls
,
SqlData
sqlData
,
Object
model
)
{
List
<
Object
>
paras
=
new
ArrayList
<
Object
>();
List
<
Object
>
paras
=
new
ArrayList
<>();
String
sql
=
this
.
getPara
(
paras
,
sqlData
,
model
,
false
);
List
<
T
>
list
=
this
.
queryWithCache
(
cls
,
sqlData
.
getName
(),
sql
,
paras
.
toArray
());
return
list
;
return
this
.
queryWithCache
(
cls
,
sqlData
.
getName
(),
sql
,
paras
.
toArray
());
}
/**
...
...
@@ -355,7 +353,6 @@ public abstract class BaseDaoSql {
* @param handle 需要处理的数据
* @param sqlName SQL语句名称
* @param model 前台参数
* @return 查询的结果
*/
public
<
T
>
void
query
(
Class
<
T
>
cls
,
DbRow
<
T
>
handle
,
String
sqlName
,
Object
model
)
{
this
.
query
(
cls
,
handle
,
sqlName
,
model
,
null
);
...
...
@@ -368,7 +365,6 @@ public abstract class BaseDaoSql {
* @param handle 需要处理的数据
* @param sqlName SQL语句名称
* @param model 前台参数
* @return 查询的结果
*/
public
<
T
>
void
query
(
Class
<
T
>
cls
,
DbRow
<
T
>
handle
,
String
sqlName
,
Object
model
,
QueryPara
queryPara
)
{
SqlData
sqlData
=
this
.
getSql
(
sqlName
);
...
...
@@ -471,7 +467,6 @@ public abstract class BaseDaoSql {
* @param model 前台参数
* @param rowHandle 处理信息
* @param <T> 返回数据类型
* @return 查询的结果
*/
public
<
T
>
void
queryPageData
(
Class
<
T
>
cls
,
PageSizeReq
pageSize
,
String
sqlName
,
Object
model
,
DbRow
<
T
>
rowHandle
,
QueryPara
queryPara
)
{
SqlData
to
=
getSqlData
(
pageSize
,
sqlName
,
queryPara
);
...
...
@@ -765,11 +760,11 @@ public abstract class BaseDaoSql {
/**
* 获取代码片段
*
* @param paras
* @param sql
* @param name
* @param val
* @return
* @param paras
参数数组
* @param sql
Sql语句
* @param name
Sql语句名称
* @param val
替换值
* @return
返回新的Sql语句
*/
protected
String
getSqlCodeParameter
(
List
<
Object
>
paras
,
String
sql
,
String
name
,
SqlCodeParameter
val
)
{
StringBuilder
sb
=
new
StringBuilder
();
...
...
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