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)
|
})
|
}
|
}
|