package com.zcloud.service.hiddenDangerCheckStandard.impl;

import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomStatisticsMapper;
import com.zcloud.service.hiddenDangerCheckStandard.CustomStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 说明：清单统计记录
 * 作者：luoxiaobao
 * 时间：2021-01-27
 * 官网：www.zcloudchina.com
 */
@Service
@Transactional //开启事物
public class CustomStatisticsServiceImpl implements CustomStatisticsService {

	@Autowired
	private CustomStatisticsMapper customStatisticsMapper;

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

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

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

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

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

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

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

	/**定时器查询
	 * @param pd
	 * @throws Exception
	 */
	@Override
	public PageData findByCondition(PageData pd) throws Exception {
		return customStatisticsMapper.findByCondition(pd);
	}

	@Override
	public List<PageData> getCountList(PageData pd) throws Exception {
		return customStatisticsMapper.getCountList(pd);
	}

	@Override
	public PageData getTimeAstrict(PageData pd) throws Exception {
		return customStatisticsMapper.getTimeAstrict(pd);
	}


	/**人员应处理清单数
	 * @param pd
	 * @throws Exception
	 */
	public List<PageData> countStaByUser(PageData pd)throws Exception{
		return customStatisticsMapper.countStaByUser(pd);
	}

	/**人员应处理清单数
	 * @param pd
	 * @throws Exception
	 */
	public List<PageData> countSta(PageData pd)throws Exception{
		return customStatisticsMapper.countSta(pd);
	}

	/**检查情况列表
	 * @param pd
	 * @throws Exception
	 */
	public List<PageData> checkSituation(PageData pd)throws Exception{
		return customStatisticsMapper.checkSituation(pd);
	}

	/**人员应处理清单个数（节假日清单数算1）
	 * @param pd
	 * @throws Exception
	 */
	public List<PageData> countListStaByUser(PageData pd)throws Exception{
		return customStatisticsMapper.countListStaByUser(pd);
	}
	/**人员应处理清单数（各周期）
	 * @param pd
	 * @throws Exception
	 */
	public List<PageData> countByPeriodUser(PageData pd)throws Exception{
		return customStatisticsMapper.countByPeriodUser(pd);
	}

	public List<PageData> listAllForPlan(PageData pd)throws Exception{
		return customStatisticsMapper.listAllForPlan(pd);
	}
}

