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
7f7096ba
Commit
7f7096ba
authored
Dec 28, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
8b46ccb3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
12 deletions
+52
-12
AdminUserServiceImpl.java
...com/egolm/film/api/service/impl/AdminUserServiceImpl.java
+2
-0
ReviewServiceImpl.java
...va/com/egolm/film/api/service/impl/ReviewServiceImpl.java
+50
-12
No files found.
src/main/java/com/egolm/film/api/service/impl/AdminUserServiceImpl.java
View file @
7f7096ba
...
@@ -89,6 +89,7 @@ public class AdminUserServiceImpl implements AdminUserService {
...
@@ -89,6 +89,7 @@ public class AdminUserServiceImpl implements AdminUserService {
@Override
@Override
public
void
saveGroupRound
(
Integer
group_id
,
Integer
[]
rounds
)
{
public
void
saveGroupRound
(
Integer
group_id
,
Integer
[]
rounds
)
{
jdbcTemplate
.
executeUpdate
(
"delete from fc_user_group_round where group_id = ?"
,
group_id
);
if
(
rounds
!=
null
&&
rounds
.
length
>
0
)
{
if
(
rounds
!=
null
&&
rounds
.
length
>
0
)
{
List
<
Fc_user_group_round
>
objs
=
new
ArrayList
<
Fc_user_group_round
>();
List
<
Fc_user_group_round
>
objs
=
new
ArrayList
<
Fc_user_group_round
>();
for
(
Integer
round
:
rounds
)
{
for
(
Integer
round
:
rounds
)
{
...
@@ -103,6 +104,7 @@ public class AdminUserServiceImpl implements AdminUserService {
...
@@ -103,6 +104,7 @@ public class AdminUserServiceImpl implements AdminUserService {
@Override
@Override
public
void
saveGroupEnroll
(
Integer
group_id
,
Integer
[]
enroll_types
)
{
public
void
saveGroupEnroll
(
Integer
group_id
,
Integer
[]
enroll_types
)
{
jdbcTemplate
.
executeUpdate
(
"delete from fc_user_group_enroll where group_id = ?"
,
group_id
);
if
(
enroll_types
!=
null
&&
enroll_types
.
length
>
0
)
{
if
(
enroll_types
!=
null
&&
enroll_types
.
length
>
0
)
{
List
<
Fc_user_group_enroll
>
typeList
=
new
ArrayList
<
Fc_user_group_enroll
>();
List
<
Fc_user_group_enroll
>
typeList
=
new
ArrayList
<
Fc_user_group_enroll
>();
for
(
Integer
enrollType
:
enroll_types
)
{
for
(
Integer
enrollType
:
enroll_types
)
{
...
...
src/main/java/com/egolm/film/api/service/impl/ReviewServiceImpl.java
View file @
7f7096ba
...
@@ -159,7 +159,7 @@ public class ReviewServiceImpl implements ReviewService {
...
@@ -159,7 +159,7 @@ public class ReviewServiceImpl implements ReviewService {
+
"mf.en_name, "
+
"mf.en_name, "
+
"mf.film_no, "
+
"mf.film_no, "
+
"rre.ext_type, "
+
"rre.ext_type, "
+
"rre.ext_name
,
"
+
"rre.ext_name"
;
;
SqlWhere
where
=
new
SqlWhere
().
eq
(
"t.review_state"
,
review_state
).
lk
(
new
String
[]
{
"tt.cn_name"
,
"tt.en_name"
,
"tt.film_no"
,
"tt.ext_name"
},
keyword
);
SqlWhere
where
=
new
SqlWhere
().
eq
(
"t.review_state"
,
review_state
).
lk
(
new
String
[]
{
"tt.cn_name"
,
"tt.en_name"
,
"tt.film_no"
,
"tt.ext_name"
},
keyword
);
sql
=
"select @rownum:=@rownum+1 as rownum, t.* from ("
+
sql
+
") t, (select @rownum:=0) row order by t.ext_score_avg desc"
;
sql
=
"select @rownum:=@rownum+1 as rownum, t.* from ("
+
sql
+
") t, (select @rownum:=0) row order by t.ext_score_avg desc"
;
...
@@ -167,6 +167,55 @@ public class ReviewServiceImpl implements ReviewService {
...
@@ -167,6 +167,55 @@ public class ReviewServiceImpl implements ReviewService {
return
jdbcTemplate
.
limit
(
sql
,
page
,
where
.
getObjectList
());
return
jdbcTemplate
.
limit
(
sql
,
page
,
where
.
getObjectList
());
}
}
public
static
void
main
(
String
[]
args
)
{
String
ext_type
=
"最佳男主角"
;
Integer
review_round
=
2
;
Integer
review_state
=
null
;
String
keyword
=
null
;
String
sql
=
""
+
"select "
+
"rh.film_id, "
+
"rh.review_id, "
+
"rh.enroll_type_id, "
+
"rh.review_round, "
+
"rh.review_state, "
+
"rh.opt_state, "
+
"mf.cn_name, "
+
"mf.en_name, "
+
"mf.film_no, "
+
"rre.ext_type, "
+
"rre.ext_name, "
+
"avg(rre.ext_score) ext_score_avg "
+
"from "
+
"fc_review_record_ext rre, "
+
"fc_review_record rr, "
+
"fc_review_history rh left join fc_member_film mf on mf.id = rh.film_id "
+
"where "
+
"rre.ext_type = '"
+
ext_type
+
"' "
+
"and rh.review_round = "
+
review_round
+
" "
+
"and rre.record_id = rr.id "
+
"and rr.review_id = rh.review_id "
+
"and rh.enroll_type_id = 2 "
+
"and rh.opt_state = 2 "
+
"group by "
+
"rh.film_id, "
+
"rh.review_id, "
+
"rh.enroll_type_id, "
+
"rh.review_round, "
+
"rh.review_state, "
+
"rh.opt_state, "
+
"mf.cn_name, "
+
"mf.en_name, "
+
"mf.film_no, "
+
"rre.ext_type, "
+
"rre.ext_name "
;
SqlWhere
where
=
new
SqlWhere
().
eq
(
"t.review_state"
,
review_state
).
lk
(
new
String
[]
{
"tt.cn_name"
,
"tt.en_name"
,
"tt.film_no"
,
"tt.ext_name"
},
keyword
);
sql
=
"select @rownum:=@rownum+1 as rownum, t.* from ("
+
sql
+
") t, (select @rownum:=0) row order by t.ext_score_avg desc"
;
sql
=
"select tt.* from ("
+
sql
+
") tt "
+
StringUtil
.
join
(
" where "
,
" and "
,
""
,
""
,
where
.
getStringList
())
+
" order by tt.rownum"
;
System
.
out
.
println
(
sql
);
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
queryReviewListForUser
(
public
List
<
Map
<
String
,
Object
>>
queryReviewListForUser
(
boolean
is_review
,
boolean
is_review
,
...
@@ -369,17 +418,6 @@ public class ReviewServiceImpl implements ReviewService {
...
@@ -369,17 +418,6 @@ public class ReviewServiceImpl implements ReviewService {
return
null
;
return
null
;
}
}
public
static
void
main
(
String
[]
args
)
{
List
<
Fc_review_record
>
records
=
new
ArrayList
<
Fc_review_record
>();
Fc_review_record
r1
=
new
Fc_review_record
();
Fc_review_record
r2
=
new
Fc_review_record
();
r1
.
setReview_state
(
5
);
r2
.
setReview_state
(
5
);
records
.
add
(
r1
);
records
.
add
(
r2
);
System
.
out
.
println
(
new
ReviewServiceImpl
().
reviewStateElection
(
records
));
}
private
void
transfer_4_flow_4
(
Fc_review
review
)
{
private
void
transfer_4_flow_4
(
Fc_review
review
)
{
Date
now
=
new
Date
();
Date
now
=
new
Date
();
jdbcTemplate
.
executeUpdate
(
"update fc_review set opt_state = 3, review_state = 2 where id = ?"
,
review
.
getId
());
jdbcTemplate
.
executeUpdate
(
"update fc_review set opt_state = 3, review_state = 2 where id = ?"
,
review
.
getId
());
...
...
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