package com.clx.performance.dao.loan;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.mapper.loan.OwnerLoanAccountMapper;
import com.clx.performance.model.loan.OwnerLoanAccount;
import com.clx.performance.param.pc.loan.carrier.PageOwnerLoanAccountParam;
import com.clx.performance.vo.pc.loan.carrier.CarrierOwnerLoanAccountVO;
import com.msl.common.dao.BaseDao;

import java.time.LocalDateTime;

/**
 * @author kavin
 * Date 2024-01-20
 * Time 13:31
 */
public interface OwnerLoanAccountDao extends BaseDao<OwnerLoanAccountMapper, OwnerLoanAccount, Integer> {

    Integer updateAccountCAS(OwnerLoanAccount account, LocalDateTime now, boolean flag);

    /**
     * 核心抵扣
     * @param account
     * @param now
     * @return
     */
    Integer childWriteOffOwnerLoanAccountCAS(OwnerLoanAccount account, LocalDateTime now);


    IPage<CarrierOwnerLoanAccountVO> pageByParam(PageOwnerLoanAccountParam param);

    /**
     * 解冻账户金额
     * @param account
     * @param now
     * @return
     */
    Integer thawOwnerLoanAccountCAS(OwnerLoanAccount account, LocalDateTime now);
}
