Commit d75087e4 authored by Quxl's avatar Quxl

x

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