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.RecordsPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.MedicalRecordsDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 医疗记录主 Mapper
 *
 * @author 系统管理员
 */
@Mapper
public interface MedicalRecordsMapper extends BaseMapperX<MedicalRecordsDO> {

    default PageResult<MedicalRecordsDO> selectPage(RecordsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MedicalRecordsDO>()
                .eqIfPresent(MedicalRecordsDO::getElderId, reqVO.getElderId())
                .betweenIfPresent(MedicalRecordsDO::getDiscoveryTime, reqVO.getDiscoveryTime())
                .eqIfPresent(MedicalRecordsDO::getDiscoverer, reqVO.getDiscoverer())
                .eqIfPresent(MedicalRecordsDO::getConditionDesc, reqVO.getConditionDesc())
                .eqIfPresent(MedicalRecordsDO::getHandlingNote, reqVO.getHandlingNote())
                .eqIfPresent(MedicalRecordsDO::getTenantId, reqVO.getTenantId())
                .likeIfPresent(MedicalRecordsDO::getElderName, reqVO.getElderName())
                .orderByDesc(MedicalRecordsDO::getCreateTime));
    }

}