Commit d75087e4 authored by Quxl's avatar Quxl

x

parent 40c96294
......@@ -20,16 +20,16 @@ public class T_video implements java.io.Serializable {
private Integer id;
@Column(columnDefinition="varchar(255) COMMENT '视频名称'")
private String name;
private String video_name;
@Column(columnDefinition="varchar(255) COMMENT '一句话简介'")
private String desc;
private String video_desc;
@Column(columnDefinition="longtext COMMENT '剧情简介'")
private String profiles;
private String video_profiles;
@Column(columnDefinition="int(4) COMMENT '年份'")
private Integer year;
private Integer video_year;
@Column(columnDefinition="varchar(255) COMMENT '国家'")
private String country;
......@@ -64,36 +64,36 @@ public class T_video implements java.io.Serializable {
return id;
}
public void setName(String name) {
this.name = name;
public void setVideo_name(String video_name) {
this.video_name = video_name;
}
public String getName() {
return name;
public String getVideo_name() {
return video_name;
}
public void setDesc(String desc) {
this.desc = desc;
public void setVideo_desc(String video_desc) {
this.video_desc = video_desc;
}
public String getDesc() {
return desc;
public String getVideo_desc() {
return video_desc;
}
public void setProfiles(String profiles) {
this.profiles = profiles;
public void setVideo_profiles(String video_profiles) {
this.video_profiles = video_profiles;
}
public String getProfiles() {
return profiles;
public String getVideo_profiles() {
return video_profiles;
}
public void setYear(Integer year) {
this.year = year;
public void setVideo_year(Integer video_year) {
this.video_year = video_year;
}
public Integer getYear() {
return year;
public Integer getVideo_year() {
return video_year;
}
public void setCountry(String country) {
......
......@@ -19,7 +19,7 @@ public class T_video_source implements java.io.Serializable {
private Integer video_id;
@Column(columnDefinition="varchar(255) COMMENT '视频源名称'")
private String name;
private String source_name;
@Column(columnDefinition="varchar(255) COMMENT '播放地址'")
private String play_key;
......@@ -47,12 +47,12 @@ public class T_video_source implements java.io.Serializable {
return video_id;
}
public void setName(String name) {
this.name = name;
public void setSource_name(String source_name) {
this.source_name = source_name;
}
public String getName() {
return name;
public String getSource_name() {
return source_name;
}
public void setPlay_key(String play_key) {
......
......@@ -16,10 +16,7 @@ public class X_type implements java.io.Serializable {
private Integer id;
@Column(columnDefinition="varchar(255)")
private String cn_name;
@Column(columnDefinition="varchar(255)")
private String en_name;
private String type_name;
public void setId(Integer id) {
......@@ -30,20 +27,12 @@ public class X_type implements java.io.Serializable {
return id;
}
public void setCn_name(String cn_name) {
this.cn_name = cn_name;
}
public String getCn_name() {
return cn_name;
}
public void setEn_name(String en_name) {
this.en_name = en_name;
public void setType_name(String type_name) {
this.type_name = type_name;
}
public String getEn_name() {
return en_name;
public String getType_name() {
return type_name;
}
}
......
......@@ -16,16 +16,16 @@ public class T_video_model implements java.io.Serializable {
private Integer id;
@Column(columnDefinition="varchar(255) COMMENT '视频名称'")
private String name;
private String video_name;
@Column(columnDefinition="varchar(255) COMMENT '一句话简介'")
private String desc;
private String video_desc;
@Column(columnDefinition="longtext COMMENT '剧情简介'")
private String profiles;
private String video_profiles;
@Column(columnDefinition="int(4) COMMENT '年份'")
private Integer year;
private Integer video_year;
@Column(columnDefinition="varchar(255) COMMENT '国家'")
private String country;
......@@ -44,36 +44,36 @@ public class T_video_model implements java.io.Serializable {
this.id = id;
}
public String getName() {
return name;
public String getVideo_name() {
return video_name;
}
public void setName(String name) {
this.name = name;
public void setVideo_name(String video_name) {
this.video_name = video_name;
}
public String getDesc() {
return desc;
public String getVideo_desc() {
return video_desc;
}
public void setDesc(String desc) {
this.desc = desc;
public void setVideo_desc(String video_desc) {
this.video_desc = video_desc;
}
public String getProfiles() {
return profiles;
public String getVideo_profiles() {
return video_profiles;
}
public void setProfiles(String profiles) {
this.profiles = profiles;
public void setVideo_profiles(String video_profiles) {
this.video_profiles = video_profiles;
}
public Integer getYear() {
return year;
public Integer getVideo_year() {
return video_year;
}
public void setYear(Integer year) {
this.year = year;
public void setVideo_year(Integer video_year) {
this.video_year = video_year;
}
public String getCountry() {
......
......@@ -48,7 +48,7 @@ public class AdminVideoController {
if(page == null) {
page = new Page();
}
SqlWhere where = new SqlWhere().eq("is_sales", is_sales).eq("is_free", is_free).lk(new String[]{"name"}, keyword);
SqlWhere where = new SqlWhere().eq("is_sales", is_sales).eq("is_free", is_free).lk(new String[]{"video_name"}, keyword);
String sql = "select * from t_video" + StringUtil.join(" and ", " where ", where.getStringList());
List<Map<String, Object>> list = jdbcTemplate.limit(sql, page, where.getObjectArray());
return Rjx.jsonOk().setData(list).setPage(page);
......@@ -111,7 +111,7 @@ public class AdminVideoController {
public Rjx doImport() {
List<Map<String, Object>> list = jdbcTemplate.queryForList("select * from x_mvlist where upload_id is not null and upload_state = 2");
for(Map<String, Object> map : list) {
String name = (String)map.get("cn_name");
String video_name = (String)map.get("cn_name");
Integer is_sales = 0;
String profiles = (String)map.get("intro");
String country = (String)map.get("film_country");
......@@ -125,8 +125,8 @@ public class AdminVideoController {
String cover = null;
Integer source = 1;
String source_key = map.get("id") + "";
Object[] argArray = new Object[] {name, is_sales, profiles, country, year, cover, source, source_key, source, source_key};
String sql = "insert into t_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, 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 = ?)";
KeyHolder keyHolder = new GeneratedKeyHolder();
jdbcTemplate.update(new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
......@@ -141,7 +141,7 @@ public class AdminVideoController {
if(id != null) {
T_video_source vs = new T_video_source();
vs.setVideo_id(id.intValue());
vs.setName(name);
vs.setSource_name(video_name);
vs.setPlay_key(upload_id);
jdbcTemplate.save(vs);
}
......
......@@ -57,7 +57,7 @@ public class PlayerController {
year_start = year_end = Integer.valueOf(year);
}
}
SqlWhere where = new SqlWhere().eq("is_sales", 1).ge("year", year_start).le("year", year_end).lk(new String[]{"name"}, keyword);
SqlWhere where = new SqlWhere().eq("is_sales", 1).ge("year", year_start).le("year", year_end).lk(new String[]{"video_name"}, keyword);
String sql = "select * from t_video" + StringUtil.join(" and ", " where ", where.getStringList());
List<Map<String, Object>> list = jdbcTemplate.limit(sql, page, where.getObjectArray());
return Rjx.jsonOk().setData(list);
......
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