菜品分类接口修改

This commit is contained in:
zjf committed 2025-01-17 14:55:45 +08:00
1 parent 38de9915e3
commit 6089c0251e
1 file changed
+3 -1
@@ -139,8 +139,10 @@ public class CanteenCategoryController {
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/getAllSimple")
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_view')")
public R getAllSimple(@RequestParam(value = "categoryType", required = false) String categoryType) {
public R getAllSimple(@RequestParam(value = "categoryType", required = false) String categoryType,
@RequestParam(value = "name", required = false) String name) {
LambdaQueryWrapper<CanteenCategoryEntity> wrapper = Wrappers.lambdaQuery();
wrapper.like(StringUtils.isNotBlank(name), CanteenCategoryEntity::getName, name);
wrapper.orderByAsc(CanteenCategoryEntity::getSort);
wrapper.apply(StringUtils.isNotEmpty(categoryType), "FIND_IN_SET({0}, your_column_name)", categoryType);
List<CanteenCategoryEntity> list = canteenCategoryService.listScope(wrapper);