|
@@ -1,43 +1,58 @@
|
|
|
<?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.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" />
|
|
|
+ <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
|
|
|
+ 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>
|
|
|
+ <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>
|
|
|
-
|
|
|
+
|
|
|
+ <select id="selectListByDate" resultMap="TlInspectionDeviceTrailResult">
|
|
|
+ <include refid="selectTlInspectionDeviceTrailVo"/>
|
|
|
+ where date_format(create_time,'%Y-%m-%d') = #{date}
|
|
|
+ order by create_time asc
|
|
|
+ </select>
|
|
|
+
|
|
|
<insert id="insertTlInspectionDeviceTrail" parameterType="TlInspectionDeviceTrail" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into tl_inspection_device_trail
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -49,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="checkpointCard != null">checkpoint_card,</if>
|
|
|
<if test="fence != null">fence,</if>
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="deviceId != null">#{deviceId},</if>
|
|
|
<if test="deviceName != null">#{deviceName},</if>
|
|
@@ -59,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="checkpointCard != null">#{checkpointCard},</if>
|
|
|
<if test="fence != null">#{fence},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateTlInspectionDeviceTrail" parameterType="TlInspectionDeviceTrail">
|
|
@@ -78,11 +93,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteTlInspectionDeviceTrailById" parameterType="Long">
|
|
|
- delete from tl_inspection_device_trail where id = #{id}
|
|
|
+ delete
|
|
|
+ from tl_inspection_device_trail
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTlInspectionDeviceTrailByIds" parameterType="String">
|
|
|
- delete from tl_inspection_device_trail where id in
|
|
|
+ delete from tl_inspection_device_trail where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|