|
@@ -0,0 +1,218 @@
|
|
|
+<?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.zcxk.zoniot.data.migrate.dao.DataMigrateRecordMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.zcxk.zoniot.data.migrate.model.DataMigrateRecord">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ <!--@Table sc_data_migrate_record-->
|
|
|
+ <result column="migrate_date" jdbcType="INTEGER" property="migrateDate" />
|
|
|
+ <result column="total" jdbcType="INTEGER" property="total" />
|
|
|
+ <result column="table_name" jdbcType="VARCHAR" property="tableName" />
|
|
|
+ <result column="process_count" jdbcType="INTEGER" property="processCount" />
|
|
|
+ <result column="date_create" jdbcType="TIMESTAMP" property="dateCreate" />
|
|
|
+ <result column="date_update" jdbcType="TIMESTAMP" property="dateUpdate" />
|
|
|
+ <result column="device_id" jdbcType="BIGINT" property="deviceId" />
|
|
|
+ <result column="migrate_end_date" jdbcType="INTEGER" property="migrateEndDate" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ migrate_date, total, `table_name`,
|
|
|
+ process_count, date_create, date_update,
|
|
|
+ device_id, migrate_end_date
|
|
|
+ </sql>
|
|
|
+ <insert id="insert" parameterType="com.zcxk.zoniot.data.migrate.model.DataMigrateRecord">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into sc_data_migrate_record (migrate_date, total, `table_name`,
|
|
|
+ process_count, date_create, date_update,
|
|
|
+ device_id, migrate_end_date)
|
|
|
+ values (#{migrateDate,jdbcType=INTEGER}, #{total,jdbcType=INTEGER}, #{tableName,jdbcType=VARCHAR},
|
|
|
+ #{processCount,jdbcType=INTEGER}, #{dateCreate,jdbcType=TIMESTAMP}, #{dateUpdate,jdbcType=TIMESTAMP},
|
|
|
+ #{deviceId,jdbcType=BIGINT}, #{migrateEndDate,jdbcType=INTEGER})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.zcxk.zoniot.data.migrate.model.DataMigrateRecord">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into sc_data_migrate_record
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="migrateDate != null">
|
|
|
+ migrate_date,
|
|
|
+ </if>
|
|
|
+ <if test="total != null">
|
|
|
+ total,
|
|
|
+ </if>
|
|
|
+ <if test="tableName != null">
|
|
|
+ `table_name`,
|
|
|
+ </if>
|
|
|
+ <if test="processCount != null">
|
|
|
+ process_count,
|
|
|
+ </if>
|
|
|
+ <if test="dateCreate != null">
|
|
|
+ date_create,
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ date_update,
|
|
|
+ </if>
|
|
|
+ <if test="deviceId != null">
|
|
|
+ device_id,
|
|
|
+ </if>
|
|
|
+ <if test="migrateEndDate != null">
|
|
|
+ migrate_end_date,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="migrateDate != null">
|
|
|
+ #{migrateDate,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="total != null">
|
|
|
+ #{total,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="tableName != null">
|
|
|
+ #{tableName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="processCount != null">
|
|
|
+ #{processCount,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="dateCreate != null">
|
|
|
+ #{dateCreate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ #{dateUpdate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="deviceId != null">
|
|
|
+ #{deviceId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="migrateEndDate != null">
|
|
|
+ #{migrateEndDate,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <insert id="batchInsert" parameterType="map">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into sc_data_migrate_record
|
|
|
+ (migrate_date, total, `table_name`, process_count, date_create, date_update, device_id,
|
|
|
+ migrate_end_date)
|
|
|
+ values
|
|
|
+ <foreach collection="list" item="item" separator=",">
|
|
|
+ (#{item.migrateDate,jdbcType=INTEGER}, #{item.total,jdbcType=INTEGER}, #{item.tableName,jdbcType=VARCHAR},
|
|
|
+ #{item.processCount,jdbcType=INTEGER}, #{item.dateCreate,jdbcType=TIMESTAMP}, #{item.dateUpdate,jdbcType=TIMESTAMP},
|
|
|
+ #{item.deviceId,jdbcType=BIGINT}, #{item.migrateEndDate,jdbcType=INTEGER})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+ <insert id="insertOrUpdate" parameterType="com.zcxk.zoniot.data.migrate.model.DataMigrateRecord">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into sc_data_migrate_record
|
|
|
+ (migrate_date, total, `table_name`, process_count, date_create, date_update, device_id,
|
|
|
+ migrate_end_date)
|
|
|
+ values
|
|
|
+ (#{migrateDate,jdbcType=INTEGER}, #{total,jdbcType=INTEGER}, #{tableName,jdbcType=VARCHAR},
|
|
|
+ #{processCount,jdbcType=INTEGER}, #{dateCreate,jdbcType=TIMESTAMP}, #{dateUpdate,jdbcType=TIMESTAMP},
|
|
|
+ #{deviceId,jdbcType=BIGINT}, #{migrateEndDate,jdbcType=INTEGER})
|
|
|
+ on duplicate key update
|
|
|
+ migrate_date = #{migrateDate,jdbcType=INTEGER},
|
|
|
+ total = #{total,jdbcType=INTEGER},
|
|
|
+ `table_name` = #{tableName,jdbcType=VARCHAR},
|
|
|
+ process_count = #{processCount,jdbcType=INTEGER},
|
|
|
+ date_create = #{dateCreate,jdbcType=TIMESTAMP},
|
|
|
+ date_update = #{dateUpdate,jdbcType=TIMESTAMP},
|
|
|
+ device_id = #{deviceId,jdbcType=BIGINT},
|
|
|
+ migrate_end_date = #{migrateEndDate,jdbcType=INTEGER}
|
|
|
+ </insert>
|
|
|
+ <insert id="insertOrUpdateSelective" parameterType="com.zcxk.zoniot.data.migrate.model.DataMigrateRecord">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into sc_data_migrate_record
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="migrateDate != null">
|
|
|
+ migrate_date,
|
|
|
+ </if>
|
|
|
+ <if test="total != null">
|
|
|
+ total,
|
|
|
+ </if>
|
|
|
+ <if test="tableName != null">
|
|
|
+ `table_name`,
|
|
|
+ </if>
|
|
|
+ <if test="processCount != null">
|
|
|
+ process_count,
|
|
|
+ </if>
|
|
|
+ <if test="dateCreate != null">
|
|
|
+ date_create,
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ date_update,
|
|
|
+ </if>
|
|
|
+ <if test="deviceId != null">
|
|
|
+ device_id,
|
|
|
+ </if>
|
|
|
+ <if test="migrateEndDate != null">
|
|
|
+ migrate_end_date,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ values
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="migrateDate != null">
|
|
|
+ #{migrateDate,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="total != null">
|
|
|
+ #{total,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="tableName != null">
|
|
|
+ #{tableName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="processCount != null">
|
|
|
+ #{processCount,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="dateCreate != null">
|
|
|
+ #{dateCreate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ #{dateUpdate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="deviceId != null">
|
|
|
+ #{deviceId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="migrateEndDate != null">
|
|
|
+ #{migrateEndDate,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ on duplicate key update
|
|
|
+ <trim suffixOverrides=",">
|
|
|
+ <if test="migrateDate != null">
|
|
|
+ migrate_date = #{migrateDate,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="total != null">
|
|
|
+ total = #{total,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="tableName != null">
|
|
|
+ `table_name` = #{tableName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="processCount != null">
|
|
|
+ process_count = #{processCount,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="dateCreate != null">
|
|
|
+ date_create = #{dateCreate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="dateUpdate != null">
|
|
|
+ date_update = #{dateUpdate,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="deviceId != null">
|
|
|
+ device_id = #{deviceId,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="migrateEndDate != null">
|
|
|
+ migrate_end_date = #{migrateEndDate,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <select id="findMigrateRecord" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from
|
|
|
+ sc_data_migrate_record
|
|
|
+ where migrate_date = #{migrateBeginDate,jdbcType=INTEGER}
|
|
|
+ and migrate_end_date = #{migrateEndDate,jdbcType=INTEGER}
|
|
|
+ and device_id = #{deviceId,jdbcType=BIGINT}
|
|
|
+ </select>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from
|
|
|
+ sc_data_migrate_record
|
|
|
+ where migrate_date = #{migrateDate,jdbcType=INTEGER}
|
|
|
+ and table_name = #{tableName,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+</mapper>
|