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

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

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

}