package com.jwipc.message.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.message.entity.MessageCenter;
import com.jwipc.message.mapper.MessageCenterMapper;
import com.jwipc.message.model.po.AddresseeUserPO;
import com.jwipc.message.model.po.MessageCenterPO;
import com.jwipc.message.model.query.AddresseeUserQuery;
import com.jwipc.message.model.query.MessageCenterQuery;
import com.jwipc.message.service.IMessageCenterService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 信息中心主表 服务实现类
 * </p>
 *
 * @author shenyang.ou
 * @since 2024-07-03
 */
@Service
public class MessageCenterServiceImpl extends ServiceImpl<MessageCenterMapper, MessageCenter> implements IMessageCenterService {

    @Override
    public List<AddresseeUserPO> selectSupplierUser(AddresseeUserQuery query) {
        return baseMapper.selectSupplierUser(query);
    }

    @Override
    public List<AddresseeUserPO> selectUser(AddresseeUserQuery query) {
        return baseMapper.selectUser(query);
    }

    @Override
    public List<MessageCenterPO> findPageByQuery(Page<MessageCenter> dbPage, MessageCenterQuery query) {
        if (dbPage==null){
            return baseMapper.findPageByQuery(query);
        }
        return baseMapper.findPageByQuery(dbPage,query);
    }

    @Override
    public MessageCenterPO getDataById(Long id) {
        return baseMapper.getDataById(id);
    }
}
