Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sentinel
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
曲欣亮
sentinel
Commits
3a5eb65b
Commit
3a5eb65b
authored
Jan 08, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
9706d9f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
FilmGroupService.java
...ain/java/com/egolm/film/api/service/FilmGroupService.java
+4
-0
FilmGroupServiceImpl.java
...com/egolm/film/api/service/impl/FilmGroupServiceImpl.java
+12
-0
FilmGroupController.java
...ava/com/egolm/film/api/web/admin/FilmGroupController.java
+13
-0
No files found.
src/main/java/com/egolm/film/api/service/FilmGroupService.java
View file @
3a5eb65b
...
...
@@ -3,6 +3,8 @@ package com.egolm.film.api.service;
import
java.util.List
;
import
java.util.Map
;
import
com.egolm.common.jdbc.Page
;
public
interface
FilmGroupService
{
List
<
Map
<
String
,
Object
>>
queryFilmGroupList
();
...
...
@@ -13,4 +15,6 @@ public interface FilmGroupService {
void
removeFilmGroupById
(
Integer
id
);
List
<
Map
<
String
,
Object
>>
queryFilmList
(
Integer
enroll_type_id
,
String
film_country
,
Page
page
);
}
src/main/java/com/egolm/film/api/service/impl/FilmGroupServiceImpl.java
View file @
3a5eb65b
...
...
@@ -7,7 +7,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.film.api.service.FilmGroupService
;
@Service
...
...
@@ -37,5 +39,15 @@ public class FilmGroupServiceImpl implements FilmGroupService {
jdbcTemplate
.
executeUpdate
(
"delete from fc_film_group where id = ?"
,
id
);
jdbcTemplate
.
executeUpdate
(
"update fc_member_film set group_id = ? where group_id = ?"
,
null
,
id
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
queryFilmList
(
Integer
enroll_type_id
,
String
film_country
,
Page
page
)
{
//TODO
String
table
=
"fc_member_film"
;
if
(
enroll_type_id
!=
null
)
{
table
=
"(select mf.* from fc_member_film mf, fc_member_film_enroll mfe where mf.id = mfe.film_id and mfe.enroll_type_id = "
+
enroll_type_id
+
")"
;
}
String
sql
=
"select t.* from "
+
table
+
" t"
+
(
StringUtil
.
isNotBlank
(
film_country
)
?
(
"t.film_country = '"
+
film_country
+
"'"
)
:
""
);
return
jdbcTemplate
.
limit
(
sql
,
page
);
}
}
src/main/java/com/egolm/film/api/web/admin/FilmGroupController.java
View file @
3a5eb65b
...
...
@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.film.api.service.FilmGroupService
;
import
com.egolm.film.bean.Fc_film_group
;
...
...
@@ -28,6 +29,18 @@ public class FilmGroupController {
@Autowired
JdbcTemplate
jdbcTemplate
;
@ResponseBody
@PostMapping
(
"getFilmList"
)
@ApiOperation
(
"查询未分类影片列表"
)
public
Object
getFilmList
(
Integer
enroll_type_id
,
String
film_country
,
String
[]
orderBy
,
Long
index
,
Long
limit
)
{
index
=
index
==
null
?
1
:
index
;
limit
=
limit
==
null
?
20
:
limit
;
Page
page
=
new
Page
(
index
,
limit
);
page
.
setLimitKey
(
orderBy
);
List
<
Map
<
String
,
Object
>>
list
=
filmGroupService
.
queryFilmList
(
enroll_type_id
,
film_country
,
page
);
return
Rjx
.
jsonOk
().
setData
(
list
);
}
@ResponseBody
@PostMapping
(
"saveOrUpdate"
)
@ApiOperation
(
"保存或更新分类"
)
...
...
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