package cn.iocoder.yudao.module.system.dal.mysql.biz;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.AssessmentsPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.RehabilitationAssessmentsDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 康复评估记录 Mapper
 *
 * @author 系统管理员
 */
@Mapper
public interface RehabilitationAssessmentsMapper extends BaseMapperX<RehabilitationAssessmentsDO> {

    default PageResult<RehabilitationAssessmentsDO> selectPage(AssessmentsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RehabilitationAssessmentsDO>()
                .eqIfPresent(RehabilitationAssessmentsDO::getElderId, reqVO.getElderId())
                .betweenIfPresent(RehabilitationAssessmentsDO::getAssessmentTime, reqVO.getAssessmentTime())
                .eqIfPresent(RehabilitationAssessmentsDO::getAssessmentTimes, reqVO.getAssessmentTimes())
                .eqIfPresent(RehabilitationAssessmentsDO::getTherapist, reqVO.getTherapist())
                .eqIfPresent(RehabilitationAssessmentsDO::getAdmissionCondition, reqVO.getAdmissionCondition())
                .eqIfPresent(RehabilitationAssessmentsDO::getDysfunction, reqVO.getDysfunction())
                .eqIfPresent(RehabilitationAssessmentsDO::getRehabilitationMethod, reqVO.getRehabilitationMethod())
                .eqIfPresent(RehabilitationAssessmentsDO::getRehabilitationPlan, reqVO.getRehabilitationPlan())
                .eqIfPresent(RehabilitationAssessmentsDO::getExpectedEffect, reqVO.getExpectedEffect())
                .eqIfPresent(RehabilitationAssessmentsDO::getTenantId,reqVO.getTenantId())
                .likeIfPresent(RehabilitationAssessmentsDO::getElderlyInfo,reqVO.getElderName())
                .orderByDesc(RehabilitationAssessmentsDO::getCreateTime));
    }

}