package com.zcloud.service.bus.impl;

import java.util.List;

import com.zcloud.mapper.dsno2.notice.ServiceNoticeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.bus.ServiceNoticeService;


/**
 * 说明： 通知公告接口实现类
 * 作者：luoxiaobao
 * 官网：www.qdkjchina.com
 * @version
 */
@Service
@Transactional //开启事物
public class ServiceNoticeServiceImpl implements ServiceNoticeService{

	@Autowired
	private ServiceNoticeMapper noticeMapper;

	/**新增
	 * @param pd
	 * @throws Exception
	 */
	public void save(PageData pd)throws Exception{
		noticeMapper.save(pd);
	}

	/**删除
	 * @param pd
	 * @throws Exception
	 */
	public void delete(PageData pd)throws Exception{
		noticeMapper.delete(pd);
	}

	/**修改
	 * @param pd
	 * @throws Exception
	 */
	public void edit(PageData pd)throws Exception{
		noticeMapper.edit(pd);
	}

	/**列表
	 * @param page
	 * @throws Exception
	 */
	public List<PageData> list(Page page)throws Exception{
		return noticeMapper.datalistPage(page);
	}

	/**列表(全部)
	 * @param pd
	 * @throws Exception
	 */
	public List<PageData> listAll(PageData pd)throws Exception{
		return noticeMapper.listAll(pd);
	}
	public List<PageData> applistAll(PageData pd)throws Exception{
		return noticeMapper.applistAll(pd);
	}

	/**通过id获取数据
	 * @param pd
	 * @throws Exception
	 */
	public PageData findById(PageData pd)throws Exception{
		return noticeMapper.findById(pd);
	}
	public PageData listCountBYBasicinfoID(PageData pd)throws Exception{
		return noticeMapper.listCountBYBasicinfoID(pd);
	}

	/**批量删除
	 * @param ArrayDATA_IDS
	 * @throws Exception
	 */
	public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
		noticeMapper.deleteAll(ArrayDATA_IDS);
	}

	@Override
	public void saveNotAndCorp(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		noticeMapper.saveNotAndCorp(pd);
	}

	@Override
	public void deleteNotAndCorpByNotId(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		noticeMapper.delteNotAndCorpByNotId(pd);
	}

	@Override
	public List<PageData> getNotAndCorpByNotId(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		return noticeMapper.getNotAndCorpByNotId(pd);
	}

	@Override
	public List<PageData> getNotAndCorpByCorpId(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		return noticeMapper.getNotAndCorpByCorpId(pd);
	}

	@Override
	public List<PageData> getTypeCountByNotId(Page page) throws Exception {
		// TODO Auto-generated method stub
		return noticeMapper.getTypeCountByNotId(page);
	}

	@Override
	public void editCorpInfo(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		noticeMapper.editCorpInfo(pd);
	}

	@Override
	public List<PageData> findNoticeCorpInfoById(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		return noticeMapper.findNoticeCorpInfoById(pd);
	}
	/**
	 * 查看公告的阅读状态
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<PageData> getCorpReadType(Page page) throws Exception {
		// TODO Auto-generated method stub
		return noticeMapper.getCorpReadTypelistPage(page);
	}

	@Override
	public List<PageData> getCorpReadTypeAll(Page page) throws Exception {
		// TODO Auto-generated method stub
		return noticeMapper.getCorpReadTypeAlldatalistPage(page);
	}

}

