7-31 岗位查用户

This commit is contained in:
ybb 2025-08-05 09:27:10 +08:00
parent 141c95f63e
commit 50c343402b
5 changed files with 32 additions and 30 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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>

View File

@ -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 {
}
}
}