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

/**
 * 楼层活动文字记录 Mapper
 *
 * @author 系统管理员
 */
@Mapper
public interface ElderlyBuildFloorActivityTextMapper extends BaseMapperX<ElderlyBuildFloorActivityTextDO> {

    default PageResult<ElderlyBuildFloorActivityTextDO> selectPage(ElderlyBuildFloorActivityTextPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ElderlyBuildFloorActivityTextDO>()
                .likeIfPresent(ElderlyBuildFloorActivityTextDO::getElderName, reqVO.getElderName())
                .eqIfPresent(ElderlyBuildFloorActivityTextDO::getBuidId, reqVO.getBuidId())
                .eqIfPresent(ElderlyBuildFloorActivityTextDO::getFloorId, reqVO.getFloorId())
                .eqIfPresent(ElderlyBuildFloorActivityTextDO::getRecordMonth, reqVO.getRecordMonth())
                .betweenIfPresent(ElderlyBuildFloorActivityTextDO::getRecordMonth, reqVO.getRecordMonthRange())
                .eqIfPresent(ElderlyBuildFloorActivityTextDO::getTenantId, reqVO.getTenantId())
                .orderByDesc(ElderlyBuildFloorActivityTextDO::getId));
    }
}
