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
1a3886a3
Commit
1a3886a3
authored
Dec 10, 2021
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改】列表筛选
parent
0e874f33
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
6 deletions
+71
-6
NewsMovieController.java
...office/modules/manage/controller/NewsMovieController.java
+7
-3
NewsMovieDao.java
src/main/java/io/office/modules/manage/dao/NewsMovieDao.java
+7
-1
NewsMovieService.java
...va/io/office/modules/manage/service/NewsMovieService.java
+2
-0
NewsMovieServiceImpl.java
...ice/modules/manage/service/impl/NewsMovieServiceImpl.java
+15
-1
NewsMovieDao.xml
src/main/resources/mapper/manage/NewsMovieDao.xml
+40
-1
No files found.
src/main/java/io/office/modules/manage/controller/NewsMovieController.java
View file @
1a3886a3
...
...
@@ -5,12 +5,15 @@ import java.util.Date;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.annotation.SysLog
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.NewtopicEntity
;
import
io.office.modules.manage.vo.request.NewsMovieEntityVo
;
import
io.office.modules.manage.vo.request.NewtopicEntityVo
;
import
io.office.modules.sys.controller.AbstractController
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
io.swagger.models.auth.In
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -47,9 +50,10 @@ public class NewsMovieController extends AbstractController {
@RequestMapping
(
"/list"
)
// @RequiresPermissions("manage:newsmovie:list")
public
R
list
(
@RequestBody
Map
<
String
,
Object
>
params
){
PageUtils
page
=
newsMovieService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
Page
<
NewsMovieEntity
>
page
=
this
.
newsMovieService
.
selectMoveList
(
params
,
new
Page
(
Integer
.
valueOf
(
params
.
get
(
"page"
).
toString
()),
Integer
.
valueOf
(
params
.
get
(
"limit"
).
toString
())));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"page"
,
pageUtils
);
}
...
...
src/main/java/io/office/modules/manage/dao/NewsMovieDao.java
View file @
1a3886a3
package
io
.
office
.
modules
.
manage
.
dao
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.NewsMovieEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* ${comments}
...
...
@@ -13,5 +18,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public
interface
NewsMovieDao
extends
BaseMapper
<
NewsMovieEntity
>
{
List
<
NewsMovieEntity
>
selectMoveList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
,
Page
page
);
}
src/main/java/io/office/modules/manage/service/NewsMovieService.java
View file @
1a3886a3
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.NewsMovieEntity
;
...
...
@@ -22,5 +23,6 @@ public interface NewsMovieService extends IService<NewsMovieEntity> {
void
insert
(
NewsMovieEntityVo
newsMovieEntityVo
,
SysUserEntity
user
);
Page
<
NewsMovieEntity
>
selectMoveList
(
Map
<
String
,
Object
>
params
,
Page
page
);
}
src/main/java/io/office/modules/manage/service/impl/NewsMovieServiceImpl.java
View file @
1a3886a3
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.vo.request.NewsMovieEntityVo
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -22,11 +25,14 @@ import io.office.modules.manage.service.NewsMovieService;
@Service
(
"newsMovieService"
)
public
class
NewsMovieServiceImpl
extends
ServiceImpl
<
NewsMovieDao
,
NewsMovieEntity
>
implements
NewsMovieService
{
@Autowired
NewsMovieDao
newsMovieDao
;
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
QueryWrapper
<
NewsMovieEntity
>
newsMovieEntityQueryWrapper
=
new
QueryWrapper
<>();
newsMovieEntityQueryWrapper
.
select
(
"
id,title,keyword,author,releasedate,long as longStr,clanguage,lasteditor,showtime,auditor,status
"
);
newsMovieEntityQueryWrapper
.
select
(
""
);
if
(
params
.
containsKey
(
"levels"
))
{
newsMovieEntityQueryWrapper
.
eq
(
"levels"
,
params
.
get
(
"levels"
));
}
else
{
...
...
@@ -59,5 +65,12 @@ public class NewsMovieServiceImpl extends ServiceImpl<NewsMovieDao, NewsMovieEnt
baseMapper
.
insert
(
newsMovieEntity
);
}
@Override
public
Page
<
NewsMovieEntity
>
selectMoveList
(
Map
<
String
,
Object
>
params
,
Page
page
)
{
List
<
NewsMovieEntity
>
list
=
this
.
newsMovieDao
.
selectMoveList
(
params
,
page
);
page
.
setRecords
(
list
);
return
page
;
}
}
\ No newline at end of file
src/main/resources/mapper/manage/NewsMovieDao.xml
View file @
1a3886a3
...
...
@@ -32,5 +32,43 @@
<result
property=
"lasteditor"
column=
"lasteditor"
/>
</resultMap>
<select
id=
"selectMoveList"
resultMap=
"newsMovieMap"
>
SELECT
id,
title,
keyword,
author,
releasedate,
long AS longStr,
clanguage,
lasteditor,
showtime,
auditor,
status,
editor
from news_movie
where 1=1
<if
test=
"params.title !=null and params.title !=''"
>
and title like concat('%',#{params.title},'%')
</if>
<if
test=
"params.author !=null and params.author !=''"
>
and author like concat('%',#{params.author},'%')
</if>
<if
test=
"params.editor !=null and params.editor !=''"
>
and editor like concat('%',#{params.editor},'%')
</if>
<if
test=
"params.keyword !=null and params.keyword !=''"
>
and keyword like concat('%',#{params.keyword},'%')
</if>
<if
test=
"params.status !=null and params.status !=''"
>
and status = #{params.status}
</if>
<if
test=
"params.clanguage !=null and params.clanguage !=''"
>
and clanguage =#{params.clanguage}
</if>
<if
test=
"params.levels !=null and params.levels !=''"
>
and levels = #{params.levels}
</if>
ORDER BY releasedate 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