Przeglądaj źródła

检查时长接口数据修改

xuxiaodong 2 miesięcy temu
rodzic
commit
101859b84d

+ 6 - 0
zfjg-api/zfjg-api-manage/src/main/java/com/zfjg/manage/api/dto/statistics/EnforceAverageTimeDto.java

@@ -18,12 +18,18 @@ public class EnforceAverageTimeDto {
 
 
     public String getOrgAvgTime() {
+        if (this.orgAvgTime == null || this.orgAvgTime.equals("")) {
+            return null;
+        }
         NumberFormat percentInstance = NumberFormat.getNumberInstance();
         BigDecimal bigDecimal = new BigDecimal(this.orgAvgTime);
         return percentInstance.format(bigDecimal);
     }
 
     public String getHeadCorpsAvgTime() {
+        if (this.headCorpsAvgTime == null) {
+            return null;
+        }
         NumberFormat percentInstance = NumberFormat.getNumberInstance();
         BigDecimal bigDecimal = new BigDecimal(this.headCorpsAvgTime);
         return percentInstance.format(bigDecimal);

+ 7 - 4
zfjg-modules/zfjg-manage/src/main/resources/mapper/StatisticsMapper.xml

@@ -66,7 +66,7 @@
     <resultMap id="EnforceAverageTimeDtoResultMap" type="com.zfjg.manage.api.dto.statistics.EnforceAverageTimeDto">
         <id property="orgName" column="执法机构"/>
         <result property="orgAvgTime" column="支队平均时长"/>
-        <result property="headCorpsAvgTime" column="总队平均时长"/>
+        <result property="headCorpsAvgTime" column="视频时长"/>
     </resultMap>
 
     <select id="selectEnforcementProcess" resultMap="EnforcementProcessResultMap">
@@ -82,9 +82,12 @@
     </select>
 
     <select id="selectEnforceAverageTime" resultMap="EnforceAverageTimeDtoResultMap">
-        select * from (select  (select  enforce_org_name from enforce_organize where enforce_org_id = 执法机构id ) 执法机构,round(sum(检查耗时/1000/60)/count(*),2) 支队平均时长 from v_rw     where 状态= '已归档'  and 检查期限 &gt;= '2024-10-01' and 检查期限 &lt;= '2024-10-31' and 是否删除 = '正常' and 任务类型 = '日常检查'
-        group by 执法机构id) m  left join
-        (select round(sum(检查耗时/1000/60)/count(*),2)  总队平均时长  from v_rw     where 状态= '已归档'  and 检查期限 &gt;= '2024-10-01' and 检查期限 &lt;= '2024-10-31' and 是否删除 = '正常' and 任务类型 = '日常检查' and 检查耗时 &lt; 28800000) r   on 1=1
+        select  (select  enforce_org_name from enforce_organize where enforce_org_id = 执法机构id ) 执法机构,
+        round(sum(检查耗时/1000/60)/count(*),2) 支队平均时长,
+        round(sum((SELECT sum(case when media_id = '-1' then duration  else TIMESTAMPDIFF(SECOND,video_begin_time, video_end_time)  end  ) zfzsc FROM enforce_video  C WHERE c.is_deleted = 0 AND c.enfore_job_id = a.id))/count(*)/60,2)  视频时长
+        from v_rw  a   where 状态= '已归档'  and `开始执行任务时间` &gt;= '2024-10-01' and 开始执行任务时间 &lt;= '2024-10-31' and 是否删除 = '正常'   and 检查耗时 &lt;= 28800000   and 执法机构id != '55c99876ec0f425aac6925a92cceeb17'
+        and 任务类型= '日常检查'
+        group by 执法机构id
     </select>
 
 </mapper>