package cn.iocoder.yudao.module.system.dal.mysql.biz;

import java.util.*;

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


/**
 * 长者护理巡检 Mapper
 *
 * @author 系统管理员
 */
@Mapper
public interface NursingInspectionMapper extends BaseMapperX<NursingInspectionDO> {

    default PageResult<NursingInspectionDO> selectPage(NursingInspectionPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<NursingInspectionDO>()
                .eqIfPresent(NursingInspectionDO::getElderId, reqVO.getElderId())
                .likeIfPresent(NursingInspectionDO::getElderName, reqVO.getElderName())
                .likeIfPresent(NursingInspectionDO::getNurseItemName, reqVO.getNurseItemName())
                .eqIfPresent(NursingInspectionDO::getNurseItemImage, reqVO.getNurseItemImage())
                .betweenIfPresent(NursingInspectionDO::getInspectionTime, reqVO.getInspectionTime())
                .likeIfPresent(NursingInspectionDO::getInspectionName, reqVO.getInspectionName())
                .eqIfPresent(NursingInspectionDO::getContent, reqVO.getContent())
                .eqIfPresent(NursingInspectionDO::getImages, reqVO.getImages())
                .eqIfPresent(NursingInspectionDO::getOrgType, reqVO.getOrgType())
                .orderByDesc(NursingInspectionDO::getInspectionTime));
    }

}