package com.jojubanking.boot.module.system.dal.mysql.refundapply;

import java.util.*;

import com.jojubanking.boot.framework.common.pojo.PageResult;
import com.jojubanking.boot.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.jojubanking.boot.framework.mybatis.core.mapper.BaseMapperX;
import com.jojubanking.boot.module.system.dal.dataobject.refundapply.RefundApplyDO;
import org.apache.ibatis.annotations.Mapper;
import com.jojubanking.boot.module.system.controller.admin.refundapply.vo.*;

/**
 * 就诊卡退费申请 Mapper
 *
 * @author admin
 */
@Mapper
public interface RefundApplyMapper extends BaseMapperX<RefundApplyDO> {

    default PageResult<RefundApplyDO> selectPage(RefundApplyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RefundApplyDO>()
                .likeIfPresent(RefundApplyDO::getRefname, reqVO.getRefname())
                .eqIfPresent(RefundApplyDO::getRefidcard, reqVO.getRefidcard())
                .eqIfPresent(RefundApplyDO::getRefbankcard, reqVO.getRefbankcard())
                .eqIfPresent(RefundApplyDO::getRefbanktype, reqVO.getRefbanktype())
                .eqIfPresent(RefundApplyDO::getReftel, reqVO.getReftel())
                .eqIfPresent(RefundApplyDO::getZidcard, reqVO.getZidcard())
                .eqIfPresent(RefundApplyDO::getZidcardimg, reqVO.getZidcardimg())
                .eqIfPresent(RefundApplyDO::getFidcard, reqVO.getFidcard())
                .eqIfPresent(RefundApplyDO::getFidcardimg, reqVO.getFidcardimg())
                .eqIfPresent(RefundApplyDO::getZbankcard, reqVO.getZbankcard())
                .eqIfPresent(RefundApplyDO::getZbankcardimg, reqVO.getZbankcardimg())
                .eqIfPresent(RefundApplyDO::getChildidcard, reqVO.getChildidcard())
                .eqIfPresent(RefundApplyDO::getChildidcardimg, reqVO.getChildidcardimg())
                .betweenIfPresent(RefundApplyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RefundApplyDO::getId));
    }

    default List<RefundApplyDO> selectList(RefundApplyExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<RefundApplyDO>()
                .likeIfPresent(RefundApplyDO::getRefname, reqVO.getRefname())
                .eqIfPresent(RefundApplyDO::getRefidcard, reqVO.getRefidcard())
                .eqIfPresent(RefundApplyDO::getRefbankcard, reqVO.getRefbankcard())
                .eqIfPresent(RefundApplyDO::getRefbanktype, reqVO.getRefbanktype())
                .eqIfPresent(RefundApplyDO::getReftel, reqVO.getReftel())
                .eqIfPresent(RefundApplyDO::getZidcard, reqVO.getZidcard())
                .eqIfPresent(RefundApplyDO::getZidcardimg, reqVO.getZidcardimg())
                .eqIfPresent(RefundApplyDO::getFidcard, reqVO.getFidcard())
                .eqIfPresent(RefundApplyDO::getFidcardimg, reqVO.getFidcardimg())
                .eqIfPresent(RefundApplyDO::getZbankcard, reqVO.getZbankcard())
                .eqIfPresent(RefundApplyDO::getZbankcardimg, reqVO.getZbankcardimg())
                .eqIfPresent(RefundApplyDO::getChildidcard, reqVO.getChildidcard())
                .eqIfPresent(RefundApplyDO::getChildidcardimg, reqVO.getChildidcardimg())
                .betweenIfPresent(RefundApplyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RefundApplyDO::getId));
    }

}
