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

@Mapper
public interface SpecialNursingPlanItemMapper extends BaseMapperX<ElderlySpecialNursingPlanItemDO> {

    default PageResult<ElderlySpecialNursingPlanItemDO> selectPage(SpecialNursingPlanItemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ElderlySpecialNursingPlanItemDO>()
                .eqIfPresent(ElderlySpecialNursingPlanItemDO::getSpecialNursingPlanId, reqVO.getSpecialNursingPlanId())
                .eqIfPresent(ElderlySpecialNursingPlanItemDO::getNurseItemId, reqVO.getNurseItemId())
                .likeIfPresent(ElderlySpecialNursingPlanItemDO::getNurseItemName, reqVO.getNurseItemName())
                .eqIfPresent(ElderlySpecialNursingPlanItemDO::getStatus, reqVO.getStatus())
                .inIfPresent(ElderlySpecialNursingPlanItemDO::getTenantId, reqVO.getTenantIds())
                .orderByDesc(ElderlySpecialNursingPlanItemDO::getId));
    }
}

