1.库存预警不提示修复
This commit is contained in:
@@ -26,8 +26,8 @@ public interface TbShopOpenIdMapper {
|
|||||||
|
|
||||||
int updateByPrimaryKey(TbShopOpenId record);
|
int updateByPrimaryKey(TbShopOpenId record);
|
||||||
|
|
||||||
@Select("select * from tb_shop_open_id where open_id=#{openId}")
|
@Select("select * from tb_shop_open_id where open_id=#{openId} and shop_id=#{shopId}")
|
||||||
TbShopOpenId countByOpenId(@Param("openId") String openId);
|
TbShopOpenId countByOpenId(@Param("openId") String openId, @Param("shopId") Integer shopId);
|
||||||
|
|
||||||
@Select("select * from tb_shop_open_id where shop_id=#{shopId} and status=1")
|
@Select("select * from tb_shop_open_id where shop_id=#{shopId} and status=1")
|
||||||
List<TbShopOpenId> selectByShopId(@Param("shopId") Integer shopId);
|
List<TbShopOpenId> selectByShopId(@Param("shopId") Integer shopId);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public interface TbShopSongOrderMapper {
|
|||||||
" tb_shop_song_order AS a\n" +
|
" tb_shop_song_order AS a\n" +
|
||||||
" LEFT JOIN tb_shop_song AS b ON a.song_id = b.id\n" +
|
" LEFT JOIN tb_shop_song AS b ON a.song_id = b.id\n" +
|
||||||
" WHERE\n" +
|
" WHERE\n" +
|
||||||
" a.open_id = #{openId}\n" +
|
" a.open_id = #{openId} " +
|
||||||
" <if test=\"state!=null\">AND a.state = #{state}</if></script>")
|
" <if test=\"state!=null\">AND a.state = #{state}</if></script>")
|
||||||
List<Map<String, Object>> selectByUserId(@Param("openId") String openId, @Param("state") Integer state);
|
List<Map<String, Object>> selectByUserId(@Param("openId") String openId, @Param("state") Integer state);
|
||||||
|
|
||||||
@@ -55,4 +55,12 @@ public interface TbShopSongOrderMapper {
|
|||||||
"WHERE create_time < NOW() - INTERVAL 10 MINUTE AND state=-1;\n")
|
"WHERE create_time < NOW() - INTERVAL 10 MINUTE AND state=-1;\n")
|
||||||
int deleteExpireOrder();
|
int deleteExpireOrder();
|
||||||
|
|
||||||
|
@Select("SELECT\n" +
|
||||||
|
" b.img, b.name, b.origin_singer originSinger, b.price, a.from_name fromName, a.to_name toName, a.note\n" +
|
||||||
|
" FROM\n" +
|
||||||
|
" tb_shop_song_order AS a\n" +
|
||||||
|
" LEFT JOIN tb_shop_song AS b ON a.song_id = b.id\n" +
|
||||||
|
" WHERE\n" +
|
||||||
|
" a.open_id = #{openId} and a.state in (1, 2, 3)")
|
||||||
|
List<Map<String, Object>> selectActiveOrderByUserId(@Param("openId") String openId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,12 @@ public class TbShopSongServiceImpl implements TbShopSongService{
|
|||||||
@Override
|
@Override
|
||||||
public Object getRecord(String openId, Integer page, Integer size, Integer state, boolean isDesc) {
|
public Object getRecord(String openId, Integer page, Integer size, Integer state, boolean isDesc) {
|
||||||
PageHelper.startPage(page, size);
|
PageHelper.startPage(page, size);
|
||||||
List<Map<String, Object>> songOrders = shopSongOrderMapper.selectByUserId(openId, state);
|
List<Map<String, Object>> songOrders;
|
||||||
|
if (state == null) {
|
||||||
|
songOrders = shopSongOrderMapper.selectActiveOrderByUserId(openId);
|
||||||
|
}else {
|
||||||
|
songOrders = shopSongOrderMapper.selectByUserId(openId, state);
|
||||||
|
}
|
||||||
|
|
||||||
ArrayList<Map<String, Object>> infos = new ArrayList<>();
|
ArrayList<Map<String, Object>> infos = new ArrayList<>();
|
||||||
for (int i = 0; i < songOrders.size(); i++) {
|
for (int i = 0; i < songOrders.size(); i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user