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

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.evaluation.vo.EvaluationServiceQualityPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.evaluation.EvaluationServiceQualityDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 卫生服务质量评价 Mapper
 */
@Mapper
public interface EvaluationServiceQualityMapper extends BaseMapperX<EvaluationServiceQualityDO> {

    default PageResult<EvaluationServiceQualityDO> selectPage(EvaluationServiceQualityPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EvaluationServiceQualityDO>()
                .likeIfPresent(EvaluationServiceQualityDO::getCheckArea, reqVO.getCheckArea())
                .likeIfPresent(EvaluationServiceQualityDO::getCheckPerson, reqVO.getCheckPerson())
                .betweenIfPresent(EvaluationServiceQualityDO::getCheckDate, reqVO.getCheckDate())
                .inIfPresent(EvaluationServiceQualityDO::getTenantId, reqVO.getTenantIds())
                .orderByDesc(EvaluationServiceQualityDO::getCheckDate)
                .orderByDesc(EvaluationServiceQualityDO::getId));
    }
}

