LingangEquipmentHeartbeatMapper.xml 4.71 KB
<?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.ruoyi.mapper.equipment.heartbeat.LingangEquipmentHeartbeatMapper">
    <resultMap id="BaseResultMap" type="com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="device" jdbcType="VARCHAR" property="device"/>
        <result column="time" jdbcType="TIMESTAMP" property="time"/>
        <result column="alarm" jdbcType="INTEGER" property="alarm"/>
        <result column="exKeys" jdbcType="VARCHAR" property="exkeys"/>
        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
        <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
        <result column="updateBy" jdbcType="VARCHAR" property="updateby"/>
    </resultMap>

    <insert id="insertSelective" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
            parameterType="com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat">
        INSERT INTO equipment_heartbeat
        <include refid="insertSelectiveColumn"></include>
        <include refid="insertSelectiveValue"></include>
    </insert>

    <sql id="columns">
        id
        ,  device   ,  time   ,  alarm   ,  exKeys   ,  create_time   ,  create_by   ,  update_time   ,  updateBy
    </sql>

    <sql id="insert_columns">
        id
        ,  device  ,  time  ,  alarm  ,  exKeys  ,  create_time  ,  create_by  ,  update_time  ,  updateBy
    </sql>

    <sql id="insert_values">
        #{id}
        ,
        #{device},
        #{time},
        #{alarm},
        #{exkeys},
        #{createTime},
        #{createBy},
        #{updateTime},
        #{updateby}
    </sql>

    <sql id="insertSelectiveColumn">
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="null!=id">id,</if>
            <if test="null!=device">device,</if>
            <if test="null!=time">time,</if>
            <if test="null!=alarm">alarm,</if>
            <if test="null!=exkeys">exKeys,</if>
            <if test="null!=createTime">create_time,</if>
            <if test="null!=createBy">create_by,</if>
            <if test="null!=updateTime">update_time,</if>
            <if test="null!=updateby">updateBy,</if>
        </trim>
    </sql>

    <sql id="insertSelectiveValue">
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="null!=id">#{id,jdbcType=BIGINT},</if>
            <if test="null!=device">#{device,jdbcType=VARCHAR},</if>
            <if test="null!=time">#{time,jdbcType=TIMESTAMP},</if>
            <if test="null!=alarm">#{alarm,jdbcType=INTEGER},</if>
            <if test="null!=exkeys">#{exkeys,jdbcType=VARCHAR},</if>
            <if test="null!=createTime">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="null!=createBy">#{createBy,jdbcType=VARCHAR},</if>
            <if test="null!=updateTime">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="null!=updateby">#{updateby,jdbcType=VARCHAR},</if>
        </trim>
    </sql>

    <sql id="updateByPrimaryKeySelectiveSql">
        <set>
            <if test="null!=id">id = #{id,jdbcType=BIGINT},</if>
            <if test="null!=device">device = #{device,jdbcType=VARCHAR},</if>
            <if test="null!=time">time = #{time,jdbcType=TIMESTAMP},</if>
            <if test="null!=alarm">alarm = #{alarm,jdbcType=INTEGER},</if>
            <if test="null!=exkeys">exKeys = #{exkeys,jdbcType=VARCHAR},</if>
            <if test="null!=createTime">create_time = #{createTime,jdbcType=TIMESTAMP},</if>
            <if test="null!=createBy">create_by = #{createBy,jdbcType=VARCHAR},</if>
            <if test="null!=updateTime">update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="null!=updateby">updateBy = #{updateby,jdbcType=VARCHAR},</if>
        </set>
    </sql>

    <sql id="where">
        <if test="null!=id">AND id = #{id,jdbcType=BIGINT},</if>
        <if test="null!=device">AND device = #{device,jdbcType=VARCHAR},</if>
        <if test="null!=time">AND time = #{time,jdbcType=TIMESTAMP},</if>
        <if test="null!=alarm">AND alarm = #{alarm,jdbcType=INTEGER},</if>
        <if test="null!=exkeys">AND exKeys = #{exkeys,jdbcType=VARCHAR},</if>
        <if test="null!=createTime">AND create_time = #{createTime,jdbcType=TIMESTAMP},</if>
        <if test="null!=createBy">AND create_by = #{createBy,jdbcType=VARCHAR},</if>
        <if test="null!=updateTime">AND update_time = #{updateTime,jdbcType=TIMESTAMP},</if>
        <if test="null!=updateby">AND updateBy = #{updateby,jdbcType=VARCHAR},</if>
    </sql>
</mapper>