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
75e74d54
Commit
75e74d54
authored
Jun 19, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
常规BUG的修改
parent
1dd16657
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
44 deletions
+49
-44
DaoConst.java
yzg-util-db/src/main/java/com/yanzuoguang/dao/DaoConst.java
+17
-17
TableAnnotation.java
...db/src/main/java/com/yanzuoguang/dao/TableAnnotation.java
+3
-1
TableStruct.java
...b/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
+28
-25
AllBeanRowMapper.java
...c/main/java/com/yanzuoguang/db/impl/AllBeanRowMapper.java
+1
-1
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/dao/DaoConst.java
View file @
75e74d54
...
...
@@ -74,39 +74,39 @@ public class DaoConst {
* 单位地址
*/
public
static
final
int
CODE_UNIT
=
2
;
/**
*
表名代码片段
*
插入SQL语句模板
*/
public
static
final
String
TABLE_CODE
=
"{TABLE}
"
;
public
static
final
String
SQL_INSERT
=
"INSERT INTO {TABLE}({FIELD}) VALUES({VALUES})
"
;
/**
*
字段代码片段
*
更新SQL语句模板
*/
public
static
final
String
FIELD_CODE
=
"{FIELD
}"
;
public
static
final
String
SQL_UPDATE
=
"UPDATE {TABLE} AS a {INNER} SET {FIELD} WHERE 1=1 {WHERE
}"
;
/**
*
值代码片段
*
删除SQL语句模板
*/
public
static
final
String
VALUES_CODE
=
"{VALUES
}"
;
public
static
final
String
SQL_REMOVE
=
"DELETE a FROM {TABLE} AS a {INNER} WHERE 1=1 {WHERE
}"
;
/**
*
WHERE条件代码片段
*
加载SQL语句模板
*/
public
static
final
String
WHERE_CODE
=
"{WHERE}"
;
public
static
final
String
SQL_LOAD
=
"SELECT a.*{FIELD} FROM {TABLE} AS a {INNER} WHERE 1=1 {WHERE}"
;
/**
*
插入SQL语句模板
*
表名代码片段
*/
public
static
final
String
INSERT_MODEL
=
"INSERT INTO {TABLE}({FIELD}) VALUES({VALUES})
"
;
public
static
final
String
CODE_TABLE
=
"{TABLE}
"
;
/**
*
更新SQL语句模板
*
字段代码片段
*/
public
static
final
String
UPDATE_MODEL
=
"UPDATE {TABLE} AS a {INNER} SET {FIELD} WHERE 1=1 {WHERE
}"
;
public
static
final
String
CODE_FIELD
=
"{FIELD
}"
;
/**
*
删除SQL语句模板
*
值代码片段
*/
public
static
final
String
REMOVE_MODEL
=
"DELETE a FROM {TABLE} AS a {INNER} WHERE 1=1 {WHERE
}"
;
public
static
final
String
CODE_VALUES
=
"{VALUES
}"
;
/**
*
加载SQL语句模板
*
WHERE条件代码片段
*/
public
static
final
String
LOAD_MODEL
=
"SELECT a.*{FIELD} FROM {TABLE} AS a {INNER} WHERE 1=1
{WHERE}"
;
public
static
final
String
CODE_WHERE
=
"
{WHERE}"
;
/**
* 更新字段模板
*/
...
...
yzg-util-db/src/main/java/com/yanzuoguang/dao/TableAnnotation.java
View file @
75e74d54
package
com
.
yanzuoguang
.
dao
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
...
...
@@ -18,7 +20,7 @@ public @interface TableAnnotation {
*
* @return
*/
String
value
();
String
value
()
default
StringHelper
.
EMPTY
;
/**
* 字段类型
...
...
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
View file @
75e74d54
This diff is collapsed.
Click to expand it.
yzg-util-db/src/main/java/com/yanzuoguang/db/impl/AllBeanRowMapper.java
View file @
75e74d54
...
...
@@ -84,7 +84,7 @@ public class AllBeanRowMapper<T> implements RowMapper<T> {
}
else
if
(
field
.
getGetMethod
()
!=
null
)
{
annotation
=
field
.
getGetMethod
().
getAnnotation
(
TableAnnotation
.
class
);
}
if
(
annotation
!=
null
)
{
if
(
annotation
!=
null
&&
!
StringHelper
.
isEmpty
(
annotation
.
value
())
)
{
name
=
annotation
.
value
();
}
String
underscoredName
=
underscoreName
(
name
);
...
...
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