Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
Overview
Overview
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
吴迪
gs1-office-web-sit
Commits
34c05225
Commit
34c05225
authored
Nov 13, 2021
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】政策法规列表查询
parent
4201b6ce
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
6 deletions
+86
-6
PolicyController.java
...io/office/modules/manage/controller/PolicyController.java
+8
-4
PolicyDao.java
src/main/java/io/office/modules/manage/dao/PolicyDao.java
+8
-1
PolicyParams.java
...ava/io/office/modules/manage/entity/dto/PolicyParams.java
+27
-0
PolicyService.java
.../java/io/office/modules/manage/service/PolicyService.java
+5
-0
PolicyServiceImpl.java
...office/modules/manage/service/impl/PolicyServiceImpl.java
+15
-0
PolicyDao.xml
src/main/resources/mapper/manage/PolicyDao.xml
+23
-1
No files found.
src/main/java/io/office/modules/manage/controller/PolicyController.java
View file @
34c05225
...
@@ -3,10 +3,13 @@ package io.office.modules.manage.controller;
...
@@ -3,10 +3,13 @@ package io.office.modules.manage.controller;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Map
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.PictureEntity
;
import
io.office.modules.manage.entity.PolicyEntity
;
import
io.office.modules.manage.entity.PolicyEntity
;
import
io.office.modules.manage.entity.dto.PolicyParams
;
import
io.office.modules.manage.service.PolicyService
;
import
io.office.modules.manage.service.PolicyService
;
import
io.office.modules.sys.controller.AbstractController
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -34,10 +37,11 @@ public class PolicyController extends AbstractController {
...
@@ -34,10 +37,11 @@ public class PolicyController extends AbstractController {
*/
*/
@RequestMapping
(
"/list"
)
@RequestMapping
(
"/list"
)
// @RequiresPermissions("generator:policy:list")
// @RequiresPermissions("generator:policy:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
public
R
list
(
@RequestBody
PolicyParams
params
){
PageUtils
page
=
policyService
.
queryPage
(
params
);
Page
<
PictureEntity
>
page
=
this
.
policyService
.
selectPolicyList
(
params
,
new
Page
(
params
.
getPage
(),
params
.
getLimit
()));
return
R
.
ok
().
put
(
"page"
,
page
);
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
}
...
...
src/main/java/io/office/modules/manage/dao/PolicyDao.java
View file @
34c05225
package
io
.
office
.
modules
.
manage
.
dao
;
package
io
.
office
.
modules
.
manage
.
dao
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.PolicyEntity
;
import
io.office.modules.manage.entity.PolicyEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
io.office.modules.manage.entity.dto.PolicyParams
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
/**
* ${comments}
* ${comments}
...
@@ -13,5 +19,6 @@ import org.apache.ibatis.annotations.Mapper;
...
@@ -13,5 +19,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
*/
@Mapper
@Mapper
public
interface
PolicyDao
extends
BaseMapper
<
PolicyEntity
>
{
public
interface
PolicyDao
extends
BaseMapper
<
PolicyEntity
>
{
List
<
NewsEntity
>
selectPolicyList
(
@Param
(
"newsParams"
)
PolicyParams
params
,
Page
page
);
}
}
src/main/java/io/office/modules/manage/entity/dto/PolicyParams.java
0 → 100644
View file @
34c05225
package
io
.
office
.
modules
.
manage
.
entity
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.office.modules.manage.entity.page.PageParams
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @author JavaClimber
* @version 1.0
* @date 2021/11/13 21:21
*/
@Data
public
class
PolicyParams
extends
PageParams
{
private
String
title
;
private
String
editor
;
private
String
keyword
;
private
String
status
;
private
String
class1
;
private
String
level
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTimeStart
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTimeEnd
;
}
\ No newline at end of file
src/main/java/io/office/modules/manage/service/PolicyService.java
View file @
34c05225
package
io
.
office
.
modules
.
manage
.
service
;
package
io
.
office
.
modules
.
manage
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.PictureEntity
;
import
io.office.modules.manage.entity.PolicyEntity
;
import
io.office.modules.manage.entity.PolicyEntity
;
import
io.office.modules.manage.entity.dto.PolicyParams
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -26,5 +29,7 @@ public interface PolicyService extends IService<PolicyEntity> {
...
@@ -26,5 +29,7 @@ public interface PolicyService extends IService<PolicyEntity> {
R
deletePolicy
(
Integer
[]
ids
,
SysUserEntity
user
);
R
deletePolicy
(
Integer
[]
ids
,
SysUserEntity
user
);
R
verifyTopic
(
PolicyEntity
policyEntity
,
SysUserEntity
user
);
R
verifyTopic
(
PolicyEntity
policyEntity
,
SysUserEntity
user
);
Page
<
PictureEntity
>
selectPolicyList
(
PolicyParams
params
,
Page
page
);
}
}
src/main/java/io/office/modules/manage/service/impl/PolicyServiceImpl.java
View file @
34c05225
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.utils.DateUtils
;
import
io.office.common.utils.DateUtils
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.common.utils.Query
;
import
io.office.common.utils.R
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.dao.PolicyDao
;
import
io.office.modules.manage.dao.PolicyDao
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.PictureEntity
;
import
io.office.modules.manage.entity.PolicyEntity
;
import
io.office.modules.manage.entity.PolicyEntity
;
import
io.office.modules.manage.entity.dto.PolicyParams
;
import
io.office.modules.manage.service.PolicyService
;
import
io.office.modules.manage.service.PolicyService
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
@@ -21,6 +26,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...
@@ -21,6 +26,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
(
"policyService"
)
@Service
(
"policyService"
)
public
class
PolicyServiceImpl
extends
ServiceImpl
<
PolicyDao
,
PolicyEntity
>
implements
PolicyService
{
public
class
PolicyServiceImpl
extends
ServiceImpl
<
PolicyDao
,
PolicyEntity
>
implements
PolicyService
{
@Autowired
private
PolicyDao
policyDao
;
@Override
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
PolicyEntity
>
page
=
this
.
page
(
IPage
<
PolicyEntity
>
page
=
this
.
page
(
...
@@ -90,4 +97,11 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyDao, PolicyEntity> impl
...
@@ -90,4 +97,11 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyDao, PolicyEntity> impl
return
R
.
ok
(
"审核成功!"
);
return
R
.
ok
(
"审核成功!"
);
}
}
@Override
public
Page
<
PictureEntity
>
selectPolicyList
(
PolicyParams
params
,
Page
page
)
{
List
<
NewsEntity
>
newsList
=
this
.
policyDao
.
selectPolicyList
(
params
,
page
);
page
.
setRecords
(
newsList
);
return
page
;
}
}
}
\ No newline at end of file
src/main/resources/mapper/manage/PolicyDao.xml
View file @
34c05225
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<!-- 可根据自己的需求,是否要使用 -->
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"io.office.modules.manage.entity.PolicyEntity"
id=
"policyMap"
>
<resultMap
type=
"io.office.modules.manage.entity.PolicyEntity"
id=
"policyMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
<result
property=
"class"
column=
"class"
/>
<result
property=
"class
1
"
column=
"class"
/>
<result
property=
"title"
column=
"title"
/>
<result
property=
"title"
column=
"title"
/>
<result
property=
"titleOld"
column=
"title_old"
/>
<result
property=
"titleOld"
column=
"title_old"
/>
<result
property=
"keyword"
column=
"keyword"
/>
<result
property=
"keyword"
column=
"keyword"
/>
...
@@ -26,6 +26,27 @@
...
@@ -26,6 +26,27 @@
<result
property=
"status"
column=
"status"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"auditor"
column=
"auditor"
/>
<result
property=
"auditor"
column=
"auditor"
/>
</resultMap>
</resultMap>
<select
id=
"selectPolicyList"
resultMap=
"policyMap"
parameterType=
"io.office.modules.manage.entity.dto.PolicyParams"
>
select class,title,editor,lasteditor,releasedate,updatedate,auditor,status from Policy
where 1=1
<if
test=
"newsParams.updateTimeStart !=null and newsParams.updateTimeEnd !=null"
>
and updatedate BETWEEN #{newsParams.updateTimeStart} AND #{newsParams.updateTimeEnd}
</if>
<if
test=
"newsParams.keyword !=null and newsParams.keyword !=''"
>
and keyword like concat('%',#{newsParams.keyword},'%')
</if>
<if
test=
"newsParams.title !=null and newsParams.title !=''"
>
and title like concat('%',#{newsParams.title},'%')
</if>
<if
test=
"newsParams.status !=null"
>
and status =#{newsParams.status}
</if>
<if
test=
"newsParams.editor !=null and newsParams.editor !=''"
>
and editor =#{newsParams.editor}
</if>
ORDER BY
id DESC
</select>
</mapper>
</mapper>
\ No newline at end of file
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