打印机列表添加筛选条件

This commit is contained in:
张松 2025-03-07 14:15:31 +08:00
parent 7cad9078c5
commit e1d6fae806
1 changed files with 5 additions and 1 deletions

View File

@ -36,7 +36,7 @@ public class PrintMachineController {
*/
@SaAdminCheckPermission(value = "printer:list", name = "打印机列表获取")
@GetMapping
public CzgResult<Page<PrintMachine>> list(String name, String connectionType) {
public CzgResult<Page<PrintMachine>> list(String name, String connectionType, String subType) {
QueryWrapper queryWrapper = new QueryWrapper().eq(PrintMachine::getShopId, StpKit.USER.getShopId());
if (StrUtil.isNotBlank(name)) {
queryWrapper.like(PrintMachine::getName, name);
@ -45,6 +45,10 @@ public class PrintMachineController {
if (StrUtil.isNotBlank(connectionType)) {
queryWrapper.eq(PrintMachine::getConnectionType, connectionType);
}
if (StrUtil.isNotBlank(subType)) {
queryWrapper.eq(PrintMachine::getSubType, subType);
}
queryWrapper.orderBy(PrintMachine::getSort, true).orderBy(PrintMachine::getId, false);
return CzgResult.success(printMachineService.page(PageUtil.buildPage(), queryWrapper));
}