Commit 9aa8635f authored by Quxl's avatar Quxl

x

parent 3713982e
......@@ -498,12 +498,12 @@ public class FilmServiceImpl implements FilmService {
@Override
@Transactional
public void allot(Integer review_id, Integer review_round, Integer[] user_id) {
if(user_id != null && user_id.length > 0) {
String sql = "insert into fc_review_record(review_id, user_id, review_round, view_state, review_state, create_time) select ?, ?, ?, 0, 1, now() from dual where not exists (select * from fc_review_record where review_id = ? and user_id = ? and review_round = ?)";
Object[][] objs = new Object[user_id.length][];
for(Integer i : user_id) {
String sql = "insert into fc_review_record(review_id, user_id, view_state, review_round, review_state, create_time) select " + review_id + ", " + i + ", 0, " + review_round + ", 1, now() from dual where not exists (select * from fc_review_record where review_id = " + review_id + " and user_id = " + i + " and review_round = " + review_round + ")";
jdbcTemplate.executeUpdate(sql);
}
objs[i] = new Object[]{review_id, i, review_round, review_id, i, review_round};
}
jdbcTemplate.batchUpdate(sql, objs);
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment