From a17f15e196a89ab8a35fc8344384a6996c0864aa Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期一, 12 八月 2024 17:02:37 +0800
Subject: [PATCH] 电站详情完成

---
 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