1.点歌记录店铺区分

This commit is contained in:
2024-07-19 13:46:27 +08:00
parent 66cacb668d
commit e52206e6d8
2 changed files with 3 additions and 3 deletions

View File

@@ -67,6 +67,6 @@ public interface TbShopSongOrderMapper {
@Select("SELECT a.song_name songName, a.id, b.img FROM `tb_shop_song_order` as a left join tb_shop_song as b on a.song_id=b.id where state=2 limit 1") @Select("SELECT a.song_name songName, a.id, b.img FROM `tb_shop_song_order` as a left join tb_shop_song as b on a.song_id=b.id where state=2 limit 1")
Map<String, Object> selectSinging(); Map<String, Object> selectSinging();
@Select("select id from tb_shop_song_order where state=1 or state=2 order by create_time asc") @Select("select id from tb_shop_song_order where (state=1 or state=2) and shop_id=#{id} order by create_time asc")
List<TbShopSongOrder> selectWaitAll(); List<TbShopSongOrder> selectWaitAll(@Param("id") Integer shopId);
} }

View File

@@ -79,7 +79,7 @@ public class TbShopSongServiceImpl implements TbShopSongService{
} }
LinkedHashMap<String, Integer> rank = new LinkedHashMap<>(); LinkedHashMap<String, Integer> rank = new LinkedHashMap<>();
List<TbShopSongOrder> tbShopSongOrders = shopSongOrderMapper.selectWaitAll(); List<TbShopSongOrder> tbShopSongOrders = shopSongOrderMapper.selectWaitAll(shopId);
for (int i = 0; i < tbShopSongOrders.size(); i++) { for (int i = 0; i < tbShopSongOrders.size(); i++) {
rank.put(tbShopSongOrders.get(i).getId().toString(), i); rank.put(tbShopSongOrders.get(i).getId().toString(), i);
} }