package com.usoft.fin.grpc.dal.mapper;

import com.usoft.fin.grpc.dal.entity.Credit;
import com.usoft.fin.grpc.dal.entity.vo.CreditVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CreditMapper {
    /**
     * deleteByPrimaryKey
     * 
     * @param id
     * @return int
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * insert
     * 
     * @param record
     * @return int
     */
    int insert(Credit record);

    /**
     * insertSelective
     * 
     * @param record
     * @return int
     */
    int insertSelective(Credit record);

    /**
     * selectByPrimaryKey
     * 
     * @param id
     * @return Credit
     */
    Credit selectByPrimaryKey(Integer id);

    /**
     * updateByPrimaryKeySelective
     * 
     * @param record
     * @return int
     */
    int updateByPrimaryKeySelective(Credit record);

    /**
     * updateByPrimaryKey
     * 
     * @param record
     * @return int
     */
    int updateByPrimaryKey(Credit record);

    /**
     * findByEnuuAndProductCode
     * @param enuu
     * @param productCode
     * @return
     */
    List<Credit> findByEnuuAndProductCode(@Param("enuu") Integer enuu, @Param("productCode") String productCode);

    /**
     * findByEnuuAndProductCode
     * @param enuu
     * @return
     */
    List<Credit> findByEnuu(@Param("enuu") Integer enuu);

    /**
     * 获取额度信息
     * @param enuu 企业uu号
     *
     * @return
     */
    List<CreditVO> findCreditVOByEnuu(@Param("enuu")Integer enuu);


    /**
     * updateByCodeSelective
     *
     * @param record
     * @return
     */
    int updateByCodeSelective(Credit record);

    /**
     * 根据code获取额度信息
     * @param code
     * @return
     */
    Credit findByCode(String code);


    /**
     * 根据额度申请编号查询额度信息
     * @param creditApplyCode 额度申请编号
     * @return
     */
    List<Credit> findByCreditApplyCode(@Param("creditApplyCode") String creditApplyCode);
}