|
@@ -0,0 +1,103 @@
|
|
|
+<?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=".dao.TEtaIndexPushTaskDao">
|
|
|
+
|
|
|
+ <resultMap type="com.qhtx.eta.infra.entity.dw.TEtaIndexPushTask" id="TEtaIndexPushTaskMap">
|
|
|
+ <result property="id" column="ID" jdbcType="INTEGER"/>
|
|
|
+ <result property="indexCode" column="INDEX_CODE" jdbcType="VARCHAR"/>
|
|
|
+ <result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="startDate" column="START_DATE" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="endDate" column="END_DATE" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="indexName" column="INDEX_NAME" jdbcType="VARCHAR"/>
|
|
|
+ <result property="unit" column="UNIT" jdbcType="VARCHAR"/>
|
|
|
+ <result property="sourceName" column="SOURCE_NAME" jdbcType="VARCHAR"/>
|
|
|
+ <result property="lastPushTime" column="LAST_PUSH_TIME" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="dataCount" column="DATA_COUNT" jdbcType="INTEGER"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="queryById" resultMap="TEtaIndexPushTaskMap">
|
|
|
+ select ID,
|
|
|
+ INDEX_CODE,
|
|
|
+ CREATE_TIME,
|
|
|
+ UPDATE_TIME,
|
|
|
+ START_DATE,
|
|
|
+ END_DATE,
|
|
|
+ INDEX_NAME,
|
|
|
+ UNIT,
|
|
|
+ SOURCE_NAME,
|
|
|
+ LAST_PUSH_TIMEDATA_COUNT
|
|
|
+ from T_ETA_INDEX_PUSH_TASK
|
|
|
+ where ID = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="insert" keyProperty="id" useGeneratedKeys="false">
|
|
|
+ insert into T_ETA_INDEX_PUSH_TASK (INDEX_CODE, CREATE_TIME, UPDATE_TIME, START_DATE, END_DATE, INDEX_NAME, UNIT,
|
|
|
+ SOURCE_NAME, LAST_PUSH_TIMEDATA_COUNT)
|
|
|
+ values (#{entity.indexCode}#{entity.createTime}#{entity.updateTime}#{entity.startDate}#{entity.endDate}#{entity.indexName}#{entity.unit}#{entity.sourceName}#{entity.lastPushTime}#{entity.dataCount})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into
|
|
|
+ T_ETA_INDEX_PUSH_TASK (INDEX_CODE,CREATE_TIME,UPDATE_TIME,START_DATE,END_DATE,INDEX_NAME,UNIT,SOURCE_NAME,LAST_PUSH_TIMEDATA_COUNT)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.indexCode}#{entity.createTime}#{entity.updateTime}#{entity.startDate}#{entity.endDate}#{entity.indexName}#{entity.unit}#{entity.sourceName}#{entity.lastPushTime}#{entity.dataCount})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into
|
|
|
+ T_ETA_INDEX_PUSH_TASK(INDEX_CODE,CREATE_TIME,UPDATE_TIME,START_DATE,END_DATE,INDEX_NAME,UNIT,SOURCE_NAME,LAST_PUSH_TIMEDATA_COUNT)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.indexCode}#{entity.createTime}#{entity.updateTime}#{entity.startDate}#{entity.endDate}#{entity.indexName}#{entity.unit}#{entity.sourceName}#{entity.lastPushTime}#{entity.dataCount})
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+ INDEX_CODE = values(INDEX_CODE)CREATE_TIME = values(CREATE_TIME)UPDATE_TIME = values(UPDATE_TIME)START_DATE =
|
|
|
+ values(START_DATE)END_DATE = values(END_DATE)INDEX_NAME = values(INDEX_NAME)UNIT = values(UNIT)SOURCE_NAME =
|
|
|
+ values(SOURCE_NAME)LAST_PUSH_TIME = values(LAST_PUSH_TIME)DATA_COUNT = values(DATA_COUNT)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ update T_ETA_INDEX_PUSH_TASK
|
|
|
+ <set>
|
|
|
+ <if test="indexCode != null and indexCode != ''">
|
|
|
+ INDEX_CODE = #{indexCode},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ CREATE_TIME = #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ UPDATE_TIME = #{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null">
|
|
|
+ START_DATE = #{startDate},
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null">
|
|
|
+ END_DATE = #{endDate},
|
|
|
+ </if>
|
|
|
+ <if test="indexName != null and indexName != ''">
|
|
|
+ INDEX_NAME = #{indexName},
|
|
|
+ </if>
|
|
|
+ <if test="unit != null and unit != ''">
|
|
|
+ UNIT = #{unit},
|
|
|
+ </if>
|
|
|
+ <if test="sourceName != null and sourceName != ''">
|
|
|
+ SOURCE_NAME = #{sourceName},
|
|
|
+ </if>
|
|
|
+ <if test="lastPushTime != null">
|
|
|
+ LAST_PUSH_TIME = #{lastPushTime},
|
|
|
+ </if>
|
|
|
+ <if test="dataCount != null and dataCount != ''">
|
|
|
+ DATA_COUNT = #{dataCount},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where ID = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+</mapper>
|
|
|
+
|