<?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.ard.inspection.mapper.ArdPointCloudMapper">
|
|
<resultMap type="ArdPointCloud" id="ArdPointCloudResult">
|
<result property="id" column="id" />
|
<result property="cloudName" column="cloud_name" />
|
<result property="fileName" column="file_name" />
|
<result property="folderName" column="folder_name" />
|
<result property="fileSize" column="file_size" />
|
<result property="associatedState" column="associated_state" />
|
<result property="groupId" column="group_id" />
|
<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="filePath" column="file_path" />
|
</resultMap>
|
|
<resultMap type="ArdPointCloudRoute" id="ArdPointCloudRouteNameResult">
|
<result property="id" column="id" />
|
<result property="cloudName" column="cloud_name" />
|
<result property="fileName" column="file_name" />
|
<result property="folderName" column="folder_name" />
|
<result property="fileSize" column="file_size" />
|
<result property="associatedState" column="associated_state" />
|
<result property="groupId" column="group_id" />
|
<result property="filePath" column="file_path" />
|
<result property="routeId" column="route_id" />
|
<result property="name" column="name" />
|
</resultMap>
|
|
<sql id="selectArdPointCloudVo">
|
select id,
|
cloud_name,
|
file_name,
|
folder_name,
|
file_size,
|
associated_state,
|
group_id,
|
create_by,
|
create_time,
|
update_by,
|
update_time,
|
file_path
|
from ard_point_cloud
|
</sql>
|
|
<sql id="selectArdPointCloudRouteName">
|
SELECT
|
a.id,
|
a.cloud_name,
|
a.file_name,
|
a.folder_name,
|
a.file_size,
|
a.associated_state,
|
a.group_id,
|
a.file_path,
|
c.id as route_id,
|
c.name
|
FROM ard_point_cloud a
|
LEFT JOIN ard_route_cloud b ON a.id = b.cloud_id
|
LEFT JOIN ard_route_info c ON b.route_id = c.id
|
</sql>
|
|
<select id="selectArdPointCloudList" parameterType="ArdPointCloud" resultMap="ArdPointCloudResult">
|
<include refid="selectArdPointCloudVo"/>
|
<where>
|
<if test="cloudName != null and cloudName != ''"> and cloud_name like concat('%', #{cloudName}, '%')</if>
|
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
<if test="fileSize != null "> and file_size = #{fileSize}</if>
|
<if test="associatedState != null and associatedState != ''"> and associated_state = #{associatedState}</if>
|
<if test="groupId != null and groupId != ''"> and group_id = #{groupId}</if>
|
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
|
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
and date_format(create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d')
|
</if>
|
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
and date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d')
|
</if>
|
</where>
|
</select>
|
|
<select id="selectArdPointCloudById" parameterType="String" resultMap="ArdPointCloudResult">
|
<include refid="selectArdPointCloudVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertArdPointCloud" parameterType="ArdPointCloud">
|
insert into ard_point_cloud
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="cloudName != null">cloud_name,</if>
|
<if test="fileName != null">file_name,</if>
|
<if test="folderName != null">folder_name,</if>
|
<if test="fileSize != null">file_size,</if>
|
<if test="associatedState != null">associated_state,</if>
|
<if test="groupId != null">group_id,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateBy != null">update_by,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="filePath != null">file_path,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="cloudName != null">#{cloudName},</if>
|
<if test="fileName != null">#{fileName},</if>
|
<if test="folderName != null">#{folderName},</if>
|
<if test="fileSize != null">#{fileSize},</if>
|
<if test="associatedState != null">#{associatedState},</if>
|
<if test="groupId != null">#{groupId},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="filePath != null">#{filePath},</if>
|
</trim>
|
</insert>
|
|
<update id="updateArdPointCloud" parameterType="ArdPointCloud">
|
update ard_point_cloud
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="cloudName != null">cloud_name = #{cloudName},</if>
|
<if test="fileName != null">file_name = #{fileName},</if>
|
<if test="folderName != null">folder_name = #{folderName},</if>
|
<if test="fileSize != null">file_size = #{fileSize},</if>
|
<if test="associatedState != null">associated_state = #{associatedState},</if>
|
<if test="groupId != null">group_id = #{groupId},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="filePath != null">file_path = #{filePath},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteArdPointCloudById" parameterType="String">
|
delete from ard_point_cloud where id = #{id}
|
</delete>
|
|
<delete id="deleteArdPointCloudByIds" parameterType="String">
|
delete from ard_point_cloud where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
<select id="selectArdPointCloudByFileName" parameterType="String" resultMap="ArdPointCloudResult">
|
<include refid="selectArdPointCloudVo"/>
|
where file_name = #{fileName}
|
</select>
|
|
<select id="selectArdPointCloudNotList" resultMap="ArdPointCloudResult">
|
<include refid="selectArdPointCloudVo"/>
|
where 1=1
|
<if test="ids != null and ids.length > 0">
|
and id NOT IN
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</if>
|
<if test="cloudName != null and cloudName != ''">
|
and cloud_name like concat('%', #{cloudName}, '%')
|
</if>
|
<if test="groupId != null and groupId != ''">
|
and group_id = #{groupId}
|
</if>
|
</select>
|
|
<select id="selectPointCloudRoute" parameterType="String" resultMap="ArdPointCloudRouteNameResult">
|
<include refid="selectArdPointCloudRouteName"/>
|
<where>
|
c.id is NOT NULL
|
<if test="id != null and id != ''"> and a.id = #{id}</if>
|
</where>
|
</select>
|
|
</mapper>
|