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
7fb4719f
Commit
7fb4719f
authored
Oct 12, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口文档的支持
parent
26cedd5a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
9 deletions
+20
-9
SqlAnnotation.java
...l-db/src/main/java/com/yanzuoguang/dao/SqlAnnotation.java
+7
-4
SqlFieldAnnotation.java
...src/main/java/com/yanzuoguang/dao/SqlFieldAnnotation.java
+13
-5
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/dao/SqlAnnotation.java
View file @
7fb4719f
package
com
.
yanzuoguang
.
dao
;
package
com
.
yanzuoguang
.
dao
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.RetentionPolicy
;
...
@@ -8,7 +10,6 @@ import java.lang.annotation.Target;
...
@@ -8,7 +10,6 @@ import java.lang.annotation.Target;
/**
/**
* 途比达列明映射
* 途比达列明映射
*/
*/
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
({
ElementType
.
TYPE
})
@Target
({
ElementType
.
TYPE
})
public
@interface
SqlAnnotation
{
public
@interface
SqlAnnotation
{
...
@@ -21,16 +22,18 @@ public @interface SqlAnnotation {
...
@@ -21,16 +22,18 @@ public @interface SqlAnnotation {
String
[]
name
()
default
{};
String
[]
name
()
default
{};
/**
/**
* 关联的基本表结构实体,当关联时,会根据实体类型自动生成SQL语句.
* Sql语句的类型
*
* @return
*/
*/
Class
[]
table
()
default
{}
;
int
sqlType
()
default
DaoConst
.
SQL_TYPE_LOAD
;
/**
/**
* Sql语句列表,当table和sql都为空时,则根据当前注解 @TableAnnotation 生成对应类型的SQL语句
* Sql语句列表,当table和sql都为空时,则根据当前注解 @TableAnnotation 生成对应类型的SQL语句
*
*
* @return
* @return
*/
*/
String
[]
sql
()
default
{}
;
String
sql
()
default
StringHelper
.
EMPTY
;
/**
/**
* 需要移除的前台输入参数
* 需要移除的前台输入参数
...
...
yzg-util-db/src/main/java/com/yanzuoguang/dao/SqlFieldAnnotation.java
View file @
7fb4719f
package
com
.
yanzuoguang
.
dao
;
package
com
.
yanzuoguang
.
dao
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.RetentionPolicy
;
...
@@ -8,24 +10,30 @@ import java.lang.annotation.Target;
...
@@ -8,24 +10,30 @@ import java.lang.annotation.Target;
/**
/**
* 途比达列明映射
* 途比达列明映射
*/
*/
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
({
ElementType
.
FIELD
})
@Target
({
ElementType
.
FIELD
})
public
@interface
SqlFieldAnnotation
{
public
@interface
SqlFieldAnnotation
{
/**
/**
* Sql语句名称,当为空时,则为当前类
* Sql参数名称,默认等于当前字段
*
* @return
*/
String
name
()
default
StringHelper
.
EMPTY
;
/**
* Sql前台输入参数名称,默认等于当前字段
*
*
* @return
* @return
*/
*/
String
[]
name
()
default
{};
String
[]
input
()
default
{};
/**
/**
*
Sql语句列表,当table和sql都为空时,则根据当前注解 @TableAnnotation 生成对应类型的SQL语句
*
是否必须输入,当必须输入时,则该字段关联的sql语句为必须输入的参数
*
*
* @return
* @return
*/
*/
String
[]
sql
()
default
{}
;
boolean
require
()
default
false
;
/**
/**
* 字段代码片段,关联到 {FIELD}
* 字段代码片段,关联到 {FIELD}
...
...
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