2024-08-09 19:47:55 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
<!DOCTYPE mapper
|
2024-08-12 14:23:08 +08:00
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
2024-08-09 19:47:55 +08:00
|
|
|
<mapper namespace="com.ics.admin.mapper.RepairAttachMapper">
|
|
|
|
|
|
|
|
<resultMap type="com.ics.admin.domain.RepairAttach" id="RepairAttachResult">
|
2024-08-12 14:23:08 +08:00
|
|
|
<result property="id" column="id"/>
|
|
|
|
<result property="repairId" column="repair_id"/>
|
|
|
|
<result property="nodeId" column="node_id"/>
|
|
|
|
<result property="originalFilename" column="original_filename"/>
|
|
|
|
<result property="fileName" column="filename"/>
|
|
|
|
<result property="url" column="url"/>
|
|
|
|
<result property="fileSize" column="filesize"/>
|
|
|
|
<result property="ext1" column="ext1"/>
|
|
|
|
<result property="ext2" column="ext2"/>
|
|
|
|
<result property="ext3" column="ext3"/>
|
|
|
|
<result property="deleteFlag" column="delete_flag"/>
|
|
|
|
<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="tenantId" column="tenant_id"/>
|
|
|
|
<result property="parkId" column="park_id"/>
|
2024-08-09 19:47:55 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectRepairAttachVo">
|
2024-08-12 14:23:08 +08:00
|
|
|
SELECT id,
|
|
|
|
repair_id,
|
|
|
|
node_id,
|
|
|
|
original_filename,
|
|
|
|
filename,
|
|
|
|
url,
|
|
|
|
filesize,
|
|
|
|
ext1,
|
|
|
|
ext2,
|
|
|
|
ext3,
|
|
|
|
delete_flag,
|
|
|
|
create_by,
|
|
|
|
create_time,
|
|
|
|
update_by,
|
|
|
|
update_time,
|
|
|
|
tenant_id,
|
|
|
|
park_id
|
|
|
|
FROM ics_repair_attach
|
2024-08-09 19:47:55 +08:00
|
|
|
</sql>
|
|
|
|
|
2024-08-12 14:23:08 +08:00
|
|
|
<select id="selectRepairAttachById" parameterType="Long" resultMap="RepairAttachResult">
|
2024-08-09 19:47:55 +08:00
|
|
|
<include refid="selectRepairAttachVo"/>
|
2024-08-12 14:23:08 +08:00
|
|
|
WHERE id = #{id} and delete_flag = 0
|
2024-08-09 19:47:55 +08:00
|
|
|
</select>
|
|
|
|
|
2024-08-14 03:23:31 +08:00
|
|
|
<select id="selectRepairAttachList" parameterType="Long" resultMap="RepairAttachResult">
|
2024-08-09 19:47:55 +08:00
|
|
|
<include refid="selectRepairAttachVo"/>
|
2024-08-12 14:23:08 +08:00
|
|
|
where repair_id= #{repairId} and delete_flag = 0
|
2024-08-09 19:47:55 +08:00
|
|
|
</select>
|
|
|
|
|
2024-08-14 11:17:01 +08:00
|
|
|
<select id="getRepairFirstImg" parameterType="Long" resultType="String">
|
|
|
|
select url from ics_repair_attach where repair_id=#{repairId} and node_id=1 and delete_flag=0 and ext1='img/video' order by id limit 1
|
|
|
|
</select>
|
|
|
|
|
2024-08-14 03:23:31 +08:00
|
|
|
<insert id="insertRepairAttach" parameterType="com.ics.admin.domain.RepairAttach">
|
2024-08-09 19:47:55 +08:00
|
|
|
INSERT INTO ics_repair_attach
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="repairId != null ">repair_id,</if>
|
|
|
|
<if test="nodeId != null ">node_id,</if>
|
|
|
|
<if test="originalFilename != null and originalFilename != ''">original_filename,</if>
|
2024-08-12 14:23:08 +08:00
|
|
|
<if test="fileName != null and fileName != ''">filename,</if>
|
2024-08-09 19:47:55 +08:00
|
|
|
<if test="url != null and url != ''">url,</if>
|
2024-08-12 14:23:08 +08:00
|
|
|
<if test="fileSize != null ">fileSize,</if>
|
2024-08-09 19:47:55 +08:00
|
|
|
<if test="ext1 != null and ext1 != ''">ext1,</if>
|
|
|
|
<if test="ext2 != null and ext2 != ''">ext2,</if>
|
|
|
|
<if test="ext3 != null and ext3 != ''">ext3,</if>
|
2024-08-12 14:23:08 +08:00
|
|
|
<if test="deleteFlag != null ">delete_flag,</if>
|
2024-08-09 19:47:55 +08:00
|
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
|
<if test="createTime != null ">create_time,</if>
|
|
|
|
<if test="tenantId != null ">tenant_id,</if>
|
|
|
|
<if test="parkId != null ">park_id,</if>
|
|
|
|
</trim>
|
2024-08-12 14:23:08 +08:00
|
|
|
|
2024-08-09 19:47:55 +08:00
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="repairId != null ">#{repairId},</if>
|
|
|
|
<if test="nodeId != null ">#{nodeId},</if>
|
|
|
|
<if test="originalFilename != null and originalFilename != ''">#{originalFilename},</if>
|
2024-08-12 14:23:08 +08:00
|
|
|
<if test="fileName != null and fileName != ''">#{fileName},</if>
|
2024-08-09 19:47:55 +08:00
|
|
|
<if test="url != null and url != ''">#{url},</if>
|
2024-08-12 14:23:08 +08:00
|
|
|
<if test="fileSize != null ">#{fileSize},</if>
|
2024-08-09 19:47:55 +08:00
|
|
|
<if test="ext1 != null and ext1 != ''">#{ext1},</if>
|
|
|
|
<if test="ext2 != null and ext2 != ''">#{ext2},</if>
|
|
|
|
<if test="ext3 != null and ext3 != ''">#{ext3},</if>
|
2024-08-12 14:23:08 +08:00
|
|
|
<if test="deleteFlag != null ">#{deleteFlag},</if>
|
2024-08-09 19:47:55 +08:00
|
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
|
<if test="createTime != null ">#{createTime},</if>
|
|
|
|
<if test="tenantId != null ">#{tenantId},</if>
|
|
|
|
<if test="parkId != null ">#{parkId},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
2024-08-14 03:23:31 +08:00
|
|
|
<update id="updateRepairAttachs">
|
2024-08-12 14:23:08 +08:00
|
|
|
UPDATE ics_repair_attach set repair_id= #{repairId} where id in
|
|
|
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
2024-08-09 19:47:55 +08:00
|
|
|
</update>
|
|
|
|
|
2024-08-12 14:23:08 +08:00
|
|
|
<delete id="deleteByRepairId" parameterType="Long">
|
|
|
|
DELETE
|
|
|
|
FROM ics_repair_attach
|
|
|
|
WHERE repair_id = #{repairId}
|
2024-08-09 19:47:55 +08:00
|
|
|
</delete>
|
|
|
|
|
2024-08-12 14:23:08 +08:00
|
|
|
<delete id="deleteRepairAttachById" parameterType="Long">
|
2024-08-14 03:23:31 +08:00
|
|
|
DELETE
|
|
|
|
FROM ics_repair_attach
|
|
|
|
WHERE id = #{id}
|
2024-08-09 19:47:55 +08:00
|
|
|
</delete>
|
|
|
|
</mapper>
|