hanfucheng 6 kuukautta sitten
vanhempi
commit
2570b2af20

+ 4 - 9
src/main/resources/mapper/lawenforcement/LawenforcementViewMapper.xml

@@ -210,7 +210,7 @@
             FROM_UNIXTIME( a.check_end_time / 1000, '%Y-%m-%d %h:%m:%s' ) checkEndTime,
             a.scan_name scanName,
             FROM_UNIXTIME( a.scan_time / 1000, '%Y-%m-%d %h:%m:%s' ) scanTime,
-            case WHEN a.is_last = 0 then '否' WHEN a.is_last = 1 THEN '是' end isLast,
+            case WHEN a.record_status = 'lawenforcement_type_4' or a.record_status ='lawenforcement_type_5' then '是' else '否' end isLast,
             case WHEN a.is_cross_dept = 0 then '否' WHEN a.is_cross_dept = 1 THEN '是' end isCrossDept
         FROM
             lawenforcement_record a
@@ -242,13 +242,7 @@
             b.person_name personName,
             c.device_id deviceId,
             c.device_name deviceName,
-        <choose>
-            <when test="deviceId != null and deviceId != ''">
-                DATE_FORMAT(c.start_time,'%Y-%m-%d %h:%m:%s') checkStartTime,
-            </when>
-            <otherwise>SUBSTRING_INDEX( GROUP_CONCAT( DATE_FORMAT(c.start_time,'%Y-%m-%d %h:%m:%s') ORDER BY start_time asc ), ',', 1 ) checkStartTime,</otherwise>
-        </choose>
-            case WHEN a.is_last = 0 then '否' WHEN a.is_last = 1 THEN '是' end isLast,
+            SUBSTRING_INDEX( GROUP_CONCAT( DATE_FORMAT(c.start_time,'%Y-%m-%d %h:%m:%s') ORDER BY start_time asc ), ',', 1 ) checkStartTime,
             case WHEN a.is_cross_dept = 0 then '否' WHEN a.is_cross_dept = 1 THEN '是' end isCrossDept
         FROM
             lawenforcement_record a
@@ -259,8 +253,9 @@
             <when test="deviceId != null and deviceId != ''">
                 and c.device_id = #{deviceId}
             </when>
-            <otherwise>and a.record_status in ('lawenforcement_type_4','lawenforcement_type_6') and c.record_state = 0 GROUP BY a.id</otherwise>
+            <otherwise>and a.record_status in ('lawenforcement_type_4','lawenforcement_type_6') and c.record_state = 0 </otherwise>
         </choose>
+        GROUP BY a.id
         order by c.start_time desc
         <if test="deviceId != null  and deviceId != ''"> LIMIT 5 </if>
     </select>