package shop.alien.mapper.second;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import shop.alien.entity.second.SecondUserCredit;


/**
 * 二手商品映射器
 */
@Mapper
public interface SecondUserCreditMapper extends BaseMapper<SecondUserCredit> {

    @Select("update second_user_credit set user_points = user_points + #{points} " +
            "where user_id = #{userId} and delete_flag = 0 ")
    void updatePointsByUserId(@Param("userId") int userId, @Param("points") int points);

}