liyong
3 天以前 d62a74c14a4002c0f401c94976fba8cc77cda6e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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));
    }
 
}