package com.foreverwin.mesnac.listener.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.listener.mapper.SysUserMapper;
import com.foreverwin.mesnac.listener.model.SysUser;
import com.foreverwin.mesnac.listener.service.SysUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(rollbackFor = Exception.class)
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {
    @Override
    public SysUser selectOne(String userName)
    {
        LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SysUser::getUserName, userName);
        //----------------------------------------------------------------------------------------------------------------------------------
        return super.getOne(queryWrapper, false);
    }

    @Override
    public SysUser getById(String site, String engineerQa) {
        return baseMapper.getById(site,engineerQa);
    }
}