fix(订单中心):首页统计优化
This commit is contained in:
+5
-15
@@ -139,11 +139,9 @@ public interface DashboardMapper {
|
||||
"<script>",
|
||||
"SELECT COALESCE(SUM(os.platform_amount), 0)",
|
||||
"FROM order_statistics os",
|
||||
"JOIN orders o ON os.order_id = o.id",
|
||||
"JOIN qrcodes q ON o.code_id = q.code_id",
|
||||
"WHERE 1=1",
|
||||
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
||||
" AND q.is_test = 0",
|
||||
" AND os.qrcode_id IN (SELECT code_id FROM qrcodes WHERE is_test = 0)",
|
||||
"</if>",
|
||||
"<if test='p.tourismId != null'>",
|
||||
" AND os.tourism_id = #{p.tourismId}",
|
||||
@@ -168,11 +166,9 @@ public interface DashboardMapper {
|
||||
"<script>",
|
||||
"SELECT COALESCE(SUM(os.tourism_amount), 0)",
|
||||
"FROM order_statistics os",
|
||||
"JOIN orders o ON os.order_id = o.id",
|
||||
"JOIN qrcodes q ON o.code_id = q.code_id",
|
||||
"WHERE 1=1",
|
||||
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
||||
" AND q.is_test = 0",
|
||||
" AND os.qrcode_id IN (SELECT code_id FROM qrcodes WHERE is_test = 0)",
|
||||
"</if>",
|
||||
"<if test='p.tourismId != null'>",
|
||||
" AND os.tourism_id = #{p.tourismId}",
|
||||
@@ -294,11 +290,9 @@ public interface DashboardMapper {
|
||||
" '平台分账' as type,",
|
||||
" COALESCE(SUM(os.platform_amount), 0) as value",
|
||||
"FROM order_statistics os",
|
||||
"JOIN orders o ON os.order_id = o.id",
|
||||
"JOIN qrcodes q ON o.code_id = q.code_id",
|
||||
"WHERE 1=1",
|
||||
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
||||
" AND q.is_test = 0",
|
||||
" AND os.qrcode_id IN (SELECT code_id FROM qrcodes WHERE is_test = 0)",
|
||||
"</if>",
|
||||
"<if test='p.tourismId != null'>",
|
||||
" AND os.tourism_id = #{p.tourismId}",
|
||||
@@ -320,11 +314,9 @@ public interface DashboardMapper {
|
||||
" '景区分账' as type,",
|
||||
" COALESCE(SUM(os.tourism_amount), 0) as value",
|
||||
"FROM order_statistics os",
|
||||
"JOIN orders o ON os.order_id = o.id",
|
||||
"JOIN qrcodes q ON o.code_id = q.code_id",
|
||||
"WHERE 1=1",
|
||||
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
||||
" AND q.is_test = 0",
|
||||
" AND os.qrcode_id IN (SELECT code_id FROM qrcodes WHERE is_test = 0)",
|
||||
"</if>",
|
||||
"<if test='p.tourismId != null'>",
|
||||
" AND os.tourism_id = #{p.tourismId}",
|
||||
@@ -346,11 +338,9 @@ public interface DashboardMapper {
|
||||
" '退款金额' as type,",
|
||||
" COALESCE(SUM(os.refund_amount), 0) as value",
|
||||
"FROM order_statistics os",
|
||||
"JOIN orders o ON os.order_id = o.id",
|
||||
"JOIN qrcodes q ON o.code_id = q.code_id",
|
||||
"WHERE 1=1",
|
||||
"<if test='p.includeTestQrcodes == null or p.includeTestQrcodes == false'>",
|
||||
" AND q.is_test = 0",
|
||||
" AND os.qrcode_id IN (SELECT code_id FROM qrcodes WHERE is_test = 0)",
|
||||
"</if>",
|
||||
"<if test='p.tourismId != null'>",
|
||||
" AND os.tourism_id = #{p.tourismId}",
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ public class TourismServiceImpl extends SuperServiceImpl<TourismMapper, Tourism>
|
||||
}
|
||||
|
||||
if (radius == null || radius <= 0) {
|
||||
radius = 10.0; // 默认10公里
|
||||
radius = 1000.0; // 默认10公里
|
||||
}
|
||||
|
||||
if (limit == null || limit <= 0) {
|
||||
|
||||
Reference in New Issue
Block a user