Memory_LG 8 mesiacov pred
rodič
commit
1f9801083f

+ 23 - 0
lawenforcement-ui/src/api/lawenforcement/record.js

@@ -42,3 +42,26 @@ export function delRecord(id) {
     method: 'delete'
   })
 }
+
+export function getPersonsList(data){
+  return request({
+    url: '/sooka-sponest-lawenforcement/person/getPersonsListByRecordId',
+    method: 'post',
+    data: data
+  })
+}
+
+export function getDeivceList(){
+  return request({
+    url: '/sooka-sponest-lawenforcement/record/getDeivceList',
+    method: 'get'
+  })
+}
+
+export function addRecordLog(data){
+  return request({
+    url: '/sooka-sponest-lawenforcement/record/addRecordLog',
+    method: 'post',
+    data: data
+  })
+}

+ 147 - 69
lawenforcement-ui/src/views/lawenforcement/record/index.vue

@@ -68,17 +68,17 @@
 
     <el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center"/>
-      <el-table-column label="任务ID" align="center" prop="id"/>
       <el-table-column label="任务类型" align="center" prop="jobType"/>
-      <el-table-column label="任务创建人ID" align="center" prop="creatorId"/>
       <el-table-column label="任务创建人姓名" align="center" prop="creatorName"/>
-      <el-table-column label="任务创建部门ID" align="center" prop="deptId"/>
       <el-table-column label="任务创建部门名称" align="center" prop="deptName"/>
-      <el-table-column label="地区ID" align="center" prop="areaId"/>
       <el-table-column label="任务名称" align="center" prop="jobName"/>
+      <el-table-column label="任务状态" align="center" prop="gender">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.lawenforcement_type" :value="scope.row.recordStatus"/>
+        </template>
+      </el-table-column>
       <el-table-column label="任务检查类型" align="center" prop="checkType"/>
       <el-table-column label="检查对象类型" align="center" prop="checkObjectType"/>
-      <el-table-column label="检查对象ID" align="center" prop="checkObjectId"/>
       <el-table-column label="检查对象代码" align="center" prop="checkObjectCode"/>
       <el-table-column label="检查对象名称" align="center" prop="checkObjectName"/>
       <el-table-column label="检查对象联系电话" align="center" prop="checkObjectPhone"/>
@@ -86,32 +86,34 @@
       <el-table-column label="检查结束时间" align="center" prop="checkEndTime"/>
       <el-table-column label="检查子项数量" align="center" prop="subitemCount"/>
       <el-table-column label="备注" align="center" prop="remark"/>
-      <el-table-column label="是否核验(0未核验 1已核验 2无法核验)" align="center" prop="verify"/>
-      <el-table-column label="无法核验原因" align="center" prop="unableVerifyReason"/>
-      <el-table-column label="扫码人身份证号" align="center" prop="scanId"/>
-      <el-table-column label="扫码人姓名" align="center" prop="scanName"/>
-      <el-table-column label="扫码时间" align="center" prop="scanTime"/>
-      <el-table-column label="核验人ID" align="center" prop="verifyPeopleId"/>
-      <el-table-column label="核验人姓名" align="center" prop="verifyPeopleName"/>
-      <el-table-column label="核验时间" align="center" prop="verifyTime"/>
-      <el-table-column label="评价(0待评价 1 好评 2一般 3差评)" align="center" prop="evaluation"/>
-      <el-table-column label="评价内容" align="center" prop="evaluationContent"/>
-      <el-table-column label="评价时间" align="center" prop="evaluationTime"/>
-      <el-table-column label="是否有检查结果(0未填 1已填)" align="center" prop="result"/>
-      <el-table-column label="检查结果录入时间" align="center" prop="resultTime"/>
-      <el-table-column label="检查结果录入人员" align="center" prop="resultPersonId"/>
-      <el-table-column label="任务状态(1待核验 2待填报 3已完成)" align="center" prop="status"/>
-      <el-table-column label="是否延续检查" align="center" prop="isLast"/>
-      <el-table-column label="原任务Id" align="center" prop="jobId"/>
-      <el-table-column label="延续任务类型" align="center" prop="lastJobType"/>
-      <el-table-column label="数据来源" align="center" prop="source"/>
-      <el-table-column label="创建方式(1自建,2API对接;3数据同步)" align="center" prop="createMethod"/>
-      <el-table-column label="是否跨部门" align="center" prop="isCrossDept"/>
-      <el-table-column label="设备id" align="center" prop="deviceId"/>
-      <el-table-column label="设备名称" align="center" prop="deviceName"/>
+      <el-table-column label="创建方式" align="center">
+        <template v-slot="scope">
+          <span v-if="scope.row.createMethod === 1">自建</span>
+          <span v-else-if="scope.row.createMethod === 2">API对接</span>
+          <span v-else-if="scope.row.createMethod === 3">数据同步</span>
+          <span v-else>未知方式</span>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
+            v-if="scope.row.recordStatus === 'lawenforcement_type_1' || scope.row.recordStatus === 'lawenforcement_type_3'"
+            size="mini"
+            type="text"
+            icon="el-icon-paper-plus"
+            @click="showDispatchDialog(scope.row)"
+          >派发
+          </el-button>
+          <el-button
+            v-if="scope.row.recordStatus === 'lawenforcement_type_6'"
+            size="mini"
+            type="text"
+            icon="el-icon-paper-plus"
+            @click="showBindDeviceDialog(scope.row)"
+          >绑定设备
+          </el-button>
+          <el-button
+            v-if="scope.row.createMethod === 1"
             size="mini"
             type="text"
             icon="el-icon-edit"
