|
@@ -0,0 +1,414 @@
|
|
|
+<?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.bz.smart_city.dao.MeterPushDataMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.bz.smart_city.entity.MeterPushData">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ <!--@Table sc_meter_push_data-->
|
|
|
+ <id column="device_id" jdbcType="BIGINT" property="deviceId" />
|
|
|
+ <id column="sync_date" jdbcType="INTEGER" property="syncDate" />
|
|
|
+ <result column="device_no" jdbcType="VARCHAR" property="deviceNo" />
|
|
|
+ <result column="meter_no" jdbcType="VARCHAR" property="meterNo" />
|
|
|
+ <result column="device_status" jdbcType="CHAR" property="deviceStatus" />
|
|
|
+ <result column="real_data" jdbcType="VARCHAR" property="realData" />
|
|
|
+ <result column="real_data_date" jdbcType="TIMESTAMP" property="realDataDate" />
|
|
|
+ <result column="sync_data" jdbcType="VARCHAR" property="syncData" />
|
|
|
+ <result column="sync_data_date" jdbcType="TIMESTAMP" property="syncDataDate" />
|
|
|
+ <result column="gap" jdbcType="DECIMAL" property="gap" />
|
|
|
+ <result column="customer_id" jdbcType="INTEGER" property="customerId" />
|
|
|
+ <result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
|
|
+ <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
|
|
+ <result column="date_create" jdbcType="TIMESTAMP" property="dateCreate" />
|
|
|
+ <result column="date_update" jdbcType="TIMESTAMP" property="dateUpdate" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ device_id, sync_date, device_no, meter_no, device_status, real_data, real_data_date,
|
|
|
+ sync_data, sync_data_date, gap, customer_id, create_by, update_by, date_create, date_update
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="map" resultMap="BaseResultMap">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from sc_meter_push_data
|
|
|
+ where device_id = #{deviceId,jdbcType=BIGINT}
|
|
|
+ and sync_date = #{syncDate,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="map">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ delete from sc_meter_push_data
|
|
|
+ where device_id = #{deviceId,jdbcType=BIGINT}
|
|
|
+ and sync_date = #{syncDate,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.bz.smart_city.entity.MeterPushData">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into sc_meter_push_data (device_id, sync_date, device_no,
|
|
|
+ meter_no, device_status, real_data,
|
|
|
+ real_data_date, sync_data, sync_data_date,
|
|
|
+ gap, customer_id, create_by,
|
|
|
+ update_by, date_create, date_update
|
|
|
+ )
|
|
|
+ values (#{deviceId,jdbcType=BIGINT}, #{syncDate,jdbcType=INTEGER}, #{deviceNo,jdbcType=VARCHAR},
|
|
|
+ #{meterNo,jdbcType=VARCHAR}, #{deviceStatus,jdbcType=CHAR}, #{realData,jdbcType=VARCHAR},
|
|
|
+ #{realDataDate,jdbcType=TIMESTAMP}, #{syncData,jdbcType=VARCHAR}, #{syncDataDate,jdbcType=TIMESTAMP},
|
|
|
+ #{gap,jdbcType=DECIMAL}, #{customerId,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR},
|
|
|
+ #{updateBy,jdbcType=VARCHAR}, #{dateCreate,jdbcType=TIMESTAMP}, #{dateUpdate,jdbcType=TIMESTAMP}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.bz.smart_city.entity.MeterPushData">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into sc_meter_push_data
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="deviceId != null">
|
|
|
+ device_id,
|
|
|
+ </if>
|
|
|
+ <if test="syncDate != null">
|
|
|
+ sync_date,
|
|
|
+ </if>
|
|
|
+ <if test="deviceNo != null">
|
|
|
+ device_no,
|
|
|
+ </if>
|
|
|
+ <if test="meterNo != null">
|
|
|
+ meter_no,
|
|
|
+ </if>
|
|
|
+ <if test="deviceStatus != null">
|
|
|
+ device_status,
|
|
|
+ </if>
|
|
|
+ <if test="realData != null">
|
|
|
+ real_data,
|
|
|
+ </if>
|
|
|
+ <if test="realDataDate != null">
|
|
|
+ real_data_date,
|
|
|
+ </if>
|
|
|
+ <if test="syncData != null">
|
|
|
+ sync_data,
|
|
|
+ </if>
|
|
|
+ <if test="syncDataDate != null">
|
|
|
+ sync_data_date,
|
|
|
+ </if>
|
|
|
+ <if test="gap != null">
|
|
|
+ gap,
|
|
|
+ </if>
|
|
|
+ <if test="customerId != null">
|
|
|
+ customer_id,
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ create_by,
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ update_by,
|
|
|
+ </if>
|
|
|
+ <if test="dateCreate != null">
|
|
|
+ date_create,
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ date_update,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="deviceId != null">
|
|
|
+ #{deviceId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="syncDate != null">
|
|
|
+ #{syncDate,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="deviceNo != null">
|
|
|
+ #{deviceNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="meterNo != null">
|
|
|
+ #{meterNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="deviceStatus != null">
|
|
|
+ #{deviceStatus,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="realData != null">
|
|
|
+ #{realData,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="realDataDate != null">
|
|
|
+ #{realDataDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="syncData != null">
|
|
|
+ #{syncData,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="syncDataDate != null">
|
|
|
+ #{syncDataDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="gap != null">
|
|
|
+ #{gap,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="customerId != null">
|
|
|
+ #{customerId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ #{createBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ #{updateBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="dateCreate != null">
|
|
|
+ #{dateCreate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ #{dateUpdate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.bz.smart_city.entity.MeterPushData">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ update sc_meter_push_data
|
|
|
+ <set>
|
|
|
+ <if test="deviceNo != null">
|
|
|
+ device_no = #{deviceNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="meterNo != null">
|
|
|
+ meter_no = #{meterNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="deviceStatus != null">
|
|
|
+ device_status = #{deviceStatus,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="realData != null">
|
|
|
+ real_data = #{realData,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="realDataDate != null">
|
|
|
+ real_data_date = #{realDataDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="syncData != null">
|
|
|
+ sync_data = #{syncData,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="syncDataDate != null">
|
|
|
+ sync_data_date = #{syncDataDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="gap != null">
|
|
|
+ gap = #{gap,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="customerId != null">
|
|
|
+ customer_id = #{customerId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ update_by = #{updateBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="dateCreate != null">
|
|
|
+ date_create = #{dateCreate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ date_update = #{dateUpdate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where device_id = #{deviceId,jdbcType=BIGINT}
|
|
|
+ and sync_date = #{syncDate,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.bz.smart_city.entity.MeterPushData">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ update sc_meter_push_data
|
|
|
+ set device_no = #{deviceNo,jdbcType=VARCHAR},
|
|
|
+ meter_no = #{meterNo,jdbcType=VARCHAR},
|
|
|
+ device_status = #{deviceStatus,jdbcType=CHAR},
|
|
|
+ real_data = #{realData,jdbcType=VARCHAR},
|
|
|
+ real_data_date = #{realDataDate,jdbcType=TIMESTAMP},
|
|
|
+ sync_data = #{syncData,jdbcType=VARCHAR},
|
|
|
+ sync_data_date = #{syncDataDate,jdbcType=TIMESTAMP},
|
|
|
+ gap = #{gap,jdbcType=DECIMAL},
|
|
|
+ customer_id = #{customerId,jdbcType=INTEGER},
|
|
|
+ create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
+ update_by = #{updateBy,jdbcType=VARCHAR},
|
|
|
+ date_create = #{dateCreate,jdbcType=TIMESTAMP},
|
|
|
+ date_update = #{dateUpdate,jdbcType=TIMESTAMP}
|
|
|
+ where device_id = #{deviceId,jdbcType=BIGINT}
|
|
|
+ and sync_date = #{syncDate,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <insert id="batchInsert" parameterType="map">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into sc_meter_push_data
|
|
|
+ (device_id, sync_date, device_no, meter_no, device_status, real_data, real_data_date,
|
|
|
+ sync_data, sync_data_date, gap, customer_id, create_by, update_by, date_create,
|
|
|
+ date_update)
|
|
|
+ values
|
|
|
+ <foreach collection="list" item="item" separator=",">
|
|
|
+ (#{item.deviceId,jdbcType=BIGINT}, #{item.syncDate,jdbcType=INTEGER}, #{item.deviceNo,jdbcType=VARCHAR},
|
|
|
+ #{item.meterNo,jdbcType=VARCHAR}, #{item.deviceStatus,jdbcType=CHAR}, #{item.realData,jdbcType=VARCHAR},
|
|
|
+ #{item.realDataDate,jdbcType=TIMESTAMP}, #{item.syncData,jdbcType=VARCHAR}, #{item.syncDataDate,jdbcType=TIMESTAMP},
|
|
|
+ #{item.gap,jdbcType=DECIMAL}, #{item.customerId,jdbcType=INTEGER}, #{item.createBy,jdbcType=VARCHAR},
|
|
|
+ #{item.updateBy,jdbcType=VARCHAR}, #{item.dateCreate,jdbcType=TIMESTAMP}, #{item.dateUpdate,jdbcType=TIMESTAMP}
|
|
|
+ )
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+ <insert id="insertOrUpdate" parameterType="com.bz.smart_city.entity.MeterPushData">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into sc_meter_push_data
|
|
|
+ (device_id, sync_date, device_no, meter_no, device_status, real_data, real_data_date,
|
|
|
+ sync_data, sync_data_date, gap, customer_id, create_by, update_by, date_create,
|
|
|
+ date_update)
|
|
|
+ values
|
|
|
+ (#{deviceId,jdbcType=BIGINT}, #{syncDate,jdbcType=INTEGER}, #{deviceNo,jdbcType=VARCHAR},
|
|
|
+ #{meterNo,jdbcType=VARCHAR}, #{deviceStatus,jdbcType=CHAR}, #{realData,jdbcType=VARCHAR},
|
|
|
+ #{realDataDate,jdbcType=TIMESTAMP}, #{syncData,jdbcType=VARCHAR}, #{syncDataDate,jdbcType=TIMESTAMP},
|
|
|
+ #{gap,jdbcType=DECIMAL}, #{customerId,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR},
|
|
|
+ #{updateBy,jdbcType=VARCHAR}, #{dateCreate,jdbcType=TIMESTAMP}, #{dateUpdate,jdbcType=TIMESTAMP}
|
|
|
+ )
|
|
|
+ on duplicate key update
|
|
|
+ device_id = #{deviceId,jdbcType=BIGINT},
|
|
|
+ sync_date = #{syncDate,jdbcType=INTEGER},
|
|
|
+ device_no = #{deviceNo,jdbcType=VARCHAR},
|
|
|
+ meter_no = #{meterNo,jdbcType=VARCHAR},
|
|
|
+ device_status = #{deviceStatus,jdbcType=CHAR},
|
|
|
+ real_data = #{realData,jdbcType=VARCHAR},
|
|
|
+ real_data_date = #{realDataDate,jdbcType=TIMESTAMP},
|
|
|
+ sync_data = #{syncData,jdbcType=VARCHAR},
|
|
|
+ sync_data_date = #{syncDataDate,jdbcType=TIMESTAMP},
|
|
|
+ gap = #{gap,jdbcType=DECIMAL},
|
|
|
+ customer_id = #{customerId,jdbcType=INTEGER},
|
|
|
+ create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
+ update_by = #{updateBy,jdbcType=VARCHAR},
|
|
|
+ date_create = #{dateCreate,jdbcType=TIMESTAMP},
|
|
|
+ date_update = #{dateUpdate,jdbcType=TIMESTAMP}
|
|
|
+ </insert>
|
|
|
+ <insert id="insertOrUpdateSelective" parameterType="com.bz.smart_city.entity.MeterPushData">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into sc_meter_push_data
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="deviceId != null">
|
|
|
+ device_id,
|
|
|
+ </if>
|
|
|
+ <if test="syncDate != null">
|
|
|
+ sync_date,
|
|
|
+ </if>
|
|
|
+ <if test="deviceNo != null">
|
|
|
+ device_no,
|
|
|
+ </if>
|
|
|
+ <if test="meterNo != null">
|
|
|
+ meter_no,
|
|
|
+ </if>
|
|
|
+ <if test="deviceStatus != null">
|
|
|
+ device_status,
|
|
|
+ </if>
|
|
|
+ <if test="realData != null">
|
|
|
+ real_data,
|
|
|
+ </if>
|
|
|
+ <if test="realDataDate != null">
|
|
|
+ real_data_date,
|
|
|
+ </if>
|
|
|
+ <if test="syncData != null">
|
|
|
+ sync_data,
|
|
|
+ </if>
|
|
|
+ <if test="syncDataDate != null">
|
|
|
+ sync_data_date,
|
|
|
+ </if>
|
|
|
+ <if test="gap != null">
|
|
|
+ gap,
|
|
|
+ </if>
|
|
|
+ <if test="customerId != null">
|
|
|
+ customer_id,
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ create_by,
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ update_by,
|
|
|
+ </if>
|
|
|
+ <if test="dateCreate != null">
|
|
|
+ date_create,
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ date_update,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ values
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="deviceId != null">
|
|
|
+ #{deviceId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="syncDate != null">
|
|
|
+ #{syncDate,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="deviceNo != null">
|
|
|
+ #{deviceNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="meterNo != null">
|
|
|
+ #{meterNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="deviceStatus != null">
|
|
|
+ #{deviceStatus,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="realData != null">
|
|
|
+ #{realData,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="realDataDate != null">
|
|
|
+ #{realDataDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="syncData != null">
|
|
|
+ #{syncData,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="syncDataDate != null">
|
|
|
+ #{syncDataDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="gap != null">
|
|
|
+ #{gap,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="customerId != null">
|
|
|
+ #{customerId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ #{createBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ #{updateBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="dateCreate != null">
|
|
|
+ #{dateCreate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ #{dateUpdate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ on duplicate key update
|
|
|
+ <trim suffixOverrides=",">
|
|
|
+ <if test="deviceId != null">
|
|
|
+ device_id = #{deviceId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="syncDate != null">
|
|
|
+ sync_date = #{syncDate,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="deviceNo != null">
|
|
|
+ device_no = #{deviceNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="meterNo != null">
|
|
|
+ meter_no = #{meterNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="deviceStatus != null">
|
|
|
+ device_status = #{deviceStatus,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="realData != null">
|
|
|
+ real_data = #{realData,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="realDataDate != null">
|
|
|
+ real_data_date = #{realDataDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="syncData != null">
|
|
|
+ sync_data = #{syncData,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="syncDataDate != null">
|
|
|
+ sync_data_date = #{syncDataDate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="gap != null">
|
|
|
+ gap = #{gap,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="customerId != null">
|
|
|
+ customer_id = #{customerId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">
|
|
|
+ create_by = #{createBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">
|
|
|
+ update_by = #{updateBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="dateCreate != null">
|
|
|
+ date_create = #{dateCreate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ date_update = #{dateUpdate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+</mapper>
|