Commit df1c2dbf authored by Quxl's avatar Quxl

x

parent 6316cc15
...@@ -204,4 +204,33 @@ public class WebUtilController { ...@@ -204,4 +204,33 @@ public class WebUtilController {
return Rjx.jsonOk(); return Rjx.jsonOk();
} }
@ResponseBody
@Transactional
@PostMapping("removeFilmData")
@ApiOperation("彻底删除影片数据")
public Object removeFilmData(String[] film_no) {
this.verifyAuth();
List<String> nos = new ArrayList<String>();
for(String no: film_no) {
nos.add(Integer.valueOf(no).toString());
}
List<Integer> ids = jdbcTemplate.queryForObjects("select id from fc_member_film where in (" + StringUtil.join(", ", "", "", "''", nos) + ")", Integer.class);
List<String> idList = new ArrayList<String>();
for(Integer id : ids) {
idList.add(id.toString());
}
jdbcTemplate.executeUpdate("delete from fc_review where film_id in (" + StringUtil.join(", ", "", "", "''", idList) + ")");
jdbcTemplate.executeUpdate("delete from fc_review_record where review_id in (select id from fc_review where film_id in (" + StringUtil.join(", ", "", "", "''", idList) + "))");
jdbcTemplate.executeUpdate("delete from fc_user_film where review_id in (select id from fc_review where film_id in (" + StringUtil.join(", ", "", "", "''", idList) + "))");
jdbcTemplate.executeUpdate("delete from fc_review_record_ext where record_id in (select id from fc_review_record where review_id in (select id from fc_review where film_id in (" + StringUtil.join(", ", "", "", "''", idList) + ")))");
jdbcTemplate.executeUpdate("delete from fc_member_film_playactor where film_id in (" + StringUtil.join(", ", "", "", "''", idList) + ")");
jdbcTemplate.executeUpdate("delete from fc_member_film_enroll where film_id in (" + StringUtil.join(", ", "", "", "''", idList) + ")");
jdbcTemplate.executeUpdate("delete from fc_member_film_ext where id in (" + StringUtil.join(", ", "", "", "''", idList) + ")");
jdbcTemplate.executeUpdate("delete from fc_member_film_issuer where film_id in (" + StringUtil.join(", ", "", "", "''", idList) + ")");
jdbcTemplate.executeUpdate("delete from fc_member_film_show where film_id in (" + StringUtil.join(", ", "", "", "''", idList) + ")");
jdbcTemplate.executeUpdate("delete from fc_film_upload where film_id in (" + StringUtil.join(", ", "", "", "''", idList) + ")");
jdbcTemplate.executeUpdate("delete from fc_member_film where id in (" + StringUtil.join(", ", "", "", "''", idList) + ")");
return Rjx.jsonOk();
}
} }
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