Newer
Older
bremer / src / main / kotlin / dao / AlbumDao.kt
yhornisse on 2 Jul 2023 779 bytes add project
/*
 * Copyright (c) 2023. yo-saito. All Rights Reserved.
 */

package net.piedpiper.bremer.dao

import net.piedpiper.bremer.entity.AlbumEntity
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 org.springframework.stereotype.Repository

@Repository("bremer.dao.AlbumDao")
@Mapper
interface AlbumDao {

    @ResultMap("net.piedpiper.bremer.AlbumEntity")
    @Select("SELECT * FROM album WHERE name LIKE CONCAT('%', #{nameLike}, '%') LIMIT #{limit}")
    fun findAllByNameLikeLimit(
        @Param("nameLike") nameLike: String,
        @Param("limit") limit: Int
    ): List<AlbumEntity>
}