| | |
| | | IFNULL(SUM(CASE WHEN tog.goods_type = 1 THEN 1 ELSE 0 END),0) cycleTotal, |
| | | IFNULL(SUM(CASE WHEN tog.goods_type = 3 THEN 1 ELSE 0 END),0) experienceTotal, |
| | | IFNULL(SUM(CASE WHEN tog.goods_type = 2 THEN 1 ELSE 0 END),0) serviceTotal, |
| | | IFNULL(SUM(CASE WHEN tog.goods_type = 1 THEN tog.goods_total_money ELSE 0 END),0) cycleMoney, |
| | | IFNULL(SUM(CASE WHEN tog.goods_type = 3 THEN tog.goods_total_money ELSE 0 END),0) experienceMoney, |
| | | IFNULL(SUM(CASE WHEN tog.goods_type = 2 THEN tog.goods_total_money ELSE 0 END),0) serviceMoney |
| | | IFNULL(SUM(CASE WHEN tog.goods_type = 1 THEN tog.goods_receivable_money ELSE 0 END),0) cycleMoney, |
| | | IFNULL(SUM(CASE WHEN tog.goods_type = 3 THEN tog.goods_receivable_money ELSE 0 END),0) experienceMoney, |
| | | IFNULL(SUM(CASE WHEN tog.goods_type = 2 THEN tog.goods_receivable_money ELSE 0 END),0) serviceMoney |
| | | FROM t_order toc |
| | | INNER JOIN t_order_goods tog ON tog.order_id = toc.order_id |
| | | WHERE toc.del_flag = 0 |
| | | WHERE toc.del_flag = 0 AND order_status IN (2,3) |
| | | <if test="param.shopId != null and param.shopId != ''"> |
| | | AND toc.shop_id = #{param.shopId} |
| | | </if> |
| | |
| | | IFNULL(SUM(CASE WHEN order_from = 3 THEN 1 ELSE 0 END),0) offlineTotal, |
| | | IFNULL(SUM(CASE WHEN order_from = 2 THEN 1 ELSE 0 END),0) activityTotal, |
| | | IFNULL(SUM(order_money),0) orderMoney, |
| | | IFNULL(SUM(CASE WHEN order_from = 1 THEN order_money ELSE 0 END),0) onlineMoney, |
| | | IFNULL(SUM(CASE WHEN order_from = 3 THEN order_money ELSE 0 END),0) offlineMoney, |
| | | IFNULL(SUM(CASE WHEN order_from = 2 THEN order_money ELSE 0 END),0) activityMoney |
| | | FROM t_order WHERE del_flag = 0 |
| | | IFNULL(SUM(CASE WHEN order_from = 1 THEN change_receivable_money ELSE 0 END),0) onlineMoney, |
| | | IFNULL(SUM(CASE WHEN order_from = 3 THEN change_receivable_money ELSE 0 END),0) offlineMoney, |
| | | IFNULL(SUM(CASE WHEN order_from = 2 THEN change_receivable_money ELSE 0 END),0) activityMoney |
| | | FROM t_order WHERE del_flag = 0 AND order_status IN (2,3) |
| | | <if test="param.shopId != null and param.shopId != ''"> |
| | | AND shop_id = #{param.shopId} |
| | | </if> |
| | |
| | | SUM(tog.goods_receivable_money) AS mapValueSecond |
| | | FROM t_order toc |
| | | INNER JOIN t_order_goods tog ON toc.order_id = tog.order_id |
| | | WHERE toc.del_flag = 0 AND tog.del_flag = 0 AND tog.goods_type = #{param.goodsType} |
| | | WHERE toc.del_flag = 0 AND toc.order_status IN (2,3) AND tog.del_flag = 0 AND tog.goods_type = #{param.goodsType} |
| | | <if test="param.shopId != null and param.shopId != ''"> |
| | | AND shop_id = #{param.shopId} |
| | | </if> |
| | |
| | | SELECT |
| | | tog.goods_type mapKey, |
| | | COUNT(DISTINCT toc.order_id) AS mapValueFirst, |
| | | IFNULL(SUM(tog.goods_total_money),0) AS mapValueSecond |
| | | FROM |
| | | t_order toc |
| | | IFNULL(SUM(tog.goods_receivable_money),0) AS mapValueSecond |
| | | FROM t_order toc |
| | | INNER JOIN t_order_goods tog ON tog.order_id = toc.order_id |
| | | WHERE toc.del_flag = 0 |
| | | WHERE toc.del_flag = 0 AND toc.order_status IN (2,3) |
| | | <if test="param.shopId != null and param.shopId != ''"> |
| | | AND toc.shop_id = #{param.shopId} |
| | | </if> |
| | |
| | | <select id="listMerOrderTotalGoodsRank" resultType="com.ruoyi.system.api.domain.vo.MgtMapBigTotalVo"> |
| | | SELECT |
| | | tog.goods_name mapKey, |
| | | IFNULL(SUM(tog.goods_total_money),0) mapValue |
| | | IFNULL(SUM(tog.goods_receivable_money),0) mapValue |
| | | FROM t_order toc |
| | | INNER JOIN t_order_goods tog ON tog.order_id = toc.order_id |
| | | WHERE toc.del_flag = 0 |
| | | WHERE toc.del_flag = 0 AND toc.order_status IN (2,3) |
| | | <if test="param.goodsType != null and param.goodsType != ''"> |
| | | AND tog.goods_type = #{param.goodsType} |
| | | </if> |
| | | <if test="param.shopId != null and param.shopId != ''"> |
| | | AND toc.shop_id = #{param.shopId} |
| | | </if> |
| | |
| | | AND Date(toc.create_time) <= #{param.endDate} |
| | | </if> |
| | | GROUP BY tog.goods_name |
| | | ORDER BY SUM(tog.goods_total_money) DESC LIMIT 10 |
| | | ORDER BY mapValue DESC LIMIT 15 |
| | | </select> |
| | | |
| | | <select id="listMerOrderTotalOrderFrom" resultType="com.ruoyi.system.api.domain.vo.MgtMapBigTotalVo"> |
| | |
| | | END mapKey, |
| | | IFNULL(SUM(toc.order_money),0) mapValue |
| | | FROM t_order toc |
| | | WHERE toc.del_flag = 0 |
| | | WHERE toc.del_flag = 0 AND toc.order_status IN (2,3) |
| | | <if test="param.goodsType != null and param.goodsType != ''"> |
| | | AND tog.goods_type = #{param.goodsType} |
| | | </if> |
| | | <if test="param.shopId != null and param.shopId != ''"> |
| | | AND toc.shop_id = #{param.shopId} |
| | | </if> |