|
@@ -0,0 +1,90 @@
|
|
|
+<?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.qdtl.mapper.TlInspectionDeviceTrailMapper">
|
|
|
+
|
|
|
+ <resultMap type="TlInspectionDeviceTrail" id="TlInspectionDeviceTrailResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="deviceId" column="device_id" />
|
|
|
+ <result property="deviceName" column="device_name" />
|
|
|
+ <result property="deviceCode" column="device_code" />
|
|
|
+ <result property="checkpointId" column="checkpoint_id" />
|
|
|
+ <result property="checkpointName" column="checkpoint_name" />
|
|
|
+ <result property="checkpointCard" column="checkpoint_card" />
|
|
|
+ <result property="fence" column="fence" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectTlInspectionDeviceTrailVo">
|
|
|
+ select id, device_id, device_name, device_code, checkpoint_id, checkpoint_name, checkpoint_card, fence, create_time from tl_inspection_device_trail
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectTlInspectionDeviceTrailList" parameterType="TlInspectionDeviceTrail" resultMap="TlInspectionDeviceTrailResult">
|
|
|
+ <include refid="selectTlInspectionDeviceTrailVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
|
|
+ <if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
|
|
|
+ <if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
|
|
|
+ <if test="checkpointId != null and checkpointId != ''"> and checkpoint_id = #{checkpointId}</if>
|
|
|
+ <if test="checkpointName != null and checkpointName != ''"> and checkpoint_name like concat('%', #{checkpointName}, '%')</if>
|
|
|
+ <if test="checkpointCard != null and checkpointCard != ''"> and checkpoint_card = #{checkpointCard}</if>
|
|
|
+ <if test="fence != null and fence != ''"> and fence = #{fence}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTlInspectionDeviceTrailById" parameterType="Long" resultMap="TlInspectionDeviceTrailResult">
|
|
|
+ <include refid="selectTlInspectionDeviceTrailVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertTlInspectionDeviceTrail" parameterType="TlInspectionDeviceTrail" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into tl_inspection_device_trail
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="deviceId != null">device_id,</if>
|
|
|
+ <if test="deviceName != null">device_name,</if>
|
|
|
+ <if test="deviceCode != null">device_code,</if>
|
|
|
+ <if test="checkpointId != null">checkpoint_id,</if>
|
|
|
+ <if test="checkpointName != null">checkpoint_name,</if>
|
|
|
+ <if test="checkpointCard != null">checkpoint_card,</if>
|
|
|
+ <if test="fence != null">fence,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="deviceId != null">#{deviceId},</if>
|
|
|
+ <if test="deviceName != null">#{deviceName},</if>
|
|
|
+ <if test="deviceCode != null">#{deviceCode},</if>
|
|
|
+ <if test="checkpointId != null">#{checkpointId},</if>
|
|
|
+ <if test="checkpointName != null">#{checkpointName},</if>
|
|
|
+ <if test="checkpointCard != null">#{checkpointCard},</if>
|
|
|
+ <if test="fence != null">#{fence},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateTlInspectionDeviceTrail" parameterType="TlInspectionDeviceTrail">
|
|
|
+ update tl_inspection_device_trail
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="deviceId != null">device_id = #{deviceId},</if>
|
|
|
+ <if test="deviceName != null">device_name = #{deviceName},</if>
|
|
|
+ <if test="deviceCode != null">device_code = #{deviceCode},</if>
|
|
|
+ <if test="checkpointId != null">checkpoint_id = #{checkpointId},</if>
|
|
|
+ <if test="checkpointName != null">checkpoint_name = #{checkpointName},</if>
|
|
|
+ <if test="checkpointCard != null">checkpoint_card = #{checkpointCard},</if>
|
|
|
+ <if test="fence != null">fence = #{fence},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteTlInspectionDeviceTrailById" parameterType="Long">
|
|
|
+ delete from tl_inspection_device_trail where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteTlInspectionDeviceTrailByIds" parameterType="String">
|
|
|
+ delete from tl_inspection_device_trail where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|