@@ -120,6 +122,7 @@
           >修改
           </el-button>
           <el-button
+            v-if="scope.row.createMethod === 1"
             size="mini"
             type="text"
             icon="el-icon-delete"
@@ -253,14 +256,81 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+
+    <!-- 派发事件弹窗 -->
+    <el-dialog :visible.sync="dialogVisible" title="派发任务">
+      <el-form :model="form">
+        <el-form-item label="选择部门">
+<!--          <el-select v-model="dispatchForm.department" placeholder="请选择部门">
+            <el-option
+              v-for="item in departments"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            />
+          </el-select>-->
+        </el-form-item>
+
+        <el-form-item label="选择人员">
+<!--          <el-select v-model="dispatchForm.person" placeholder="请选择人员">
+            <el-option
+              v-for="item in personnel"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            />
+          </el-select>-->
+        </el-form-item>
+      </el-form>
+      <div slot="footer">
+        <el-button @click="dialogVisible = false">取消</el-button>
+        <el-button type="primary" @click="handleDispatch">确定</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 绑定设备弹窗 -->
+    <el-dialog :visible.sync="bindDialogVisible" title="绑定设备">
+      <el-form>
+        <el-form-item label="任务名称" prop="jobName">
+          <el-input v-model="form.jobName" placeholder="请输入任务名称"/>
+        </el-form-item>
+        <el-form-item label="设备信息" prop="deviceId">
+          <el-select v-model="form.deviceId" @change="onDeviceChange" placeholder="请选择设备">
+            <el-option
+              v-for="item in deviceList"
+              :key="item.cameraCode"
+              :label="item.cameraName"
+              :value="item.cameraCode"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer">
+        <el-button @click="bindDialogVisible = false">取消</el-button>
+        <el-button type="primary" @click="submitBindHandle">确定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import {addRecord, delRecord, getRecord, listRecord, updateRecord} from "@/api/lawenforcement/record";
+import {
+  addRecord, addRecordLog,
+  delRecord,
+  getDeivceList,
+  getPersonsList,
+  getRecord,
+  listRecord,
+  updateRecord
+} from "@/api/lawenforcement/record";
+import dict from "@/utils/dict";
 
 export default {
   name: "Record",
+  dicts: [
+    'lawenforcement_type'
+  ],
   data() {
     return {
       // 遮罩层
@@ -281,54 +351,20 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
+      dialogVisible: false,
+      bindDialogVisible: false,
       // 查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        jobType: null,
-        creatorId: null,
-        creatorName: null,
-        deptId: null,
-        deptName: null,
-        areaId: null,
-        jobName: null,
-        checkType: null,
-        checkObjectType: null,
-        checkObjectId: null,
-        checkObjectCode: null,
-        checkObjectName: null,
-        checkObjectPhone: null,
-        checkStartTime: null,
-        checkEndTime: null,
-        subitemCount: null,
-        verify: null,
-        unableVerifyReason: null,
-        scanId: null,
-        scanName: null,
-        scanTime: null,
-        verifyPeopleId: null,
-        verifyPeopleName: null,
-        verifyTime: null,
-        evaluation: null,
-        evaluationContent: null,
-        evaluationTime: null,
-        result: null,
-        resultTime: null,
-        resultPersonId: null,
-        status: null,
-        isLast: null,
-        jobId: null,
-        lastJobType: null,
-        source: null,
-        createMethod: null,
-        isCrossDept: null,
-        deviceId: null,
-        deviceName: null
+        jobName: null
       },
       // 表单参数
       form: {},
       // 表单校验
-      rules: {}
+      rules: {},
+      // 执法设备列表
+      deviceList: []
     };
   },
   created() {
@@ -466,6 +502,48 @@ export default {
       this.download('lawenforcement/record/export', {
         ...this.queryParams
       }, `record_${new Date().getTime()}.xlsx`)
+    },
+    /** 派发按钮事件*/
+    showDispatchDialog(row) {
+      // getPersonsList(row).then(res=>{
+        console.log("派发工单")
+        // res.data
+        this.dialogVisible = true;
+      // })
+    },
+    /** 派发工单提交 */
+    handleDispatch() {
+      // 处理派发逻辑,这里可以写你的逻辑,比如保存数据或者提交请求
+      console.log("派发信息");
+      this.dialogVisible = false;
+    },
+
+    /** 绑定设备事件 */
+    showBindDeviceDialog(row){
+      /* 根据部门id获取执法设备 */
+      getDeivceList().then(res=>{
+        this.deviceList = res.data
+        this.form.id = row.id
+        this.form.jobName = row.jobName
+        this.bindDialogVisible = true;
+      })
+
+    },
+
+    /** 选中设备事件 */
+    onDeviceChange(value){
+      const selectedDevice = this.deviceList.find(item => item.cameraCode === value);
+      this.form.deviceName = selectedDevice ? selectedDevice.cameraName : ''; // 更新设备名称
+      // this.form.deviceId = selectedDevice.cameraCode
+    },
+
+    /** 绑定设备提交 */
+    submitBindHandle(){
+      console.log(this.form)
+      this.bindDialogVisible = false;
+      addRecordLog(this.form).then(res=>{
+        console.log(res)
+      })
     }
   }
 };

