StockTradeCalMapper.xml 10 KB
Newer Older
张亚辉's avatar
张亚辉 committed
1 2 3 4 5 6 7
<?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.StockTradeCalMapper">
  <resultMap id="BaseResultMap" type="com.tanpu.fund.entity.generator.StockTradeCal">
    <!--@mbg.generated-->
    <!--@Table stock_trade_cal-->
    <result column="is_open" jdbcType="BIGINT" property="isOpen" />
zp's avatar
zp committed
8
    <result column="org_id" jdbcType="VARCHAR" property="orgId" />
张亚辉's avatar
张亚辉 committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tanpu.fund.entity.generator.StockTradeCal">
    <!--@mbg.generated-->
    <!--@Table stock_trade_cal-->
    <result column="exchange" jdbcType="LONGVARCHAR" property="exchange" />
    <result column="cal_date" jdbcType="LONGVARCHAR" property="calDate" />
  </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-->
zp's avatar
zp committed
78
    is_open, org_id
张亚辉's avatar
张亚辉 committed
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
  </sql>
  <sql id="Blob_Column_List">
    <!--@mbg.generated-->
    exchange, cal_date
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.tanpu.fund.entity.generator.StockTradeCalExample" resultMap="ResultMapWithBLOBs">
    <!--@mbg.generated-->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from stock_trade_cal
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="com.tanpu.fund.entity.generator.StockTradeCalExample" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from stock_trade_cal
    <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.StockTradeCalExample">
    <!--@mbg.generated-->
    delete from stock_trade_cal
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.tanpu.fund.entity.generator.StockTradeCal">
    <!--@mbg.generated-->
