修改种类/模糊查询
This commit is contained in:
parent
511d86596f
commit
1ef16a9bc5
|
|
@ -96,8 +96,8 @@ public class MarketController {
|
|||
* @throws BotException
|
||||
*/
|
||||
@GetMapping("/getContentsLikeNameAndFunc")
|
||||
public Result<MarketBotPagesVO> getContentsLikeNameAndFunc(@RequestParam("name") String keyword,
|
||||
@RequestParam("func") String func,
|
||||
public Result<MarketBotPagesVO> getContentsLikeNameAndFunc(@RequestParam(value = "name",required = false) String keyword,
|
||||
@RequestParam(value= "func", required = false) String func,
|
||||
@RequestParam(value = "page_no",defaultValue = "1",required = false) Integer pageIndex,
|
||||
@RequestParam(value = "page_size",defaultValue = "12",required = false) Integer pageSize) throws BotException{
|
||||
MarketBotPagesVO marketBotPagesVO = marketService.getContentsLikeNameAndFunc(keyword,func,pageIndex,pageSize);
|
||||
|
|
|
|||
|
|
@ -230,8 +230,15 @@ public class MarketService implements IMarketService {
|
|||
@Override
|
||||
public MarketBotPagesVO getContentsLikeNameAndFunc(String name, String fun, Integer pageNo, Integer pageSize) {
|
||||
LambdaQueryWrapper<MarketBot> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(StringUtils.isNotBlank(fun),MarketBot::getFirstFunc,fun);
|
||||
lambdaQueryWrapper.like(StringUtils.isNotBlank(name),MarketBot::getMarketName,name);
|
||||
if(StringUtils.isNotBlank(fun)){
|
||||
lambdaQueryWrapper.and(wrapper->{
|
||||
wrapper.eq(StringUtils.isNotBlank(fun),MarketBot::getFirstFunc,fun)
|
||||
.or().eq(StringUtils.isNotBlank(fun),MarketBot::getSecondFunc,fun);
|
||||
});
|
||||
}
|
||||
if(StringUtils.isNotBlank(name)){
|
||||
lambdaQueryWrapper.like(StringUtils.isNotBlank(name),MarketBot::getMarketName,name);
|
||||
}
|
||||
lambdaQueryWrapper.orderByDesc(MarketBot::getInstallNum);
|
||||
IPage<MarketBot> page = marketBotMapper.selectPage(new Page<MarketBot>(pageNo,pageSize),lambdaQueryWrapper);
|
||||
MarketBotPagesVO marketBotPagesVO = new MarketBotPagesVO();
|
||||
|
|
@ -241,4 +248,5 @@ public class MarketService implements IMarketService {
|
|||
marketBotPagesVO.setPageSize(pageSize);
|
||||
return marketBotPagesVO;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue