duhongyu 9 月之前
父节点
当前提交
0a4c233e0a

+ 2 - 0
hjzx-mapper/src/main/java/api/mapper/report/ReportMapper.java

@@ -37,6 +37,8 @@ public interface ReportMapper {
37 37
 
38 38
     /**工单分类表**/
39 39
     public  List<CompleteView> selectBusinessType (String time,Long area );
40
+    public  List<CompleteView> selectBusinessAreaType (String time,Long area );
41
+
40 42
     /**工单处理趋势**/
41 43
     public  List<HourReport> selectDealingWithTrends(Date beginTime, Date endTime);
42 44
     /**话务量统计**/

+ 17 - 1
hjzx-mapper/src/main/resources/mapper/report/ReportMapper.xml

@@ -253,6 +253,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
253 253
 	</select>
254 254
 
255 255
 	<select id="selectBusinessType"  parameterType="long" resultMap="CompleteView">
256
+		select   Name , SUM(number) number  from
257
+		(select   CONCAT(ancestors, ',', id) ancestors,type_name Name  from  workorder_type where category=0 and parent_id=0 and is_delete=0) a
258
+		left join (select COUNT(1) number,  CONCAT((select ancestors from workorder_type where id=workordercate ),',',workordercate)  ancestors  from
259
+		wo_workorderbase
260
+		where  isdelete=0
261
+		<if test="time != null and time !='' ">
262
+			and YEAR(createtime) = YEAR(CURRENT_DATE)
263
+			AND ${time}(createtime) = ${time}(CURRENT_DATE)
264
+		</if>
265
+		group by ancestors)  b on  CONCAT(b.ancestors,',')  LIKE CONCAT('%', a.ancestors,',' '%')
266
+		group by Name
267
+
268
+	</select>
269
+
270
+
271
+	<select id="selectBusinessAreaType"  parameterType="long" resultMap="CompleteView">
256 272
 		WITH RECURSIVE sub_areas AS (
257 273
 
258 274
 		SELECT id FROM sys_area WHERE id = #{area}
@@ -439,7 +455,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
439 455
 		GROUP BY a.root_id, a.root_name;
440 456
 	</select>
441 457
 	<select id="selectTelephoneData"  parameterType="String" resultMap="RecordDateViewResult">
442
-		select count(note=${note} or null) total,
458
+		select count(1) total,
443 459
 		count(note=${note} and call_type = 1 or null )	incoming,		count(call_type = 2
444 460
 		or null )	exhalation  from rep_record
445 461
 		where 1=1

+ 3 - 1
hjzx-service/src/main/java/api/service/report/impl/DataAnalysisServiceImpl.java

@@ -75,6 +75,8 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
75 75
         RecordDateView view1=reportMapper.selectTelephoneData(time,1L);//八院话务数据
76 76
         RecordDateView view2=reportMapper.selectTelephoneData(time,2L);//九院话务数据
77 77
         view2.setExhalation(0L);
78
+        view1.setTotal(view1.getIncoming()+view1.getExhalation());
79
+        view2.setTotal(view2.getIncoming());
78 80
         RecordDateView view3=new RecordDateView();
79 81
         view3.setTotal(view1.getTotal()+view2.getTotal());
80 82
         view3.setIncoming(view1.getIncoming()+view2.getIncoming());
@@ -361,7 +363,7 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
361 363
             }
362 364
         }
363 365
         List<HashMap<String,Object>> MapList = new ArrayList<HashMap<String,Object>>();
364
-        List<CompleteView>  BusinessType= reportMapper.selectBusinessType( time,area);
366
+        List<CompleteView>  BusinessType= reportMapper.selectBusinessAreaType( time,area);
365 367
         if (BusinessType!=null)
366 368
         {
367 369
             long total=BusinessType.stream().filter(x->x.getNumber()!=null).mapToLong(CompleteView::getNumber).sum();

+ 0 - 1
hjzx-service/src/main/java/api/service/report/impl/ReportBaseServiceImpl.java

@@ -74,7 +74,6 @@ public class ReportBaseServiceImpl implements IReportBaseService {
74 74
     /**工单分类表**/
75 75
     @Override
76 76
     public List<HashMap<String,Object>>  selectBusinessType()  {
77
-
78 77
         List<HashMap<String,Object>> MapList = new ArrayList<HashMap<String,Object>>();
79 78
         List<CompleteView>  BusinessType= reportMapper.selectBusinessType("", 0L);
80 79
         if (BusinessType!=null)