|
|
@@ -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
|