package com.dgtly.notice.service.impl;

import java.util.List;

import com.dgtly.common.annotation.DataScope;
import com.dgtly.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dgtly.notice.mapper.NoticeSupplyMapper;
import com.dgtly.notice.domain.NoticeSupply;
import com.dgtly.notice.service.INoticeSupplyService;
import com.dgtly.common.core.text.Convert;

/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author dgtly
 * @date 2020-02-13
 */
@Service
public class NoticeSupplyServiceImpl implements INoticeSupplyService 
{
    @Autowired
    private NoticeSupplyMapper noticeSupplyMapper;

    /**
     * 查询【请填写功能名称】
     * 
     * @param id 【请填写功能名称】ID
     * @return 【请填写功能名称】
     */
    @Override
    public NoticeSupply selectNoticeSupplyById(Long id)
    {
        return noticeSupplyMapper.selectNoticeSupplyById(id);
    }

    /**
     * 查询【请填写功能名称】列表
     * 
     * @param noticeSupply 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    @DataScope(deptAlias = "d")
    public List<NoticeSupply> selectNoticeSupplyList(NoticeSupply noticeSupply)
    {
        return noticeSupplyMapper.selectNoticeSupplyList(noticeSupply);
    }

    /**
     * 新增【请填写功能名称】
     * 
     * @param noticeSupply 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertNoticeSupply(NoticeSupply noticeSupply)
    {
        noticeSupply.setCreateTime(DateUtils.getNowDate());
        return noticeSupplyMapper.insertNoticeSupply(noticeSupply);
    }

    /**
     * 修改【请填写功能名称】
     * 
     * @param noticeSupply 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateNoticeSupply(NoticeSupply noticeSupply)
    {
        noticeSupply.setUpdateTime(DateUtils.getNowDate());
        return noticeSupplyMapper.updateNoticeSupply(noticeSupply);
    }

    /**
     * 删除【请填写功能名称】对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteNoticeSupplyByIds(String ids)
    {
        return noticeSupplyMapper.deleteNoticeSupplyByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除【请填写功能名称】信息
     * 
     * @param id 【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteNoticeSupplyById(Long id)
    {
        return noticeSupplyMapper.deleteNoticeSupplyById(id);
    }

    @Override
    public List<NoticeSupply> getSupplyInfoTenList() {
        return noticeSupplyMapper.getSupplyInfoTenList();
    }


    @Override
    public List<NoticeSupply> getSupplyInfoAllList(NoticeSupply noticeSupply) {
        return noticeSupplyMapper.getSupplyInfoAllList(noticeSupply);
    }
}
