1.代客下单 会员支付实现

This commit is contained in:
2024-08-23 09:20:51 +08:00
parent c408e8e168
commit 9e26fad331
8 changed files with 137 additions and 25 deletions

View File

@@ -5,7 +5,9 @@ import cn.ysk.cashier.mybatis.entity.TbMShopUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.math.BigDecimal;
import java.util.Map;
/**
@@ -36,6 +38,8 @@ public interface TbMShopUserMapper extends BaseMapper<TbMShopUser> {
"</script>")
Map<String, Object> selectUserSummary(@Param("shopId") String shopId, @Param("isVip") Integer isVip);
@Update("update tb_shop_user set amount=amount-#{orderAmount}, consume_amount=consume_amount+#{orderAmount} where id=#{vipUserId} and amount >= 0")
long decrBalance(@Param("vipUserId") Integer vipUserId, @Param("orderAmount") BigDecimal orderAmount);
}