2024-11-18 11:30:59 +08:00

126 lines
7.5 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.fastbee.deviceInfo.mapper.DeviceInformationMiaoqingMapper">
<resultMap type="DeviceInformationMiaoqing" id="DeviceInformationMiaoqingResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="deviceBrand" column="device_brand" />
<result property="deviceType" column="device_type" />
<result property="deviceEncoding" column="device_encoding" />
<result property="type" column="type" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="installationLocation" column="installation_location" />
<result property="nameProject" column="name_project" />
<result property="constructionYear" column="construction_year" />
<result property="dockingMethod" column="docking_method" />
<result property="delFlag" column="del_flag" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectDeviceInformationMiaoqingVo">
select id, name, device_brand, device_type, device_encoding, type, longitude, latitude, installation_location, name_project, construction_year, docking_method, del_flag, create_time, create_by, update_time, update_by from iot_device_information_miaoQing
</sql>
<select id="selectDeviceInformationMiaoqingList" parameterType="DeviceInformationMiaoqing" resultMap="DeviceInformationMiaoqingResult">
<include refid="selectDeviceInformationMiaoqingVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="deviceBrand != null and deviceBrand != ''"> and device_brand = #{deviceBrand}</if>
<if test="deviceType != null and deviceType != ''"> and device_type = #{deviceType}</if>
<if test="deviceEncoding != null and deviceEncoding != ''"> and device_encoding = #{deviceEncoding}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
<if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
<if test="installationLocation != null and installationLocation != ''"> and installation_location = #{installationLocation}</if>
<if test="nameProject != null and nameProject != ''"> and name_project = #{nameProject}</if>
<if test="constructionYear != null "> and construction_year = #{constructionYear}</if>
<if test="dockingMethod != null and dockingMethod != ''"> and docking_method = #{dockingMethod}</if>
</where>
</select>
<select id="selectDeviceInformationMiaoqingById" parameterType="Long" resultMap="DeviceInformationMiaoqingResult">
<include refid="selectDeviceInformationMiaoqingVo"/>
where id = #{id}
</select>
<insert id="insertDeviceInformationMiaoqing" parameterType="DeviceInformationMiaoqing" useGeneratedKeys="true" keyProperty="id">
insert into iot_device_information_miaoQing
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="deviceBrand != null">device_brand,</if>
<if test="deviceType != null">device_type,</if>
<if test="deviceEncoding != null">device_encoding,</if>
<if test="type != null">type,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="installationLocation != null">installation_location,</if>
<if test="nameProject != null">name_project,</if>
<if test="constructionYear != null">construction_year,</if>
<if test="dockingMethod != null">docking_method,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="deviceBrand != null">#{deviceBrand},</if>
<if test="deviceType != null">#{deviceType},</if>
<if test="deviceEncoding != null">#{deviceEncoding},</if>
<if test="type != null">#{type},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="installationLocation != null">#{installationLocation},</if>
<if test="nameProject != null">#{nameProject},</if>
<if test="constructionYear != null">#{constructionYear},</if>
<if test="dockingMethod != null">#{dockingMethod},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateDeviceInformationMiaoqing" parameterType="DeviceInformationMiaoqing">
update iot_device_information_miaoQing
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="deviceBrand != null">device_brand = #{deviceBrand},</if>
<if test="deviceType != null">device_type = #{deviceType},</if>
<if test="deviceEncoding != null">device_encoding = #{deviceEncoding},</if>
<if test="type != null">type = #{type},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="installationLocation != null">installation_location = #{installationLocation},</if>
<if test="nameProject != null">name_project = #{nameProject},</if>
<if test="constructionYear != null">construction_year = #{constructionYear},</if>
<if test="dockingMethod != null">docking_method = #{dockingMethod},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDeviceInformationMiaoqingById" parameterType="Long">
delete from iot_device_information_miaoQing where id = #{id}
</delete>
<delete id="deleteDeviceInformationMiaoqingByIds" parameterType="String">
delete from iot_device_information_miaoQing where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>