package com.nantian.cloud.jljc.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nantian.cloud.jljc.entity.RecordCertificateManager;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 备案管理-证书管理 Mapper 接口
 * @since 2020-09-03
 */
@Mapper
public interface RecordCertificateManagerMapper extends BaseMapper<RecordCertificateManager> {

    //根据能源管理人员id获取证书信息
    List<RecordCertificateManager> getCertificateByPersonId(@Param("id") Long id);

    //根据能源管理人员id获取证书信息
    IPage getCertificateByPage(@Param("page") Page page, @Param("id") Long id);

    //根据id删除证书管理信息
    boolean removeByCertificateId(RecordCertificateManager recordCertificateManager);

    //新增
    boolean addCertificate(RecordCertificateManager recordCertificateManager);

    //修改
    boolean updateCertificateById(RecordCertificateManager recordCertificateManager);

    //删除人员时删除相关证书
    boolean removeByPersonId(RecordCertificateManager certificateManager);
}
