1.增加台桌会员id

This commit is contained in:
2024-08-21 09:49:24 +08:00
parent 2b7ca62abf
commit e04c3ee084
3 changed files with 22 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbShopTable;
import com.chaozhanggui.system.cashierservice.entity.vo.TbShopTableVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
@@ -23,4 +24,5 @@ public interface TbShopTableMapper {
int updateByPrimaryKey(TbShopTable record);
List<TbShopTable> selectByShopIdAndStatus(@Param("shopId") String shopId,@Param("areaId") String areaId,@Param("status") String status);
}
List<TbShopTableVO> selectTableInfo(@Param("shopId") String shopId, @Param("areaId") String areaId, @Param("status") String status);
}

View File

@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.dao.*;
import com.chaozhanggui.system.cashierservice.entity.*;
import com.chaozhanggui.system.cashierservice.entity.vo.TbShopTableVO;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.DateUtils;
@@ -53,8 +54,9 @@ public class ShopInfoService {
}
PageHelperUtil.startPage(page, pageSize);
List<TbShopTable> shopTables=tbShopTableMapper.selectByShopIdAndStatus(shopId,areaId,status);
PageInfo pageInfo=new PageInfo(shopTables);
// List<TbShopTable> shopTables=tbShopTableMapper.selectByShopIdAndStatus(shopId,areaId,status);
List<TbShopTableVO> tbShopTableVOList = tbShopTableMapper.selectTableInfo(shopId, areaId, status);
PageInfo pageInfo=new PageInfo(tbShopTableVOList);
return Result.success(CodeEnum.SUCCESS,pageInfo);
}

View File

@@ -228,4 +228,19 @@
</select>
<select id="selectTableInfo" resultType="com.chaozhanggui.system.cashierservice.entity.vo.TbShopTableVO">
select a.*, b.user_id from tb_shop_table a
left join tb_order_info b on a.qrcode=b.table_id and (b.`status`='unpaid' or b.`status`='paying') and b.user_id is not null
where a.shop_id=#{shopId}
<if test="areaId != null and areaId !=''">
and a.area_id = #{areaId}
</if>
<if test="status != null and status !=''">
and a.status = #{status}
</if>
order by a.`sort` asc
</select>
</mapper>