| <?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"> | 
| <mapper namespace="com.ruoyi.inspect.mapper.ArdVideoInspectRecordMapper"> | 
|      | 
|     <resultMap type="ArdVideoInspectRecord" id="ArdVideoInspectRecordResult"> | 
|         <result property="id"    column="id"    /> | 
|         <result property="startTime"    column="start_time"    /> | 
|         <result property="endTime"    column="end_time"    /> | 
|         <result property="recordFilePath"    column="record_file_path"    /> | 
|         <result property="stepId"    column="step_id"    /> | 
|         <result property="deptId"    column="dept_id"    /> | 
|         <result property="userId"    column="user_id"    /> | 
|     </resultMap> | 
|   | 
|     <sql id="selectArdVideoInspectRecordVo"> | 
|         select id, start_time, end_time, record_file_path, step_id, dept_id, user_id,well_name from ard_video_inspect_record | 
|     </sql> | 
|   | 
|     <select id="selectArdVideoInspectRecordList" parameterType="ArdVideoInspectRecord" resultMap="ArdVideoInspectRecordResult"> | 
|         <include refid="selectArdVideoInspectRecordVo"/> | 
|         <where> | 
|             <if test="startTime != null  and startTime != ''"> and start_time = #{startTime}</if> | 
|             <if test="endTime != null  and endTime != ''"> and end_time = #{ejava.util.HashMapndTime}</if> | 
|             <if test="recordFilePath != null  and recordFilePath != ''"> and record_file_path = #{recordFilePath}</if> | 
|             <if test="stepId != null  and stepId != ''"> and step_id = #{stepId}</if> | 
|             <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if> | 
|             <if test="userId != null  and userId != ''"> and user_id = #{userId}</if> | 
|         </where> | 
|     </select> | 
|     <!--按日期查询--> | 
|     <select id="selectArdVideoInspectRecordListByStartTime" parameterType="ArdVideoInspectRecord" resultType="java.util.HashMap"> | 
|         <include refid="selectArdVideoInspectRecordVo"/> | 
|         <where> | 
|             <if test="startTime != null  and startTime != ''">and start_time like ('${startTime}%')</if> | 
|             <if test="stepId != null  and stepId != ''">and step_id = #{stepId}</if> | 
|         </where> | 
|         order by start_time desc | 
|     </select> | 
|     <!--按月份统计文件数量--> | 
|     <select id="selectArdVideoInspectRecordCountByStartMonth" parameterType="String" resultType="java.util.HashMap"> | 
|         select f.start_date,count(*) from | 
|         (select substring(r.start_time,0,11)as start_date,* from ard_video_inspect_record r | 
|         where r.start_time like '${startMonth}%') as f | 
|         group by f.start_date | 
|     </select> | 
|   | 
|     <select id="selectArdVideoInspectRecordById" parameterType="String" resultMap="ArdVideoInspectRecordResult"> | 
|         <include refid="selectArdVideoInspectRecordVo"/> | 
|         where id = #{id} | 
|     </select> | 
|          | 
|     <insert id="insertArdVideoInspectRecord" parameterType="ArdVideoInspectRecord"> | 
|         insert into ard_video_inspect_record | 
|         <trim prefix="(" suffix=")" suffixOverrides=","> | 
|             <if test="id != null">id,</if> | 
|             <if test="startTime != null">start_time,</if> | 
|             <if test="endTime != null">end_time,</if> | 
|             <if test="recordFilePath != null">record_file_path,</if> | 
|             <if test="stepId != null">step_id,</if> | 
|             <if test="deptId != null">dept_id,</if> | 
|             <if test="userId != null">user_id,</if> | 
|             <if test="wellName != null">well_name,</if> | 
|          </trim> | 
|         <trim prefix="values (" suffix=")" suffixOverrides=","> | 
|             <if test="id != null">#{id},</if> | 
|             <if test="startTime != null">#{startTime},</if> | 
|             <if test="endTime != null">#{endTime},</if> | 
|             <if test="recordFilePath != null">#{recordFilePath},</if> | 
|             <if test="stepId != null">#{stepId},</if> | 
|             <if test="deptId != null">#{deptId},</if> | 
|             <if test="userId != null">#{userId},</if> | 
|             <if test="wellName != null">#{wellName},</if> | 
|          </trim> | 
|     </insert> | 
|   | 
|     <update id="updateArdVideoInspectRecord" parameterType="ArdVideoInspectRecord"> | 
|         update ard_video_inspect_record | 
|         <trim prefix="SET" suffixOverrides=","> | 
|             <if test="startTime != null">start_time = #{startTime},</if> | 
|             <if test="endTime != null">end_time = #{endTime},</if> | 
|             <if test="recordFilePath != null">record_file_path = #{recordFilePath},</if> | 
|             <if test="stepId != null">step_id = #{stepId},</if> | 
|             <if test="deptId != null">dept_id = #{deptId},</if> | 
|             <if test="userId != null">user_id = #{userId},</if> | 
|             <if test="wellName != null">well_name = #{wellName},</if> | 
|         </trim> | 
|         where id = #{id} | 
|     </update> | 
|   | 
|     <delete id="deleteArdVideoInspectRecordById" parameterType="String"> | 
|         delete from ard_video_inspect_record where id = #{id} | 
|     </delete> | 
|   | 
|     <delete id="deleteArdVideoInspectRecordByIds" parameterType="String"> | 
|         delete from ard_video_inspect_record where id in  | 
|         <foreach item="id" collection="array" open="(" separator="," close=")"> | 
|             #{id} | 
|         </foreach> | 
|     </delete> | 
| </mapper> |