diff --git a/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java b/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java index 5c40bec..9fad179 100644 --- a/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java +++ b/src/main/java/com/yutou/nas/Services/impl/MusicToolsServiceImpl.java @@ -150,11 +150,11 @@ public class MusicToolsServiceImpl implements IMusicToolsService { - public List getAllAlbum() { + public List getAllAlbum() { return musicDataDao.selectAllAlbum(); } - public List getAllArtist() { + public List getAllArtist() { return musicDataDao.selectAllArtist(); } diff --git a/src/main/java/com/yutou/nas/mybatis/dao/MusicDataDao.java b/src/main/java/com/yutou/nas/mybatis/dao/MusicDataDao.java index 8256054..8399efe 100644 --- a/src/main/java/com/yutou/nas/mybatis/dao/MusicDataDao.java +++ b/src/main/java/com/yutou/nas/mybatis/dao/MusicDataDao.java @@ -34,8 +34,8 @@ public interface MusicDataDao { void truncate(); List selectByRegexp(@Param("regexp")String regexp,@Param("isDelFile")boolean isDelFile); - List selectAllAlbum(); - List selectAllArtist(); + List selectAllAlbum(); + List selectAllArtist(); List selectAlbum(@Param("album")String album,@Param("isDelFile")boolean isDelFile); List selectArtist(@Param("artist")String artist,@Param("isDelFile")boolean isDelFile); diff --git a/src/main/resources/mappers/MusicDataDao.xml b/src/main/resources/mappers/MusicDataDao.xml index 624ffe4..91f031f 100644 --- a/src/main/resources/mappers/MusicDataDao.xml +++ b/src/main/resources/mappers/MusicDataDao.xml @@ -308,13 +308,13 @@ from music_data where `file` REGEXP #{regexp,jdbcType=VARCHAR} - + SELECT album,`md5` + FROM music_data a group by `album`; - + SELECT artist,`md5` FROM music_data group by `artist`;