feiyu02
2024-09-25 0516cba27e632f20efac2752787f38f0c87baafa
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/MediaFileRep.kt
@@ -1,12 +1,10 @@
package cn.flightfeather.supervision.domain.ds1.repository
import cn.flightfeather.supervision.common.utils.Constant
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
import java.io.File
/**
 * 多媒体文件数据库操作
@@ -16,13 +14,29 @@
@Repository
class MediaFileRep(private val mediaFileMapper: MediafileMapper, @Value("\${imgPath}") var imgPath: String,) {
    /**
     * 根据主键删除
     */
    fun deleteOne(guid: String?): Int {
        return mediaFileMapper.deleteByPrimaryKey(guid)
    }
    fun findList(idList: List<String>): List<Mediafile?> {
    /**
     * 根据主键查询
     */
    fun findList(primaryKeyList: List<String>): List<Mediafile?> {
        return mediaFileMapper.selectByExample(Example(Mediafile::class.java).apply {
            createCriteria().andIn("guid", idList)
            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)
        })
    }
}