package com.xunmei.system.service.impl;

import com.xunmei.system.domain.Logininfor;
import com.xunmei.system.mapper.LogininforMapper;
import com.xunmei.system.service.ILogininforService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.xunmei.common.core.web.domain.AjaxResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import static com.xunmei.common.core.web.domain.AjaxResult.success;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * <p>
 * 系统访问记录 服务实现类
 * </p>
 *
 * @author gaoxiong
 * @since 2023-08-04
 */
@Service
public class LogininforServiceImpl extends ServiceImpl<LogininforMapper, Logininfor> implements ILogininforService {

    @Override
    public AjaxResult findListByPage(Page<Logininfor> page,Logininfor logininfor){
    QueryWrapper<Logininfor> where = new QueryWrapper<>(logininfor);
        return success(baseMapper.selectPage(page,where));
    }

    @Override
    public AjaxResult add(Logininfor logininfor){
        return success(baseMapper.insert(logininfor));
    }

    @Override
    public AjaxResult delete(Long id){
        return success(baseMapper.deleteById(id));
    }

    @Override
    public AjaxResult updateData(Logininfor logininfor){
        return success(baseMapper.updateById(logininfor));
    }

    @Override
    public AjaxResult findById(Long id){
        return success(baseMapper.selectById(id));
    }
}
