优化音乐库获取专辑时附带md5值

This commit is contained in:
Yutousama 2022-05-16 18:37:59 +08:00
parent b63d05a89c
commit a21a875261
3 changed files with 9 additions and 9 deletions

View File

@ -150,11 +150,11 @@ public class MusicToolsServiceImpl implements IMusicToolsService {
public List<String> getAllAlbum() {
public List<MusicData> getAllAlbum() {
return musicDataDao.selectAllAlbum();
}
public List<String> getAllArtist() {
public List<MusicData> getAllArtist() {
return musicDataDao.selectAllArtist();
}

View File

@ -34,8 +34,8 @@ public interface MusicDataDao {
void truncate();
List<MusicData> selectByRegexp(@Param("regexp")String regexp,@Param("isDelFile")boolean isDelFile);
List<String> selectAllAlbum();
List<String> selectAllArtist();
List<MusicData> selectAllAlbum();
List<MusicData> selectAllArtist();
List<MusicData> selectAlbum(@Param("album")String album,@Param("isDelFile")boolean isDelFile);
List<MusicData> selectArtist(@Param("artist")String artist,@Param("isDelFile")boolean isDelFile);

View File

@ -308,13 +308,13 @@
from music_data
where `file` REGEXP #{regexp,jdbcType=VARCHAR}
</select>
<select id="selectAllAlbum" resultType="java.lang.String">
SELECT album
FROM music_data
<select id="selectAllAlbum" resultType="com.yutou.nas.mybatis.model.MusicData">
SELECT album,`md5`
FROM music_data a
group by `album`;
</select>
<select id="selectAllArtist" resultType="java.lang.String">
SELECT artist
<select id="selectAllArtist" resultType="com.yutou.nas.mybatis.model.MusicData">
SELECT artist,`md5`
FROM music_data
group by `artist`;
</select>