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.module.system.controller.admin.biz.vo.buildcleandisinfectrecord.ElderlyBuildCleanDisinfectRecordPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.buildcleandisinfectrecord.ElderlyBuildCleanDisinfectRecordRespVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.ElderlyBuildCleanDisinfectRecordDO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ElderlyBuildCleanDisinfectRecordMapper extends BaseMapperX<ElderlyBuildCleanDisinfectRecordDO> {

    List<ElderlyBuildCleanDisinfectRecordRespVO> selectPageWithBuildInfo(Page<ElderlyBuildCleanDisinfectRecordRespVO> page,
                                                                         @Param("reqVO") ElderlyBuildCleanDisinfectRecordPageReqVO reqVO);

    default PageResult<ElderlyBuildCleanDisinfectRecordRespVO> selectPageWithBuildInfo(ElderlyBuildCleanDisinfectRecordPageReqVO reqVO) {
        Page<ElderlyBuildCleanDisinfectRecordRespVO> page = new Page<>(reqVO.getPageNo(), reqVO.getPageSize());
        List<ElderlyBuildCleanDisinfectRecordRespVO> list = selectPageWithBuildInfo(page, reqVO);
        return new PageResult<>(list, page.getTotal());
    }
}

