主页统计
This commit is contained in:
@ -90,4 +90,6 @@ public interface ZcBaseUserMapper
|
|||||||
public int deleteZcBaseUserStoreByUserId(Long id);
|
public int deleteZcBaseUserStoreByUserId(Long id);
|
||||||
|
|
||||||
public int deleteZcBaseUserStoreById(Long id);
|
public int deleteZcBaseUserStoreById(Long id);
|
||||||
|
|
||||||
|
public int selectUserCount();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,4 +64,6 @@ public interface IZcBaseUserService
|
|||||||
public int deleteZcBaseUserById(Long id);
|
public int deleteZcBaseUserById(Long id);
|
||||||
|
|
||||||
public int deleteZcBaseUserStoreById(Long id);
|
public int deleteZcBaseUserStoreById(Long id);
|
||||||
|
|
||||||
|
public int selectUserCount();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -175,4 +175,10 @@ public class ZcBaseUserServiceImpl implements IZcBaseUserService
|
|||||||
public int deleteZcBaseUserStoreById(Long id) {
|
public int deleteZcBaseUserStoreById(Long id) {
|
||||||
return zcBaseUserMapper.deleteZcBaseUserStoreById(id);
|
return zcBaseUserMapper.deleteZcBaseUserStoreById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int selectUserCount(){
|
||||||
|
return zcBaseUserMapper.selectUserCount();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -173,14 +173,19 @@ public class ZcOrderMainController extends BaseController
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult statisticsHomeOrder(String type) {
|
public AjaxResult statisticsHomeOrder(String type) {
|
||||||
List<StatisticsHomeOrder> list = new ArrayList<StatisticsHomeOrder>();
|
List<StatisticsHomeOrder> list = new ArrayList<StatisticsHomeOrder>();
|
||||||
|
StatisticsHomeOrder query = new StatisticsHomeOrder();
|
||||||
|
// 运营者账号,只能查询所属商户数据
|
||||||
|
if(UserConstants.USER_TYPE_02.equals(getSysUser().getUserType())){
|
||||||
|
query.setOperatorId(getSysUser().getGroupId());
|
||||||
|
}
|
||||||
if(type.equals("hour")) {
|
if(type.equals("hour")) {
|
||||||
list = zcOrderMainService.statisticsOrderByHour();
|
list = zcOrderMainService.statisticsOrderByHour(query);
|
||||||
}else if(type.equals("week")) {
|
}else if(type.equals("week")) {
|
||||||
list = zcOrderMainService.statisticsOrderByWeek();
|
list = zcOrderMainService.statisticsOrderByWeek(query);
|
||||||
}else if(type.equals("month")) {
|
}else if(type.equals("month")) {
|
||||||
list = zcOrderMainService.statisticsOrderByMonth();
|
list = zcOrderMainService.statisticsOrderByMonth(query);
|
||||||
}else if(type.equals("year")) {
|
}else if(type.equals("year")) {
|
||||||
list = zcOrderMainService.statisticsOrderByYear();
|
list = zcOrderMainService.statisticsOrderByYear(query);
|
||||||
}
|
}
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,10 @@ package com.ruoyi.orders.dto;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
public class StatisticsHomeOrder {
|
public class StatisticsHomeOrder {
|
||||||
|
|
||||||
|
private Long operatorId;
|
||||||
|
|
||||||
|
|
||||||
private String keyType;
|
private String keyType;
|
||||||
private String name;
|
private String name;
|
||||||
private int totalCount;
|
private int totalCount;
|
||||||
@ -75,4 +79,12 @@ public class StatisticsHomeOrder {
|
|||||||
public void setRentbatteryAmount(BigDecimal rentbatteryAmount) {
|
public void setRentbatteryAmount(BigDecimal rentbatteryAmount) {
|
||||||
this.rentbatteryAmount = rentbatteryAmount;
|
this.rentbatteryAmount = rentbatteryAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getOperatorId() {
|
||||||
|
return operatorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOperatorId(Long operatorId) {
|
||||||
|
this.operatorId = operatorId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,15 +101,18 @@ public interface ZcOrderMainMapper
|
|||||||
* @param limit 前N条记录
|
* @param limit 前N条记录
|
||||||
* @return 门店订单统计列表
|
* @return 门店订单统计列表
|
||||||
*/
|
*/
|
||||||
List<StoreOrderStats> selectTopStoreOrderStats(@Param("limit") int limit);
|
List<StoreOrderStats> selectTopStoreOrderStats(@Param("operatorId") Long operatorId, @Param("limit") int limit);
|
||||||
|
|
||||||
int selectOrderCountByCarRuleId(@Param("carRuleId")Long carRuleId);
|
int selectOrderCountByCarRuleId(@Param("carRuleId")Long carRuleId);
|
||||||
|
|
||||||
List<StatisticsHomeOrder> statisticsOrderByHour();
|
List<StatisticsHomeOrder> statisticsOrderByHour(StatisticsHomeOrder query);
|
||||||
|
|
||||||
List<StatisticsHomeOrder> statisticsOrderByWeek();
|
List<StatisticsHomeOrder> statisticsOrderByWeek(StatisticsHomeOrder query);
|
||||||
|
|
||||||
List<StatisticsHomeOrder> statisticsOrderByMonth();
|
List<StatisticsHomeOrder> statisticsOrderByMonth(StatisticsHomeOrder query);
|
||||||
|
|
||||||
|
List<StatisticsHomeOrder> statisticsOrderByYear(StatisticsHomeOrder query);
|
||||||
|
|
||||||
|
StatisticsHomeOrder statisticsOrderSum(StatisticsHomeOrder query);
|
||||||
|
|
||||||
List<StatisticsHomeOrder> statisticsOrderByYear();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,16 +71,18 @@ public interface IZcOrderMainService
|
|||||||
* @param limit 前N条记录
|
* @param limit 前N条记录
|
||||||
* @return 门店订单统计列表
|
* @return 门店订单统计列表
|
||||||
*/
|
*/
|
||||||
List<StoreOrderStats> getTopStoreOrderStats(int limit);
|
List<StoreOrderStats> getTopStoreOrderStats(Long operatorId, int limit);
|
||||||
|
|
||||||
public int selectOrderCountByCarRuleId(Long carRuleId);
|
public int selectOrderCountByCarRuleId(Long carRuleId);
|
||||||
|
|
||||||
public List<StatisticsHomeOrder> statisticsOrderByHour();
|
public List<StatisticsHomeOrder> statisticsOrderByHour(StatisticsHomeOrder query);
|
||||||
|
|
||||||
public List<StatisticsHomeOrder> statisticsOrderByWeek();
|
public List<StatisticsHomeOrder> statisticsOrderByWeek(StatisticsHomeOrder query);
|
||||||
|
|
||||||
public List<StatisticsHomeOrder> statisticsOrderByMonth();
|
public List<StatisticsHomeOrder> statisticsOrderByMonth(StatisticsHomeOrder query);
|
||||||
|
|
||||||
public List<StatisticsHomeOrder> statisticsOrderByYear();
|
public List<StatisticsHomeOrder> statisticsOrderByYear(StatisticsHomeOrder query);
|
||||||
|
|
||||||
|
public StatisticsHomeOrder statisticsOrderSum(StatisticsHomeOrder query);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -339,8 +339,8 @@ public class ZcOrderMainServiceImpl implements IZcOrderMainService
|
|||||||
* @return 门店订单统计列表
|
* @return 门店订单统计列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<StoreOrderStats> getTopStoreOrderStats(int limit) {
|
public List<StoreOrderStats> getTopStoreOrderStats(Long operatorId, int limit) {
|
||||||
return zcOrderMainMapper.selectTopStoreOrderStats(limit);
|
return zcOrderMainMapper.selectTopStoreOrderStats(operatorId, limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -349,23 +349,28 @@ public class ZcOrderMainServiceImpl implements IZcOrderMainService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<StatisticsHomeOrder> statisticsOrderByHour() {
|
public List<StatisticsHomeOrder> statisticsOrderByHour(StatisticsHomeOrder query) {
|
||||||
return zcOrderMainMapper.statisticsOrderByHour();
|
return zcOrderMainMapper.statisticsOrderByHour(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<StatisticsHomeOrder> statisticsOrderByWeek() {
|
public List<StatisticsHomeOrder> statisticsOrderByWeek(StatisticsHomeOrder query) {
|
||||||
return zcOrderMainMapper.statisticsOrderByWeek();
|
return zcOrderMainMapper.statisticsOrderByWeek(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<StatisticsHomeOrder> statisticsOrderByMonth() {
|
public List<StatisticsHomeOrder> statisticsOrderByMonth(StatisticsHomeOrder query) {
|
||||||
return zcOrderMainMapper.statisticsOrderByMonth();
|
return zcOrderMainMapper.statisticsOrderByMonth(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<StatisticsHomeOrder> statisticsOrderByYear() {
|
public List<StatisticsHomeOrder> statisticsOrderByYear(StatisticsHomeOrder query) {
|
||||||
return zcOrderMainMapper.statisticsOrderByYear();
|
return zcOrderMainMapper.statisticsOrderByYear(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StatisticsHomeOrder statisticsOrderSum(StatisticsHomeOrder query) {
|
||||||
|
return zcOrderMainMapper.statisticsOrderSum(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,8 @@ import java.util.List;
|
|||||||
import javax.servlet.http.Cookie;
|
import javax.servlet.http.Cookie;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.ruoyi.baseUser.service.IZcBaseUserService;
|
||||||
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.utils.*;
|
import com.ruoyi.common.utils.*;
|
||||||
import com.ruoyi.orders.dto.StatisticsHomeOrder;
|
import com.ruoyi.orders.dto.StatisticsHomeOrder;
|
||||||
import com.ruoyi.orders.dto.StoreOrderStats;
|
import com.ruoyi.orders.dto.StoreOrderStats;
|
||||||
@ -53,6 +55,8 @@ public class SysIndexController extends BaseController
|
|||||||
private ISysNoticeService noticeService;
|
private ISysNoticeService noticeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IZcOrderMainService zcOrderMainService;
|
private IZcOrderMainService zcOrderMainService;
|
||||||
|
@Autowired
|
||||||
|
private IZcBaseUserService zcBaseUserService;
|
||||||
|
|
||||||
// 系统首页
|
// 系统首页
|
||||||
@GetMapping("/index")
|
@GetMapping("/index")
|
||||||
@ -151,13 +155,27 @@ public class SysIndexController extends BaseController
|
|||||||
// HomeStatisticsVo homeStatisticsVo = idWarningMemberService.selectHomeStatistics();
|
// HomeStatisticsVo homeStatisticsVo = idWarningMemberService.selectHomeStatistics();
|
||||||
// mmap.put("homeStatisticsVo", homeStatisticsVo);
|
// mmap.put("homeStatisticsVo", homeStatisticsVo);
|
||||||
|
|
||||||
|
StatisticsHomeOrder query = new StatisticsHomeOrder();
|
||||||
|
// 运营者账号,只能查询所属商户数据
|
||||||
|
Long operatorId = null;
|
||||||
|
if(UserConstants.USER_TYPE_02.equals(getSysUser().getUserType())){
|
||||||
|
query.setOperatorId(getSysUser().getGroupId());
|
||||||
|
operatorId = getSysUser().getGroupId();
|
||||||
|
}
|
||||||
|
|
||||||
// 获取门店订单统计数据
|
// 获取门店订单统计数据
|
||||||
List<StoreOrderStats> storeOrderStats = zcOrderMainService.getTopStoreOrderStats(9);
|
List<StoreOrderStats> storeOrderStats = zcOrderMainService.getTopStoreOrderStats(operatorId, 9);
|
||||||
mmap.put("storeOrderStats", storeOrderStats);
|
mmap.put("storeOrderStats", storeOrderStats);
|
||||||
|
|
||||||
List<StatisticsHomeOrder> statisticsHomeOrders = zcOrderMainService.statisticsOrderByMonth();
|
|
||||||
|
List<StatisticsHomeOrder> statisticsHomeOrders = zcOrderMainService.statisticsOrderByMonth(query);
|
||||||
mmap.put("statisticsHomeOrders", statisticsHomeOrders);
|
mmap.put("statisticsHomeOrders", statisticsHomeOrders);
|
||||||
|
|
||||||
|
StatisticsHomeOrder statisticsSum = zcOrderMainService.statisticsOrderSum(query);
|
||||||
|
mmap.put("statisticsSum", statisticsSum);
|
||||||
|
|
||||||
|
mmap.put("userCount", zcBaseUserService.selectUserCount());
|
||||||
|
|
||||||
List<SysNotice> sysNotices = noticeService.selectHomeNoticeList();
|
List<SysNotice> sysNotices = noticeService.selectHomeNoticeList();
|
||||||
mmap.put("sysNotices", sysNotices);
|
mmap.put("sysNotices", sysNotices);
|
||||||
|
|
||||||
|
|||||||
@ -185,4 +185,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<select id="selectUserCount" resultType="java.lang.Integer">
|
||||||
|
SELECT count(1) as orderCount FROM zc_base_user where del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -290,6 +290,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
WHERE a.order_status in ('AUTO_END','MANUAL_END')
|
WHERE a.order_status in ('AUTO_END','MANUAL_END')
|
||||||
AND a.del_flag = '0'
|
AND a.del_flag = '0'
|
||||||
AND b.del_flag = '0'
|
AND b.del_flag = '0'
|
||||||
|
<if test="operatorId != null">
|
||||||
|
and b.operating_company_id = #{operatorId}
|
||||||
|
</if>
|
||||||
GROUP BY a.store_id
|
GROUP BY a.store_id
|
||||||
ORDER BY orderAmount DESC
|
ORDER BY orderAmount DESC
|
||||||
LIMIT #{limit}
|
LIMIT #{limit}
|
||||||
@ -300,65 +303,92 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="statisticsOrderByHour" resultType="com.ruoyi.orders.dto.StatisticsHomeOrder">
|
<select id="statisticsOrderByHour" resultType="com.ruoyi.orders.dto.StatisticsHomeOrder">
|
||||||
SELECT
|
SELECT
|
||||||
HOUR(create_time) as keyType,
|
HOUR(a.create_time) as keyType,
|
||||||
count(1) as totalCount,
|
count(1) as totalCount,
|
||||||
sum(amount) as totalAmount,
|
sum(a.amount) as totalAmount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTCAR' THEN 1 ELSE 0 END) as rentcarCount,
|
SUM(CASE WHEN a.suborder_type = 'RENTCAR' THEN 1 ELSE 0 END) as rentcarCount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTCAR' THEN amount ELSE 0 END) as rentcarAmount,
|
SUM(CASE WHEN a.suborder_type = 'RENTCAR' THEN a.amount ELSE 0 END) as rentcarAmount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTBATTEY' THEN 1 ELSE 0 END) as rentbatteryCount,
|
SUM(CASE WHEN a.suborder_type = 'RENTBATTEY' THEN 1 ELSE 0 END) as rentbatteryCount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTBATTEY' THEN amount ELSE 0 END) as rentbatteryAmount
|
SUM(CASE WHEN a.suborder_type = 'RENTBATTEY' THEN a.amount ELSE 0 END) as rentbatteryAmount
|
||||||
FROM zc_order_sub
|
FROM zc_order_sub a left join zc_order_main m on a.order_id = m.order_id
|
||||||
WHERE DATE(create_time) = CURDATE()
|
WHERE DATE(a.create_time) = CURDATE()
|
||||||
AND suborder_type IN ('RENTCAR', 'RENTBATTEY')
|
AND a.suborder_type IN ('RENTCAR', 'RENTBATTEY') and a.pay_status = 'SUCCESS'
|
||||||
GROUP BY HOUR(create_time)
|
<if test="operatorId != null">
|
||||||
|
and m.operator_id = #{operatorId}
|
||||||
|
</if>
|
||||||
|
GROUP BY HOUR(a.create_time)
|
||||||
ORDER BY keyType;
|
ORDER BY keyType;
|
||||||
</select>
|
</select>
|
||||||
<select id="statisticsOrderByWeek" resultType="com.ruoyi.orders.dto.StatisticsHomeOrder">
|
<select id="statisticsOrderByWeek" resultType="com.ruoyi.orders.dto.StatisticsHomeOrder">
|
||||||
SELECT
|
SELECT
|
||||||
DAYNAME(create_time) as name,
|
DAYNAME(a.create_time) as name,
|
||||||
DAYOFWEEK(create_time) as keyType,
|
DAYOFWEEK(a.create_time) as keyType,
|
||||||
count(1) as totalCount,
|
count(1) as totalCount,
|
||||||
sum(amount) as totalAmount,
|
sum(a.amount) as totalAmount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTCAR' THEN 1 ELSE 0 END) as rentcarCount,
|
SUM(CASE WHEN a.suborder_type = 'RENTCAR' THEN 1 ELSE 0 END) as rentcarCount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTCAR' THEN amount ELSE 0 END) as rentcarAmount,
|
SUM(CASE WHEN a.suborder_type = 'RENTCAR' THEN a.amount ELSE 0 END) as rentcarAmount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTBATTEY' THEN 1 ELSE 0 END) as rentbatteryCount,
|
SUM(CASE WHEN a.suborder_type = 'RENTBATTEY' THEN 1 ELSE 0 END) as rentbatteryCount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTBATTEY' THEN amount ELSE 0 END) as rentbatteryAmount
|
SUM(CASE WHEN a.suborder_type = 'RENTBATTEY' THEN a.amount ELSE 0 END) as rentbatteryAmount
|
||||||
FROM zc_order_sub
|
FROM zc_order_sub a left join zc_order_main m on a.order_id = m.order_id
|
||||||
WHERE YEARWEEK(create_time, 1) = YEARWEEK(CURDATE(), 1)
|
WHERE YEARWEEK(a.create_time, 1) = YEARWEEK(CURDATE(), 1)
|
||||||
AND suborder_type IN ('RENTCAR', 'RENTBATTEY')
|
AND a.suborder_type IN ('RENTCAR', 'RENTBATTEY') and a.pay_status = 'SUCCESS'
|
||||||
GROUP BY DAYOFWEEK(create_time), DAYNAME(create_time)
|
<if test="operatorId != null">
|
||||||
|
and m.operator_id = #{operatorId}
|
||||||
|
</if>
|
||||||
|
GROUP BY DAYOFWEEK(a.create_time), DAYNAME(a.create_time)
|
||||||
ORDER BY keyType;
|
ORDER BY keyType;
|
||||||
</select>
|
</select>
|
||||||
<select id="statisticsOrderByMonth" resultType="com.ruoyi.orders.dto.StatisticsHomeOrder">
|
<select id="statisticsOrderByMonth" resultType="com.ruoyi.orders.dto.StatisticsHomeOrder">
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
DAY(create_time) as keyType,
|
DAY(a.create_time) as keyType,
|
||||||
count(1) as totalCount,
|
count(1) as totalCount,
|
||||||
sum(amount) as totalAmount,
|
sum(amount) as totalAmount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTCAR' THEN 1 ELSE 0 END) as rentcarCount,
|
SUM(CASE WHEN a.suborder_type = 'RENTCAR' THEN 1 ELSE 0 END) as rentcarCount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTCAR' THEN amount ELSE 0 END) as rentcarAmount,
|
SUM(CASE WHEN a.suborder_type = 'RENTCAR' THEN a.amount ELSE 0 END) as rentcarAmount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTBATTEY' THEN 1 ELSE 0 END) as rentbatteryCount,
|
SUM(CASE WHEN a.suborder_type = 'RENTBATTEY' THEN 1 ELSE 0 END) as rentbatteryCount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTBATTEY' THEN amount ELSE 0 END) as rentbatteryAmount
|
SUM(CASE WHEN a.suborder_type = 'RENTBATTEY' THEN a.amount ELSE 0 END) as rentbatteryAmount
|
||||||
FROM zc_order_sub
|
FROM zc_order_sub a left join zc_order_main m on a.order_id = m.order_id
|
||||||
WHERE MONTH(create_time) = MONTH(CURDATE())
|
WHERE MONTH(a.create_time) = MONTH(CURDATE())
|
||||||
AND YEAR(create_time) = YEAR(CURDATE())
|
AND YEAR(a.create_time) = YEAR(CURDATE())
|
||||||
AND suborder_type IN ('RENTCAR', 'RENTBATTEY')
|
AND a.suborder_type IN ('RENTCAR', 'RENTBATTEY') and a.pay_status = 'SUCCESS'
|
||||||
GROUP BY DAY(create_time)
|
<if test="operatorId != null">
|
||||||
|
and m.operator_id = #{operatorId}
|
||||||
|
</if>
|
||||||
|
GROUP BY DAY(a.create_time)
|
||||||
ORDER BY keyType;
|
ORDER BY keyType;
|
||||||
</select>
|
</select>
|
||||||
<select id="statisticsOrderByYear" resultType="com.ruoyi.orders.dto.StatisticsHomeOrder">
|
<select id="statisticsOrderByYear" resultType="com.ruoyi.orders.dto.StatisticsHomeOrder">
|
||||||
SELECT
|
SELECT
|
||||||
MONTH(create_time) as keyType,
|
MONTH(a.create_time) as keyType,
|
||||||
count(1) as totalCount,
|
count(1) as totalCount,
|
||||||
sum(amount) as totalAmount,
|
sum(a.amount) as totalAmount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTCAR' THEN 1 ELSE 0 END) as rentcarCount,
|
SUM(CASE WHEN a.suborder_type = 'RENTCAR' THEN 1 ELSE 0 END) as rentcarCount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTCAR' THEN amount ELSE 0 END) as rentcarAmount,
|
SUM(CASE WHEN a.suborder_type = 'RENTCAR' THEN a.amount ELSE 0 END) as rentcarAmount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTBATTEY' THEN 1 ELSE 0 END) as rentbatteryCount,
|
SUM(CASE WHEN a.suborder_type = 'RENTBATTEY' THEN 1 ELSE 0 END) as rentbatteryCount,
|
||||||
SUM(CASE WHEN suborder_type = 'RENTBATTEY' THEN amount ELSE 0 END) as rentbatteryAmount
|
SUM(CASE WHEN a.suborder_type = 'RENTBATTEY' THEN a.amount ELSE 0 END) as rentbatteryAmount
|
||||||
FROM zc_order_sub
|
FROM zc_order_sub a left join zc_order_main m on a.order_id = m.order_id
|
||||||
WHERE YEAR(create_time) = YEAR(CURDATE())
|
WHERE YEAR(a.create_time) = YEAR(CURDATE())
|
||||||
AND suborder_type IN ('RENTCAR', 'RENTBATTEY')
|
AND a.suborder_type IN ('RENTCAR', 'RENTBATTEY') and a.pay_status = 'SUCCESS'
|
||||||
GROUP BY MONTH(create_time), MONTHNAME(create_time)
|
<if test="operatorId != null">
|
||||||
|
and m.operator_id = #{operatorId}
|
||||||
|
</if>
|
||||||
|
GROUP BY MONTH(a.create_time), MONTHNAME(a.create_time)
|
||||||
ORDER BY keyType;
|
ORDER BY keyType;
|
||||||
</select>
|
</select>
|
||||||
|
<select id="statisticsOrderSum" resultType="com.ruoyi.orders.dto.StatisticsHomeOrder">
|
||||||
|
SELECT
|
||||||
|
count(1) as totalCount,
|
||||||
|
sum(a.amount) as totalAmount,
|
||||||
|
SUM(CASE WHEN a.suborder_type = 'RENTCAR' THEN 1 ELSE 0 END) as rentcarCount,
|
||||||
|
SUM(CASE WHEN a.suborder_type = 'RENTCAR' THEN a.amount ELSE 0 END) as rentcarAmount,
|
||||||
|
SUM(CASE WHEN a.suborder_type = 'RENTBATTEY' THEN 1 ELSE 0 END) as rentbatteryCount,
|
||||||
|
SUM(CASE WHEN a.suborder_type = 'RENTBATTEY' THEN a.amount ELSE 0 END) as rentbatteryAmount
|
||||||
|
FROM zc_order_sub a left join zc_order_main m on a.order_id = m.order_id
|
||||||
|
WHERE a.suborder_type IN ('RENTCAR', 'RENTBATTEY') and a.pay_status = 'SUCCESS'
|
||||||
|
<if test="operatorId != null">
|
||||||
|
and m.operator_id = #{operatorId}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -225,6 +225,7 @@
|
|||||||
/* 新增样式 */
|
/* 新增样式 */
|
||||||
.box.box-success.box-widget {
|
.box.box-success.box-widget {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
border-top: 2px solid #4facfe !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.box-header p.box-title {
|
.box-header p.box-title {
|
||||||
@ -269,6 +270,8 @@
|
|||||||
border-top: 0;
|
border-top: 0;
|
||||||
padding: 10px 10px 10px 10px;
|
padding: 10px 10px 10px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@ -289,9 +292,9 @@
|
|||||||
<div class="box box-success box-widget" style="border: 1px solid #e5e5e5">
|
<div class="box box-success box-widget" style="border: 1px solid #e5e5e5">
|
||||||
<div class="box-header" style="border-bottom: none;">
|
<div class="box-header" style="border-bottom: none;">
|
||||||
<p class="box-title">平台订单金额</p>
|
<p class="box-title">平台订单金额</p>
|
||||||
<p style="font-size: 18px; margin: 10px;">12,560元</p>
|
<p style="font-size: 18px; margin: 10px;"><span th:text="${statisticsSum.totalAmount}"></span>元</p>
|
||||||
<p style="font-size: 12px; color: #999;">比上月 ▲ 12% 比上周 ▲ 11%</p>
|
<!-- <p style="font-size: 12px; color: #999;">比上月 ▲ 12% 比上周 ▲ 11%</p>-->
|
||||||
<p style="font-size: 12px; color: #999;">本月日均销售额 ¥12,423</p>
|
<!-- <p style="font-size: 12px; color: #999;">本月日均销售额 ¥12,423</p>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -300,10 +303,10 @@
|
|||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="box box-success box-widget" style="border: 1px solid #e5e5e5">
|
<div class="box box-success box-widget" style="border: 1px solid #e5e5e5">
|
||||||
<div class="box-header" style="border-bottom: none;">
|
<div class="box-header" style="border-bottom: none;">
|
||||||
<p class="box-title">租车订单</p>
|
<p class="box-title">租车订单金额</p>
|
||||||
<p style="font-size: 18px; margin: 10px;">7,000元</p>
|
<p style="font-size: 18px; margin: 10px;"><span th:text="${statisticsSum.rentcarAmount}"></span>元</p>
|
||||||
<p style="font-size: 12px; color: #999;">比上月 ▲ 12% 比上周 ▲ 11%</p>
|
<!-- <p style="font-size: 12px; color: #999;">比上月 ▲ 12% 比上周 ▲ 11%</p>-->
|
||||||
<p style="font-size: 12px; color: #999;">本月日均销售额 ¥12,423</p>
|
<!-- <p style="font-size: 12px; color: #999;">本月日均销售额 ¥12,423</p>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -314,10 +317,10 @@
|
|||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="box box-success box-widget" style="border: 1px solid #e5e5e5">
|
<div class="box box-success box-widget" style="border: 1px solid #e5e5e5">
|
||||||
<div class="box-header" style="border-bottom: none;">
|
<div class="box-header" style="border-bottom: none;">
|
||||||
<p class="box-title">租车订单数</p>
|
<p class="box-title">租电订单金额</p>
|
||||||
<p style="font-size: 18px; margin: 10px;">560</p>
|
<p style="font-size: 18px; margin: 10px;"><span th:text="${statisticsSum.rentbatteryAmount}"></span>元</p>
|
||||||
<p style="font-size: 12px; color: #999;">比上月 ▲ 30 比上周 ▲ 20</p>
|
<!-- <p style="font-size: 12px; color: #999;">比上月 ▲ 30 比上周 ▲ 20</p>-->
|
||||||
<p style="font-size: 12px; color: #999;">上月订单数 423</p>
|
<!-- <p style="font-size: 12px; color: #999;">上月订单数 423</p>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -326,10 +329,10 @@
|
|||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="box box-success box-widget" style="border: 1px solid #e5e5e5">
|
<div class="box box-success box-widget" style="border: 1px solid #e5e5e5">
|
||||||
<div class="box-header" style="border-bottom: none;">
|
<div class="box-header" style="border-bottom: none;">
|
||||||
<p class="box-title">租车平台新增用户数</p>
|
<p class="box-title">平台用户数</p>
|
||||||
<p style="font-size: 18px; margin: 10px;">560</p>
|
<p style="font-size: 18px; margin: 10px;"><span th:text="${userCount}"></span></p>
|
||||||
<p style="font-size: 12px; color: #999;">本月新增 ▲ 100 七天新增 ▲ 80</p>
|
<!-- <p style="font-size: 12px; color: #999;">本月新增 ▲ 100 七天新增 ▲ 80</p>-->
|
||||||
<p style="font-size: 12px; color: #999;">租车+电池租车总用户 62,423</p>
|
<!-- <p style="font-size: 12px; color: #999;">租车+电池租车总用户 62,423</p>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user