package cn.com.ctop.common.module.service.impl;

import cn.com.ctop.common.module.entity.BindAccountLogin;
import cn.com.ctop.common.module.mapper.BindAccountLoginMapper;
import cn.com.ctop.common.module.service.IBindAccountLoginService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

/**
 * @Description: 账号绑定-登陆
 * @Author: jeecg-boot
 * @Date: 2019-07-31
 * @Version: V1.0
 */
@Slf4j
@Service
@Primary
public class BindAccountLoginServiceImpl extends ServiceImpl<BindAccountLoginMapper, BindAccountLogin> implements IBindAccountLoginService {
    @Override
    public BindAccountLogin selectByAccountId(String accountId) {
        QueryWrapper<BindAccountLogin> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("account_id", accountId).orderByDesc("id").last("limit 1");
        return this.getOne(queryWrapper);
    }
}
