224 lines
8.1 KiB
XML
224 lines
8.1 KiB
XML
<?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.zhwl.passflow.mapper.ZdyDevicePassflowMapper">
|
|
|
|
<resultMap type="ZdyDevicePassflow" id="ZdyDevicePassflowResult">
|
|
<result property="passflowId" column="passflow_id"/>
|
|
<result property="sn" column="sn"/>
|
|
<result property="passflowName" column="passflow_name"/>
|
|
<result property="passflowType" column="passflow_type"/>
|
|
<result property="passflowLocation" column="passflow_location"/>
|
|
<result property="name" column="name"/>
|
|
<result property="longitude" column="longitude"/>
|
|
<result property="latitude" column="latitude"/>
|
|
<result property="status" column="status"/>
|
|
<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="remark" column="remark"/>
|
|
<result property="syncTime" column="sync_time"/>
|
|
<result property="deptId" column="dept_id"/>
|
|
<result property="scenicId" column="scenic_id"/>
|
|
<result property="scenicName" column="scenic_name"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectZdyDevicePassflowVo">
|
|
select zdp.passflow_id,
|
|
zdp.sn,
|
|
zdp.passflow_name,
|
|
zdp.passflow_type,
|
|
zdp.passflow_location,
|
|
zdp.name,
|
|
zdp.longitude,
|
|
zdp.latitude,
|
|
zdp.status,
|
|
zdp.create_by,
|
|
zdp.create_time,
|
|
zdp.update_by,
|
|
zdp.update_time,
|
|
zdp.remark,
|
|
zdp.sync_time,
|
|
zdp.dept_id,
|
|
zdp.scenic_id,
|
|
zs.scenic_name
|
|
from zdy_device_passflow zdp
|
|
left join zdy_scenic zs on zs.id = zdp.scenic_id
|
|
</sql>
|
|
|
|
<select id="selectZdyDevicePassflowList" parameterType="ZdyDevicePassflow" resultMap="ZdyDevicePassflowResult">
|
|
<include refid="selectZdyDevicePassflowVo"/>
|
|
left join sys_dept d on zdp.dept_id = d.dept_id
|
|
<where>
|
|
<if test="passflowName != null and passflowName != ''">
|
|
and zdp.passflow_name like concat('%', #{passflowName}, '%')
|
|
</if>
|
|
<if test="sn != null and sn != ''">
|
|
and zdp.sn = #{sn}
|
|
</if>
|
|
<if test="status != null ">
|
|
and zdp.status = #{status}
|
|
</if>
|
|
<if test="passflowLocation != null and passflowLocation != ''">
|
|
and zdp.passflow_location = #{passflowLocation}
|
|
</if>
|
|
${params.dataScope}
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectZdyDevicePassflowByPassflowId" parameterType="Long"
|
|
resultMap="ZdyDevicePassflowResult">
|
|
<include refid="selectZdyDevicePassflowVo"/>
|
|
where zdp.passflow_id = #{passflowId}
|
|
</select>
|
|
|
|
<select id="selectZdyDevicePassflowBySnAndName" parameterType="String"
|
|
resultMap="ZdyDevicePassflowResult">
|
|
<include refid="selectZdyDevicePassflowVo"/>
|
|
where zdp.sn = #{sn} and zdp.name = #{name}
|
|
</select>
|
|
|
|
<insert id="insertZdyDevicePassflow" parameterType="ZdyDevicePassflow" useGeneratedKeys="true"
|
|
keyProperty="passflowId">
|
|
insert into zdy_device_passflow
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="sn != null">sn,
|
|
</if>
|
|
<if test="passflowName != null">passflow_name,
|
|
</if>
|
|
<if test="passflowType != null">passflow_type,
|
|
</if>
|
|
<if test="passflowLocation != null">passflow_location,
|
|
</if>
|
|
<if test="name != null">name,
|
|
</if>
|
|
<if test="longitude != null">longitude,
|
|
</if>
|
|
<if test="latitude != null">latitude,
|
|
</if>
|
|
<if test="status != null">status,
|
|
</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="remark != null">remark,
|
|
</if>
|
|
<if test="syncTime != null">sync_time,
|
|
</if>
|
|
<if test="deptId != null">dept_id,
|
|
</if>
|
|
<if test="scenicId != null">scenic_id,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="sn != null">#{sn},
|
|
</if>
|
|
<if test="passflowName != null">#{passflowName},
|
|
</if>
|
|
<if test="passflowType != null">#{passflowType},
|
|
</if>
|
|
<if test="passflowLocation != null">#{passflowLocation},
|
|
</if>
|
|
<if test="name != null">#{name},
|
|
</if>
|
|
<if test="longitude != null">#{longitude},
|
|
</if>
|
|
<if test="latitude != null">#{latitude},
|
|
</if>
|
|
<if test="status != null">#{status},
|
|
</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="remark != null">#{remark},
|
|
</if>
|
|
<if test="syncTime != null">#{syncTime},
|
|
</if>
|
|
<if test="deptId != null">#{deptId},
|
|
</if>
|
|
<if test="scenicId != null">#{scenicId},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateZdyDevicePassflow" parameterType="ZdyDevicePassflow">
|
|
update zdy_device_passflow
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="sn != null">sn =
|
|
#{sn},
|
|
</if>
|
|
<if test="passflowName != null">passflow_name =
|
|
#{passflowName},
|
|
</if>
|
|
<if test="passflowType != null">passflow_type =
|
|
#{passflowType},
|
|
</if>
|
|
<if test="passflowLocation != null">passflow_location =
|
|
#{passflowLocation},
|
|
</if>
|
|
<if test="name != null">name =
|
|
#{name},
|
|
</if>
|
|
<if test="longitude != null">longitude =
|
|
#{longitude},
|
|
</if>
|
|
<if test="latitude != null">latitude =
|
|
#{latitude},
|
|
</if>
|
|
<if test="status != null">status =
|
|
#{status},
|
|
</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="remark != null">remark =
|
|
#{remark},
|
|
</if>
|
|
<if test="syncTime != null">sync_time =
|
|
#{syncTime},
|
|
</if>
|
|
<if test="deptId != null">dept_id =
|
|
#{deptId},
|
|
</if>
|
|
<if test="scenicId != null">scenic_id =
|
|
#{scenicId},
|
|
</if>
|
|
</trim>
|
|
where passflow_id = #{passflowId}
|
|
</update>
|
|
|
|
<delete id="deleteZdyDevicePassflowByPassflowId" parameterType="Long">
|
|
delete
|
|
from zdy_device_passflow
|
|
where passflow_id = #{passflowId}
|
|
</delete>
|
|
|
|
<delete id="deleteZdyDevicePassflowByPassflowIds" parameterType="String">
|
|
delete from zdy_device_passflow where passflow_id in
|
|
<foreach item="passflowId" collection="array" open="(" separator="," close=")">
|
|
#{passflowId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|