| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.inspect.mapper.ArdVideoInspectTaskMapper"> |
| | | |
| | | |
| | | <resultMap type="ArdVideoInspectTask" id="ArdVideoInspectTaskResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="taskName" column="task_name" /> |
| | | <result property="startTime" column="start_time" /> |
| | | <result property="endTime" column="end_time" /> |
| | | <result property="repeatPeriod" column="repeat_period" /> |
| | | <result property="inspectMode" column="inspect_mode" /> |
| | | <result property="menualSwitch" column="menual_switch" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="cameraId" column="camera_id" /> |
| | | <result property="channel" column="channel" /> |
| | | <result property="deptId" column="dept_id" /> |
| | | <result property="userId" column="user_id" /> |
| | | <result property="currentStepId" column="current_step_id" /> |
| | | <result property="currentStepStartTime" column="current_step_start_time" /> |
| | | <result property="id" column="id"/> |
| | | <result property="taskName" column="task_name"/> |
| | | <result property="startTime" column="start_time"/> |
| | | <result property="endTime" column="end_time"/> |
| | | <result property="repeatPeriod" column="repeat_period"/> |
| | | <result property="inspectMode" column="inspect_mode"/> |
| | | <result property="menualSwitch" column="menual_switch"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="cameraId" column="camera_id"/> |
| | | <result property="channel" column="channel"/> |
| | | <result property="deptId" column="dept_id"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="currentStepId" column="current_step_id"/> |
| | | <result property="currentStepStartTime" column="current_step_start_time"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="ArdVideoInspectTaskArdVideoInspectTaskStepResult" type="ArdVideoInspectTask" extends="ArdVideoInspectTaskResult"> |
| | | <collection property="ardVideoInspectTaskStepList" notNullColumn="sub_task_id" javaType="java.util.List" resultMap="ArdVideoInspectTaskStepResult" /> |
| | | <resultMap id="ArdVideoInspectTaskArdVideoInspectTaskStepResult" type="ArdVideoInspectTask" |
| | | extends="ArdVideoInspectTaskResult"> |
| | | <collection property="ardVideoInspectTaskStepList" notNullColumn="sub_task_id" javaType="java.util.List" |
| | | resultMap="ArdVideoInspectTaskStepResult"/> |
| | | </resultMap> |
| | | |
| | | <resultMap type="ArdVideoInspectTaskStep" id="ArdVideoInspectTaskStepResult"> |
| | | <result property="taskId" column="sub_task_id" /> |
| | | <result property="deptId" column="sub_dept_id" /> |
| | | <result property="userId" column="sub_user_id" /> |
| | | <result property="id" column="sub_id" /> |
| | | <result property="orderNumber" column="sub_order_number" /> |
| | | <result property="recordingTime" column="sub_recording_time" /> |
| | | <result property="wellId" column="sub_well_id" /> |
| | | <result property="taskId" column="sub_task_id"/> |
| | | <result property="deptId" column="sub_dept_id"/> |
| | | <result property="userId" column="sub_user_id"/> |
| | | <result property="id" column="sub_id"/> |
| | | <result property="orderNumber" column="sub_order_number"/> |
| | | <result property="recordingTime" column="sub_recording_time"/> |
| | | <result property="wellId" column="sub_well_id"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdVideoInspectTaskVo"> |
| | | select id, task_name, start_time, end_time, repeat_period, inspect_mode, menual_switch, create_by, create_time, update_by, update_time, camera_id, channel, dept_id, user_id, current_step_id, current_step_start_time from ard_video_inspect_task |
| | | select id, |
| | | task_name, |
| | | start_time, |
| | | end_time, |
| | | repeat_period, |
| | | inspect_mode, |
| | | menual_switch, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time, |
| | | camera_id, |
| | | channel, |
| | | dept_id, |
| | | user_id, |
| | | current_step_id, |
| | | current_step_start_time |
| | | from ard_video_inspect_task |
| | | </sql> |
| | | |
| | | <select id="selectArdVideoInspectTaskList" parameterType="ArdVideoInspectTask" resultMap="ArdVideoInspectTaskResult"> |
| | | <select id="selectArdVideoInspectTaskList" parameterType="ArdVideoInspectTask" |
| | | resultMap="ArdVideoInspectTaskResult"> |
| | | <include refid="selectArdVideoInspectTaskVo"/> |
| | | <where> |
| | | <if test="taskName != null and taskName != ''"> and task_name like '%'||#{taskName}||'%'</if> |
| | | <if test="inspectMode != null and inspectMode != ''"> and inspect_mode = #{inspectMode}</if> |
| | | <where> |
| | | <if test="taskName != null and taskName != ''">and task_name like '%'||#{taskName}||'%'</if> |
| | | <if test="inspectMode != null and inspectMode != ''">and inspect_mode = #{inspectMode}</if> |
| | | <if test="menualSwitch != null and inspectMode != ''">and menual_switch= #{menualSwitch}</if> |
| | | <if test="cameraId != null and cameraId != ''"> and camera_id = #{cameraId}</if> |
| | | <if test="channel != null "> and channel = #{channel}</if> |
| | | <if test="cameraId != null and cameraId != ''">and camera_id = #{cameraId}</if> |
| | | <if test="channel != null ">and channel = #{channel}</if> |
| | | </where> |
| | | order by start_time |
| | | </select> |
| | | |
| | | <select id="selectArdVideoInspectTaskById" parameterType="String" resultMap="ArdVideoInspectTaskArdVideoInspectTaskStepResult"> |
| | | select a.id, a.task_name, a.start_time, a.end_time, a.repeat_period, a.inspect_mode, a.menual_switch, a.create_by, a.create_time, a.update_by, a.update_time, a.camera_id, a.channel, a.dept_id, a.user_id, a.current_step_id, a.current_step_start_time, |
| | | b.task_id as sub_task_id, b.dept_id as sub_dept_id, b.user_id as sub_user_id, b.id as sub_id, b.order_number as sub_order_number, b.recording_time as sub_recording_time, b.well_id as sub_well_id |
| | | |
| | | <select id="selectArdVideoInspectTaskById" parameterType="String" |
| | | resultMap="ArdVideoInspectTaskArdVideoInspectTaskStepResult"> |
| | | select a.id, |
| | | a.task_name, |
| | | a.start_time, |
| | | a.end_time, |
| | | a.repeat_period, |
| | | a.inspect_mode, |
| | | a.menual_switch, |
| | | a.create_by, |
| | | a.create_time, |
| | | a.update_by, |
| | | a.update_time, |
| | | a.camera_id, |
| | | a.channel, |
| | | a.dept_id, |
| | | a.user_id, |
| | | a.current_step_id, |
| | | a.current_step_start_time, |
| | | b.task_id as sub_task_id, |
| | | b.dept_id as sub_dept_id, |
| | | b.user_id as sub_user_id, |
| | | b.id as sub_id, |
| | | b.order_number as sub_order_number, |
| | | b.recording_time as sub_recording_time, |
| | | b.well_id as sub_well_id |
| | | from ard_video_inspect_task a |
| | | left join ard_video_inspect_task_step b on b.task_id = a.id |
| | | left join ard_video_inspect_task_step b on b.task_id = a.id |
| | | where a.id = #{id} |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertArdVideoInspectTask" parameterType="ArdVideoInspectTask"> |
| | | insert into ard_video_inspect_task |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="userId != null">user_id,</if> |
| | | <if test="currentStepId != null">current_step_id,</if> |
| | | <if test="currentStepStartTime != null">current_step_start_time,</if> |
| | | </trim> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="taskName != null">#{taskName},</if> |
| | |
| | | <if test="userId != null">#{userId},</if> |
| | | <if test="currentStepId != null">#{currentStepId},</if> |
| | | <if test="currentStepStartTime != null">#{currentStepStartTime},</if> |
| | | </trim> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateArdVideoInspectTask" parameterType="ArdVideoInspectTask"> |
| | |
| | | <if test="channel != null">channel = #{channel},</if> |
| | | <if test="deptId != null">dept_id = #{deptId},</if> |
| | | <if test="userId != null">user_id = #{userId},</if> |
| | | <!-- <if test="currentStepId != null">current_step_id = #{currentStepId},</if>--> |
| | | <!-- <if test="currentStepStartTime != null">current_step_start_time = #{currentStepStartTime},</if>--> |
| | | <!-- <if test="currentStepId != null">current_step_id = #{currentStepId},</if>--> |
| | | <!-- <if test="currentStepStartTime != null">current_step_start_time = #{currentStepStartTime},</if>--> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | where id = #{id} |
| | | </update> |
| | | <delete id="deleteArdVideoInspectTaskById" parameterType="String"> |
| | | delete from ard_video_inspect_task where id = #{id} |
| | | delete |
| | | from ard_video_inspect_task |
| | | where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdVideoInspectTaskByIds" parameterType="String"> |
| | | delete from ard_video_inspect_task where id in |
| | | delete from ard_video_inspect_task where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | |
| | | <delete id="deleteArdVideoInspectTaskStepByTaskIds" parameterType="String"> |
| | | delete from ard_video_inspect_task_step where task_id in |
| | | delete from ard_video_inspect_task_step where task_id in |
| | | <foreach item="taskId" collection="array" open="(" separator="," close=")"> |
| | | #{taskId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <delete id="deleteArdVideoInspectTaskStepByTaskId" parameterType="String"> |
| | | delete from ard_video_inspect_task_step where task_id = #{taskId} |
| | | delete |
| | | from ard_video_inspect_task_step |
| | | where task_id = #{taskId} |
| | | </delete> |
| | | |
| | | <insert id="batchArdVideoInspectTaskStep"> |
| | | insert into ard_video_inspect_task_step( task_id, dept_id, user_id, order_number, recording_time, well_id) values |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | ( #{item.taskId}, #{item.deptId}, #{item.userId}, #{item.orderNumber}, #{item.recordingTime}, #{item.wellId}) |
| | | insert into ard_video_inspect_task_step( task_id, dept_id, user_id, order_number, recording_time, well_id) |
| | | values |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | ( #{item.taskId}, #{item.deptId}, #{item.userId}, #{item.orderNumber}, #{item.recordingTime}, |
| | | #{item.wellId}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <!--查询任务中相机已使用时段--> |
| | | <select id="getTaskUsedCameraPeriods" parameterType="String" resultType="java.util.HashMap"> |
| | | select t.start_time,t.end_time from ard_video_inspect_task t |
| | | where t.camera_id=#{cameraId} |
| | | select t.start_time, t.end_time |
| | | from ard_video_inspect_task t |
| | | where t.camera_id = #{cameraId} |
| | | ORDER BY t.start_time |
| | | </select> |
| | | </mapper> |