小程序主页接口

This commit is contained in:
张松
2025-03-07 17:00:32 +08:00
parent 9ff72f171e
commit d148aafb48
24 changed files with 879 additions and 99 deletions

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.czg.service.order.mapper.ShopOrderStatisticMapper">
</mapper>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.czg.service.order.mapper.ShopProdStatisticMapper">
</mapper>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.czg.service.order.mapper.ShopTableOrderStatisticMapper">
<update id="incrInfo">
update tb_shop_table_order_statistic set order_count=order_count + #{count}, order_amount=order_amount + #{count}
where shop_id = #{shopId} and table_id = #{tableId} and create_day=#{date}
</update>
<select id="selectSummary" resultType="com.czg.order.entity.ShopTableOrderStatistic">
SELECT
a.table_id as tableId, b.name as name, sum(a.order_count) as orderCount, sum(a.order_amount) as orderAmount
FROM
tb_shop_table_order_statistic as a
left join tb_shop_table as b on a.table_id = b.id
WHERE
a.shop_id = #{shopId}
<if test="startTime != null and startTime != ''">
AND a.create_day >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and a.create_day &lt;= #{endTime}
</if>
GROUP BY
a.table_id
order by a.id desc
</select>
</mapper>