| | |
| | | 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; |
| | |
| | | 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"))); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |