package com.muyu.fault.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.fault.common.FaultMessage;
import com.muyu.fault.mapper.FaultMessageMapper;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FaultMessageServiceImpl extends ServiceImpl<FaultMessageMapper, FaultMessage> implements FaultMessageService{

    @Override
    public List<FaultMessage> selectOne() {
        LambdaQueryWrapper<FaultMessage> queryWrapper = new LambdaQueryWrapper<>();
        //查询消息状态为1的未读数据
        queryWrapper.eq(FaultMessage::getFaultMessageState, 1);
        return this.list(queryWrapper);
    }

    @Override
    public List<FaultMessage> selectTwo() {
        LambdaQueryWrapper<FaultMessage> queryWrapper = new LambdaQueryWrapper<>();
        //查询消息状态为2的已读数据
        queryWrapper.eq(FaultMessage::getFaultMessageState, 2);
        return this.list(queryWrapper);
    }
}
