|
|
@@ -1,129 +0,0 @@
|
|
|
-<?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.zd.laboratory.mapper.LabFireDeviceMapper">
|
|
|
-
|
|
|
- <resultMap type="com.zd.laboratory.domain.vo.LabFireDeviceVO" id="LabFireDeviceResult">
|
|
|
- <result property="id" column="id"/>
|
|
|
- <result property="deptName" column="dept_name"/>
|
|
|
- <result property="deptId" column="dept_id"/>
|
|
|
- <result property="createTime" column="create_time"/>
|
|
|
- <result property="userId" column="user_id"/>
|
|
|
- <result property="createBy" column="create_by"/>
|
|
|
- <result property="updateBy" column="update_by"/>
|
|
|
- <result property="deviceName" column="device_name"/>
|
|
|
- <result property="deviceCode" column="device_code"/>
|
|
|
- <result property="deviceUrl" column="device_url"/>
|
|
|
- <result property="deviceCountDown" column="device_count_down"/>
|
|
|
- <result property="deviceStatus" column="device_status"/>
|
|
|
- <result property="subjectId" column="subject_id"/>
|
|
|
- </resultMap>
|
|
|
-
|
|
|
- <sql id="selectFireDeviceVo">
|
|
|
- select fd.id,
|
|
|
- fd.device_name,
|
|
|
- fd.device_code,
|
|
|
- fd.device_url,
|
|
|
- fd.device_count_down,
|
|
|
- fd.device_status,
|
|
|
- fd.subject_id,
|
|
|
- fd.dept_id,
|
|
|
- fd.dept_name,
|
|
|
- fd.user_id,
|
|
|
- fd.create_by,
|
|
|
- fd.create_time,
|
|
|
- ls.name subjectName,
|
|
|
- lsl.room,
|
|
|
- sd.dept_name buildName
|
|
|
- from lab_fire_device fd
|
|
|
- LEFT JOIN lab_subject ls on fd.subject_id = ls.id
|
|
|
- LEFT JOIN lab_subject_layout lsl on lsl.floor_id = ls.layout_id and ls.id = fd.subject_id
|
|
|
- LEFT JOIN sys_dept sd on ls.build_id = sd.dept_id and ls.id = fd.subject_id
|
|
|
- </sql>
|
|
|
-
|
|
|
- <select id="selectLabFireDeviceList" parameterType="com.zd.laboratory.domain.vo.LabFireDeviceVO"
|
|
|
- resultMap="LabFireDeviceResult">
|
|
|
- <include refid="selectFireDeviceVo"/>
|
|
|
- <where>
|
|
|
- <if test="searchValue != null and searchValue != ''">
|
|
|
- and (fd.device_name like concat('%', #{searchValue}, '%') or
|
|
|
- ls.`nick_name` like concat('%', #{searchValue}, '%') )
|
|
|
- </if>
|
|
|
- <if test="deviceName != null and deviceName != ''">and fd.device_name like concat('%', #{deviceName}, '%')</if>
|
|
|
- <if test="deviceCode != null and deviceCode != ''">and fd.device_code = #{deviceCode}</if>
|
|
|
- <if test="deviceUrl != null and deviceUrl != ''">and fd.device_url = #{deviceUrl}</if>
|
|
|
- <if test="deviceCountDown != null ">and fd.device_count_down =#{deviceCountDown}</if>
|
|
|
- <if test="deviceStatus != null ">and fd.device_status = #{deviceStatus}</if>
|
|
|
- ${params.dataScope}
|
|
|
- </where>
|
|
|
- order by fd.create_time desc
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectLabFireDeviceById" parameterType="Long" resultMap="LabFireDeviceResult">
|
|
|
- <include refid="selectFireDeviceVo"/>
|
|
|
- where id = #{id}
|
|
|
- </select>
|
|
|
-
|
|
|
- <insert id="insertLabFireDevice" parameterType="com.zd.laboratory.domain.LabFireDevice" useGeneratedKeys="true"
|
|
|
- keyProperty="id">
|
|
|
- insert into lab_fire_device
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="deptName != null">dept_name,</if>
|
|
|
- <if test="deptId != null">dept_id,</if>
|
|
|
- <if test="createTime != null">create_time,</if>
|
|
|
- <if test="userId != null">user_id,</if>
|
|
|
- <if test="createBy != null">create_by,</if>
|
|
|
- <if test="deviceName != null">device_name,</if>
|
|
|
- <if test="deviceCode != null">device_code,</if>
|
|
|
- <if test="deviceUrl != null">device_url,</if>
|
|
|
- <if test="deviceCountDown != null">device_count_down,</if>
|
|
|
- <if test="deviceStatus != null">device_status,</if>
|
|
|
- <if test="subjectId != null">subject_id,</if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="deptName != null">#{deptName},</if>
|
|
|
- <if test="deptId != null">#{deptId},</if>
|
|
|
- <if test="createTime != null">#{createTime},</if>
|
|
|
- <if test="userId != null">#{userId},</if>
|
|
|
- <if test="createBy != null">#{createBy},</if>
|
|
|
- <if test="deviceName != null">#{deviceName},</if>
|
|
|
- <if test="deviceCode != null">#{deviceCode},</if>
|
|
|
- <if test="deviceUrl != null">#{deviceUrl},</if>
|
|
|
- <if test="deviceCountDown != null">#{deviceCountDown},</if>
|
|
|
- <if test="deviceStatus != null">#{deviceStatus},</if>
|
|
|
- <if test="subjectId != null">#{subjectId},</if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
-
|
|
|
- <update id="updateLabFireDevice" parameterType="com.zd.laboratory.domain.LabMold">
|
|
|
- update lab_fire_device
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="deptName != null">dept_name = #{deptName},</if>
|
|
|
- <if test="deptId != null">dept_id = #{deptId},</if>
|
|
|
- <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
- <if test="userId != null">user_id = #{userId},</if>
|
|
|
- <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
- <if test="deviceName != null">device_name = #{deviceName},</if>
|
|
|
- <if test="deviceCode != null">device_code = #{deviceCode},</if>
|
|
|
- <if test="deviceUrl != null">device_url = #{deviceUrl},</if>
|
|
|
- <if test="deviceCountDown != null">device_count_down = #{deviceCountDown},</if>
|
|
|
- <if test="deviceStatus != null">device_status = #{deviceStatus},</if>
|
|
|
- <if test="subjectId != null">subject_id = #{subjectId},</if>
|
|
|
- </trim>
|
|
|
- where id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <delete id="deleteLabFireDeviceById" parameterType="Long">
|
|
|
- delete
|
|
|
- from lab_fire_device
|
|
|
- where id = #{id}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <delete id="deleteLabFireDeviceByIds" parameterType="String">
|
|
|
- delete from lab_fire_device where id in
|
|
|
- <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </delete>
|
|
|
-</mapper>
|