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
77301e4e
Commit
77301e4e
authored
Nov 08, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实例化关系
parent
8923370e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
1 deletion
+83
-1
TableStruct.java
...b/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
+1
-1
TestDbPrintSql.java
yzg-util-db/src/test/java/TestDbPrintSql.java
+10
-0
TestTableGroupVo.java
yzg-util-db/src/test/java/TestTableGroupVo.java
+22
-0
TestTableGroupVo1.java
yzg-util-db/src/test/java/TestTableGroupVo1.java
+50
-0
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
View file @
77301e4e
...
...
@@ -801,7 +801,7 @@ public class TableStruct {
// 生成覆盖值
if
(
replaceFields
!=
null
)
{
for
(
TableFieldVo
field
:
replaceFields
)
{
sqlGroupAdd
.
addPara
(
field
.
inputName
,
DaoConst
.
CODE_FIELD
,
String
.
format
(
"a.%s=?"
,
field
.
name
));
sqlGroupAdd
.
addPara
(
field
.
inputName
,
DaoConst
.
CODE_FIELD
,
String
.
format
(
"
,
a.%s=?"
,
field
.
name
));
}
}
// 当没有字段时,直接修改主键
...
...
yzg-util-db/src/test/java/TestDbPrintSql.java
View file @
77301e4e
...
...
@@ -24,6 +24,16 @@ public class TestDbPrintSql {
SqlData
sqlData
=
cache
.
getNameCache
().
get
(
DaoConst
.
GROUP_ADD
);
System
.
out
.
println
(
JsonHelper
.
serialize
(
sqlData
,
true
));
}
@Test
public
void
testTableStruct1
()
{
TableSqlCache
cache
=
new
TableSqlCache
();
TableStruct
table
=
new
TableStruct
(
"test"
,
TestTableGroupVo1
.
class
);
table
.
init
(
cache
);
SqlData
sqlData
=
cache
.
getNameCache
().
get
(
DaoConst
.
GROUP_ADD
);
System
.
out
.
println
(
JsonHelper
.
serialize
(
sqlData
,
true
));
}
@Test
public
void
testTable
()
{
...
...
yzg-util-db/src/test/java/TestTableGroupVo.java
View file @
77301e4e
...
...
@@ -13,10 +13,16 @@ public class TestTableGroupVo {
@TableAnnotation
(
value
=
"total"
,
type
=
DaoConst
.
FIELD_REPLACE_GROUP
)
private
int
total
;
@TableAnnotation
(
value
=
"total1"
,
type
=
DaoConst
.
FIELD_REPLACE_GROUP
)
private
int
total1
;
@TableAnnotation
(
value
=
"has"
,
type
=
DaoConst
.
FIELD_ADD_GROUP
)
private
int
has
;
@TableAnnotation
(
value
=
"has1"
,
type
=
DaoConst
.
FIELD_ADD_GROUP
)
private
int
has1
;
public
String
getId
()
{
return
id
;
}
...
...
@@ -41,6 +47,14 @@ public class TestTableGroupVo {
this
.
total
=
total
;
}
public
int
getTotal1
()
{
return
total1
;
}
public
void
setTotal1
(
int
total1
)
{
this
.
total1
=
total1
;
}
public
int
getHas
()
{
return
has
;
}
...
...
@@ -48,4 +62,12 @@ public class TestTableGroupVo {
public
void
setHas
(
int
has
)
{
this
.
has
=
has
;
}
public
int
getHas1
()
{
return
has1
;
}
public
void
setHas1
(
int
has1
)
{
this
.
has1
=
has1
;
}
}
yzg-util-db/src/test/java/TestTableGroupVo1.java
0 → 100644
View file @
77301e4e
import
com.yanzuoguang.dao.DaoConst
;
import
com.yanzuoguang.dao.TableAnnotation
;
@TableAnnotation
(
"db_time"
)
public
class
TestTableGroupVo1
{
@TableAnnotation
(
"id"
)
private
String
id
;
@TableAnnotation
(
"createDate"
)
private
String
createDate
;
@TableAnnotation
(
value
=
"total"
,
type
=
DaoConst
.
FIELD_REPLACE_GROUP
)
private
int
total
;
@TableAnnotation
(
value
=
"total1"
,
type
=
DaoConst
.
FIELD_REPLACE_GROUP
)
private
int
total1
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getCreateDate
()
{
return
createDate
;
}
public
void
setCreateDate
(
String
createDate
)
{
this
.
createDate
=
createDate
;
}
public
int
getTotal
()
{
return
total
;
}
public
void
setTotal
(
int
total
)
{
this
.
total
=
total
;
}
public
int
getTotal1
()
{
return
total1
;
}
public
void
setTotal1
(
int
total1
)
{
this
.
total1
=
total1
;
}
}
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