package com.zhiqiyun.open.mapper;

import com.zhiqiyun.open.enmus.AccountType;
import com.zhiqiyun.open.models.UserLoginAccount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Administrator
 * @date 2017-6-7
 */
@Mapper
public interface UserLoginAccountMapper {

    /**
     * 插入账号信息
     *
     * @param loginAccount
     */
    void insertOrUpdate(UserLoginAccount loginAccount);

    /**
     * 查询用户所有账户
     *
     * @param uid
     * @return
     */
    List<UserLoginAccount> findLoginAccounts(@Param("uid") Long uid);

    /**
     * 查询用户账号
     *
     * @param loginAccount
     * @param accountType
     * @return
     */
    UserLoginAccount findLoginAccount(@Param("loginAccount") String loginAccount, @Param("accountType") AccountType accountType);

    /**
     * 删除用户账号
     *
     * @param uid
     */
    void deleteByUid(@Param("uid") Long uid);
}
