|
|
|
<?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.zc.business.mapper.MiddleDatabaseMapper">
|
|
|
|
|
|
|
|
<insert id="insertMiddleDatabaseDeviceData" parameterType="MdDeviceData" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
insert into device_data
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="devNo != null">devNo,</if>
|
|
|
|
<if test="devType != null">devType,</if>
|
|
|
|
<if test="timeStamp != null">`timeStamp`,</if>
|
|
|
|
<if test="expands != null">expands,</if>
|
|
|
|
<if test="creatorUserId != null">CreatorUserId,</if>
|
|
|
|
<if test="lastModificationTime != null">LastModificationTime,</if>
|
|
|
|
<if test="lastModifierUserId != null">LastModifierUserId,</if>
|
|
|
|
<if test="isDeleted != null">IsDeleted,</if>
|
|
|
|
<if test="deleterUserId != null">DeleterUserId,</if>
|
|
|
|
<if test="deletionTime != null">DeletionTime,</if>
|
|
|
|
CreationTime
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="devNo != null">#{devNo},</if>
|
|
|
|
<if test="devType != null">#{devType},</if>
|
|
|
|
<if test="timeStamp != null">#{timeStamp},</if>
|
|
|
|
<if test="expands != null">#{expands},</if>
|
|
|
|
<if test="creatorUserId != null">#{creatorUserId},</if>
|
|
|
|
<if test="lastModificationTime != null">#{lastModificationTime},</if>
|
|
|
|
<if test="isDeleted != null">#{isDeleted},</if>
|
|
|
|
<if test="deleterUserId != null">#{deleterUserId},</if>
|
|
|
|
<if test="deletionTime != null">#{deletionTime},</if>
|
|
|
|
current_date
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateMiddleDatabaseDevice">
|
|
|
|
update device set dev_status = #{deviceState} where dev_no = #{iotDeviceId}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
</mapper>
|