package cn.cecep.talroad.service.impl;

import cn.cecep.talroad.domain.BEnterpriseIrNotifierproNotice;
import cn.cecep.talroad.mapper.BEnterpriseIrNotifierproNoticeMapper;
import cn.cecep.talroad.service.IBEnterpriseIrNotifierproNoticeService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import java.util.List;
import java.util.Map;




/**
 * 通知提醒-通知公告Service业务层处理
 *
 * @author szhpt
 * @date 2023-03-14*/
@Service
public class BEnterpriseIrNotifierproNoticeServiceImpl extends ServiceImpl<BEnterpriseIrNotifierproNoticeMapper,BEnterpriseIrNotifierproNotice> implements IBEnterpriseIrNotifierproNoticeService
{
    @Autowired
    private BEnterpriseIrNotifierproNoticeMapper bEnterpriseIrNotifierproNoticeMapper;

    /**
     * 查询通知提醒-通知公告列表
     *
     * @param bEnterpriseIrNotifierproNotice 通知提醒-通知公告
     * @return 通知提醒-通知公告
     */
    @Override
    public List<BEnterpriseIrNotifierproNotice> selectBEnterpriseIrNotifierproNoticeList(BEnterpriseIrNotifierproNotice bEnterpriseIrNotifierproNotice)
    {
        bEnterpriseIrNotifierproNotice.setDelFlag("1");
        return bEnterpriseIrNotifierproNoticeMapper.selectBEnterpriseIrNotifierproNoticeList(bEnterpriseIrNotifierproNotice);
    }

    @Override
    public List<Map<String, String>> selectOptions(String factoryId) {
        return bEnterpriseIrNotifierproNoticeMapper.selectOptions(factoryId);
    }

    @Override
    public Integer countByFactoryId(String factoryId){
        Assert.notNull(factoryId, "企业ID不存在");
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("factory_id", factoryId);
        return bEnterpriseIrNotifierproNoticeMapper.selectCount(wrapper);
    }
}
