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
eeef8185
Commit
eeef8185
authored
Jul 06, 2023
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表结构修改
parent
ca6b468c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
BaseDaoSql.java
...db/src/main/java/com/yanzuoguang/dao/impl/BaseDaoSql.java
+24
-5
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/BaseDaoSql.java
View file @
eeef8185
...
...
@@ -303,8 +303,7 @@ public abstract class BaseDaoSql {
List
<
Object
>
paras
=
new
ArrayList
<>();
String
sql
=
this
.
getPara
(
paras
,
sqlData
,
model
,
false
);
Object
cell
=
this
.
queryCellWithCache
(
sqlData
.
getName
(),
sql
,
paras
.
toArray
());
return
cell
;
return
this
.
queryCellWithCache
(
sqlData
.
getName
(),
sql
,
paras
.
toArray
());
}
...
...
@@ -418,8 +417,7 @@ public abstract class BaseDaoSql {
pageSize
.
setPageIndex
(
1
);
pageSize
.
setPageSize
(
1
);
List
<
T
>
list
=
this
.
queryPageData
(
cls
,
pageSize
,
sqlName
,
model
,
queryPara
);
T
retVal
=
list
.
size
()
>
0
?
list
.
get
(
0
)
:
null
;
return
retVal
;
return
list
.
size
()
>
0
?
list
.
get
(
0
)
:
null
;
}
/**
...
...
@@ -460,6 +458,27 @@ public abstract class BaseDaoSql {
* @return 查询的结果
*/
public
<
T
extends
Object
>
List
<
T
>
queryPageData
(
Class
<
T
>
cls
,
PageSizeReq
pageSize
,
String
sqlName
,
Object
model
,
QueryPara
queryPara
)
{
SqlData
to
=
getSqlData
(
pageSize
,
sqlName
,
queryPara
);
return
queryData
(
cls
,
to
,
model
);
}
/**
* 查询分页数据,仅仅只是查询分页中的数据,不查询分页信息。如:包含的总数据数量
*
* @param cls 数据结果类型
* @param pageSize 分页参数
* @param sqlName SQL语句名称
* @param model 前台参数
* @param rowHandle 处理信息
* @param <T> 返回数据类型
* @return 查询的结果
*/
public
<
T
extends
Object
>
void
queryPageData
(
Class
<
T
>
cls
,
PageSizeReq
pageSize
,
String
sqlName
,
Object
model
,
DbRow
<
T
>
rowHandle
,
QueryPara
queryPara
)
{
SqlData
to
=
getSqlData
(
pageSize
,
sqlName
,
queryPara
);
queryData
(
cls
,
rowHandle
,
to
,
model
);
}
private
SqlData
getSqlData
(
PageSizeReq
pageSize
,
String
sqlName
,
QueryPara
queryPara
)
{
SqlData
from
=
this
.
getSql
(
sqlName
);
// 对SQL语句进行分页处理
SqlData
to
=
from
.
copy
();
...
...
@@ -468,7 +487,7 @@ public abstract class BaseDaoSql {
to
.
setSql
(
from
.
getSql
());
to
.
addCode
(
"{LIMIT}"
,
" LIMIT "
+
pageSize
.
getPageStart
()
+
","
+
pageSize
.
getPageSize
());
return
queryData
(
cls
,
to
,
model
)
;
return
to
;
}
/**
...
...
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