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

@Mapper
public interface SpecialNursingPlanMapper extends BaseMapperX<ElderlySpecialNursingPlanDO> {

    default PageResult<ElderlySpecialNursingPlanDO> selectPage(SpecialNursingPlanPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ElderlySpecialNursingPlanDO>()
                .eqIfPresent(ElderlySpecialNursingPlanDO::getElderId, reqVO.getElderId())
                .likeIfPresent(ElderlySpecialNursingPlanDO::getElderName, reqVO.getElderName())
                .inIfPresent(ElderlySpecialNursingPlanDO::getTenantId, reqVO.getTenantIds())
                .orderByDesc(ElderlySpecialNursingPlanDO::getId));
    }
}

