From 7e5de439d51ac44a72807a82ea0caa26e7440d99 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期二, 13 八月 2024 11:14:00 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java index b2f94b8..6942f7e 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java @@ -1,6 +1,7 @@ package com.ruoyi.other.controller; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.PageInfo; @@ -78,5 +79,31 @@ return R.ok(idNameMap); } + /** + * 获取最高抵扣、最低起步价,最高折扣的会员 + * @param type 1=最高抵扣、2=最低起步价,3=最高折扣 + * @return + */ + @PostMapping(value = "/getVipInfoByType") + public R<TVip> getVipInfoByType(@RequestParam Integer type){ + switch (type){ + case 1: + return R.ok(vipService.getOne(Wrappers.lambdaQuery(TVip.class) + .eq(TVip::getReveal,1) + .orderByDesc(TVip::getMaximumDeduction) + .last("LIMIT 1"))); + case 2: + return R.ok(vipService.getOne(Wrappers.lambdaQuery(TVip.class) + .eq(TVip::getReveal,1) + .orderByAsc(TVip::getMonthlyCard) + .last("LIMIT 1"))); + default: + return R.ok(vipService.getOne(Wrappers.lambdaQuery(TVip.class) + .eq(TVip::getReveal,1) + .orderByDesc(TVip::getMonthlyCardDiscount) + .last("LIMIT 1"))); + } + } + } -- Gitblit v1.7.1