package com.jkcredit.invoice.mapper.customer;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jkcredit.invoice.model.entity.customer.CustomerRec;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CustomerRecMapper extends BaseMapper<CustomerRec> {
    int deleteByPrimaryKey(Integer id);

    @Override
    int insert(CustomerRec record);
    int updateByCompany(CustomerRec customerRec);
    int insertSelective(CustomerRec record);

    CustomerRec selectByPrimaryKey(String id);
    CustomerRec selectByPrimaryKeyHasBase64(Integer id);
    List<CustomerRec> selectByCustomerName(String customerName);
    List<CustomerRec> selectByCustomerNameAll(String customerName);
    List<CustomerRec> selectByCustomerNameCpAll(@Param("customerRec") CustomerRec record);
    CustomerRec selectByCustomerNameAndCompany(CustomerRec record);
    CustomerRec selectByCustomerNameAndCompanyConcat(CustomerRec record);
    CustomerRec selectByCustomerNameAndCompanyReference(CustomerRec record);
    CustomerRec selectByCustomerNameAndCompanyReferenceAll(CustomerRec record);

    List<CustomerRec> selectByCompanyReference(String companyReference);

    List<CustomerRec> selectByCompanyName(String comapanyName);
    //根据客户名称和 企业编码查询唯一数据
    CustomerRec selectByCustomerNameAndCompanyNum(CustomerRec record);
    List<CustomerRec> selectByCompanyNum(CustomerRec record);
    int updateByPrimaryKeySelective(CustomerRec record);
    int updateByPrimaryKeySelectiveUpload(CustomerRec record);

    int updateByPrimaryKey(CustomerRec record);
    IPage<List<CustomerRec>> selectAllByPage(Page page, @Param("customerRec") CustomerRec customerRec);


    IPage<List<CustomerRec>> selectAllByPageWarning(Page page, @Param("customerRec") CustomerRec customerRec);


    List<CustomerRec> selectAllByPageExport( @Param("customerRec") CustomerRec customerRec);
}