package co.yixiang.yshop.module.system.dal.mysql.backuprecord;

import co.yixiang.yshop.framework.common.pojo.PageResult;
import co.yixiang.yshop.framework.mybatis.core.mapper.BaseMapperX;
import co.yixiang.yshop.framework.mybatis.core.query.LambdaQueryWrapperX;
import co.yixiang.yshop.module.system.controller.admin.backuprecord.vo.BackupPageReqVO;
import co.yixiang.yshop.module.system.dal.dataobject.backup.BackupRecordDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface BackupRecordMapper extends BaseMapperX<BackupRecordDO> {

    default PageResult<BackupRecordDO> selectPage(BackupPageReqVO pageVO) {
        return selectPage(pageVO, new LambdaQueryWrapperX<BackupRecordDO>()
                .orderByDesc(BackupRecordDO::getCreateTime));
    }

    void backup();

    void revertBackup();

}
