<?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.tanpu.fund.mapper.generator.IndexMonthlyMapper"> <resultMap id="BaseResultMap" type="com.tanpu.fund.entity.generator.IndexMonthly"> <!--@mbg.generated--> <!--@Table index_monthly--> <result column="ts_code" jdbcType="VARCHAR" property="tsCode" /> <result column="trade_date" jdbcType="TIMESTAMP" property="tradeDate" /> <result column="close" jdbcType="DOUBLE" property="close" /> <result column="open" jdbcType="DOUBLE" property="open" /> <result column="high" jdbcType="DOUBLE" property="high" /> <result column="low" jdbcType="DOUBLE" property="low" /> <result column="pre_close" jdbcType="DOUBLE" property="preClose" /> <result column="change" jdbcType="DOUBLE" property="change" /> <result column="pct_chg" jdbcType="DOUBLE" property="pctChg" /> <result column="vol" jdbcType="DOUBLE" property="vol" /> <result column="amount" jdbcType="DOUBLE" property="amount" /> <result column="org_id" jdbcType="VARCHAR" property="orgId" /> </resultMap> <sql id="Example_Where_Clause"> <!--@mbg.generated--> <where> <foreach collection="oredCriteria" item="criteria" separator="or"> <if test="criteria.valid"> <trim prefix="(" prefixOverrides="and" suffix=")"> <foreach collection="criteria.criteria" item="criterion"> <choose> <when test="criterion.noValue"> and ${criterion.condition} </when> <when test="criterion.singleValue"> and ${criterion.condition} #{criterion.value} </when> <when test="criterion.betweenValue"> and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} </when> <when test="criterion.listValue"> and ${criterion.condition} <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> #{listItem} </foreach> </when> </choose> </foreach> </trim> </if> </foreach> </where> </sql> <sql id="Update_By_Example_Where_Clause"> <!--@mbg.generated--> <where> <foreach collection="example.oredCriteria" item="criteria" separator="or"> <if test="criteria.valid"> <trim prefix="(" prefixOverrides="and" suffix=")"> <foreach collection="criteria.criteria" item="criterion"> <choose> <when test="criterion.noValue"> and ${criterion.condition} </when> <when test="criterion.singleValue"> and ${criterion.condition} #{criterion.value} </when> <when test="criterion.betweenValue"> and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} </when> <when test="criterion.listValue"> and ${criterion.condition} <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> #{listItem} </foreach> </when> </choose> </foreach> </trim> </if> </foreach> </where> </sql> <sql id="Base_Column_List"> <!--@mbg.generated--> ts_code, trade_date, `close`, `open`, high, low, pre_close, `change`, pct_chg, vol, amount, org_id </sql> <select id="selectByExample" parameterType="com.tanpu.fund.entity.generator.IndexMonthlyExample" resultMap="BaseResultMap"> <!--@mbg.generated--> select <if test="distinct"> distinct </if> <include refid="Base_Column_List" /> from index_monthly <if test="_parameter != null"> <include refid="Example_Where_Clause" /> </if> <if test="orderByClause != null"> order by ${orderByClause} </if> </select> <delete id="deleteByExample" parameterType="com.tanpu.fund.entity.generator.IndexMonthlyExample"> <!--@mbg.generated--> delete from index_monthly <if test="_parameter != null"> <include refid="Example_Where_Clause" /> </if> </delete> <insert id="insert" parameterType="com.tanpu.fund.entity.generator.IndexMonthly"> <!--@mbg.generated--> insert into index_monthly (ts_code, trade_date, `close`, `open`, high, low, pre_close, `change`, pct_chg, vol, amount, org_id) values (#{tsCode,jdbcType=VARCHAR}, #{tradeDate,jdbcType=TIMESTAMP}, #{close,jdbcType=DOUBLE}, #{open,jdbcType=DOUBLE}, #{high,jdbcType=DOUBLE}, #{low,jdbcType=DOUBLE}, #{preClose,jdbcType=DOUBLE}, #{change,jdbcType=DOUBLE}, #{pctChg,jdbcType=DOUBLE}, #{vol,jdbcType=DOUBLE}, #{amount,jdbcType=DOUBLE}, #{orgId,jdbcType=VARCHAR}) </insert> <insert id="insertSelective" parameterType="com.tanpu.fund.entity.generator.IndexMonthly"> <!--@mbg.generated--> insert into index_monthly <trim prefix="(" suffix=")" suffixOverrides=","> <if test="tsCode != null"> ts_code, </if> <if test="tradeDate != null"> trade_date, </if> <if test="close != null"> `close`, </if> <if test="open != null"> `open`, </if> <if test="high != null"> high, </if> <if test="low != null"> low, </if> <if test="preClose != null"> pre_close, </if> <if test="change != null"> `change`, </if> <if test="pctChg != null"> pct_chg, </if> <if test="vol != null"> vol, </if> <if test="amount != null"> amount, </if> <if test="orgId != null"> org_id, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="tsCode != null"> #{tsCode,jdbcType=VARCHAR}, </if> <if test="tradeDate != null"> #{tradeDate,jdbcType=TIMESTAMP}, </if> <if test="close != null"> #{close,jdbcType=DOUBLE}, </if> <if test="open != null"> #{open,jdbcType=DOUBLE}, </if> <if test="high != null"> #{high,jdbcType=DOUBLE}, </if> <if test="low != null"> #{low,jdbcType=DOUBLE}, </if> <if test="preClose != null"> #{preClose,jdbcType=DOUBLE}, </if> <if test="change != null"> #{change,jdbcType=DOUBLE}, </if> <if test="pctChg != null"> #{pctChg,jdbcType=DOUBLE}, </if> <if test="vol != null"> #{vol,jdbcType=DOUBLE}, </if> <if test="amount != null"> #{amount,jdbcType=DOUBLE}, </if> <if test="orgId != null"> #{orgId,jdbcType=VARCHAR}, </if> </trim> </insert> <select id="countByExample" parameterType="com.tanpu.fund.entity.generator.IndexMonthlyExample" resultType="java.lang.Long"> <!--@mbg.generated--> select count(*) from index_monthly <if test="_parameter != null"> <include refid="Example_Where_Clause" /> </if> </select> <update id="updateByExampleSelective" parameterType="map"> <!--@mbg.generated--> update index_monthly <set> <if test="record.tsCode != null"> ts_code = #{record.tsCode,jdbcType=VARCHAR}, </if> <if test="record.tradeDate != null"> trade_date = #{record.tradeDate,jdbcType=TIMESTAMP}, </if> <if test="record.close != null"> `close` = #{record.close,jdbcType=DOUBLE}, </if> <if test="record.open != null"> `open` = #{record.open,jdbcType=DOUBLE}, </if> <if test="record.high != null"> high = #{record.high,jdbcType=DOUBLE}, </if> <if test="record.low != null"> low = #{record.low,jdbcType=DOUBLE}, </if> <if test="record.preClose != null"> pre_close = #{record.preClose,jdbcType=DOUBLE}, </if> <if test="record.change != null"> `change` = #{record.change,jdbcType=DOUBLE}, </if> <if test="record.pctChg != null"> pct_chg = #{record.pctChg,jdbcType=DOUBLE}, </if> <if test="record.vol != null"> vol = #{record.vol,jdbcType=DOUBLE}, </if> <if test="record.amount != null"> amount = #{record.amount,jdbcType=DOUBLE}, </if> <if test="record.orgId != null"> org_id = #{record.orgId,jdbcType=VARCHAR}, </if> </set> <if test="_parameter != null"> <include refid="Update_By_Example_Where_Clause" /> </if> </update> <update id="updateByExample" parameterType="map"> <!--@mbg.generated--> update index_monthly set ts_code = #{record.tsCode,jdbcType=VARCHAR}, trade_date = #{record.tradeDate,jdbcType=TIMESTAMP}, `close` = #{record.close,jdbcType=DOUBLE}, `open` = #{record.open,jdbcType=DOUBLE}, high = #{record.high,jdbcType=DOUBLE}, low = #{record.low,jdbcType=DOUBLE}, pre_close = #{record.preClose,jdbcType=DOUBLE}, `change` = #{record.change,jdbcType=DOUBLE}, pct_chg = #{record.pctChg,jdbcType=DOUBLE}, vol = #{record.vol,jdbcType=DOUBLE}, amount = #{record.amount,jdbcType=DOUBLE}, org_id = #{record.orgId,jdbcType=VARCHAR} <if test="_parameter != null"> <include refid="Update_By_Example_Where_Clause" /> </if> </update> <insert id="batchInsert" parameterType="map"> <!--@mbg.generated--> insert into index_monthly (ts_code, trade_date, `close`, `open`, high, low, pre_close, `change`, pct_chg, vol, amount, org_id) values <foreach collection="list" item="item" separator=","> (#{item.tsCode,jdbcType=VARCHAR}, #{item.tradeDate,jdbcType=TIMESTAMP}, #{item.close,jdbcType=DOUBLE}, #{item.open,jdbcType=DOUBLE}, #{item.high,jdbcType=DOUBLE}, #{item.low,jdbcType=DOUBLE}, #{item.preClose,jdbcType=DOUBLE}, #{item.change,jdbcType=DOUBLE}, #{item.pctChg,jdbcType=DOUBLE}, #{item.vol,jdbcType=DOUBLE}, #{item.amount,jdbcType=DOUBLE}, #{item.orgId,jdbcType=VARCHAR} ) </foreach> </insert> <insert id="insertOrUpdate" parameterType="com.tanpu.fund.entity.generator.IndexMonthly"> <!--@mbg.generated--> insert into index_monthly (ts_code, trade_date, `close`, `open`, high, low, pre_close, `change`, pct_chg, vol, amount, org_id) values (#{tsCode,jdbcType=VARCHAR}, #{tradeDate,jdbcType=TIMESTAMP}, #{close,jdbcType=DOUBLE}, #{open,jdbcType=DOUBLE}, #{high,jdbcType=DOUBLE}, #{low,jdbcType=DOUBLE}, #{preClose,jdbcType=DOUBLE}, #{change,jdbcType=DOUBLE}, #{pctChg,jdbcType=DOUBLE}, #{vol,jdbcType=DOUBLE}, #{amount,jdbcType=DOUBLE}, #{orgId,jdbcType=VARCHAR}) on duplicate key update ts_code = #{tsCode,jdbcType=VARCHAR}, trade_date = #{tradeDate,jdbcType=TIMESTAMP}, `close` = #{close,jdbcType=DOUBLE}, `open` = #{open,jdbcType=DOUBLE}, high = #{high,jdbcType=DOUBLE}, low = #{low,jdbcType=DOUBLE}, pre_close = #{preClose,jdbcType=DOUBLE}, `change` = #{change,jdbcType=DOUBLE}, pct_chg = #{pctChg,jdbcType=DOUBLE}, vol = #{vol,jdbcType=DOUBLE}, amount = #{amount,jdbcType=DOUBLE}, org_id = #{orgId,jdbcType=VARCHAR} </insert> <insert id="insertOrUpdateSelective" parameterType="com.tanpu.fund.entity.generator.IndexMonthly"> <!--@mbg.generated--> insert into index_monthly <trim prefix="(" suffix=")" suffixOverrides=","> <if test="tsCode != null"> ts_code, </if> <if test="tradeDate != null"> trade_date, </if> <if test="close != null"> `close`, </if> <if test="open != null"> `open`, </if> <if test="high != null"> high, </if> <if test="low != null"> low, </if> <if test="preClose != null"> pre_close, </if> <if test="change != null"> `change`, </if> <if test="pctChg != null"> pct_chg, </if> <if test="vol != null"> vol, </if> <if test="amount != null"> amount, </if> <if test="orgId != null"> org_id, </if> </trim> values <trim prefix="(" suffix=")" suffixOverrides=","> <if test="tsCode != null"> #{tsCode,jdbcType=VARCHAR}, </if> <if test="tradeDate != null"> #{tradeDate,jdbcType=TIMESTAMP}, </if> <if test="close != null"> #{close,jdbcType=DOUBLE}, </if> <if test="open != null"> #{open,jdbcType=DOUBLE}, </if> <if test="high != null"> #{high,jdbcType=DOUBLE}, </if> <if test="low != null"> #{low,jdbcType=DOUBLE}, </if> <if test="preClose != null"> #{preClose,jdbcType=DOUBLE}, </if> <if test="change != null"> #{change,jdbcType=DOUBLE}, </if> <if test="pctChg != null"> #{pctChg,jdbcType=DOUBLE}, </if> <if test="vol != null"> #{vol,jdbcType=DOUBLE}, </if> <if test="amount != null"> #{amount,jdbcType=DOUBLE}, </if> <if test="orgId != null"> #{orgId,jdbcType=VARCHAR}, </if> </trim> on duplicate key update <trim suffixOverrides=","> <if test="tsCode != null"> ts_code = #{tsCode,jdbcType=VARCHAR}, </if> <if test="tradeDate != null"> trade_date = #{tradeDate,jdbcType=TIMESTAMP}, </if> <if test="close != null"> `close` = #{close,jdbcType=DOUBLE}, </if> <if test="open != null"> `open` = #{open,jdbcType=DOUBLE}, </if> <if test="high != null"> high = #{high,jdbcType=DOUBLE}, </if> <if test="low != null"> low = #{low,jdbcType=DOUBLE}, </if> <if test="preClose != null"> pre_close = #{preClose,jdbcType=DOUBLE}, </if> <if test="change != null"> `change` = #{change,jdbcType=DOUBLE}, </if> <if test="pctChg != null"> pct_chg = #{pctChg,jdbcType=DOUBLE}, </if> <if test="vol != null"> vol = #{vol,jdbcType=DOUBLE}, </if> <if test="amount != null"> amount = #{amount,jdbcType=DOUBLE}, </if> <if test="orgId != null"> org_id = #{orgId,jdbcType=VARCHAR}, </if> </trim> </insert> </mapper>