package cn.iocoder.yudao.module.infra.dal.mysql.file;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.infra.dal.dataobject.file.MultipartUploadSessionDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 分片上传会话 Mapper
 *
 * @author AI Assistant
 */
@Mapper
public interface MultipartUploadSessionMapper extends BaseMapperX<MultipartUploadSessionDO> {

    /**
     * 根据uploadId查询会话信息
     *
     * @param uploadId 上传会话ID
     * @return 会话信息
     */
    default MultipartUploadSessionDO selectByUploadId(String uploadId) {
        return selectOne(MultipartUploadSessionDO::getUploadId, uploadId);
    }

    /**
     * 根据uploadId删除会话信息
     *
     * @param uploadId 上传会话ID
     * @return 删除条数
     */
    default int deleteByUploadId(String uploadId) {
        return delete(MultipartUploadSessionDO::getUploadId, uploadId);
    }

} 