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

import com.usoft.fin.grpc.dal.entity.RepayPlan;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

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

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

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

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

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

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

    /**
     * 根据提款编号查询还款计划列表
     * @param drawApplyCode 提款申请编号
     * @return
     */
    List<RepayPlan> findByDrawCode(String drawApplyCode);

    /**
     * 插入还款计划列表
     * @param repayPlans
     * @return
     */
    int insertItems(List<RepayPlan> repayPlans);

    /**
     * insertAllSelective
     *
     * @param repayPlanInfos
     * @return
     */
    int insertAllSelective(Collection<RepayPlan> repayPlanInfos);

    /**
     * deleteAllByRepayCode
     *
     * @param repayCode
     * @return
     */
    int deleteAllByRepayCode(@Param("repayCode") String repayCode);

    /**
     * findByRepayCode
     * @param repayCode
     * @return
     */
    List<RepayPlan> findByRepayCode(@Param("repayCode") String repayCode);
}