<?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.data.emqx.mapper.LoadCarDataSoureMapper">

    <insert id="addLoadCarDataSourceMapper" parameterType="com.data.emqx.domain.LoadCarDataSoure" >
        insert into emqx_load_car (
          id,
           device_id,
           device_status,
           send_time,
           weight,
           weight_status,
           weight_time,
           flag,
           tag,
           create_time,
           update_time)
        values (
           #{id},
           #{deviceId},
           #{deviceStatus},
           #{sendTime},
           #{weight},
           #{weightStatus},
           #{weightTime},
           #{flag},
           #{tag},
           #{createTime},
           #{updateTime}
               )
    </insert>

    <insert id="addUnLoadCarDataSourceMapper" parameterType="com.data.emqx.domain.LoadCarDataSoure" >
        insert into emqx_unload_car (
            id,
            device_id,
            device_status,
            send_time,
            rfid_num,
            rfid_no,
            rfid_time,
            flag,
            tag,
            create_time,
            update_time)
        values (
                   #{id},
                   #{deviceId},
                   #{deviceStatus},
                   #{sendTime},
                   #{rfidNum},
                   #{rfidNo},
                   #{rfidTime},
                   #{flag},
                   #{tag},
                   #{createTime},
                   #{updateTime}
               )
    </insert>
    <insert id="addDeviceCard" parameterType="com.data.emqx.domain.LoadCarDataSoure" >
        insert into emqx_device_card (
            id,
            device_id,
            card_id,
            send_time)
        values (
                   #{id},
                   #{deviceId},
                   #{cardID},
                   #{sendTime}
               )
    </insert>
    <insert id="addEmqx_error">
        insert into emqx_receive_error (
             json_value,
             send_time,
             create_time
        ) values (
            #{json},
            #{sendTime},
            #{createTime}
     )
    </insert>

</mapper>