1.代客下单相关接口

This commit is contained in:
2024-08-09 16:07:00 +08:00
parent c300f61def
commit 86df7addd6
21 changed files with 576 additions and 59 deletions

View File

@@ -59,6 +59,16 @@
and uuid = #{uuid}
</if>
</select>
<select id="selectDetailByQrcode" resultType="com.chaozhanggui.system.cashierservice.entity.TbCashierCart">
select
<include refid="Base_Column_List"/>
from tb_cashier_cart where table_id = #{tableId} and product_id = #{productId} and shop_id = #{shopId} and
sku_id = #{skuId}
<if test="uuid != null">
and uuid = #{uuid}
</if>
</select>
<select id="selectByMaskerId" resultType="com.chaozhanggui.system.cashierservice.entity.TbCashierCart">
select *
from tb_cashier_cart where master_id = #{masterId} and shop_id = #{shopId} and status = #{status} and trade_day = #{day} order by id desc
@@ -92,8 +102,15 @@
delete from tb_cashier_cart
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByCartId">
delete from tb_cashier_cart where id = #{cartId} and master_id = #{masterId}
<delete id="deleteByCartIdOrTableId">
delete from tb_cashier_cart where id = #{cartId} and
<if test="masterId != null">
master_id = #{masterId}
</if>
<if test="qrcode != null">
table_id =#{qrcode}
</if>
</delete>
<delete id="deleteBymasterId">
delete from tb_cashier_cart where master_id = #{masterId} and shop_id = #{shopId}
@@ -103,22 +120,22 @@
</if>
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbCashierCart" useGeneratedKeys="true" keyProperty="id">
insert into tb_cashier_cart (id, master_id, order_id,
ref_order_id, total_amount, product_id,
cover_img, is_sku, sku_id,
name, sale_price, number,
total_number, refund_number, category_id,
status, type, merchant_id,
shop_id, created_at, updated_at, pack_fee,trade_day,is_pack,is_gift,uuid
insert into tb_cashier_cart (id, master_id, order_id,
ref_order_id, total_amount, product_id,
cover_img, is_sku, sku_id,
name, sale_price, number,
total_number, refund_number, category_id,
status, type, merchant_id,
shop_id, created_at, updated_at, pack_fee,trade_day,is_pack,is_gift,uuid, table_id
)
values (#{id,jdbcType=INTEGER}, #{masterId,jdbcType=VARCHAR}, #{orderId,jdbcType=VARCHAR},
#{refOrderId,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, #{productId,jdbcType=VARCHAR},
#{coverImg,jdbcType=VARCHAR}, #{isSku,jdbcType=TINYINT}, #{skuId,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{salePrice,jdbcType=DECIMAL}, #{number,jdbcType=REAL},
#{totalNumber,jdbcType=REAL}, #{refundNumber,jdbcType=REAL}, #{categoryId,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{merchantId,jdbcType=VARCHAR},
values (#{id,jdbcType=INTEGER}, #{masterId,jdbcType=VARCHAR}, #{orderId,jdbcType=VARCHAR},
#{refOrderId,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, #{productId,jdbcType=VARCHAR},
#{coverImg,jdbcType=VARCHAR}, #{isSku,jdbcType=TINYINT}, #{skuId,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{salePrice,jdbcType=DECIMAL}, #{number,jdbcType=REAL},
#{totalNumber,jdbcType=REAL}, #{refundNumber,jdbcType=REAL}, #{categoryId,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{merchantId,jdbcType=VARCHAR},
#{shopId,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{packFee,jdbcType=DECIMAL}
, #{tradeDay,jdbcType=VARCHAR}, #{isPack,jdbcType=VARCHAR}, #{isGift,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR}
, #{tradeDay,jdbcType=VARCHAR}, #{isPack,jdbcType=VARCHAR}, #{isGift,jdbcType=VARCHAR}, #{uuid,jdbcType=VARCHAR},#{tableId,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbCashierCart">
@@ -389,5 +406,16 @@
select * from tb_cashier_cart where master_id = #{masterId} and trade_day = #{day} and shop_id = #{shopId} and status = 'create'
</select>
<select id="selectActivateByQrcode"
resultType="com.chaozhanggui.system.cashierservice.entity.TbCashierCart">
select * from tb_cashier_cart where table_id = #{tableId} and shop_id = #{shopId} and status = 'create'
</select>
<select id="selectProductNumByQrcode"
resultType="com.chaozhanggui.system.cashierservice.entity.po.QueryCartPo">
select ifnull(count(*),0) as productNum,ifnull(sum(number),0)as productSum
from (select count(*),number
from tb_cashier_cart where table_id = #{qrcode} and shop_id = #{shopId} group by product_id ) a
</select>
</mapper>
</mapper>

View File

@@ -627,5 +627,9 @@ select * from tb_order_info where trade_day = #{day} and table_id = #{masterId}
</select>
<select id="selectActivateOrder" resultType="com.chaozhanggui.system.cashierservice.entity.TbOrderInfo">
SELECT * FROM `tb_order_info` where shop_id=#{shopId} and
table_id=#{tableId} and order_type != 'return' and `status` not in ('closed', 'refund', 'merge')
</select>
</mapper>

View File

@@ -17,13 +17,14 @@
<result column="view" jdbcType="VARCHAR" property="view" />
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
<result column="qrcode" jdbcType="VARCHAR" property="qrcode" />
</resultMap>
<sql id="Base_Column_List">
id, name, shop_id, max_capacity, sort, area_id, is_predate, predate_amount, status,
id, name, shop_id, max_capacity, sort, area_id, is_predate, predate_amount, status,
type, amount, perhour, view, created_at, updated_at
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
select
<include refid="Base_Column_List" />
from tb_shop_table
where id = #{id,jdbcType=INTEGER}
@@ -33,16 +34,16 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopTable">
insert into tb_shop_table (id, name, shop_id,
max_capacity, sort, area_id,
is_predate, predate_amount, status,
type, amount, perhour,
insert into tb_shop_table (id, name, shop_id,
max_capacity, sort, area_id,
is_predate, predate_amount, status,
type, amount, perhour,
view, created_at, updated_at
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{shopId,jdbcType=INTEGER},
#{maxCapacity,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER}, #{areaId,jdbcType=INTEGER},
#{isPredate,jdbcType=TINYINT}, #{predateAmount,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR},
#{type,jdbcType=TINYINT}, #{amount,jdbcType=DECIMAL}, #{perhour,jdbcType=DECIMAL},
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{shopId,jdbcType=INTEGER},
#{maxCapacity,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER}, #{areaId,jdbcType=INTEGER},
#{isPredate,jdbcType=TINYINT}, #{predateAmount,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR},
#{type,jdbcType=TINYINT}, #{amount,jdbcType=DECIMAL}, #{perhour,jdbcType=DECIMAL},
#{view,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}
)
</insert>
@@ -227,4 +228,4 @@
</select>
</mapper>
</mapper>