护理站订单统计
This commit is contained in:
parent
3e098ff77d
commit
3b9559161c
@ -0,0 +1,38 @@
|
|||||||
|
package com.xinelu.manage.controller.orderstatistics;
|
||||||
|
|
||||||
|
import com.xinelu.common.core.controller.BaseController;
|
||||||
|
import com.xinelu.common.core.page.TableDataInfo;
|
||||||
|
import com.xinelu.manage.service.orderstatistics.OrderStatisticsService;
|
||||||
|
import com.xinelu.manage.vo.orderstatistics.OrderStatisticsVO;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约服务订单订单统计
|
||||||
|
*
|
||||||
|
* @author zh
|
||||||
|
* @date 2023-11-27
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/orderStatistics")
|
||||||
|
public class OrderStatisticsController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OrderStatisticsService orderStatisticsService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询预约服务订单数量及销售额
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:orderStatistics:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list() {
|
||||||
|
startPage();
|
||||||
|
List<OrderStatisticsVO> list = orderStatisticsService.selectAppointmentOrderCount();
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package com.xinelu.manage.mapper.orderstatistics;
|
||||||
|
|
||||||
|
import com.xinelu.manage.vo.orderstatistics.OrderStatisticsVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface OrderStatisticsMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站订单数量计价格
|
||||||
|
*
|
||||||
|
* @return OrderStatisticsVO
|
||||||
|
*/
|
||||||
|
List<OrderStatisticsVO> selectAppointmentOrderCount();
|
||||||
|
}
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
package com.xinelu.manage.service.orderstatistics;
|
||||||
|
|
||||||
|
import com.xinelu.manage.vo.orderstatistics.OrderStatisticsVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单统计Service接口
|
||||||
|
*
|
||||||
|
* @author xinyilu
|
||||||
|
* @date 2023-11-27
|
||||||
|
*/
|
||||||
|
public interface OrderStatisticsService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站订单数量及价格
|
||||||
|
*
|
||||||
|
* @return OrderStatisticsVO
|
||||||
|
*/
|
||||||
|
List<OrderStatisticsVO> selectAppointmentOrderCount();
|
||||||
|
}
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
package com.xinelu.manage.service.orderstatistics.impl;
|
||||||
|
|
||||||
|
import com.xinelu.manage.mapper.orderstatistics.OrderStatisticsMapper;
|
||||||
|
import com.xinelu.manage.service.orderstatistics.OrderStatisticsService;
|
||||||
|
import com.xinelu.manage.vo.orderstatistics.OrderStatisticsVO;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单统计Service业务层处理
|
||||||
|
*
|
||||||
|
* @author xinyilu
|
||||||
|
* @date 2023-11-27
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OrderStatisticsMapper orderStatisticsMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站订单数量计价格
|
||||||
|
*
|
||||||
|
* @return OrderStatisticsVO
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<OrderStatisticsVO> selectAppointmentOrderCount() {
|
||||||
|
return orderStatisticsMapper.selectAppointmentOrderCount();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.xinelu.manage.vo.orderstatistics;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站收益统计vo
|
||||||
|
*
|
||||||
|
* @author zhangheng
|
||||||
|
* @date 2023-11—27
|
||||||
|
*/
|
||||||
|
public class OrderStatisticsVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站名称
|
||||||
|
*/
|
||||||
|
private String stationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单总价
|
||||||
|
*/
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单总数
|
||||||
|
*/
|
||||||
|
private Integer orderCount;
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.xinelu.manage.mapper.orderstatistics.OrderStatisticsMapper">
|
||||||
|
|
||||||
|
<select id="selectAppointmentOrderCount"
|
||||||
|
resultType="com.xinelu.manage.vo.orderstatistics.OrderStatisticsVO">
|
||||||
|
SELECT ns.nurse_station_name stationName,
|
||||||
|
IFNULL(SUM(aod.order_count), 0) orderCount,
|
||||||
|
IFNULL(SUM(aod.total_price), 0.00) totalPrice
|
||||||
|
FROM appointment_order ao
|
||||||
|
LEFT JOIN appointment_order_details aod ON ao.order_no = aod.order_no
|
||||||
|
LEFT JOIN nurse_station_item nsi ON ao.nurse_station_item_id = nsi.id
|
||||||
|
LEFT JOIN nurse_station ns ON nsi.nurse_station_id = ns.id
|
||||||
|
WHERE ao.del_flag = 0
|
||||||
|
and aod.del_flag = 0
|
||||||
|
GROUP BY ns.nurse_station_name,
|
||||||
|
ORDER BY orderCount DESC
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue
Block a user