Commit 92445f78 authored by Quxl's avatar Quxl

x

parent d75087e4
......@@ -113,20 +113,20 @@ public class AdminVideoController {
for(Map<String, Object> map : list) {
String video_name = (String)map.get("cn_name");
Integer is_sales = 0;
String profiles = (String)map.get("intro");
String video_profiles = (String)map.get("intro");
String country = (String)map.get("film_country");
String upload_id = (String)map.get("upload_id");
String completion_date = (String)map.get("completion_date");
Integer year = null;
Integer video_year = null;
try {
Date date = DateUtil.parse(completion_date, "yyyy-MM");
year = Integer.valueOf(DateUtil.format(date, "yyyy"));
video_year = Integer.valueOf(DateUtil.format(date, "yyyy"));
} catch (Exception e) {}
String cover = null;
Integer source = 1;
String source_key = map.get("id") + "";
Object[] argArray = new Object[] {video_name, is_sales, profiles, country, year, cover, source, source_key, source, source_key};
String sql = "insert into t_video (video_name, is_sales, profiles, country, year, cover, source, source_key) select ?, ?, ?, ?, ?, ?, ?, ? from dual where not exists(select 1 from t_video where source = ? and source_key = ?)";
Object[] argArray = new Object[] {video_name, is_sales, video_profiles, country, video_year, cover, source, source_key, source, source_key};
String sql = "insert into t_video (video_name, is_sales, video_profiles, country, video_year, cover, source, source_key) select ?, ?, ?, ?, ?, ?, ?, ? from dual where not exists(select 1 from t_video where source = ? and source_key = ?)";
KeyHolder keyHolder = new GeneratedKeyHolder();
jdbcTemplate.update(new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
......
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