+ 6 - 0
pom.xml

@@ -81,6 +81,12 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-websocket</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.ruoyi</groupId>
+            <artifactId>sooka-sponest-api-monitor</artifactId>
+            <version>3.4.0</version>
+            <scope>compile</scope>
+        </dependency>
 
     </dependencies>
 

+ 19 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/controller/LawenforcementRecordController.java

@@ -1,5 +1,7 @@
 package com.sooka.sponest.lawenforcement.record.controller;
 
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.utils.SpringUtils;
 import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -7,8 +9,12 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.common.security.utils.SecurityUtils;
 import com.sooka.sponest.lawenforcement.record.domain.LawenforcementRecord;
 import com.sooka.sponest.lawenforcement.record.service.ILawenforcementRecordService;
+import com.sooka.sponest.monitor.api.RemoteDeviceService;
+import com.sooka.sponest.monitor.api.domain.CenterdataTCamera;
+import com.sooka.sponest.monitor.api.domain.VisuForestCloudCameraBO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -88,4 +94,17 @@ public class LawenforcementRecordController extends BaseController {
     public AjaxResult remove(@PathVariable String[] ids) {
         return toAjax(lawenforcementRecordService.deleteLawenforcementRecordByIds(ids));
     }
+
+    @GetMapping("/getDeivceList")
+    public AjaxResult getDeivceList(){
+        System.out.println(" 获取设备列表 ");
+        VisuForestCloudCameraBO visuForestCloudCameraBO = new VisuForestCloudCameraBO();
+        visuForestCloudCameraBO.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
+        return SpringUtils.getBean(RemoteDeviceService.class).selectByCameraId(visuForestCloudCameraBO);
+    }
+
+    @PostMapping("addRecordLog")
+    public AjaxResult addRecordLog(@RequestBody LawenforcementRecord record){
+        return toAjax(lawenforcementRecordService.addRecordLog(record));
+    }
 }

