package com.zcloud.service.specialoperation.impl;

import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.specialoperation.PersonnelManagementMapper;
import com.zcloud.service.specialoperation.PersonnelManagementService;
import com.zcloud.util.Jurisdiction;
import com.zcloud.util.Tools;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 说明：特种作业人员管理
 * 作者：luoxiaobao
 * 时间：2022-06-16
 * 官网：www.zcloudchina.com
 */
@Service
@Transactional //开启事物
public class PersonnelManagementServiceImpl implements PersonnelManagementService{

	@Autowired
	private PersonnelManagementMapper personnelmanagementMapper;

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

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

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

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

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

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

	/**批量删除
	 * @param ArrayDATA_IDS
	 * @throws Exception
	 */
	public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
		personnelmanagementMapper.deleteAll(ArrayDATA_IDS);
	}
	/**
	 * 判断特种作业证书编号是否存在
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	public PageData findByCertificate(PageData pd) throws Exception {
		return personnelmanagementMapper.findByCertificate(pd);
	}

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

	public PageData findForLogin(PageData pd){
		return personnelmanagementMapper.findForLogin(pd);
	}

	@Override
	public PageData findByOutsourced(PageData pd) {
		return personnelmanagementMapper.findByOutsourced(pd);
	}

}

