Newer
Older
bremer / src / main / kotlin / dao / ArtistDao.kt
yhornisse on 2 Jul 2023 774 bytes add project
  1. /*
  2. * Copyright (c) 2023. yo-saito. All Rights Reserved.
  3. */
  4.  
  5. package net.piedpiper.bremer.dao
  6.  
  7. import net.piedpiper.bremer.entity.AlbumEntity
  8. import net.piedpiper.bremer.entity.ArtistEntity
  9. import org.apache.ibatis.annotations.Mapper
  10. import org.apache.ibatis.annotations.Param
  11. import org.apache.ibatis.annotations.ResultMap
  12. import org.apache.ibatis.annotations.Select
  13. import org.springframework.stereotype.Repository
  14.  
  15. @Repository("bremer.dao.ArtistDao")
  16. @Mapper
  17. interface ArtistDao {
  18.  
  19. @ResultMap("net.piedpiper.bremer.ArtistEntity")
  20. @Select("SELECT * FROM artist WHERE name LIKE CONCAT('%', #{nameLike}, '%') LIMIT #{limit}")
  21. fun findAllByNameLikeLimit(
  22. @Param("nameLike") nameLike: String,
  23. @Param("limit") limit: Int
  24. ): List<ArtistEntity>
  25. }