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
aa1ba98b
Commit
aa1ba98b
authored
Sep 18, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口文档的支持
parent
5508c826
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
InitRemoveDao.java
.../src/main/java/com/yanzuoguang/util/vo/InitRemoveDao.java
+12
-0
BaseDaoImpl.java
...b/src/main/java/com/yanzuoguang/dao/impl/BaseDaoImpl.java
+10
-8
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/vo/InitRemoveDao.java
0 → 100755
View file @
aa1ba98b
package
com
.
yanzuoguang
.
util
.
vo
;
/**
* 初始化Dao数据
* @author 颜佐光
*/
public
interface
InitRemoveDao
{
/**
* 初始化数据,去掉空值
*/
void
initRemove
();
}
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/BaseDaoImpl.java
View file @
aa1ba98b
...
@@ -6,10 +6,7 @@ import com.yanzuoguang.util.base.ObjectHelper;
...
@@ -6,10 +6,7 @@ import com.yanzuoguang.util.base.ObjectHelper;
import
com.yanzuoguang.util.exception.CodeException
;
import
com.yanzuoguang.util.exception.CodeException
;
import
com.yanzuoguang.util.helper.DateHelper
;
import
com.yanzuoguang.util.helper.DateHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.InitDao
;
import
com.yanzuoguang.util.vo.*
;
import
com.yanzuoguang.util.vo.MapRow
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.PageSizeReqVo
;
import
java.lang.reflect.Array
;
import
java.lang.reflect.Array
;
import
java.util.*
;
import
java.util.*
;
...
@@ -321,17 +318,22 @@ public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao {
...
@@ -321,17 +318,22 @@ public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao {
* @param model 需要检测的数据
* @param model 需要检测的数据
*/
*/
protected
void
check
(
int
operatorType
,
String
keyString
,
Object
model
)
{
protected
void
check
(
int
operatorType
,
String
keyString
,
Object
model
)
{
if
(
operatorType
==
DaoConst
.
OPERATOR_TYPE_CREATE
||
operatorType
==
DaoConst
.
OPERATOR_TYPE_UPDATE
)
{
if
(
model
instanceof
InitDao
)
{
if
(
model
instanceof
InitDao
)
{
InitDao
to
=
(
InitDao
)
model
;
InitDao
to
=
(
InitDao
)
model
;
to
.
init
();
to
.
init
();
}
}
if
(
operatorType
==
DaoConst
.
OPERATOR_TYPE_CREATE
||
operatorType
==
DaoConst
.
OPERATOR_TYPE_UPDATE
)
{
List
<
SqlData
>
sqlArray
=
this
.
table
.
getSqlType
(
DaoConst
.
SQL_TYPE_EXISTS
);
List
<
SqlData
>
sqlArray
=
this
.
table
.
getSqlType
(
DaoConst
.
SQL_TYPE_EXISTS
);
if
(
sqlArray
!=
null
)
{
if
(
sqlArray
!=
null
)
{
for
(
SqlData
sql
:
sqlArray
)
{
for
(
SqlData
sql
:
sqlArray
)
{
this
.
checkExist
(
sql
.
getName
(),
model
,
String
.
format
(
"%s已经存在"
,
sql
.
getName
()));
this
.
checkExist
(
sql
.
getName
(),
model
,
String
.
format
(
"%s已经存在"
,
sql
.
getName
()));
}
}
}
}
}
else
if
(
operatorType
==
DaoConst
.
OPERATOR_TYPE_REMOVE
)
{
if
(
model
instanceof
InitRemoveDao
)
{
InitRemoveDao
to
=
(
InitRemoveDao
)
model
;
to
.
initRemove
();
}
}
}
}
}
...
...
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