package cn.pluss.platform.mapper;

import cn.pluss.platform.entity.UserIntegral;
import cn.pluss.platform.entity.UserMakerQuota;
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;

/**
 * @author lyf
 */
public interface UserMakerQuotaMapper extends BaseMapper<UserMakerQuota> {
    BigDecimal sumQuota(@Param("userId") Long userId);
    @Update(value = "update tb_pluss_user_maker_quota set amount=amount+#{amount} where userId=#{userId}")
    Integer updateMakerFreeze(@Param("userId") Integer userId, @Param("amount") BigDecimal amount);

    @Select(value ="SELECT * FROM tb_pluss_user_maker_quota WHERE userId = #{userId}")
    UserMakerQuota selectByUserId(@Param("userId") Integer userId);
//    @Select(value ="SELECT * FROM tb_pluss_user_maker_quota WHERE userId = #{userId}")
//    UserMakerQuota selectByUserId(@Param("userId") Integer userId);

}
