feiyu02
2025-08-14 f373bbf83d9d2a7e5f96118d7dcd658c9fea8bc8
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
package cn.flightfeather.supervision.domain.ds1.repository
 
import cn.flightfeather.supervision.domain.ds1.entity.Mediafile
import cn.flightfeather.supervision.domain.ds1.mapper.MediafileMapper
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
 
/**
 * 多媒体文件数据库操作
 * @date 2024/9/10
 * @author feiyu02
 */
@Repository
class MediaFileRep(private val mediaFileMapper: MediafileMapper, @Value("\${imgPath}") var imgPath: String,) {
 
    /**
     * 根据主键删除
     */
    fun deleteOne(guid: String?): Int {
        return mediaFileMapper.deleteByPrimaryKey(guid)
    }
 
    /**
     * 根据主键查询
     */
    fun findList(primaryKeyList: List<String>): List<Mediafile?> {
        return mediaFileMapper.selectByExample(Example(Mediafile::class.java).apply {
            createCriteria().andIn("guid", primaryKeyList)
        })
    }
 
    /**
     * 根据巡查记录和文件业务类型查询
     */
    fun findList(iGuid: String?, typeList: List<Int?>): List<Mediafile?> {
        return mediaFileMapper.selectByExample(Example(Mediafile::class.java).apply {
            createCriteria().andEqualTo("iguid", iGuid)
                .andIn("businesstypeid", typeList)
        })
    }
}