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

@Mapper
public interface ElderlyAssessAnxietyMapper extends BaseMapperX<ElderlyAssessAnxietyDO> {

    default PageResult<ElderlyAssessAnxietyDO> selectPage(ElderlyAssessAnxietyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ElderlyAssessAnxietyDO>()
                .likeIfPresent(ElderlyAssessAnxietyDO::getElderName, reqVO.getElderName())
                .likeIfPresent(ElderlyAssessAnxietyDO::getAssessor, reqVO.getAssessor())
                .betweenIfPresent(ElderlyAssessAnxietyDO::getAssessDate, reqVO.getAssessDate())
                .inIfPresent(ElderlyAssessAnxietyDO::getTenantId, reqVO.getTenantIds())
                .orderByDesc(ElderlyAssessAnxietyDO::getAssessDate, ElderlyAssessAnxietyDO::getId));
    }
}
