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


/**
 * 护理日志 Mapper
 *
 * @author 系统管理员
 */
@Mapper
public interface NursingLogMapper extends BaseMapperX<NursingLogDO> {

    default PageResult<NursingLogDO> selectPage(NursingLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<NursingLogDO>()
                .eqIfPresent(NursingLogDO::getElderId, reqVO.getElderId())
                .likeIfPresent(NursingLogDO::getElderName, reqVO.getElderName())
                .betweenIfPresent(NursingLogDO::getNursingDate, reqVO.getNursingDate())
                .eqIfPresent(NursingLogDO::getCount, reqVO.getCount())
                .likeIfPresent(NursingLogDO::getBedName, reqVO.getBedName())
                .eqIfPresent(NursingLogDO::getNursingGrade, reqVO.getNursingGrade())
                .eqIfPresent(NursingLogDO::getOrgType, reqVO.getOrgType())
                .betweenIfPresent(NursingLogDO::getNursingDate,reqVO.getNursingDate())
                .orderByDesc(NursingLogDO::getNursingDate));
    }

}