Merge branch 'master' of https://gitee.com/xswl_123/dite-shixi-bakcend
This commit is contained in:
commit
a49d01d23a
|
@ -11,7 +11,7 @@ import java.util.List;
|
|||
|
||||
@ApiOperation("商务资料文件对象")
|
||||
public interface BusinessDataFileMapper {
|
||||
public List<BusinessDataFileEntity> List( @Param("folderId") Long folderId,String fileName);
|
||||
public List<BusinessDataFileEntity> List(@Param("folderId") Long folderId, @Param("fileName") String fileName);
|
||||
void delete(@Param("fileId") Long fileId,@Param("folderId") Long folderId);
|
||||
|
||||
void add(BusinessDataFileEntity businessDataFileEntity);
|
||||
|
|
|
@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||
|
||||
public interface BusinessDataFileService {
|
||||
|
||||
PageBean pageSelect(Integer page, Integer pageSize, Long folderId);
|
||||
PageBean pageSelect(Integer page, Integer pageSize, Long folderId, String fileName);
|
||||
|
||||
Result delete(@RequestParam(value = "fileId", required = false) Long fileId,@RequestParam(value = "foldelId", required = false) Long folderId);
|
||||
|
||||
|
|
|
@ -30,9 +30,10 @@ public class BusinessDataFileServiceImpl implements BusinessDataFileService {
|
|||
|
||||
|
||||
@ApiOperation("分页查询文件")
|
||||
public PageBean pageSelect(Integer page, Integer pageSize, Long folderId) {
|
||||
@Override
|
||||
public PageBean pageSelect(Integer page, Integer pageSize, Long folderId, String fileName) {
|
||||
PageHelper.startPage(page, pageSize);
|
||||
List<BusinessDataFileEntity> list = businessDataFileMapper.List(folderId ,"");
|
||||
List<BusinessDataFileEntity> list = businessDataFileMapper.List(folderId, fileName);
|
||||
Page<BusinessDataFileEntity> p = (Page<BusinessDataFileEntity>) list;
|
||||
PageBean pageBean = new PageBean(p.getTotal(), p.getResult());
|
||||
return pageBean;
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
<select id="List" resultType="com.dite.znpt.domain.entity.BusinessDataFileEntity">
|
||||
select * from business_data_part_file
|
||||
<where>
|
||||
<if test="param1 != null">
|
||||
and folder_id = #{param1}
|
||||
<if test="folderId != null">
|
||||
and folder_id = #{folderId}
|
||||
</if>
|
||||
<if test="param2 != null and param2 != ''">
|
||||
and file_name = #{param2}
|
||||
<if test="fileName != null and fileName != ''">
|
||||
and file_name like concat('%', #{fileName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
|
@ -45,8 +45,9 @@ public class BusinessDataFileController {
|
|||
@GetMapping("/list")
|
||||
public Result pageSelect(@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize,
|
||||
@RequestParam(defaultValue = "0") Long folderId) {
|
||||
PageBean pageBean = businessDataFileService.pageSelect(page, pageSize, folderId);
|
||||
@RequestParam(defaultValue = "0") Long folderId,
|
||||
@RequestParam(required = false) String fileName) {
|
||||
PageBean pageBean = businessDataFileService.pageSelect(page, pageSize, folderId, fileName);
|
||||
return Result.ok(pageBean);
|
||||
}
|
||||
|
||||
|
@ -96,6 +97,7 @@ public class BusinessDataFileController {
|
|||
businessDataFileService.delete(fileId, null);
|
||||
return Result.okM("删除成功");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "下载文件")
|
||||
@GetMapping("/download")
|
||||
public void download(@RequestParam("fileId") Long fileId, HttpServletResponse response) {
|
||||
|
@ -133,5 +135,4 @@ public class BusinessDataFileController {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue