|
@@ -404,10 +404,11 @@ public class FodderServiceImpl extends IBaseServiceImpl<FodderEntity, Long> impl
|
|
|
String searchKey = param.getSearchKey();
|
|
|
Long dirId = param.getDirId();
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
+ // 目录
|
|
|
builder.append("( ");
|
|
|
builder.append("select a.id,a.create_time,a.update_time,a.name, null as status, IFNULL(null,'dir') as type,a.user_id, null as icon,null as preview_icon, " +
|
|
|
"null as file_name, null as file_size,null as oss_path, null as scene_code,null as dpi,null as temp_id,a.parent_id as dir_id, b.name as dirName, " +
|
|
|
- "IFNULL(null, 1) as sortType from tb_dir a left join tb_dir b on b.id=a.parent_id where a.is_delete=0") ;
|
|
|
+ "IFNULL(null, 1) as sortType, a.ancestors from tb_dir a left join tb_dir b on b.id=a.parent_id where a.is_delete=0") ;
|
|
|
builder.append(" and a.user_id='").append(userName).append("'");
|
|
|
builder.append(" and a.type='").append(type).append("'");
|
|
|
|
|
@@ -425,9 +426,10 @@ public class FodderServiceImpl extends IBaseServiceImpl<FodderEntity, Long> impl
|
|
|
|
|
|
builder.append(" ) union all ( ");
|
|
|
|
|
|
- // 字段顺序要对应
|
|
|
+ // 字段顺序要对应, 素材
|
|
|
builder.append("select a.id,a.create_time,a.update_time,a.name, a.status,a.type,a.user_id, a.icon,a.preview_icon, a.file_name, " +
|
|
|
- "a.file_size, a.oss_path, a.scene_code,a.dpi,a.temp_id, a.dir_id, b.name as dirName, if(a.id=0, 2, 2) as sortType " +
|
|
|
+ "a.file_size, a.oss_path, a.scene_code,a.dpi,a.temp_id, a.dir_id, b.name as dirName, if(a.id=0, 2, 2) as sortType," +
|
|
|
+ " null as ancestors " +
|
|
|
"from tb_fodder a left join tb_dir b on b.id=a.dir_id where a.is_delete=0");
|
|
|
|
|
|
|