package com.zcloud.service.corp.impl;

import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.corp.CorpInfoMapper;
import com.zcloud.service.corp.CorpInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 说明：企业管理
 * 作者：luoxiaobao
 * 时间：2020-12-24
 * 官网：www.zcloudchina.com
 */
@Service
@Transactional //开启事物
public class CorpInfoServiceImpl implements CorpInfoService {

	@Autowired
	private CorpInfoMapper corpinfoMapper;

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

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

	/**修改
	 * @param pd
	 * @throws Exception
	 */
	public void edit(PageData pd)throws Exception{
		corpinfoMapper.edit(pd);
	}
	public void editSMSCOUNT(PageData pd)throws Exception{
		corpinfoMapper.editSMSCOUNT(pd);
	}
	public void editIsReceive(PageData pd)throws Exception{
		corpinfoMapper.editIsReceive(pd);
	}
	public void editISRemind(PageData pd)throws Exception{
		corpinfoMapper.editISRemind(pd);
	}

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

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

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

	/**通过id获取数据
	 * @param pd
	 * @throws Exception
	 */
	public PageData findNumById(PageData pd)throws Exception{
		return corpinfoMapper.findNumById(pd);
	}
	/**批量删除
	 * @param ArrayDATA_IDS
	 * @throws Exception
	 */
	public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
		corpinfoMapper.deleteAll(ArrayDATA_IDS);
	}

	public PageData findByName(PageData pd) {
		return corpinfoMapper.findByName(pd);
	}

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

	public PageData findByCode(PageData pd) {
		return corpinfoMapper.findByCode(pd);
	}

	public PageData eightWorkBI(PageData pd) throws Exception{
		return corpinfoMapper.eightWorkBI(pd);
	}
	@Override
	public void updateEnterpriseId(PageData corpPage) {
		corpinfoMapper.updateEnterpriseId(corpPage);
	}

}

