package cn.iocoder.yudao.module.system.dal.mysql.storage;
|
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import cn.iocoder.yudao.module.system.dal.dataobject.storage.SystemStorageAttachmentDO;
|
import org.apache.ibatis.annotations.Mapper;
|
|
import java.util.Collection;
|
import java.util.List;
|
|
/**
|
* 文件关联表 Mapper
|
*
|
* @author 芋道源码
|
*/
|
@Mapper
|
public interface SystemStorageAttachmentMapper extends BaseMapperX<SystemStorageAttachmentDO> {
|
|
default List<SystemStorageAttachmentDO> selectListByRecordTypeAndRecordId(String recordType, Long recordId) {
|
return selectList(new LambdaQueryWrapperX<SystemStorageAttachmentDO>()
|
.eq(SystemStorageAttachmentDO::getRecordType, recordType)
|
.eq(SystemStorageAttachmentDO::getRecordId, recordId));
|
}
|
|
default List<SystemStorageAttachmentDO> selectListByApplicationAndRecordTypeAndRecordId(
|
String application, String recordType, Long recordId) {
|
return selectList(new LambdaQueryWrapperX<SystemStorageAttachmentDO>()
|
.eqIfPresent(SystemStorageAttachmentDO::getApplication, application)
|
.eq(SystemStorageAttachmentDO::getRecordType, recordType)
|
.eq(SystemStorageAttachmentDO::getRecordId, recordId));
|
}
|
|
default void deleteByApplicationAndRecordTypeAndRecordId(
|
String application, String recordType, Long recordId) {
|
delete(new LambdaQueryWrapperX<SystemStorageAttachmentDO>()
|
.eqIfPresent(SystemStorageAttachmentDO::getApplication, application)
|
.eq(SystemStorageAttachmentDO::getRecordType, recordType)
|
.eq(SystemStorageAttachmentDO::getRecordId, recordId));
|
}
|
|
default void deleteByRecordTypeAndRecordId(String recordType, Long recordId) {
|
delete(new LambdaQueryWrapperX<SystemStorageAttachmentDO>()
|
.eq(SystemStorageAttachmentDO::getRecordType, recordType)
|
.eq(SystemStorageAttachmentDO::getRecordId, recordId));
|
}
|
|
default List<SystemStorageAttachmentDO> selectListByApplicationAndRecordTypeAndRecordIds(
|
String application, String recordType, Collection<Long> recordIds) {
|
return selectList(new LambdaQueryWrapperX<SystemStorageAttachmentDO>()
|
.eqIfPresent(SystemStorageAttachmentDO::getApplication, application)
|
.eq(SystemStorageAttachmentDO::getRecordType, recordType)
|
.in(SystemStorageAttachmentDO::getRecordId, recordIds));
|
}
|
|
default void deleteByApplicationAndRecordTypeAndRecordIds(
|
String application, String recordType, Collection<Long> recordIds) {
|
delete(new LambdaQueryWrapperX<SystemStorageAttachmentDO>()
|
.eqIfPresent(SystemStorageAttachmentDO::getApplication, application)
|
.eq(SystemStorageAttachmentDO::getRecordType, recordType)
|
.in(SystemStorageAttachmentDO::getRecordId, recordIds));
|
}
|
|
}
|