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
cbc824d5
Commit
cbc824d5
authored
Jun 15, 2020
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
压缩视频
parent
69b4c718
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
9 deletions
+30
-9
TableStruct.java
...b/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
+30
-9
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
View file @
cbc824d5
...
...
@@ -362,7 +362,14 @@ public class TableStruct {
public
void
init
(
TableSqlCache
table
)
{
table
.
setTable
(
this
);
if
(!
StringHelper
.
isEmpty
(
this
.
name
))
{
table
.
add
(
releaseSqlReplace
(),
releaseSqlCreate
(),
releaseSqlUpdate
(),
releaseSqlRemove
(),
releaseSqlLoad
());
table
.
add
(
releaseSqlReplace
(),
releaseSqlCreate
(),
releaseSqlUpdate
(),
releaseSqlRemove
(),
releaseSqlLoad
(),
releaseSqlQuery
()
);
}
initSaveWith
(
table
);
initAddGroup
(
table
);
...
...
@@ -511,22 +518,36 @@ public class TableStruct {
}
}
/**
* 生成加载的SQL语句
*
* @return 生成的语句
*/
private
SqlData
releaseSqlLoad
()
{
private
SqlData
releaseSqlQuery
(
String
sqlName
,
int
sqlType
)
{
// 生成添加的SQL语句
String
text
=
DaoConst
.
SQL_LOAD
.
replace
(
DaoConst
.
CODE_TABLE
,
this
.
name
);
SqlData
sql
=
new
SqlData
(
DaoConst
.
LOAD
,
text
);
SqlData
sql
=
new
SqlData
(
sqlName
,
text
);
sql
.
addParaConst
(
DaoConst
.
CODE_FIELD_DEFAULT_NAME
,
DaoConst
.
CODE_FIELD
,
DaoConst
.
CODE_FIELD_DEFAULT
);
sql
.
setSqlType
(
DaoConst
.
SQL_TYPE_LOAD
);
sql
.
setSqlType
(
sqlType
);
// 生成加载语句的WHERE条件
addWhereField
(
sql
,
DaoConst
.
CODE_TAG
,
false
);
return
sql
;
}
/**
* 生成加载的SQL语句
*
* @return 生成的语句
*/
private
SqlData
releaseSqlLoad
()
{
return
releaseSqlQuery
(
DaoConst
.
LOAD
,
DaoConst
.
SQL_TYPE_LOAD
);
}
/**
* 生成查询语句
*
* @return
*/
private
SqlData
releaseSqlQuery
()
{
return
releaseSqlQuery
(
DaoConst
.
QUERY
,
DaoConst
.
SQL_TYPE_COMMON
);
}
/**
* 当前当前表所有字段的等于SQL语句
*
...
...
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