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

@Mapper
public interface ElderlyAssessPerceptionCommunicationMapper extends BaseMapperX<ElderlyAssessPerceptionCommunicationDO> {

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