feat(video): 添加巡检任务记录关联任务ID功能
- 在巡检任务记录表中新增 task_id 字段并建立关联关系 - 移除巡检任务实体中的冗余 recordId 字段及相关映射配置- 更新数据库查询语句以适配新的字段结构 - 为 InspectionTaskRecord 实体类增加 taskId 属性及对应 getter/setter 方法- 新增根据任务ID查询记录列表的接口方法 - 修改 MyBatis 映射文件支持 task_id 的增删改查操作 - 调整 toString 方法输出内容以包含 taskId 信息
This commit is contained in:
@@ -6,7 +6,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<resultMap type="InspectionTask" id="InspectionTaskResult">
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="taskName" column="task_name" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
@@ -26,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInspectionTaskVo">
|
||||
select task_id, record_id, task_name, device_id, device_name, cron_expression, duration,
|
||||
select task_id, task_name, device_id, device_name, cron_expression, duration,
|
||||
threshold, enable_detection, status, execute_count, alarm_count,
|
||||
last_execute_time, remark, create_by, create_time, update_by, update_time
|
||||
from v_inspection_task
|
||||
@@ -54,7 +53,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
insert into v_inspection_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskName != null and taskName != ''">task_name,</if>
|
||||
<if test="recordId != null">record_id,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="deviceName != null">device_name,</if>
|
||||
<if test="cronExpression != null and cronExpression != ''">cron_expression,</if>
|
||||
@@ -71,7 +69,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskName != null and taskName != ''">#{taskName},</if>
|
||||
<if test="recordId != null">#{recordId},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="deviceName != null">#{deviceName},</if>
|
||||
<if test="cronExpression != null and cronExpression != ''">#{cronExpression},</if>
|
||||
@@ -92,7 +89,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update v_inspection_task
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
|
||||
<if test="recordId != null">record_id = #{recordId},</if>
|
||||
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||||
<if test="deviceName != null">device_name = #{deviceName},</if>
|
||||
<if test="cronExpression != null and cronExpression != ''">cron_expression = #{cronExpression},</if>
|
||||
|
||||
Reference in New Issue
Block a user