zp's avatar
zp committed
125 126 127 128
    insert into stock_trade_cal (is_open, org_id, exchange, 
      cal_date)
    values (#{isOpen,jdbcType=BIGINT}, #{orgId,jdbcType=VARCHAR}, #{exchange,jdbcType=LONGVARCHAR}, 
      #{calDate,jdbcType=LONGVARCHAR})
张亚辉's avatar
张亚辉 committed
129 130 131 132 133 134 135 136
  </insert>
  <insert id="insertSelective" parameterType="com.tanpu.fund.entity.generator.StockTradeCal">
    <!--@mbg.generated-->
    insert into stock_trade_cal
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="isOpen != null">
        is_open,
      </if>
zp's avatar
zp committed
137 138 139
      <if test="orgId != null">
        org_id,
      </if>
张亚辉's avatar
张亚辉 committed
140 141 142 143 144 145 146 147 148 149 150
      <if test="exchange != null">
        exchange,
      </if>
      <if test="calDate != null">
        cal_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="isOpen != null">
        #{isOpen,jdbcType=BIGINT},
      </if>
zp's avatar
zp committed
151 152 153
      <if test="orgId != null">
        #{orgId,jdbcType=VARCHAR},
      </if>
张亚辉's avatar
张亚辉 committed
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
      <if test="exchange != null">
        #{exchange,jdbcType=LONGVARCHAR},
      </if>
      <if test="calDate != null">
        #{calDate,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.tanpu.fund.entity.generator.StockTradeCalExample" resultType="java.lang.Long">
    <!--@mbg.generated-->
    select count(*) from stock_trade_cal
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--@mbg.generated-->
    update stock_trade_cal
    <set>
      <if test="record.isOpen != null">
        is_open = #{record.isOpen,jdbcType=BIGINT},
      </if>
zp's avatar
zp committed
176 177 178
      <if test="record.orgId != null">
        org_id = #{record.orgId,jdbcType=VARCHAR},
      </if>
张亚辉's avatar
张亚辉 committed
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
      <if test="record.exchange != null">
        exchange = #{record.exchange,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.calDate != null">
        cal_date = #{record.calDate,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    <!--@mbg.generated-->
    update stock_trade_cal
    set is_open = #{record.isOpen,jdbcType=BIGINT},
zp's avatar
zp committed
194
      org_id = #{record.orgId,jdbcType=VARCHAR},
张亚辉's avatar
张亚辉 committed
195 196 197 198 199 200 201 202 203
      exchange = #{record.exchange,jdbcType=LONGVARCHAR},
      cal_date = #{record.calDate,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--@mbg.generated-->
    update stock_trade_cal
zp's avatar
zp committed
204 205
    set is_open = #{record.isOpen,jdbcType=BIGINT},
      org_id = #{record.orgId,jdbcType=VARCHAR}
张亚辉's avatar
张亚辉 committed
206 207 208 209 210 211 212
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <insert id="batchInsert" parameterType="map">
    <!--@mbg.generated-->
    insert into stock_trade_cal
zp's avatar
zp committed
213
    (is_open, org_id, exchange, cal_date)
张亚辉's avatar
张亚辉 committed
214 215
    values
    <foreach collection="list" item="item" separator=",">
zp's avatar
zp committed
216 217
      (#{item.isOpen,jdbcType=BIGINT}, #{item.orgId,jdbcType=VARCHAR}, #{item.exchange,jdbcType=LONGVARCHAR}, 
        #{item.calDate,jdbcType=LONGVARCHAR})
张亚辉's avatar
张亚辉 committed
218 219 220 221 222
    </foreach>
  </insert>
  <insert id="insertOrUpdate" parameterType="com.tanpu.fund.entity.generator.StockTradeCal">
    <!--@mbg.generated-->
    insert into stock_trade_cal
zp's avatar
zp committed
223
    (is_open, org_id)
张亚辉's avatar
张亚辉 committed
224
    values
zp's avatar
zp committed
225
    (#{isOpen,jdbcType=BIGINT}, #{orgId,jdbcType=VARCHAR})
张亚辉's avatar
张亚辉 committed
226
    on duplicate key update 
zp's avatar
zp committed
227 228
    is_open = #{isOpen,jdbcType=BIGINT}, 
    org_id = #{orgId,jdbcType=VARCHAR}
张亚辉's avatar
张亚辉 committed
229 230 231 232
  </insert>
  <insert id="insertOrUpdateWithBLOBs" parameterType="com.tanpu.fund.entity.generator.StockTradeCal">
    <!--@mbg.generated-->
    insert into stock_trade_cal
zp's avatar
zp committed
233
    (is_open, org_id, exchange, cal_date)
张亚辉's avatar
张亚辉 committed
234
    values
zp's avatar
zp committed
235 236
    (#{isOpen,jdbcType=BIGINT}, #{orgId,jdbcType=VARCHAR}, #{exchange,jdbcType=LONGVARCHAR}, 
      #{calDate,jdbcType=LONGVARCHAR})
张亚辉's avatar
张亚辉 committed
237 238
    on duplicate key update 
    is_open = #{isOpen,jdbcType=BIGINT}, 
zp's avatar
zp committed
239
    org_id = #{orgId,jdbcType=VARCHAR}, 
张亚辉's avatar
张亚辉 committed
240 241 242 243 244 245 246 247 248 249
    exchange = #{exchange,jdbcType=LONGVARCHAR}, 
    cal_date = #{calDate,jdbcType=LONGVARCHAR}
  </insert>
  <insert id="insertOrUpdateSelective" parameterType="com.tanpu.fund.entity.generator.StockTradeCal">
    <!--@mbg.generated-->
    insert into stock_trade_cal
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="isOpen != null">
        is_open,
      </if>
zp's avatar
zp committed
250 251 252
      <if test="orgId != null">
        org_id,
      </if>
张亚辉's avatar
张亚辉 committed
253 254 255 256 257 258 259 260 261 262 263 264
      <if test="exchange != null">
        exchange,
      </if>
      <if test="calDate != null">
        cal_date,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="isOpen != null">
        #{isOpen,jdbcType=BIGINT},
      </if>
zp's avatar
zp committed
265 266 267
      <if test="orgId != null">
        #{orgId,jdbcType=VARCHAR},
      </if>
张亚辉's avatar
张亚辉 committed
268 269 270 271 272 273 274 275 276 277 278 279
      <if test="exchange != null">
        #{exchange,jdbcType=LONGVARCHAR},
      </if>
      <if test="calDate != null">
        #{calDate,jdbcType=LONGVARCHAR},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="isOpen != null">
        is_open = #{isOpen,jdbcType=BIGINT},
      </if>
zp's avatar
zp committed
280 281 282
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=VARCHAR},
      </if>
张亚辉's avatar
张亚辉 committed
283 284 285 286 287 288 289 290 291
      <if test="exchange != null">
        exchange = #{exchange,jdbcType=LONGVARCHAR},
      </if>
      <if test="calDate != null">
        cal_date = #{calDate,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
</mapper>