+ 5 - 7
src/main/java/com/sooka/sponest/lawenforcement/record/domain/LawenforcementRecord.java

@@ -1,6 +1,5 @@
 package com.sooka.sponest.lawenforcement.record.domain;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.common.core.annotation.Excel;
 import com.ruoyi.common.core.web.domain.BaseEntity;
 import lombok.Getter;
@@ -8,8 +7,6 @@ import lombok.Setter;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
-import java.util.Date;
-
 /**
  * 任务数据对象 lawenforcement_record
  *
@@ -108,15 +105,13 @@ public class LawenforcementRecord extends BaseEntity {
      * 检查开始时间
      */
     @Excel(name = "检查开始时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date checkStartTime;
+    private Long checkStartTime;
 
     /**
      * 检查结束时间
      */
     @Excel(name = "检查结束时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date checkEndTime;
+    private Long checkEndTime;
 
     /**
      * 检查子项数量
@@ -262,6 +257,8 @@ public class LawenforcementRecord extends BaseEntity {
     @Excel(name = "设备名称")
     private String deviceName;
 
+    private String recordStatus;
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@@ -308,6 +305,7 @@ public class LawenforcementRecord extends BaseEntity {
                 .append("isCrossDept", getIsCrossDept())
                 .append("deviceId", getDeviceId())
                 .append("deviceName", getDeviceName())
+                .append("recordStatus", getRecordStatus())
                 .toString();
     }
 }

+ 23 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/domain/LawenforcementRecordLog.java

@@ -0,0 +1,23 @@
+package com.sooka.sponest.lawenforcement.record.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import lombok.*;
+
+import java.util.Date;
+
+@Setter
+@Getter
+@AllArgsConstructor
+@NoArgsConstructor
+@ToString
+public class LawenforcementRecordLog extends BaseEntity {
+    private String id;
+    private String personCode;
+    private String recordId;
+    private String deviceId;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date endTime;
+}

+ 6 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/mapper/LawenforcementRecordMapper.java

@@ -1,8 +1,10 @@
 package com.sooka.sponest.lawenforcement.record.mapper;
 
 import com.sooka.sponest.lawenforcement.record.domain.LawenforcementRecord;
+import com.sooka.sponest.lawenforcement.record.domain.LawenforcementRecordLog;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 任务数据Mapper接口
@@ -58,4 +60,8 @@ public interface LawenforcementRecordMapper {
      * @return 结果
      */
     int deleteLawenforcementRecordByIds(String[] ids);
+
+    void addRecordLog(LawenforcementRecordLog recordLog);
+
+    Map<String, String> getPersonCode(String id);
 }

+ 5 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/service/ILawenforcementRecordService.java

@@ -3,6 +3,7 @@ package com.sooka.sponest.lawenforcement.record.service;
 import com.sooka.sponest.lawenforcement.record.domain.LawenforcementRecord;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 任务数据Service接口
@@ -58,4 +59,8 @@ public interface ILawenforcementRecordService {
      * @return 结果
      */
     int deleteLawenforcementRecordById(String id);
+
+    List<Map<String, Object>> getDeviceList();
+
+    int addRecordLog(LawenforcementRecord record);
 }

+ 24 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/service/impl/LawenforcementRecordServiceImpl.java

@@ -1,13 +1,20 @@
 package com.sooka.sponest.lawenforcement.record.service.impl;
 
 import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.core.utils.uuid.IdUtils;
+import com.ruoyi.common.security.utils.SecurityUtils;
 import com.sooka.sponest.lawenforcement.record.domain.LawenforcementRecord;
+import com.sooka.sponest.lawenforcement.record.domain.LawenforcementRecordLog;
 import com.sooka.sponest.lawenforcement.record.mapper.LawenforcementRecordMapper;
 import com.sooka.sponest.lawenforcement.record.service.ILawenforcementRecordService;
+import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 任务数据Service业务层处理
@@ -86,4 +93,21 @@ public class LawenforcementRecordServiceImpl implements ILawenforcementRecordSer
     public int deleteLawenforcementRecordById(String id) {
         return lawenforcementRecordMapper.deleteLawenforcementRecordById(id);
     }
+
+    @Override
+    public List<Map<String, Object>> getDeviceList() {
+        return new ArrayList<>();
+    }
+
+    @Override
+    public int addRecordLog(LawenforcementRecord record) {
+        //更新工单数据中的设备id和设备名称,以及任务开始时间
+        int i = lawenforcementRecordMapper.updateLawenforcementRecord(record);
+        Map<String, String> personCode = lawenforcementRecordMapper.getPersonCode(record.getId());
+
+        LawenforcementRecordLog lawenforcementRecordLog = new LawenforcementRecordLog(IdUtils.fastSimpleUUID(), MapUtils.getString(personCode, "personCode"),record.getId(),record.getDeviceId(),new Date(),null);
+        //将工单执行记录,写入到日志表中:数据id、任务id、执法人编号、设备编号、开始时间
+        lawenforcementRecordMapper.addRecordLog(lawenforcementRecordLog);
+        return i;
+    }
 }

