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

/**
 * 长者楼层活动记录 Mapper
 *
 * @author 系统管理员
 */
@Mapper
public interface ElderlyActivityRecordMapper extends BaseMapperX<ElderlyActivityRecordDO> {

    default PageResult<ElderlyActivityRecordDO> selectPage(ElderlyActivityRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ElderlyActivityRecordDO>()
                .betweenIfPresent(ElderlyActivityRecordDO::getRecordTime, reqVO.getRecordTime())
                .eqIfPresent(ElderlyActivityRecordDO::getType, reqVO.getType())
                .eqIfPresent(ElderlyActivityRecordDO::getTenantId, reqVO.getTenantId())
                .orderByDesc(ElderlyActivityRecordDO::getId));
    }
}
