feat(情报板类型定义条件查询):

This commit is contained in:
fuhao 2024-09-04 10:19:07 +08:00
parent a32ba2c6b9
commit dbeb12bc0a
No known key found for this signature in database
3 changed files with 14 additions and 1 deletions

View File

@ -34,7 +34,7 @@ public class BoardTypeController extends BaseController {
@GetMapping("/list")
public TableDataInfo list(BoardType boardType) {
startPage();
List<BoardType> list = boardTypeService.list();
List<BoardType> list = boardTypeService.listByParams(boardType);
return getDataTable(list);
}

View File

@ -3,5 +3,8 @@ package com.ruoyi.board.service;
import com.github.yulichang.base.MPJBaseService;
import com.ruoyi.board.domain.BoardType;
import java.util.List;
public interface IBoardTypeService extends MPJBaseService<BoardType> {
List<BoardType> listByParams(BoardType boardType);
}

View File

@ -1,11 +1,21 @@
package com.ruoyi.board.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.ruoyi.board.domain.BoardType;
import com.ruoyi.board.mapper.BoardTypeMapper;
import com.ruoyi.board.service.IBoardTypeService;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class BoardTypeServiceImpl extends MPJBaseServiceImpl<BoardTypeMapper, BoardType> implements IBoardTypeService {
@Override
public List<BoardType> listByParams(BoardType boardType) {
LambdaQueryWrapper<BoardType> boardTypeLambdaQueryWrapper = new LambdaQueryWrapper<>();
boardTypeLambdaQueryWrapper.likeRight(StringUtils.isNotEmpty(boardType.getName()), BoardType::getName, boardType.getName());
return list(boardTypeLambdaQueryWrapper);
}
}