diff --git a/src/main/kotlin/dao/AlbumDao.kt b/src/main/kotlin/dao/AlbumDao.kt index b92fe0d..532d0c3 100644 --- a/src/main/kotlin/dao/AlbumDao.kt +++ b/src/main/kotlin/dao/AlbumDao.kt @@ -5,11 +5,10 @@ package net.piedpiper.bremer.dao import net.piedpiper.bremer.entity.AlbumEntity +import net.piedpiper.bremer.entity.AudioEntity import net.piedpiper.bremer.entity.AudioPlayHistoryEntity -import org.apache.ibatis.annotations.Mapper -import org.apache.ibatis.annotations.Param -import org.apache.ibatis.annotations.ResultMap -import org.apache.ibatis.annotations.Select +import net.piedpiper.bremer.utils.DaoUtils +import org.apache.ibatis.annotations.* import org.springframework.stereotype.Repository @Repository("bremer.dao.AlbumDao") @@ -17,13 +16,19 @@ interface AlbumDao { @ResultMap("net.piedpiper.bremer.AlbumEntity") - @Select("""""") + """ + ) fun findAllByArtistIdInLimit( @Param("artistIds") artistIds: List, @Param("limit") limit: Int @@ -35,4 +40,15 @@ @Param("nameLike") nameLike: String, @Param("limit") limit: Int ): List + + @UpdateProvider(type = Sql::class, method = "updateOne") + fun updateOne(@Param("entity") entity: AlbumEntity) + + class Sql { + companion object { + @JvmStatic + fun updateOne(@Param("entity") entity: AlbumEntity): String = + DaoUtils.updateOne(entity) + } + } } \ No newline at end of file