+ 32 - 56
src/main/resources/mapper/lawenforcement/LawenforcementRecordMapper.xml

@@ -48,6 +48,7 @@
         <result property="isCrossDept" column="is_cross_dept"/>
         <result property="deviceId" column="device_id"/>
         <result property="deviceName" column="device_name"/>
+        <result property="recordStatus" column="record_status"/>
     </resultMap>
 
     <sql id="selectLawenforcementRecordVo">
@@ -65,8 +66,8 @@
                check_object_code,
                check_object_name,
                check_object_phone,
-               FROM_UNIXTIME(check_start_time / 1000) AS check_start_time,
-               FROM_UNIXTIME(check_end_time / 1000) AS check_end_time,
+               check_start_time,
+               check_end_time,
                subitem_count,
                remark,
                verify,
@@ -93,7 +94,8 @@
                create_method,
                is_cross_dept,
                device_id,
-               device_name
+               device_name,
+               recordStatus
         from lawenforcement_record
     </sql>
 
@@ -101,60 +103,7 @@
             resultMap="LawenforcementRecordResult">
         <include refid="selectLawenforcementRecordVo"/>
         <where>
-            <if test="jobType != null  and jobType != ''">and job_type = #{jobType}</if>
-            <if test="creatorId != null  and creatorId != ''">and creator_id = #{creatorId}</if>
-            <if test="creatorName != null  and creatorName != ''">and creator_name like concat('%', #{creatorName},
-                '%')
-            </if>
-            <if test="deptId != null  and deptId != ''">and dept_id = #{deptId}</if>
-            <if test="deptName != null  and deptName != ''">and dept_name like concat('%', #{deptName}, '%')</if>
-            <if test="areaId != null  and areaId != ''">and area_id = #{areaId}</if>
             <if test="jobName != null  and jobName != ''">and job_name like concat('%', #{jobName}, '%')</if>
-            <if test="checkType != null  and checkType != ''">and check_type = #{checkType}</if>
-            <if test="checkObjectType != null  and checkObjectType != ''">and check_object_type = #{checkObjectType}
-            </if>
-            <if test="checkObjectId != null  and checkObjectId != ''">and check_object_id = #{checkObjectId}</if>
-            <if test="checkObjectCode != null  and checkObjectCode != ''">and check_object_code = #{checkObjectCode}
-            </if>
-            <if test="checkObjectName != null  and checkObjectName != ''">and check_object_name like concat('%',
-                #{checkObjectName}, '%')
-            </if>
-            <if test="checkObjectPhone != null  and checkObjectPhone != ''">and check_object_phone =
-                #{checkObjectPhone}
-            </if>
-            <if test="checkStartTime != null ">and check_start_time = #{checkStartTime}</if>
-            <if test="checkEndTime != null ">and check_end_time = #{checkEndTime}</if>
-            <if test="subitemCount != null ">and subitem_count = #{subitemCount}</if>
-            <if test="verify != null  and verify != ''">and verify = #{verify}</if>
-            <if test="unableVerifyReason != null  and unableVerifyReason != ''">and unable_verify_reason =
-                #{unableVerifyReason}
-            </if>
-            <if test="scanId != null  and scanId != ''">and scan_id = #{scanId}</if>
-            <if test="scanName != null  and scanName != ''">and scan_name like concat('%', #{scanName}, '%')</if>
-            <if test="scanTime != null  and scanTime != ''">and scan_time = #{scanTime}</if>
-            <if test="verifyPeopleId != null  and verifyPeopleId != ''">and verify_people_id = #{verifyPeopleId}</if>
-            <if test="verifyPeopleName != null  and verifyPeopleName != ''">and verify_people_name like concat('%',
-                #{verifyPeopleName}, '%')
-            </if>
-            <if test="verifyTime != null  and verifyTime != ''">and verify_time = #{verifyTime}</if>
-            <if test="evaluation != null  and evaluation != ''">and evaluation = #{evaluation}</if>
-            <if test="evaluationContent != null  and evaluationContent != ''">and evaluation_content =
-                #{evaluationContent}
-            </if>
-            <if test="evaluationTime != null  and evaluationTime != ''">and evaluation_time = #{evaluationTime}</if>
-            <if test="result != null  and result != ''">and result = #{result}</if>
-            <if test="resultTime != null  and resultTime != ''">and result_time = #{resultTime}</if>
-            <if test="resultPersonId != null  and resultPersonId != ''">and result_person_id = #{resultPersonId}</if>
-            <if test="status != null  and status != ''">and status = #{status}</if>
-            <if test="isLast != null ">and is_last = #{isLast}</if>
-            <if test="jobId != null  and jobId != ''">and job_id = #{jobId}</if>
-            <if test="lastJobType != null  and lastJobType != ''">and last_job_type = #{lastJobType}</if>
-            <if test="source != null  and source != ''">and source = #{source}</if>
-            <if test="createMethod != null ">and create_method = #{createMethod}</if>
-            <if test="isCrossDept != null ">and is_cross_dept = #{isCrossDept}</if>
-            <if test="deviceId != null  and deviceId != ''">and device_id = #{deviceId}</if>
-            <if test="deviceName != null  and deviceName != ''">and device_name like concat('%', #{deviceName}, '%')
-            </if>
         </where>
     </select>
 
@@ -209,6 +158,7 @@
             <if test="isCrossDept != null">is_cross_dept,</if>
             <if test="deviceId != null">device_id,</if>
             <if test="deviceName != null">device_name,</if>
+            <if test="recordStatus != null">record_status,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -254,6 +204,7 @@
             <if test="isCrossDept != null">#{isCrossDept},</if>
             <if test="deviceId != null">#{deviceId},</if>
             <if test="deviceName != null">#{deviceName},</if>
+            <if test="recordStatus != null">#{recordStatus},</if>
         </trim>
     </insert>
 
@@ -302,6 +253,7 @@
             <if test="isCrossDept != null">is_cross_dept = #{isCrossDept},</if>
             <if test="deviceId != null">device_id = #{deviceId},</if>
             <if test="deviceName != null">device_name = #{deviceName},</if>
+            <if test="recordStatus != null">record_status = #{recordStatus},</if>
         </trim>
         where id = #{id}
     </update>
@@ -318,4 +270,28 @@
             #{id}
         </foreach>
     </delete>
+
+    <insert id="addRecordLog" parameterType="LawenforcementRecordLog">
+        insert into lawenforcement_record_log
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="personCode != null">person_code,</if>
+            <if test="recordId != null">record_id,</if>
+            <if test="deviceId != null">device_id,</if>
+            <if test="startTime != null">start_time,</if>
+            <if test="endTime != null">end_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="personCode != null">#{personCode},</if>
+            <if test="recordId != null">#{recordId},</if>
+            <if test="deviceId != null">#{deviceId},</if>
+            <if test="startTime != null">#{startTime},</if>
+            <if test="endTime != null">#{endTime},</if>
+        </trim>
+    </insert>
+
+    <select id="getPersonCode" parameterType="string" resultType="map">
+        select person_code as personCode from lawenforcement_person where record_id = #{id} and main_person = 1
+    </select>
 </mapper>