Commit c10043a4 authored by Quxl's avatar Quxl

x

parent 58bc3505
......@@ -93,7 +93,16 @@ public interface FilmService {
List<Map<String, Object>> queryListAll(String keyword);
List<Map<String, Object>> queryChuShenList(String keyword, Integer state, Integer apply_state, Integer upload_state, Integer film_type, Integer enroll_type, String film_country, Integer film_type_short, Page page);
List<Map<String, Object>> queryChuShenList(
String keyword,
Integer state,
Integer apply_state,
Integer upload_state,
Integer film_type,
Integer enroll_type,
String film_country,
Integer film_type_short,
Page page);
Integer pass(Long member_film_id);
......
......@@ -367,8 +367,25 @@ public class FilmServiceImpl implements FilmService {
}
@Override
public List<Map<String, Object>> queryChuShenList(String keyword, Integer state, Integer apply_state, Integer upload_state, Integer film_type, Integer enroll_type, String film_country, Integer film_type_short, Page page) {
SqlWhere where = new SqlWhere().eq("mf.state", state).eq("mf.apply_state", apply_state).eq("mf.upload_state", upload_state).eq("mf.film_type_name", film_type).eq("mf.film_type_name_short", film_type_short).eq("mf.film_country", film_country).lk("mf.enroll_type_name", enroll_type).lk(new String[]{"mf.en_name", "mf.cn_name", "fp.playactor_name"}, keyword);
public List<Map<String, Object>> queryChuShenList(
String keyword,
Integer state,
Integer apply_state,
Integer upload_state,
Integer film_type,
Integer enroll_type,
String film_country,
Integer film_type_short,
Page page) {
SqlWhere where = new SqlWhere()
.eq("mf.state", state)
.eq("mf.apply_state", apply_state)
.eq("mf.upload_state", upload_state)
.eq("mf.film_type_name", film_type)
.eq("mf.film_type_name_short", film_type_short)
.eq("mf.film_country", film_country)
.lk("mf.enroll_type_name", enroll_type)
.lk(new String[]{"mf.en_name", "mf.cn_name", "fp.playactor_name"}, keyword);
String sql = ""
+ "select "
+ "mf.id, "
......@@ -540,7 +557,14 @@ public class FilmServiceImpl implements FilmService {
@Override
@Transactional
public void saveReviewRecordIfNotExists(Integer review_id, Integer review_round, Integer[] user_id) {
String sql = "insert into fc_review_record(review_id, user_id, review_round, view_state, create_time) select ?, ?, ?, 0, now() from dual where not exists (select * from fc_review_record where review_id = ? and user_id = ? and review_round = ?)";
String sql = ""
+ "insert into "
+ "fc_review_record"
+ "(review_id, user_id, review_round, view_state, create_time) "
+ "select ?, ?, ?, 0, 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(int i = 0; i < objs.length; i++) {
objs[i] = new Object[]{review_id, user_id[i], review_round, review_id, user_id[i], review_round};
......@@ -566,10 +590,31 @@ public class FilmServiceImpl implements FilmService {
@Override
public void verifyFilmDuplicate(Long member_film_id) {
String sql0 = "select f.* from fc_member_film f, fc_member_film f2 where (f.apply_state = 2 or f.apply_state = 3) and (f.en_name = f2.en_name or f.cn_name = f2.cn_name) and f2.id = ? and f.id != ?";
String sql0 = ""
+ "select "
+ "f.* "
+ "from "
+ "fc_member_film f, "
+ "fc_member_film f2 "
+ "where "
+ "(f.apply_state = 2 or f.apply_state = 3) "
+ "and (f.en_name = f2.en_name or f.cn_name = f2.cn_name) "
+ "and f2.id = ? "
+ "and f.id != ?";
List<Fc_member_film> list = jdbcTemplate.queryForBeans(sql0, Fc_member_film.class, member_film_id, member_film_id);
if(list.size() > 0) {
String sql = "select count(fp.id) from fc_member_film_playactor fp, fc_member_film_playactor fp2 where fp.playactor_type = 'director' and fp.playactor_type = fp2.playactor_type and fp.playactor_name = fp2.playactor_name and fp2.film_id = ? and fp.film_id != ?";
String sql = ""
+ "select "
+ "count(fp.id) "
+ "from "
+ "fc_member_film_playactor fp, "
+ "fc_member_film_playactor fp2 "
+ "where "
+ "fp.playactor_type = 'director' "
+ "and fp.playactor_type = fp2.playactor_type "
+ "and fp.playactor_name = fp2.playactor_name "
+ "and fp2.film_id = ? "
+ "and fp.film_id != ?";
Integer count = jdbcTemplate.queryForInt(sql, member_film_id, member_film_id);
if(count > 0) {
Fc_member_film film = list.get(0);
......
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