package com.bootdo.data.dao;

import com.bootdo.common.utils.Query;
import com.bootdo.data.domain.CaInfo;
import com.bootdo.data.domain.CaInfoExample;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface CaInfoMapper {
    long countByExample(CaInfoExample example);

    int deleteByExample(CaInfoExample example);

    /**
     * delete by primary key
     *
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(CaInfo record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(CaInfo record);

    List<CaInfo> selectByExample(CaInfoExample example);

    /**
     * select by primary key
     *
     * @param id primary key
     * @return object by primary key
     */
    CaInfo selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") CaInfo record, @Param("example") CaInfoExample example);

    int updateByExample(@Param("record") CaInfo record, @Param("example") CaInfoExample example);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(CaInfo record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(CaInfo record);

    /**
     * 分页条件查询 证书列表数据
     *
     * @param query
     * @return
     */
    List<CaInfo> queryPage(Query query);

    /**
     * 分页条件查询 证书列表数据 条数
     *
     * @param query
     * @return
     */
    int queryPageCount(Query query);

    /**
     * 根据公司名称和 统一社会信用代码 获取最新的 企业ca
     *
     * @param companyName
     * @param uniformSocialCreditCode
     * @return
     */
    CaInfo getByCompanyNameAndUniformSocialCreditCode(@Param("companyName") String companyName,
                                                      @Param("uniformSocialCreditCode") String uniformSocialCreditCode);
}