package com.zcloud.service.hiddenApi.impl;

import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.hiddenApi.HiddenSchemeApiMapper;
import com.zcloud.service.hiddenApi.HiddenSchemeApiService;
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-15
 * 官网：www.zcloudchina.com
 */
@Service
@Transactional //开启事物
public class HiddenSchemeApiServiceImpl implements HiddenSchemeApiService {

	@Autowired
	private HiddenSchemeApiMapper hiddenSchemeApiMapper;

	/**新增
	 * @param pd
	 * @throws Exception
	 */
	public int save(PageData pd)throws Exception{
		return hiddenSchemeApiMapper.save(pd);
	}

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

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

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

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

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

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

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

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

}

