修改库存

This commit is contained in:
韩鹏辉
2024-06-25 09:58:21 +08:00
parent c1790a3198
commit 86bdcbe3c5
21 changed files with 406 additions and 26 deletions

View File

@@ -102,7 +102,7 @@
and uuid = #{uuid}
</if>
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbCashierCart">
<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,

View File

@@ -65,11 +65,24 @@
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAllByShop" resultType="com.chaozhanggui.system.cashierservice.entity.po.OrderPo">
select toi.created_at as createAt,toi.id,toi.order_no as orderNo,toi.order_amount as orderAmount,count(*) as
productNum,toi.order_type as orderType,
ifnull(TRIM(TRAILING ', ' FROM GROUP_CONCAT(tod.product_name ORDER BY tod.id SEPARATOR ', ')),'') AS productName,
toi.status from tb_order_info toi left join tb_order_detail tod on tod.order_id = toi.id
where toi.shop_id = #{shopId}
SELECT
toi.created_at AS createAt,
toi.id,
toi.order_no AS orderNo,
toi.order_amount AS orderAmount,
count(*) AS productNum,
toi.order_type AS orderType,
GROUP_CONCAT(tod.product_name) AS productName,
toi.STATUS,
toi.out_number AS outNumber,
toi.table_name AS tableName
FROM
tb_order_info toi
LEFT JOIN tb_order_detail tod ON tod.order_id = toi.id
WHERE
toi.shop_id = #{shopId}
<choose>
<when test="orderType == 'return'">
and toi.order_type = 'return' and toi.status in ('refund','closed')
@@ -87,7 +100,7 @@
<if test="orderNo != null and orderNo != ''">
and toi.order_no = #{orderNo}
</if>
group by toi.shop_id,toi.order_no
group by toi.id,toi.shop_id
order by toi.id desc
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
@@ -565,4 +578,17 @@ select * from tb_order_info where trade_day = #{day} and table_id = #{masterId}
GROUP BY
d.order_id
</select>
<select id="selectSkuByOrderId" resultType="com.chaozhanggui.system.cashierservice.entity.po.SkuInfoPo">
SELECT
d.product_name AS productName,
d.num,
d.product_sku_name AS productSkuName,
c.category_id AS categoryId
FROM
tb_order_detail d
LEFT JOIN tb_cashier_cart c ON d.order_id = c.order_id
AND d.product_sku_id = c.sku_id
where c.order_id=#{orderId}
</select>
</mapper>

View File

@@ -572,4 +572,8 @@
<select id="selectByCardNo" resultMap="BaseResultMap">
select * from tb_user_info where card_no=#{cardNo}
</select>
<select id="selectCountByPhone" resultType="int">
select count(0) from tb_user_info where telephone=#{phone,jdbcType=VARCHAR}
</select>
</mapper>