Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
member-api
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
曲欣亮
member-api
Commits
943d6a63
Commit
943d6a63
authored
Jan 14, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
6fbdd0bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
5 deletions
+68
-5
FilmGroupService.java
...ain/java/com/egolm/film/api/service/FilmGroupService.java
+5
-1
FilmGroupServiceImpl.java
...com/egolm/film/api/service/impl/FilmGroupServiceImpl.java
+35
-2
FilmGroupController.java
...ava/com/egolm/film/api/web/admin/FilmGroupController.java
+28
-2
No files found.
src/main/java/com/egolm/film/api/service/FilmGroupService.java
View file @
943d6a63
...
...
@@ -15,6 +15,10 @@ public interface FilmGroupService {
void
removeFilmGroupById
(
Integer
[]
id
);
List
<
Map
<
String
,
Object
>>
queryFilmList
(
Integer
enroll_type_id
,
String
film_country
,
Page
page
);
List
<
Map
<
String
,
Object
>>
queryNoGroupFilmList
(
Integer
enroll_type_id
,
String
film_country
,
Page
page
);
List
<
Map
<
String
,
Object
>>
queryGroupFilmList
(
Integer
[]
group_id
,
String
keyword
,
Integer
enroll_type_id
,
Integer
film_type_name
,
Integer
film_type_name_short
,
Integer
play_shanghai
,
Integer
is_important
,
Integer
review_state
,
Integer
review_round
,
String
film_country
,
Page
page
);
}
src/main/java/com/egolm/film/api/service/impl/FilmGroupServiceImpl.java
View file @
943d6a63
...
...
@@ -11,6 +11,7 @@ import com.egolm.common.StringUtil;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.film.api.service.FilmGroupService
;
import
com.egolm.film.util.SqlWhere
;
@Service
public
class
FilmGroupServiceImpl
implements
FilmGroupService
{
...
...
@@ -49,7 +50,7 @@ public class FilmGroupServiceImpl implements FilmGroupService {
}
@Override
public
List
<
Map
<
String
,
Object
>>
queryFilmList
(
Integer
enroll_type_id
,
String
film_country
,
Page
page
)
{
public
List
<
Map
<
String
,
Object
>>
query
NoGroup
FilmList
(
Integer
enroll_type_id
,
String
film_country
,
Page
page
)
{
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
+
")"
;
...
...
@@ -59,8 +60,40 @@ public class FilmGroupServiceImpl implements FilmGroupService {
+
"t.*, "
+
"(select group_concat(t.playactor_name) from fc_member_film_playactor fp where fp.film_id = t.id and fp.playactor_type = 'director') director_name "
+
"from "
+
""
+
table
+
" t
"
+
(
StringUtil
.
isNotBlank
(
film_country
)
?
(
"
t.film_country = '"
+
film_country
+
"'"
)
:
""
);
+
""
+
table
+
" t
where t.film_group_id is null "
+
(
StringUtil
.
isNotBlank
(
film_country
)
?
(
" and
t.film_country = '"
+
film_country
+
"'"
)
:
""
);
return
jdbcTemplate
.
limit
(
sql
,
page
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
queryGroupFilmList
(
Integer
[]
group_id
,
String
keyword
,
Integer
enroll_type_id
,
Integer
film_type_name
,
Integer
film_type_name_short
,
Integer
play_shanghai
,
Integer
is_important
,
Integer
review_state
,
Integer
review_round
,
String
film_country
,
Page
page
)
{
SqlWhere
wehre
=
new
SqlWhere
()
.
in
(
"film_group_id"
,
group_id
)
.
eq
(
"film_type_name"
,
film_type_name
)
.
eq
(
"film_type_name_short"
,
film_type_name_short
).
eq
(
"play_shanghai"
,
play_shanghai
)
.
eq
(
"is_important"
,
is_important
)
.
eq
(
"film_country"
,
film_country
)
.
eq
(
"review_state"
,
review_state
)
.
eq
(
"review_round"
,
review_round
)
.
lk
(
new
String
[]
{
"cn_name"
,
"en_name"
,
"director_name"
},
keyword
);
;
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.*, "
+
"r.review_state, "
+
"r.review_round, "
+
"(select group_concat(t.playactor_name) from fc_member_film_playactor fp where fp.film_id = t.id and fp.playactor_type = 'director') director_name "
+
"from "
+
""
+
table
+
" t left join fc_review r on r.film_id = t.id"
;
sql
=
"select * from ("
+
sql
+
") "
+
StringUtil
.
join
(
" and "
,
" where "
,
""
,
""
,
wehre
.
getStringList
());
return
jdbcTemplate
.
limit
(
sql
,
page
,
wehre
.
getObjectArray
());
}
}
src/main/java/com/egolm/film/api/web/admin/FilmGroupController.java
View file @
943d6a63
...
...
@@ -17,6 +17,8 @@ import com.egolm.film.api.service.FilmGroupService;
import
com.egolm.film.bean.Fc_film_group
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
@Api
...
...
@@ -33,12 +35,36 @@ public class FilmGroupController {
@ResponseBody
@PostMapping
(
"getFilmList"
)
@ApiOperation
(
"查询未分类影片列表"
)
public
Object
get
FilmList
(
Integer
enroll_type_id
,
String
film_country
,
String
[]
orderBy
,
Long
index
,
Long
limit
)
{
public
Object
queryNoGroup
FilmList
(
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
);
List
<
Map
<
String
,
Object
>>
list
=
filmGroupService
.
queryNoGroupFilmList
(
enroll_type_id
,
film_country
,
page
);
return
Rjx
.
jsonOk
().
setData
(
list
).
setPage
(
page
);
}
@ResponseBody
@PostMapping
(
"getGroupFilmList"
)
@ApiOperation
(
"查询未分类影片列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"group_id"
,
value
=
"所属组ID"
,
allowMultiple
=
true
),
@ApiImplicitParam
(
name
=
"keyword"
,
value
=
"搜索关键字"
),
@ApiImplicitParam
(
name
=
"enroll_type_id"
,
value
=
"影片性质"
),
@ApiImplicitParam
(
name
=
"film_type_name"
,
value
=
"影片类型"
),
@ApiImplicitParam
(
name
=
"film_type_name_short"
,
value
=
"影片扩展类型"
),
@ApiImplicitParam
(
name
=
"play_shanghai"
,
value
=
"首映情况"
),
@ApiImplicitParam
(
name
=
"is_important"
,
value
=
"重点影片"
),
@ApiImplicitParam
(
name
=
"review_state"
,
value
=
"审片结论"
),
@ApiImplicitParam
(
name
=
"review_round"
,
value
=
"审片轮数"
),
@ApiImplicitParam
(
name
=
"film_country"
,
value
=
"国家地区"
),
})
public
Object
getGroupFilmList
(
Integer
[]
group_id
,
String
keyword
,
Integer
enroll_type_id
,
Integer
film_type_name
,
Integer
film_type_name_short
,
Integer
play_shanghai
,
Integer
is_important
,
Integer
review_state
,
Integer
review_round
,
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
.
queryGroupFilmList
(
group_id
,
keyword
,
enroll_type_id
,
film_type_name
,
film_type_name_short
,
play_shanghai
,
is_important
,
review_state
,
review_round
,
film_country
,
page
);
return
Rjx
.
jsonOk
().
setData
(
list
).
setPage
(
page
);
}
...
...
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