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
2c22c213
Commit
2c22c213
authored
Jan 11, 2022
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】公告通知列表 详情
parent
ff3c61c0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
109 additions
and
5 deletions
+109
-5
AnnounceController.java
.../office/modules/manage/controller/AnnounceController.java
+14
-4
AnnounceDao.java
src/main/java/io/office/modules/manage/dao/AnnounceDao.java
+7
-1
AnnounceEntity.java
.../java/io/office/modules/manage/entity/AnnounceEntity.java
+4
-0
AnnounceService.java
...ava/io/office/modules/manage/service/AnnounceService.java
+4
-0
AnnounceServiceImpl.java
...fice/modules/manage/service/impl/AnnounceServiceImpl.java
+17
-0
AnnounceDao.xml
src/main/resources/mapper/manage/AnnounceDao.xml
+63
-0
No files found.
src/main/java/io/office/modules/manage/controller/AnnounceController.java
View file @
2c22c213
...
...
@@ -3,6 +3,9 @@ package io.office.modules.manage.controller;
import
java.util.Arrays
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -36,10 +39,11 @@ public class AnnounceController {
*/
@RequestMapping
(
"/list"
)
// @RequiresPermissions("manage:announce:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
PageUtils
page
=
announceService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
public
R
list
(
@RequestBody
NewsParams
newsParams
){
Page
<
AnnounceEntity
>
page
=
this
.
announceService
.
selectAnnounceList
(
newsParams
,
new
Page
(
newsParams
.
getPage
(),
newsParams
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
...
...
@@ -50,6 +54,12 @@ public class AnnounceController {
// @RequiresPermissions("manage:announce:info")
public
R
info
(
@PathVariable
(
"id"
)
Integer
id
){
AnnounceEntity
announce
=
announceService
.
getById
(
id
);
if
(
announce
.
getAnnouncetype
().
equals
(
"1"
)){
announce
.
setClassName
(
"中心公告"
);
}
if
(
announce
.
getAnnouncetype
().
equals
(
"3"
)){
announce
.
setClassName
(
"地方公告"
);
}
return
R
.
ok
().
put
(
"announce"
,
announce
);
}
...
...
src/main/java/io/office/modules/manage/dao/AnnounceDao.java
View file @
2c22c213
package
io
.
office
.
modules
.
manage
.
dao
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.AnnounceEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* ${comments}
...
...
@@ -13,5 +18,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public
interface
AnnounceDao
extends
BaseMapper
<
AnnounceEntity
>
{
List
<
AnnounceEntity
>
selectAnnounceList
(
@Param
(
"newsParams"
)
NewsParams
newsParams
,
Page
page
);
}
src/main/java/io/office/modules/manage/entity/AnnounceEntity.java
View file @
2c22c213
package
io
.
office
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
...
...
@@ -73,4 +74,7 @@ public class AnnounceEntity implements Serializable {
*/
private
String
auditor
;
@TableField
(
exist
=
false
)
private
String
className
;
}
src/main/java/io/office/modules/manage/service/AnnounceService.java
View file @
2c22c213
package
io
.
office
.
modules
.
manage
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
import
io.office.modules.manage.entity.AnnounceEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
java.util.Map
;
...
...
@@ -16,5 +18,7 @@ import java.util.Map;
public
interface
AnnounceService
extends
IService
<
AnnounceEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
Page
<
AnnounceEntity
>
selectAnnounceList
(
NewsParams
newsParams
,
Page
page
);
}
src/main/java/io/office/modules/manage/service/impl/AnnounceServiceImpl.java
View file @
2c22c213
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -16,6 +22,9 @@ import io.office.modules.manage.service.AnnounceService;
@Service
(
"announceService"
)
public
class
AnnounceServiceImpl
extends
ServiceImpl
<
AnnounceDao
,
AnnounceEntity
>
implements
AnnounceService
{
@Autowired
private
AnnounceDao
announceDao
;
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
AnnounceEntity
>
page
=
this
.
page
(
...
...
@@ -26,4 +35,11 @@ public class AnnounceServiceImpl extends ServiceImpl<AnnounceDao, AnnounceEntity
return
new
PageUtils
(
page
);
}
@Override
public
Page
<
AnnounceEntity
>
selectAnnounceList
(
NewsParams
newsParams
,
Page
page
)
{
List
<
AnnounceEntity
>
announceEntityList
=
this
.
announceDao
.
selectAnnounceList
(
newsParams
,
page
);
page
.
setRecords
(
announceEntityList
);
return
page
;
}
}
\ No newline at end of file
src/main/resources/mapper/manage/AnnounceDao.xml
0 → 100644
View file @
2c22c213
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"io.office.modules.manage.dao.AnnounceDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"io.office.modules.manage.entity.AnnounceEntity"
id=
"announceMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"announcetype"
column=
"announcetype"
/>
<result
property=
"title"
column=
"title"
/>
<result
property=
"content"
column=
"content"
/>
<result
property=
"releasedate"
column=
"releasedate"
/>
<result
property=
"updatedate"
column=
"updatedate"
/>
<result
property=
"levels"
column=
"levels"
/>
<result
property=
"editor"
column=
"editor"
/>
<result
property=
"fileurl"
column=
"fileurl"
/>
<result
property=
"author"
column=
"author"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"showtime"
column=
"showtime"
/>
<result
property=
"auditor"
column=
"auditor"
/>
<result
property=
"className"
column=
"className"
/>
</resultMap>
<select
id=
"selectAnnounceList"
resultMap=
"announceMap"
>
SELECT
b.announcetype className,
a.*
FROM
announce a
LEFT JOIN announcelist b ON a.announcetype = b.id
WHERE
1=1
<choose>
<when
test=
"newsParams.levels !=null and newsParams.levels !=''"
>
AND levels = #{newsParams.levels}
</when>
<otherwise>
AND levels > 0
</otherwise>
</choose>
<if
test=
"newsParams.releaseTimeStart !=null and newsParams.releaseTimeEnd !=null"
>
and a.releasedate BETWEEN #{newsParams.releaseTimeStart} AND #{newsParams.releaseTimeEnd}
</if>
<if
test=
"newsParams.keyword !=null and newsParams.keyword !=''"
>
and a.keyword like concat('%',#{newsParams.keyword},'%')
</if>
<if
test=
"newsParams.title !=null and newsParams.title !=''"
>
and a.title like concat('%',#{newsParams.title},'%')
</if>
<if
test=
"newsParams.status !=null and newsParams.status !=''"
>
and a.status =#{newsParams.status}
</if>
<if
test=
"newsParams.editor !=null and newsParams.editor !=''"
>
and a.editor =#{newsParams.editor}
</if>
<if
test=
"newsParams.type !=null and newsParams.type !=''"
>
and b.announcetype =#{newsParams.type}
</if>
ORDER BY
a.id DESC
</select>
</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