用户列表增加余额筛选

This commit is contained in:
张松 2025-03-25 15:45:45 +08:00
parent 4a48e272c5
commit ae6b5fcbd1
5 changed files with 13 additions and 6 deletions

View File

@ -21,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal;
/** /**
* 店铺用户管理 * 店铺用户管理
@ -99,8 +100,8 @@ public class ShopUserController {
@SaStaffCheckPermission("yun_xu_guan_li_hui_yuan_xin_xi") @SaStaffCheckPermission("yun_xu_guan_li_hui_yuan_xin_xi")
@SaAdminCheckPermission(value = "shopUser:list", name = "店铺用户列表") @SaAdminCheckPermission(value = "shopUser:list", name = "店铺用户列表")
@GetMapping @GetMapping
public CzgResult<Page<ShopUserDTO>> list(String key, Integer isVip) { public CzgResult<Page<ShopUserDTO>> list(String key, Integer isVip, BigDecimal amount) {
return CzgResult.success(shopUserService.getPage(key, isVip)); return CzgResult.success(shopUserService.getPage(key, isVip, amount));
} }
/** /**

View File

@ -6,6 +6,8 @@ import com.czg.resp.CzgResult;
import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService; import com.mybatisflex.core.service.IService;
import java.math.BigDecimal;
/** /**
* 商户储值会员 服务层 * 商户储值会员 服务层
* *
@ -14,7 +16,7 @@ import com.mybatisflex.core.service.IService;
*/ */
public interface ShopUserService extends IService<ShopUser> { public interface ShopUserService extends IService<ShopUser> {
Page<ShopUserDTO> getPage(String key, Integer isVip); Page<ShopUserDTO> getPage(String key, Integer isVip, BigDecimal amount);
Boolean updateInfo(Long shopId, ShopUserEditDTO shopUserEditDTO); Boolean updateInfo(Long shopId, ShopUserEditDTO shopUserEditDTO);

View File

@ -21,7 +21,7 @@ import java.util.List;
*/ */
public interface ShopUserMapper extends BaseMapper<ShopUser> { public interface ShopUserMapper extends BaseMapper<ShopUser> {
List<ShopUserDTO> selectPageByKeyAndIsVip(@Param("shopId") Long shopId, @Param("isVip") Integer isVip, @Param("key") String key); List<ShopUserDTO> selectPageByKeyAndIsVip(@Param("shopId") Long shopId, @Param("isVip") Integer isVip, @Param("key") String key, @Param("amount") BigDecimal amount);
int incrAccount(@Param("shopId") long shopId, @Param("id") Long id, @Param("time") LocalDateTime time, @Param("money") BigDecimal money); int incrAccount(@Param("shopId") long shopId, @Param("id") Long id, @Param("time") LocalDateTime time, @Param("money") BigDecimal money);
int decrAccount(@Param("shopId") long shopId, @Param("id") Long id, @Param("time") LocalDateTime time, @Param("money") BigDecimal money); int decrAccount(@Param("shopId") long shopId, @Param("id") Long id, @Param("time") LocalDateTime time, @Param("money") BigDecimal money);

View File

@ -78,9 +78,9 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
} }
@Override @Override
public Page<ShopUserDTO> getPage(String key, Integer isVip) { public Page<ShopUserDTO> getPage(String key, Integer isVip, BigDecimal amount) {
PageHelper.startPage(PageUtil.buildPageHelp()); PageHelper.startPage(PageUtil.buildPageHelp());
return PageUtil.convert(new PageInfo<>(mapper.selectPageByKeyAndIsVip(StpKit.USER.getShopId(), isVip, key))); return PageUtil.convert(new PageInfo<>(mapper.selectPageByKeyAndIsVip(StpKit.USER.getShopId(), isVip, key, amount)));
} }
@Override @Override

View File

@ -73,6 +73,10 @@
<if test="key != null and key != ''"> <if test="key != null and key != ''">
and (a.nick_name like concat('%', #{key}, '%') or a.phone like concat('%', #{key}, '%')) and (a.nick_name like concat('%', #{key}, '%') or a.phone like concat('%', #{key}, '%'))
</if> </if>
<if test="amount != null">
and a.amount >= #{amount}
</if>
GROUP BY a.id GROUP BY a.id
order by a.create_time desc order by a.create_time desc
</select> </select>