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
5b1af547
Commit
5b1af547
authored
Oct 30, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改审片列表检索条件
parent
b65fb839
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
10 deletions
+71
-10
UserReviewController.java
...in/java/com/egolm/film/api/user/UserReviewController.java
+2
-2
UserReviewService.java
...va/com/egolm/film/api/user/service/UserReviewService.java
+3
-2
UserReviewServiceImpl.java
...olm/film/api/user/service/impl/UserReviewServiceImpl.java
+66
-6
No files found.
src/main/java/com/egolm/film/api/user/UserReviewController.java
View file @
5b1af547
...
...
@@ -61,7 +61,7 @@ public class UserReviewController {
LoginToken
loginToken
=
tokenService
.
getToken
();
Long
user_id
=
(
Long
)
loginToken
.
getId
();
Page
page
=
new
Page
(
index
,
limit
,
limitKey
);
List
<
Map
<
String
,
Object
>>
list
=
reviewService
.
limitReviewList
(
user_id
,
page
);
List
<
Map
<
String
,
Object
>>
list
=
reviewService
.
limitReviewList
(
user_id
,
page
,
start_time
,
end_time
,
film_type_name
,
keyword
);
return
Rjx
.
jsonOk
().
setData
(
list
).
setPage
(
page
);
}
...
...
@@ -82,7 +82,7 @@ public class UserReviewController {
LoginToken
loginToken
=
tokenService
.
getToken
();
Long
user_id
=
(
Long
)
loginToken
.
getId
();
Page
page
=
new
Page
(
index
,
limit
,
limitKey
);
List
<
Map
<
String
,
Object
>>
list
=
reviewService
.
limitUnviewList
(
user_id
,
page
);
List
<
Map
<
String
,
Object
>>
list
=
reviewService
.
limitUnviewList
(
user_id
,
page
,
start_time
,
end_time
,
film_type_name
,
keyword
);
return
Rjx
.
jsonOk
().
setData
(
list
).
setPage
(
page
);
}
...
...
src/main/java/com/egolm/film/api/user/service/UserReviewService.java
View file @
5b1af547
package
com
.
egolm
.
film
.
api
.
user
.
service
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -11,9 +12,9 @@ import com.egolm.film.bean.Fc_film_review;
public
interface
UserReviewService
{
List
<
Map
<
String
,
Object
>>
limitReviewList
(
Long
user_id
,
Page
page
);
List
<
Map
<
String
,
Object
>>
limitReviewList
(
Long
user_id
,
Page
page
,
Date
start_time
,
Date
end_time
,
String
film_type_name
,
String
keyword
);
List
<
Map
<
String
,
Object
>>
limitUnviewList
(
Long
user_id
,
Page
page
);
List
<
Map
<
String
,
Object
>>
limitUnviewList
(
Long
user_id
,
Page
page
,
Date
start_time
,
Date
end_time
,
String
film_type_name
,
String
keyword
);
Long
queryMemberFilmIdByFilmId
(
Long
film_id
);
...
...
src/main/java/com/egolm/film/api/user/service/impl/UserReviewServiceImpl.java
View file @
5b1af547
package
com
.
egolm
.
film
.
api
.
user
.
service
.
impl
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.egolm.common.DateUtil
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
...
...
@@ -24,7 +28,35 @@ public class UserReviewServiceImpl implements UserReviewService {
private
JdbcTemplate
jdbcTemplate
;
@Override
public
List
<
Map
<
String
,
Object
>>
limitReviewList
(
Long
user_id
,
Page
page
)
{
public
List
<
Map
<
String
,
Object
>>
limitReviewList
(
Long
user_id
,
Page
page
,
Date
start_time
,
Date
end_time
,
String
film_type_name
,
String
keyword
)
{
List
<
Object
>
args
=
new
ArrayList
<
Object
>();
List
<
String
>
strs
=
new
ArrayList
<
String
>();
args
.
add
(
user_id
);
if
(
start_time
!=
null
)
{
strs
.
add
(
"allot.push_time >= ?"
);
args
.
add
(
start_time
);
}
if
(
end_time
!=
null
)
{
strs
.
add
(
"allot.push_time < ?"
);
args
.
add
(
DateUtil
.
day
(
end_time
,
1
));
}
if
(
film_type_name
!=
null
&&
film_type_name
.
trim
().
length
()
>
0
)
{
strs
.
add
(
"film.film_type_name = ?"
);
args
.
add
(
film_type_name
);
}
if
(
keyword
!=
null
&&
keyword
.
trim
().
length
()
>
0
)
{
strs
.
add
(
"(film.en_name like ? or film.cn_name like ?)"
);
args
.
add
(
"%"
+
keyword
+
"%"
);
args
.
add
(
"%"
+
keyword
+
"%"
);
}
String
sql
=
""
+
" select "
+
"film.*, "
...
...
@@ -40,12 +72,40 @@ public class UserReviewServiceImpl implements UserReviewService {
+
"left join fc_film_review review on review.film_id = allot.film_id and review.uid = allot.uid and review.round = allot.review_round "
+
"where "
+
"allot.uid = ? "
+
"and review.state > 0"
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
user_id
);
+
"and review.state > 0"
+
StringUtil
.
join
(
" and "
,
" "
,
""
,
""
,
strs
)
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
args
.
toArray
()
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
limitUnviewList
(
Long
user_id
,
Page
page
)
{
public
List
<
Map
<
String
,
Object
>>
limitUnviewList
(
Long
user_id
,
Page
page
,
Date
start_time
,
Date
end_time
,
String
film_type_name
,
String
keyword
)
{
List
<
Object
>
args
=
new
ArrayList
<
Object
>();
List
<
String
>
strs
=
new
ArrayList
<
String
>();
args
.
add
(
user_id
);
if
(
start_time
!=
null
)
{
strs
.
add
(
"allot.push_time >= ?"
);
args
.
add
(
start_time
);
}
if
(
end_time
!=
null
)
{
strs
.
add
(
"allot.push_time < ?"
);
args
.
add
(
DateUtil
.
day
(
end_time
,
1
));
}
if
(
film_type_name
!=
null
&&
film_type_name
.
trim
().
length
()
>
0
)
{
strs
.
add
(
"film.film_type_name = ?"
);
args
.
add
(
film_type_name
);
}
if
(
keyword
!=
null
&&
keyword
.
trim
().
length
()
>
0
)
{
strs
.
add
(
"(film.en_name like ? or film.cn_name like ?)"
);
args
.
add
(
"%"
+
keyword
+
"%"
);
args
.
add
(
"%"
+
keyword
+
"%"
);
}
String
sql
=
""
+
" select "
+
"film.*, "
...
...
@@ -61,8 +121,8 @@ public class UserReviewServiceImpl implements UserReviewService {
+
"left join fc_film_review review on review.film_id = allot.film_id and review.uid = allot.uid and review.round = allot.review_round "
+
"where "
+
"allot.uid = ? "
+
"and review.state is null"
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
user_id
);
+
"and review.state is null"
+
StringUtil
.
join
(
" and "
,
" "
,
""
,
""
,
strs
)
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
args
.
toArray
()
);
}
@Override
...
...
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