提交 03b019df 编写于 作者: Hello 码上秃's avatar Hello 码上秃

功能开发__统计分析__客户统计__学科客户分布饼图

上级 d6cdbd39
......@@ -38,6 +38,17 @@ public class ReportController extends BaseController {
return reportService.contractStatistics(beginCreateTime,endCreateTime);
}
/**
* 学科客户分布饼图
* @param beginCreateTime
* @param endCreateTime
* @return
*/
@GetMapping("/subjectStatistics/{beginCreateTime}/{endCreateTime}")
public AjaxResult subjectStatistics(@PathVariable String beginCreateTime, @PathVariable String endCreateTime) {
return AjaxResult.success(reportService.subjectStatistics(beginCreateTime, endCreateTime));
}
/**
* 销售统计
* @param beginCreateTime
......
......@@ -100,4 +100,6 @@ public interface TbContractMapper {
public List<Map<String,Object>> contractStatisticsByUser(IndexStatisticsVo query);
List<Map<String, Object>> subjectStatistics(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);
}
......@@ -269,4 +269,16 @@
</if>
</select>
<select id="subjectStatistics" resultType="java.util.Map">
SELECT
tb.name subject, COUNT(*) AS num
FROM
tb_contract tc
LEFT join tb_course tb on tc.course_id = tb.id
WHERE
DATE_FORMAT( tc.create_time, '%Y-%m-%d' ) BETWEEN DATE_FORMAT( #{beginCreateTime}, '%Y-%m-%d' ) AND DATE_FORMAT( #{endCreateTime}, '%Y-%m-%d' )
GROUP BY
tb.name
</select>
</mapper>
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.huike.report.service;
import java.util.List;
import java.util.Map;
import com.huike.common.core.page.TableDataInfo;
import com.huike.report.domain.vo.*;
import org.apache.ibatis.annotations.Param;
......@@ -21,6 +22,14 @@ public interface IReportService {
*/
public LineChartVO contractStatistics(String beginCreateTime, String endCreateTime);
/**
* 学科客户分布饼图
* @param beginCreateTime
* @param endCreateTime
* @return
*/
List<Map<String, Object>> subjectStatistics(String beginCreateTime, String endCreateTime);
/**
* 客户统计报表
......
......@@ -97,6 +97,17 @@ public class ReportServiceImpl implements IReportService {
return lineChartVo;
}
/**
* 学科客户分布饼图
* @param beginCreateTime
* @param endCreateTime
* @return
*/
@Override
public List<Map<String, Object>> subjectStatistics(String beginCreateTime, String endCreateTime) {
return contractMapper.subjectStatistics(beginCreateTime, endCreateTime);
}
@Override
public LineChartVO salesStatistics(String beginCreateTime, String endCreateTime) {
LineChartVO lineChartVo =new LineChartVO();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册