Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
govdna
Project
Project
Details
Activity
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
开发共享交流平台
govdna
Commits
d70ac5d3
Commit
d70ac5d3
authored
Aug 29, 2018
by
Fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mybatis-plus 2.0升级到 3.0
parent
17be2716
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
112 additions
and
118 deletions
+112
-118
.classpath
.classpath
+0
-5
pom.xml
pom.xml
+10
-5
MyMetaObjectHandler.java
...in/java/com/govmade/common/utils/MyMetaObjectHandler.java
+1
-1
PageUtils.java
src/main/java/com/govmade/common/utils/PageUtils.java
+18
-18
Query.java
src/main/java/com/govmade/common/utils/Query.java
+3
-3
MybatisPlusConfig.java
src/main/java/com/govmade/config/MybatisPlusConfig.java
+2
-1
BaseEntity.java
...ain/java/com/govmade/modules/basic/entity/BaseEntity.java
+4
-3
AreaDao.java
src/main/java/com/govmade/modules/system/dao/AreaDao.java
+1
-1
DepartDao.java
src/main/java/com/govmade/modules/system/dao/DepartDao.java
+1
-4
DictDao.java
src/main/java/com/govmade/modules/system/dao/DictDao.java
+1
-1
MenuDao.java
src/main/java/com/govmade/modules/system/dao/MenuDao.java
+1
-1
ModuleDao.java
src/main/java/com/govmade/modules/system/dao/ModuleDao.java
+1
-1
RoleDao.java
src/main/java/com/govmade/modules/system/dao/RoleDao.java
+1
-1
UserDao.java
src/main/java/com/govmade/modules/system/dao/UserDao.java
+1
-1
AreaEntity.java
...in/java/com/govmade/modules/system/entity/AreaEntity.java
+2
-2
DepartEntity.java
.../java/com/govmade/modules/system/entity/DepartEntity.java
+1
-1
DictEntity.java
...in/java/com/govmade/modules/system/entity/DictEntity.java
+2
-2
MenuEntity.java
...in/java/com/govmade/modules/system/entity/MenuEntity.java
+2
-2
ModuleEntity.java
.../java/com/govmade/modules/system/entity/ModuleEntity.java
+1
-1
RoleEntity.java
...in/java/com/govmade/modules/system/entity/RoleEntity.java
+1
-1
UserEntity.java
...in/java/com/govmade/modules/system/entity/UserEntity.java
+1
-1
AreaService.java
.../java/com/govmade/modules/system/service/AreaService.java
+1
-1
DepartService.java
...ava/com/govmade/modules/system/service/DepartService.java
+1
-2
DictService.java
.../java/com/govmade/modules/system/service/DictService.java
+1
-3
MenuService.java
.../java/com/govmade/modules/system/service/MenuService.java
+1
-2
ModuleService.java
...ava/com/govmade/modules/system/service/ModuleService.java
+1
-1
RoleService.java
.../java/com/govmade/modules/system/service/RoleService.java
+1
-1
UserService.java
.../java/com/govmade/modules/system/service/UserService.java
+1
-1
AreaServiceImpl.java
.../govmade/modules/system/service/impl/AreaServiceImpl.java
+4
-4
DepartServiceImpl.java
...ovmade/modules/system/service/impl/DepartServiceImpl.java
+6
-7
DictServiceImpl.java
.../govmade/modules/system/service/impl/DictServiceImpl.java
+5
-8
MenuServiceImpl.java
.../govmade/modules/system/service/impl/MenuServiceImpl.java
+4
-5
ModuleServiceImpl.java
...ovmade/modules/system/service/impl/ModuleServiceImpl.java
+7
-7
RoleServiceImpl.java
.../govmade/modules/system/service/impl/RoleServiceImpl.java
+6
-6
UserServiceImpl.java
.../govmade/modules/system/service/impl/UserServiceImpl.java
+16
-12
application.yml
src/main/resources/application.yml
+2
-2
No files found.
.classpath
View file @
d70ac5d3
...
...
@@ -17,11 +17,6 @@
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
excluding=
"**"
kind=
"src"
output=
"target/test-classes"
path=
"src/test/resources"
>
<attributes>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"con"
path=
"org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"
>
<attributes>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
...
...
pom.xml
View file @
d70ac5d3
...
...
@@ -19,8 +19,8 @@
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<java.version>
1.8
</java.version>
<mybatis
plus.spring.boot.version>
1.0.5
</mybatisplus.spring.boot.version
>
<mybatisplus.version>
2.1.9
</mybatisplus.version>
<mybatis
-spring-boot-starter>
1.3.2
</mybatis-spring-boot-starter
>
<mybatisplus.version>
3.0-beta
</mybatisplus.version>
<mysql.version>
5.1.38
</mysql.version>
<druid.version>
1.1.3
</druid.version>
<quartz.version>
2.3.0
</quartz.version>
...
...
@@ -67,15 +67,20 @@
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis
plus-spring-boot-starter
</artifactId>
<version>
${mybatisplus.
spring.boot.
version}
</version>
<artifactId>
mybatis
-plus
</artifactId>
<version>
${mybatisplus.version}
</version>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus
</artifactId>
<artifactId>
mybatis-plus
-boot-starter
</artifactId>
<version>
${mybatisplus.version}
</version>
</dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
${mybatis-spring-boot-starter}
</version>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
...
...
src/main/java/com/govmade/common/utils/MyMetaObjectHandler.java
View file @
d70ac5d3
...
...
@@ -4,7 +4,7 @@ import java.util.Date;
import
org.apache.ibatis.reflection.MetaObject
;
import
com.baomidou.mybatisplus.
mapper
.MetaObjectHandler
;
import
com.baomidou.mybatisplus.
core.handlers
.MetaObjectHandler
;
import
com.govmade.modules.system.entity.UserEntity
;
import
cn.hutool.core.date.DateUtil
;
...
...
src/main/java/com/govmade/common/utils/PageUtils.java
View file @
d70ac5d3
package
com
.
govmade
.
common
.
utils
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
java.io.Serializable
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
/**
* 分页工具类
*
...
...
@@ -15,13 +15,13 @@ import java.util.List;
public
class
PageUtils
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
int
totalCount
;
// 总记录数
private
long
totalCount
;
// 总记录数
private
int
pageSize
;
// 每页记录数
private
long
pageSize
;
// 每页记录数
private
int
totalPage
;
// 总页数
private
long
totalPage
;
// 总页数
private
int
currPage
;
// 当前页数
private
long
currPage
;
// 当前页数
private
List
<?>
list
;
// 列表数据
...
...
@@ -37,54 +37,54 @@ public class PageUtils implements Serializable {
* @param currPage
* 当前页数
*/
public
PageUtils
(
List
<?>
list
,
int
totalCount
,
int
pageSize
,
int
currPage
)
{
public
PageUtils
(
List
<?>
list
,
long
totalCount
,
long
pageSize
,
long
currPage
)
{
this
.
list
=
list
;
this
.
totalCount
=
totalCount
;
this
.
pageSize
=
pageSize
;
this
.
currPage
=
currPage
;
this
.
totalPage
=
(
int
)
Math
.
ceil
((
double
)
totalCount
/
pageSize
);
this
.
totalPage
=
(
long
)
Math
.
ceil
((
double
)
totalCount
/
pageSize
);
}
/**
* 分页
*/
public
PageUtils
(
Page
<?>
page
)
{
public
PageUtils
(
I
Page
<?>
page
)
{
this
.
list
=
page
.
getRecords
();
this
.
totalCount
=
page
.
get
Total
();
this
.
totalCount
=
page
.
get
Pages
();
this
.
pageSize
=
page
.
getSize
();
this
.
currPage
=
page
.
getCurrent
();
this
.
totalPage
=
page
.
getPages
();
}
public
int
getTotalCount
()
{
public
long
getTotalCount
()
{
return
totalCount
;
}
public
void
setTotalCount
(
int
totalCount
)
{
public
void
setTotalCount
(
long
totalCount
)
{
this
.
totalCount
=
totalCount
;
}
public
int
getPageSize
()
{
public
long
getPageSize
()
{
return
pageSize
;
}
public
void
setPageSize
(
int
pageSize
)
{
public
void
setPageSize
(
long
pageSize
)
{
this
.
pageSize
=
pageSize
;
}
public
int
getTotalPage
()
{
public
long
getTotalPage
()
{
return
totalPage
;
}
public
void
setTotalPage
(
int
totalPage
)
{
public
void
setTotalPage
(
long
totalPage
)
{
this
.
totalPage
=
totalPage
;
}
public
int
getCurrPage
()
{
public
long
getCurrPage
()
{
return
currPage
;
}
public
void
setCurrPage
(
int
currPage
)
{
public
void
setCurrPage
(
long
currPage
)
{
this
.
currPage
=
currPage
;
}
...
...
src/main/java/com/govmade/common/utils/Query.java
View file @
d70ac5d3
...
...
@@ -21,7 +21,7 @@ import java.util.Map;
import
org.apache.commons.lang.StringUtils
;
import
com.baomidou.mybatisplus.
plugins
.Page
;
import
com.baomidou.mybatisplus.
extension.plugins.pagination
.Page
;
import
com.govmade.common.xss.SQLFilter
;
/**
...
...
@@ -71,8 +71,8 @@ public class Query<T> extends LinkedHashMap<String, Object> {
//排序
if
(
StringUtils
.
isNotBlank
(
sidx
)
&&
StringUtils
.
isNotBlank
(
order
)){
this
.
page
.
set
OrderByField
(
sidx
);
this
.
page
.
setAsc
(
"ASC"
.
equalsIgnoreCase
(
order
)
);
this
.
page
.
set
Descs
(
sidx
);
this
.
page
.
setAsc
s
(
order
);
}
}
...
...
src/main/java/com/govmade/config/MybatisPlusConfig.java
View file @
d70ac5d3
...
...
@@ -3,7 +3,8 @@ package com.govmade.config;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
com.baomidou.mybatisplus.plugins.PaginationInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
;
/**
* mybatis-plus配置
...
...
src/main/java/com/govmade/modules/basic/entity/BaseEntity.java
View file @
d70ac5d3
...
...
@@ -3,9 +3,10 @@ package com.govmade.modules.basic.entity;
import
java.io.Serializable
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.baomidou.mybatisplus.annotations.TableId
;
import
com.baomidou.mybatisplus.enums.FieldFill
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
public
abstract
class
BaseEntity
<
ID
extends
Serializable
>
implements
Serializable
{
...
...
src/main/java/com/govmade/modules/system/dao/AreaDao.java
View file @
d70ac5d3
...
...
@@ -7,7 +7,7 @@ import java.util.Set;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.
core.
mapper.BaseMapper
;
import
com.govmade.modules.system.entity.AreaEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/dao/DepartDao.java
View file @
d70ac5d3
package
com
.
govmade
.
modules
.
system
.
dao
;
import
java.util.Set
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.
core.
mapper.BaseMapper
;
import
com.govmade.modules.system.entity.DepartEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/dao/DictDao.java
View file @
d70ac5d3
...
...
@@ -7,7 +7,7 @@ import java.util.Set;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.
core.
mapper.BaseMapper
;
import
com.govmade.modules.system.entity.DictEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/dao/MenuDao.java
View file @
d70ac5d3
...
...
@@ -8,7 +8,7 @@ import java.util.Set;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.
core.
mapper.BaseMapper
;
import
com.govmade.modules.system.entity.MenuEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/dao/ModuleDao.java
View file @
d70ac5d3
...
...
@@ -5,7 +5,7 @@ import java.util.Set;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.
core.
mapper.BaseMapper
;
import
com.govmade.modules.system.entity.ModuleEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/dao/RoleDao.java
View file @
d70ac5d3
...
...
@@ -5,7 +5,7 @@ import java.util.Set;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.
core.
mapper.BaseMapper
;
import
com.govmade.modules.system.entity.RoleEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/dao/UserDao.java
View file @
d70ac5d3
...
...
@@ -6,7 +6,7 @@ import java.util.Set;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.
core.
mapper.BaseMapper
;
import
com.govmade.modules.system.entity.UserEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/entity/AreaEntity.java
View file @
d70ac5d3
...
...
@@ -2,8 +2,8 @@ package com.govmade.modules.system.entity;
import
java.util.List
;
import
com.baomidou.mybatisplus.annotation
s
.TableField
;
import
com.baomidou.mybatisplus.annotation
s
.TableName
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.govmade.modules.basic.entity.BaseEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/entity/DepartEntity.java
View file @
d70ac5d3
package
com
.
govmade
.
modules
.
system
.
entity
;
import
com.baomidou.mybatisplus.annotation
s
.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.govmade.modules.basic.entity.BaseEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/entity/DictEntity.java
View file @
d70ac5d3
...
...
@@ -2,8 +2,8 @@ package com.govmade.modules.system.entity;
import
java.util.List
;
import
com.baomidou.mybatisplus.annotation
s
.TableField
;
import
com.baomidou.mybatisplus.annotation
s
.TableName
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.govmade.modules.basic.entity.BaseEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/entity/MenuEntity.java
View file @
d70ac5d3
...
...
@@ -2,8 +2,8 @@ package com.govmade.modules.system.entity;
import
java.util.List
;
import
com.baomidou.mybatisplus.annotation
s
.TableField
;
import
com.baomidou.mybatisplus.annotation
s
.TableName
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.govmade.modules.basic.entity.BaseEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/entity/ModuleEntity.java
View file @
d70ac5d3
package
com
.
govmade
.
modules
.
system
.
entity
;
import
com.baomidou.mybatisplus.annotation
s
.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.govmade.modules.basic.entity.BaseEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/entity/RoleEntity.java
View file @
d70ac5d3
package
com
.
govmade
.
modules
.
system
.
entity
;
import
com.baomidou.mybatisplus.annotation
s
.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.govmade.modules.basic.entity.BaseEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/entity/UserEntity.java
View file @
d70ac5d3
...
...
@@ -2,7 +2,7 @@ package com.govmade.modules.system.entity;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation
s
.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.govmade.modules.basic.entity.BaseEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/service/AreaService.java
View file @
d70ac5d3
...
...
@@ -3,7 +3,7 @@ package com.govmade.modules.system.service;
import
java.util.Map
;
import
java.util.Set
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.baomidou.mybatisplus.
extension.
service.IService
;
import
com.govmade.common.utils.PageTreeUtils
;
import
com.govmade.modules.system.entity.AreaEntity
;
...
...
src/main/java/com/govmade/modules/system/service/DepartService.java
View file @
d70ac5d3
package
com
.
govmade
.
modules
.
system
.
service
;
import
java.util.Map
;
import
java.util.Set
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.baomidou.mybatisplus.
extension.
service.IService
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.modules.system.entity.DepartEntity
;
...
...
src/main/java/com/govmade/modules/system/service/DictService.java
View file @
d70ac5d3
...
...
@@ -4,11 +4,9 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Set
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.baomidou.mybatisplus.
extension.
service.IService
;
import
com.govmade.common.utils.PageTreeUtils
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.modules.system.entity.DictEntity
;
import
com.govmade.modules.system.entity.UserEntity
;
/**
* 系统管理 - 字典设置
...
...
src/main/java/com/govmade/modules/system/service/MenuService.java
View file @
d70ac5d3
...
...
@@ -5,9 +5,8 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Set
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.baomidou.mybatisplus.
extension.
service.IService
;
import
com.govmade.common.utils.PageTreeUtils
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.modules.system.entity.MenuEntity
;
/**
...
...
src/main/java/com/govmade/modules/system/service/ModuleService.java
View file @
d70ac5d3
...
...
@@ -4,7 +4,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Set
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.baomidou.mybatisplus.
extension.
service.IService
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.modules.system.entity.ModuleEntity
;
...
...
src/main/java/com/govmade/modules/system/service/RoleService.java
View file @
d70ac5d3
...
...
@@ -3,7 +3,7 @@ package com.govmade.modules.system.service;
import
java.util.Map
;
import
java.util.Set
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.baomidou.mybatisplus.
extension.
service.IService
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.modules.system.entity.RoleEntity
;
...
...
src/main/java/com/govmade/modules/system/service/UserService.java
View file @
d70ac5d3
...
...
@@ -3,7 +3,7 @@ package com.govmade.modules.system.service;
import
java.util.Map
;
import
java.util.Set
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.baomidou.mybatisplus.
extension.
service.IService
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.modules.system.entity.UserEntity
;
...
...
src/main/java/com/govmade/modules/system/service/impl/AreaServiceImpl.java
View file @
d70ac5d3
...
...
@@ -6,8 +6,8 @@ import java.util.Set;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.
mapper.Entit
yWrapper
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.
core.conditions.query.Quer
yWrapper
;
import
com.baomidou.mybatisplus.
extension.
service.impl.ServiceImpl
;
import
com.google.common.collect.Lists
;
import
com.govmade.common.utils.PageTreeUtils
;
import
com.govmade.modules.system.dao.AreaDao
;
...
...
@@ -37,7 +37,7 @@ public class AreaServiceImpl extends ServiceImpl<AreaDao, AreaEntity> implements
params
.
put
(
"start"
,
start
);
List
<
AreaEntity
>
allList
=
this
.
baseMapper
.
listTree
(
params
);
List
<
AreaEntity
>
list
=
buildAreaTree
(
allList
,
0L
);
int
totalCount
=
super
.
selectCount
(
new
Entit
yWrapper
<
AreaEntity
>().
like
(
StrUtil
.
isNotBlank
(
name
),
"name"
,
name
)
int
totalCount
=
super
.
selectCount
(
new
Quer
yWrapper
<
AreaEntity
>().
like
(
StrUtil
.
isNotBlank
(
name
),
"name"
,
name
)
.
eq
(
"pid"
,
0
).
eq
(
"state"
,
1
));
return
new
PageTreeUtils
(
list
,
totalCount
,
pageSize
,
currPage
);
}
...
...
@@ -69,7 +69,7 @@ public class AreaServiceImpl extends ServiceImpl<AreaDao, AreaEntity> implements
@Override
public
Integer
checkArea
(
String
name
)
{
return
super
.
selectCount
(
new
Entit
yWrapper
<
AreaEntity
>().
eq
(
"name"
,
name
));
return
super
.
selectCount
(
new
Quer
yWrapper
<
AreaEntity
>().
eq
(
"name"
,
name
));
}
}
src/main/java/com/govmade/modules/system/service/impl/DepartServiceImpl.java
View file @
d70ac5d3
package
com
.
govmade
.
modules
.
system
.
service
.
impl
;
import
java.util.Map
;
import
java.util.Set
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.
mapper.Entit
yWrapper
;
import
com.baomidou.mybatisplus.
plugins.
Page
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.
core.conditions.query.Quer
yWrapper
;
import
com.baomidou.mybatisplus.
core.metadata.I
Page
;
import
com.baomidou.mybatisplus.
extension.
service.impl.ServiceImpl
;
import
com.govmade.common.utils.Constant
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.common.utils.Query
;
...
...
@@ -31,8 +30,8 @@ public class DepartServiceImpl extends ServiceImpl<DepartDao,DepartEntity> imple
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
String
name
=
(
String
)
params
.
get
(
"name"
);
Page
<
DepartEntity
>
page
=
this
.
selectPage
(
new
Query
<
DepartEntity
>(
params
).
getPage
(),
new
Entit
yWrapper
<
DepartEntity
>()
I
Page
<
DepartEntity
>
page
=
this
.
selectPage
(
new
Query
<
DepartEntity
>(
params
).
getPage
(),
new
Quer
yWrapper
<
DepartEntity
>()
.
like
(
StrUtil
.
isNotBlank
(
name
),
"name"
,
name
));
return
new
PageUtils
(
page
);
}
...
...
@@ -51,7 +50,7 @@ public class DepartServiceImpl extends ServiceImpl<DepartDao,DepartEntity> imple
@Override
public
Integer
checkDepart
(
String
name
)
{
return
super
.
selectCount
(
new
Entit
yWrapper
<
DepartEntity
>().
eq
(
"name"
,
name
));
return
super
.
selectCount
(
new
Quer
yWrapper
<
DepartEntity
>().
eq
(
"name"
,
name
));
}
}
src/main/java/com/govmade/modules/system/service/impl/DictServiceImpl.java
View file @
d70ac5d3
...
...
@@ -6,13 +6,10 @@ import java.util.Set;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.collect.Lists
;
import
com.govmade.common.utils.PageTreeUtils
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.common.utils.Query
;
import
com.govmade.modules.system.dao.DictDao
;
import
com.govmade.modules.system.entity.DictEntity
;
import
com.govmade.modules.system.service.DictService
;
...
...
@@ -41,7 +38,7 @@ public class DictServiceImpl extends ServiceImpl<DictDao, DictEntity> implements
params
.
put
(
"start"
,
start
);
List
<
DictEntity
>
allList
=
this
.
baseMapper
.
listTree
(
params
);
List
<
DictEntity
>
list
=
buildAreaTree
(
allList
,
0L
);
int
totalCount
=
super
.
selectCount
(
new
Entit
yWrapper
<
DictEntity
>().
like
(
StrUtil
.
isNotBlank
(
name
),
"name"
,
name
)
int
totalCount
=
super
.
selectCount
(
new
Quer
yWrapper
<
DictEntity
>().
like
(
StrUtil
.
isNotBlank
(
name
),
"name"
,
name
)
.
eq
(
"pid"
,
0
).
eq
(
"state"
,
1
));
return
new
PageTreeUtils
(
list
,
totalCount
,
pageSize
,
currPage
);
...
...
@@ -66,7 +63,7 @@ public class DictServiceImpl extends ServiceImpl<DictDao, DictEntity> implements
public
DictEntity
queryOne
(
Map
<
String
,
Object
>
params
)
{
String
value
=
(
String
)
params
.
get
(
"value"
);
return
(
DictEntity
)
this
.
selectOne
(
new
Entit
yWrapper
<
DictEntity
>().
eq
(
StrUtil
.
isNotBlank
(
value
),
"value"
,
value
));
.
selectOne
(
new
Quer
yWrapper
<
DictEntity
>().
eq
(
StrUtil
.
isNotBlank
(
value
),
"value"
,
value
));
}
@Override
...
...
@@ -89,7 +86,7 @@ public class DictServiceImpl extends ServiceImpl<DictDao, DictEntity> implements
@Override
public
Integer
checkDict
(
String
name
)
{
return
super
.
selectCount
(
new
Entit
yWrapper
<
DictEntity
>().
eq
(
"name"
,
name
));
return
super
.
selectCount
(
new
Quer
yWrapper
<
DictEntity
>().
eq
(
"name"
,
name
));
}
@Override
...
...
src/main/java/com/govmade/modules/system/service/impl/MenuServiceImpl.java
View file @
d70ac5d3
...
...
@@ -6,11 +6,10 @@ import java.util.Set;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.
mapper.Entit
yWrapper
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.
core.conditions.query.Quer
yWrapper
;
import
com.baomidou.mybatisplus.
extension.
service.impl.ServiceImpl
;
import
com.google.common.collect.Lists
;
import
com.govmade.common.utils.PageTreeUtils
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.modules.system.dao.MenuDao
;
import
com.govmade.modules.system.entity.MenuEntity
;
import
com.govmade.modules.system.service.MenuService
;
...
...
@@ -39,7 +38,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuDao, MenuEntity> implements
params
.
put
(
"start"
,
start
);
List
<
MenuEntity
>
allList
=
this
.
baseMapper
.
listTree
(
params
);
List
<
MenuEntity
>
list
=
buildAreaTree
(
allList
,
0L
);
int
totalCount
=
super
.
selectCount
(
new
Entit
yWrapper
<
MenuEntity
>().
like
(
StrUtil
.
isNotBlank
(
name
),
"name"
,
name
)
int
totalCount
=
super
.
selectCount
(
new
Quer
yWrapper
<
MenuEntity
>().
like
(
StrUtil
.
isNotBlank
(
name
),
"name"
,
name
)
.
eq
(
"pid"
,
0
).
eq
(
"state"
,
1
));
return
new
PageTreeUtils
(
list
,
totalCount
,
pageSize
,
currPage
);
...
...
@@ -77,7 +76,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuDao, MenuEntity> implements
@Override
public
Integer
checkMenu
(
String
name
)
{
return
super
.
selectCount
(
new
Entit
yWrapper
<
MenuEntity
>().
eq
(
"name"
,
name
));
return
super
.
selectCount
(
new
Quer
yWrapper
<
MenuEntity
>().
eq
(
"name"
,
name
));
}
@Override
...
...
src/main/java/com/govmade/modules/system/service/impl/ModuleServiceImpl.java
View file @
d70ac5d3
...
...
@@ -6,9 +6,9 @@ import java.util.Set;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.
mapper.Entit
yWrapper
;
import
com.baomidou.mybatisplus.
plugins.
Page
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.
core.conditions.query.Quer
yWrapper
;
import
com.baomidou.mybatisplus.
core.metadata.I
Page
;
import
com.baomidou.mybatisplus.
extension.
service.impl.ServiceImpl
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.common.utils.Query
;
import
com.govmade.modules.system.dao.ModuleDao
;
...
...
@@ -32,8 +32,8 @@ public class ModuleServiceImpl extends ServiceImpl<ModuleDao, ModuleEntity> impl
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
String
name
=
(
String
)
params
.
get
(
"name"
);
Page
<
ModuleEntity
>
page
=
this
.
selectPage
(
new
Query
<
ModuleEntity
>(
params
).
getPage
(),
new
Entit
yWrapper
<
ModuleEntity
>()
I
Page
<
ModuleEntity
>
page
=
this
.
selectPage
(
new
Query
<
ModuleEntity
>(
params
).
getPage
(),
new
Quer
yWrapper
<
ModuleEntity
>()
.
like
(
StrUtil
.
isNotBlank
(
name
),
"name"
,
name
));
return
new
PageUtils
(
page
);
}
...
...
@@ -41,7 +41,7 @@ public class ModuleServiceImpl extends ServiceImpl<ModuleDao, ModuleEntity> impl
@Override
public
List
<
ModuleEntity
>
queryModuleList
(){
return
super
.
selectList
(
new
Entit
yWrapper
<
ModuleEntity
>().
eq
(
"state"
,
1
));
return
super
.
selectList
(
new
Quer
yWrapper
<
ModuleEntity
>().
eq
(
"state"
,
1
));
}
@Override
...
...
@@ -56,6 +56,6 @@ public class ModuleServiceImpl extends ServiceImpl<ModuleDao, ModuleEntity> impl
@Override
public
Integer
checkModule
(
String
name
)
{
return
super
.
selectCount
(
new
Entit
yWrapper
<
ModuleEntity
>().
eq
(
"name"
,
name
));
return
super
.
selectCount
(
new
Quer
yWrapper
<
ModuleEntity
>().
eq
(
"name"
,
name
));
}
}
src/main/java/com/govmade/modules/system/service/impl/RoleServiceImpl.java
View file @
d70ac5d3
...
...
@@ -5,9 +5,9 @@ import java.util.Set;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.
mapper.Entit
yWrapper
;
import
com.baomidou.mybatisplus.
plugins.
Page
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.
core.conditions.query.Quer
yWrapper
;
import
com.baomidou.mybatisplus.
core.metadata.I
Page
;
import
com.baomidou.mybatisplus.
extension.
service.impl.ServiceImpl
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.common.utils.Query
;
import
com.govmade.modules.system.dao.RoleDao
;
...
...
@@ -29,8 +29,8 @@ public class RoleServiceImpl extends ServiceImpl<RoleDao, RoleEntity> implements
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
String
name
=
(
String
)
params
.
get
(
"name"
);
Page
<
RoleEntity
>
page
=
this
.
selectPage
(
new
Query
<
RoleEntity
>(
params
).
getPage
(),
new
Entit
yWrapper
<
RoleEntity
>()
I
Page
<
RoleEntity
>
page
=
this
.
selectPage
(
new
Query
<
RoleEntity
>(
params
).
getPage
(),
new
Quer
yWrapper
<
RoleEntity
>()
.
like
(
StrUtil
.
isNotBlank
(
name
),
"name"
,
name
));
return
new
PageUtils
(
page
);
}
...
...
@@ -47,7 +47,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleDao, RoleEntity> implements
@Override
public
Integer
checkRole
(
String
name
)
{
return
super
.
selectCount
(
new
Entit
yWrapper
<
RoleEntity
>().
eq
(
"name"
,
name
));
return
super
.
selectCount
(
new
Quer
yWrapper
<
RoleEntity
>().
eq
(
"name"
,
name
));
}
}
src/main/java/com/govmade/modules/system/service/impl/UserServiceImpl.java
View file @
d70ac5d3
...
...
@@ -4,15 +4,18 @@ import java.util.Map;
import
java.util.Set
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.govmade.common.utils.PageUtils
;
import
com.govmade.common.utils.Query
;
import
com.govmade.modules.system.dao.UserDao
;
import
com.govmade.modules.system.entity.UserEntity
;
import
com.govmade.modules.system.service.UserService
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
/**
...
...
@@ -29,12 +32,12 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
// TODO Auto-generated method stub
String
username
=
(
String
)
params
.
get
(
"username"
);
Long
createBy
=
(
Long
)
params
.
get
(
"createBy"
);
Long
deptId
=
(
Long
)
params
.
get
(
"deptId"
);
Page
<
UserEntity
>
page
=
this
.
selectPage
(
new
Query
<
UserEntity
>(
params
).
getPage
(),
new
EntityWrapper
<
UserEntity
>().
like
(
StrUtil
.
isNotBlank
(
username
),
"username"
,
username
)
.
eq
(
deptId
!=
null
,
"dept_id"
,
deptId
).
eq
(
createBy
!=
null
,
"create_by"
,
createBy
));
IPage
<
UserEntity
>
page
=
this
.
selectPage
(
new
Query
<
UserEntity
>(
params
).
getPage
(),
new
QueryWrapper
<
UserEntity
>().
like
(
StrUtil
.
isNotBlank
(
username
),
"username"
,
username
)
.
eq
(
ObjectUtil
.
isNotNull
(
deptId
),
"dept_id"
,
deptId
));
return
new
PageUtils
(
page
);
}
...
...
@@ -50,7 +53,8 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
@Override
public
void
deleteBatch
(
Set
<
Long
>
ids
)
{
this
.
baseMapper
.
deleteBatch
(
ids
);
super
.
update
(
null
,
new
UpdateWrapper
<
UserEntity
>().
in
(
"id"
,
ids
));
//this.baseMapper.deleteBatch(ids);
}
@Override
...
...
@@ -61,18 +65,18 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
@Override
public
Integer
checkUser
(
String
username
)
{
return
super
.
selectCount
(
new
Entit
yWrapper
<
UserEntity
>().
eq
(
"username"
,
username
));
return
super
.
selectCount
(
new
Quer
yWrapper
<
UserEntity
>().
eq
(
"username"
,
username
));
}
@Override
public
UserEntity
queryOne
(
Map
<
String
,
Object
>
params
)
{
String
username
=
(
String
)
params
.
get
(
"username"
);
return
(
UserEntity
)
this
.
selectOne
(
new
Entit
yWrapper
<
UserEntity
>().
eq
(
StrUtil
.
isNotBlank
(
username
),
"username"
,
username
));
.
selectOne
(
new
Quer
yWrapper
<
UserEntity
>().
eq
(
StrUtil
.
isNotBlank
(
username
),
"username"
,
username
));
}
@Override
public
Integer
userCount
(
Long
id
)
{
return
super
.
selectCount
(
new
EntityWrapper
<
UserEntity
>().
eq
(
"dept_id"
,
id
));
return
super
.
selectCount
(
new
QueryWrapper
<
UserEntity
>().
eq
(
"dept_id"
,
id
));
}
}
src/main/resources/application.yml
View file @
d70ac5d3
...
...
@@ -37,7 +37,7 @@ spring:
#mybatis
mybatis-plus
:
mapper-locations
:
classpath:mapper/**/*.xml
mapper-locations
:
classpath:mapper/**/*
Dao
.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage
:
com.govmade.modules.*.entity
global-config
:
...
...
@@ -59,7 +59,7 @@ mybatis-plus:
#自定义填充策略接口实现
meta-object-handler
:
com.govmade.common.utils.MyMetaObjectHandler
#自定义SQL注入器
sql-injector
:
com.baomidou.mybatisplus.mapper.LogicSqlInjector
sql-injector
:
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
configuration
:
map-underscore-to-camel-case
:
true
cache-enabled
:
false
...
...
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