|
@ -25,10 +25,10 @@ public class BaseVideoService {
|
|
|
* @return
|
|
|
*/
|
|
|
public ListEnvelop getVideoGroup(){
|
|
|
String sql = "SELECT id,name,sort_num sortNum,CAST(status as UNSIGNED) status," +
|
|
|
" CAST(DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') as char) createTime " +
|
|
|
" from base_video_group " +
|
|
|
" where status = 1 order by sort_num desc ";
|
|
|
String sql = "SELECT g.id,g.name,g.sort_num sortNum,CAST(g.status as UNSIGNED) status," +
|
|
|
" CAST(DATE_FORMAT(g.create_time,'%Y-%m-%d %H:%i:%S') as char) createTime,count(v.id) videoTotal " +
|
|
|
" from base_video_group g inner join base_video v on v.type = g.id " +
|
|
|
" where g.status = 1 GROUP BY g.id order by g.sort_num desc ";
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
return ListEnvelop.getSuccess("查询成功",list);
|
|
|
}
|
|
@ -47,8 +47,8 @@ public class BaseVideoService {
|
|
|
" v.introduction,v.sort_num sortNum,CAST(v.status as UNSIGNED) status,g.name ";
|
|
|
String countSql = "select count(v.id) ";
|
|
|
String sql = " from base_video v " +
|
|
|
" left join base_video_group g on v.type = g.id " +
|
|
|
" where v.status = 1 ";
|
|
|
" inner join base_video_group g on v.type = g.id " +
|
|
|
" where v.status = 1 and g.status = 1 ";
|
|
|
if(groupId > 0){
|
|
|
sql += " and v.type = "+groupId+" ";
|
|
|
}
|