| | |
| | | <select id="listPlTotalOrderTotalGoodsRank" resultType="com.ruoyi.system.api.domain.vo.MgtMapBigTotalVo"> |
| | | SELECT |
| | | tog.goods_name mapKey, |
| | | IFNULL(SUM(tog.goods_receivable_money),0) mapValue |
| | | IFNULL(SUM( |
| | | CASE |
| | | WHEN toc.order_from IN (5, 6, 7) THEN toc.receivable_money |
| | | ELSE tog.goods_receivable_money |
| | | END |
| | | ), 0) AS mapValue |
| | | FROM t_order toc |
| | | INNER JOIN t_order_goods tog ON tog.order_id = toc.order_id |
| | | WHERE toc.del_flag = 0 AND order_status = 3 |
| | |
| | | WHEN 1 THEN "商城订单" |
| | | WHEN 2 THEN "秒杀订单" |
| | | WHEN 3 THEN "线下订单" |
| | | WHEN 4 then "抽奖订单" |
| | | END mapKey, |
| | | IFNULL(SUM(CASE WHEN pay_type = 1 THEN (CASE WHEN null = change_receivable_money or change_receivable_money = 0 THEN receivable_money ELSE change_receivable_money END) WHEN pay_type = 2 THEN (CASE WHEN null = change_receivable_money or change_receivable_money = 0 THEN receivable_money ELSE change_receivable_money END) + online_pay_money ELSE 0 END),0) mapValue |
| | | FROM t_order toc |
| | |
| | | SELECT |
| | | toc.order_no orderNo, |
| | | CASE toc.order_from |
| | | WHEN 1 THEN '小程序' |
| | | WHEN 2 THEN '秒杀活动' |
| | | WHEN 3 THEN '线下创建' |
| | | WHEN 4 THEN '抽奖' |
| | | WHEN 5 THEN '美团' |
| | | WHEN 6 THEN '抖音' |
| | | WHEN 7 THEN '快手' |
| | |
| | | toc.use_time verifyTime |
| | | FROM t_order toc |
| | | INNER JOIN t_order_goods tog ON tog.order_id = toc.order_id |
| | | WHERE toc.del_flag = 0 AND toc.order_from in (5,6,7) |
| | | |
| | | WHERE toc.del_flag = 0 |
| | | <if test="param.orderFrom == null or param.orderFrom == '' "> |
| | | and toc.order_from in (5,6,7) |
| | | </if> |
| | | <if test="null != param.orderFrom and param.orderFrom!='' "> |
| | | and toc.order_from = #{param.orderFrom} |
| | | </if> |
| | | <if test="param.shopId != null and param.shopId != ''"> |
| | | AND toc.shop_id = #{param.shopId} |
| | | </if> |
| | |
| | | <if test="param.keyword != null and param.keyword != ''"> |
| | | AND (toc.order_no LIKE CONCAT('%',#{param.keyword},'%') OR toc.activity_name LIKE CONCAT('%',#{param.keyword},'%') OR FIND_IN_SET(toc.user_id, #{param.userIds}) > 0) |
| | | </if> |
| | | <if test="param.useTimeBegin != null and param.useTimeBegin != ''"> |
| | | <if test="param.verifyStartTime != null and param.verifyStartTime != ''"> |
| | | AND Date(toc.use_time) >= #{param.verifyStartTime} |
| | | </if> |
| | | <if test="param.verifyEndTime != null and param.verifyEndTime != ''"> |