package com.github.wxiaoqi.security.admin.mapper;

import com.github.wxiaoqi.security.admin.dto.WalletListDTO;
import com.github.wxiaoqi.security.admin.entity.MyWallet;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 我的钱包
 * 
 * @author zjw
 * @email 18178966185@163.com
 * @date 2019-07-11 14:14:54
 */
public interface MyWalletMapper extends Mapper<MyWallet>  {

    void  updMyWater(MyWallet myWallet);

    List<WalletListDTO> selectByPhoneOrUserName(@Param("phone") String phone, @Param("username") String username);

    /**
     * 禁用或解除 状态
     * @param id
     * @param state
     */
    @Update("UPDATE `my_wallet` SET `is_frozen`=#{state} WHERE `id`=#{id}" )
    void forbiddenWalletById(@Param("id") Integer id,
                             @Param("state") Integer state);
}
