package com.doumee.dao.business;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.doumee.dao.business.model.Shop;
|
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Select;
|
|
import java.math.BigDecimal;
|
|
/**
|
* @author 江蹄蹄
|
* @date 2023/03/21 15:48
|
*/
|
public interface ShopMapper extends BaseMapper<Shop> {
|
|
|
/**
|
* 添加积分
|
* @param memberId
|
* @param integral
|
*/
|
@Select(" update shop set INTEGRAL = ifNull( INTEGRAL,0) + #{integral} , TOTAL_INTEGRAL = ifNull(TOTAL_INTEGRAL,0) + #{titleIntegral} , EDIT_DATE = now() where id = #{shopId} ")
|
void addIntegral(@Param("shopId") Integer shopId , @Param("integral") BigDecimal integral , @Param("titleIntegral")BigDecimal titleIntegral);
|
|
/**
|
* 减少积分
|
* @param memberId
|
* @param integral
|
*/
|
@Select(" update shop set INTEGRAL = ifNull( INTEGRAL,0) - #{integral} , EDIT_DATE = now() where id = #{shopId} ")
|
void subtractIntegral(@Param("shopId") Integer shopId , @Param("integral")BigDecimal integral);
|
|
|
|
}
|