统计数据归档查询、商品数据分类缓存、已知问题修复
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
<foreach item="day" collection="days" open="(" separator="," close=")">
|
||||
#{day}
|
||||
</foreach>
|
||||
group by t1.prod_id
|
||||
group by t1.prod_id,t2.name
|
||||
order by sum(t1.sale_count) desc
|
||||
</select>
|
||||
<select id="getSaleSummaryCount" resultType="com.czg.order.vo.SaleSummaryCountVo">
|
||||
select
|
||||
@@ -146,10 +147,12 @@
|
||||
t1.product_id,
|
||||
t1.product_name,
|
||||
sum(t1.num) as number,
|
||||
sum(t1.pay_amount) as amount
|
||||
sum(t1.pay_amount) as amount,
|
||||
sum(t1.return_num) AS refundCount,
|
||||
sum(t1.return_amount) AS refundAmount
|
||||
from tb_order_detail t1
|
||||
where t1.shop_id = #{shopId}
|
||||
and t1.status = 'done'
|
||||
and t1.status in ('part-refund','refund','done')
|
||||
<if test="beginDate != null and beginDate != ''">
|
||||
and t1.create_time >= str_to_date(#{beginDate}, '%Y-%m-%d %H:%i:%s')
|
||||
</if>
|
||||
|
||||
@@ -28,9 +28,10 @@
|
||||
</select>
|
||||
<select id="findSummaryList" resultType="com.czg.order.vo.TableSummaryInfoVo">
|
||||
select
|
||||
t1.table_code,
|
||||
t1.table_id,
|
||||
ifnull(t3.name,'N/A') as area_name,
|
||||
ifnull(t2.name,'N/A') as table_name,
|
||||
t1.table_name as table_name,
|
||||
t1.area_name as area_name,
|
||||
sum(t1.order_count) as order_count,
|
||||
sum(t1.order_amount) as order_amount,
|
||||
ifnull(sum(t1.refund_count),0) as refund_count,
|
||||
@@ -45,12 +46,13 @@
|
||||
<if test="endDate != null and endDate != ''">
|
||||
and t1.create_day <= str_to_date(#{endDate}, '%Y-%m-%d')
|
||||
</if>
|
||||
group by t1.table_id
|
||||
order by sum(t1.order_count) desc,max(t1.id) desc
|
||||
group by t1.table_code
|
||||
order by sum(t1.order_count) desc,sum(t1.order_amount) desc
|
||||
</select>
|
||||
<select id="findSummaryList2" resultType="com.czg.order.vo.TableSummaryInfoVo">
|
||||
SELECT
|
||||
t1.table_code,
|
||||
t2.id as table_id,
|
||||
ifnull(t2.NAME,t1.table_code) AS table_name,
|
||||
ifnull(t3.NAME,'未知') AS area_name,
|
||||
count( t1.id ) AS order_count,
|
||||
@@ -80,8 +82,8 @@
|
||||
SELECT
|
||||
t.product_name,
|
||||
date_format(t.create_time, '%Y-%m-%d') as create_date,
|
||||
if(t.table_name = '11111111','银收客',t.table_name) as table_name,
|
||||
concat(if(t.table_name = '11111111','银收客',t.table_name),'-',date_format(t.create_time, '%Y-%m-%d')) as tableConcatDate,
|
||||
if(t.table_name = 'NONE','银收客',t.table_name) as table_name,
|
||||
concat(if(t.table_name = 'NONE','银收客',t.table_name),'-',date_format(t.create_time, '%Y-%m-%d')) as tableConcatDate,
|
||||
t.category_name,
|
||||
t.unit_name,
|
||||
group_concat(distinct t.sku_name SEPARATOR ';') as sku_name,
|
||||
@@ -95,7 +97,7 @@
|
||||
SELECT
|
||||
t1.product_id,
|
||||
t2.table_code,
|
||||
IF(t2.table_code is null or t2.table_code = '' or t6.NAME is null, '11111111', t6.NAME) AS table_name,
|
||||
IF(t2.table_code is null or t2.table_code = '' or t6.NAME is null, 'NONE', t6.NAME) AS table_name,
|
||||
t1.create_time,
|
||||
t4.NAME AS category_name,
|
||||
t3.name as product_name,
|
||||
|
||||
Reference in New Issue
Block a user