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
ba352cd6
Commit
ba352cd6
authored
Nov 27, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口文档的支持
parent
7e71f5a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
BaseDao.java
yzg-util-db/src/main/java/com/yanzuoguang/dao/BaseDao.java
+26
-0
BaseDaoImpl.java
...b/src/main/java/com/yanzuoguang/dao/impl/BaseDaoImpl.java
+3
-0
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/dao/BaseDao.java
View file @
ba352cd6
...
...
@@ -4,6 +4,8 @@ package com.yanzuoguang.dao;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.PageSizeReqVo
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.List
;
...
...
@@ -145,6 +147,30 @@ public interface BaseDao {
int
removeArray
(
Object
...
model
);
/***
* 查询数据是否存在,当存在时修改,否则增加
* @param cls 需要创建的实体的类型
* @param requests 前台参数,不能包含主键以及其他不需要修改的字段
* @return 保存成功,返回保存的ID,保存失败,返回空值
*/
<
T
extends
Object
>
List
<
String
>
saveByLoadArray
(
Class
<
T
>
cls
,
Object
...
requests
);
/***
* 查询数据是否存在,当存在时修改,否则增加
* @param cls 需要创建的实体的类型
* @param requests 前台参数,不能包含主键以及其他不需要修改的字段
* @return 保存成功,返回保存的ID,保存失败,返回空值
*/
<
T
extends
Object
>
List
<
String
>
saveByLoadList
(
Class
<
T
>
cls
,
List
<
Object
>
requests
);
/***
* 查询数据是否存在,当存在时修改,否则增加
* @param cls 需要创建的实体的类型
* @param request 前台参数,不能包含主键以及其他不需要修改的字段
* @return 保存成功,返回保存的ID,保存失败,返回空值
*/
<
T
extends
Object
>
String
saveByLoad
(
Class
<
T
>
cls
,
Object
request
);
/**
* 添加统计数据
*
...
...
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/BaseDaoImpl.java
View file @
ba352cd6
...
...
@@ -605,6 +605,7 @@ public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao {
* @param requests 前台参数,不能包含主键以及其他不需要修改的字段
* @return 保存成功,返回保存的ID,保存失败,返回空值
*/
@Override
public
<
T
extends
Object
>
List
<
String
>
saveByLoadArray
(
Class
<
T
>
cls
,
Object
...
requests
)
{
return
this
.
saveByLoadList
(
cls
,
Arrays
.
asList
(
requests
));
}
...
...
@@ -615,6 +616,7 @@ public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao {
* @param requests 前台参数,不能包含主键以及其他不需要修改的字段
* @return 保存成功,返回保存的ID,保存失败,返回空值
*/
@Override
public
<
T
extends
Object
>
List
<
String
>
saveByLoadList
(
Class
<
T
>
cls
,
List
<
Object
>
requests
)
{
List
<
String
>
ret
=
new
ArrayList
<>();
if
(
requests
!=
null
)
{
...
...
@@ -631,6 +633,7 @@ public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao {
* @param request 前台参数,不能包含主键以及其他不需要修改的字段
* @return 保存成功,返回保存的ID,保存失败,返回空值
*/
@Override
public
<
T
extends
Object
>
String
saveByLoad
(
Class
<
T
>
cls
,
Object
request
)
{
String
key
=
this
.
getInputKey
(
request
);
T
from
=
null
;
...
...
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