package com.sqx.modules.sys.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sqx.modules.sys.entity.SysUserMoney;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface SysUserMoneyDao extends BaseMapper<SysUserMoney> {

    void updateSysMoney(@Param("type") Integer type, @Param("userId")Long userId, @Param("money") Double money);


    @Update("update sys_user_money set money=money+#{money} where user_id=#{userId}")
    Boolean incrMoney(@Param("money") String money, @Param("userId") Long userId);


    @Update("update sys_user_money set money=money-#{money} where user_id=#{userId}")
    Boolean decrMoney(@Param("money") String money, @Param("userId") Long userId);
}

