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