Commit f0d60fa1 by 284718418@qq.com

修改BUG 空间大小总计

parent 29d6ef8b
......@@ -231,11 +231,11 @@ public class DiskFilesController {
* @param userBean
* @return
*/
@GetMapping(value = "/mycatalogue")
@GetMapping(value = "/mycatalogue/{type}")
@ApiOperation(value = "我的文件空间大小", httpMethod = "GET", notes = "我的文件空间大小")
public Result<Object> myCatalogue(@CurrentUser UserBean userBean) {
public Result<Object> myCatalogue(@PathVariable("type")Integer type,@CurrentUser UserBean userBean) {
try {
DiskFileCatalogueDto diskFileCatalogueDto = diskFilesService.getFileCount(userBean);
DiskFileCatalogueDto diskFileCatalogueDto = diskFilesService.getFileCount(userBean,type);
return ResultUtil.data(diskFileCatalogueDto);
}catch (Exception e){
e.printStackTrace();
......
......@@ -28,7 +28,7 @@ public interface DiskFilesService {
* @param userBean
* @return
*/
DiskFileCatalogueDto getFileCount(UserBean userBean);
DiskFileCatalogueDto getFileCount(UserBean userBean,Integer type);
/**
* 删除文件
......
......@@ -30,8 +30,8 @@ public class DiskFilesServiceImpl implements DiskFilesService {
}
@Override
public DiskFileCatalogueDto getFileCount(UserBean userBean) {
DiskFileCatalogueDto dto = diskFilesMapper.selectFileCount(userBean);
public DiskFileCatalogueDto getFileCount(UserBean userBean,Integer type) {
DiskFileCatalogueDto dto = diskFilesMapper.selectFileCount(userBean,type);
if(StringUtils.isEmpty(dto)){
dto = new DiskFileCatalogueDto();
}
......
......@@ -34,7 +34,7 @@ public interface DiskFilesMapper extends BaseMapper<DiskFiles> {
* @param userBean
* @return
*/
DiskFileCatalogueDto selectFileCount(@Param("param") UserBean userBean);
DiskFileCatalogueDto selectFileCount(@Param("param") UserBean userBean,@Param("type")Integer type);
/**
* 删除文件
......
......@@ -37,7 +37,11 @@
SELECT COALESCE(sum(df.file_size),0) as countSize FROM `disk_files` df
LEFT JOIN disk_catalogue_files dcf ON df.id = dcf.files_id
LEFT JOIN disk_catalogue dc ON dc.id = dcf.catalogue_id
WHERE df.create_user_id = #{param.empNum} AND df.org_id=#{param.orgCode} AND df.delete_flag=0 AND dcf.delete_flag=0 AND dc.delete_flag=0 AND dc.type=0
WHERE df.delete_flag=0
<if test="type == 1">
AND df.create_user_id = #{param.empNum}
</if>
AND df.org_id=#{param.orgCode} AND dcf.delete_flag=0 AND dc.delete_flag=0 AND dc.type = #{type}
</select>
......
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