182 lines
9.1 KiB
XML
182 lines
9.1 KiB
XML
<?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.intc.invest.mapper.FutureStandardInforMapper">
|
|
|
|
<resultMap type="FutureStandardInforVo" id="FutureStandardInforResult">
|
|
<result property="id" column="id" />
|
|
<result property="name" column="name" />
|
|
<result property="type" column="type" />
|
|
<result property="code" column="code" />
|
|
<result property="exchangeId" column="exchange_id" />
|
|
<result property="exchangeName" column="exchange_name" />
|
|
<result property="tradingUnit" column="trading_unit" />
|
|
<result property="minimumPriceFluctuation" column="minimum_price_fluctuation" />
|
|
<result property="tradingTime" column="trading_time" />
|
|
<result property="priceLimit" column="price_limit" />
|
|
<result property="deliveryMonth" column="delivery_month" />
|
|
<result property="deliveryMethod" column="delivery_method" />
|
|
<result property="deliveryLocation" column="delivery_location" />
|
|
<result property="marginRatio" column="margin_ratio" />
|
|
<result property="pricingUnit" column="pricing_unit" />
|
|
<result property="lastTradingDay" column="last_trading_day" />
|
|
<result property="deliveryDate" column="delivery_date" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="delFlag" column="del_flag" />
|
|
<result property="remark" column="remark" />
|
|
</resultMap>
|
|
|
|
<sql id="selectFutureStandardInforVo">
|
|
select
|
|
a.id,
|
|
a.name,
|
|
a.type,
|
|
a.code,
|
|
a.exchange_id,
|
|
a.trading_unit,
|
|
a.minimum_price_fluctuation,
|
|
a.trading_time,
|
|
a.price_limit,
|
|
a.delivery_month,
|
|
a.delivery_method,
|
|
a.delivery_location,
|
|
a.margin_ratio,
|
|
a.pricing_unit,
|
|
a.last_trading_day,
|
|
a.delivery_date,
|
|
a.create_by,
|
|
a.create_time,
|
|
a.update_by,
|
|
a.update_time,
|
|
a.del_flag,
|
|
a.remark,
|
|
ie."name" as exchange_name
|
|
from
|
|
invest_future_standard_infor a
|
|
left join invest_exchange ie on ie.id =a.exchange_id
|
|
|
|
</sql>
|
|
|
|
<select id="selectFutureStandardInforList" parameterType="FutureStandardInforDto" resultMap="FutureStandardInforResult">
|
|
<include refid="selectFutureStandardInforVo"/>
|
|
<where>
|
|
a.del_flag='0'
|
|
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
|
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
|
<if test="code != null and code != ''"> and a.code = #{code}</if>
|
|
<if test="exchangeId != null "> and a.exchange_id = #{exchangeId}</if>
|
|
</where>
|
|
order by a.create_time desc
|
|
</select>
|
|
|
|
<select id="selectFutureStandardInforById" parameterType="Long" resultMap="FutureStandardInforResult">
|
|
<include refid="selectFutureStandardInforVo"/>
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertFutureStandardInfor" parameterType="FutureStandardInfor">
|
|
insert into invest_future_standard_infor
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="name != null and name != ''">name,</if>
|
|
<if test="type != null and type != ''">type,</if>
|
|
<if test="code != null and code != ''">code,</if>
|
|
<if test="exchangeId != null">exchange_id,</if>
|
|
<if test="tradingUnit != null">trading_unit,</if>
|
|
<if test="minimumPriceFluctuation != null">minimum_price_fluctuation,</if>
|
|
<if test="tradingTime != null">trading_time,</if>
|
|
<if test="priceLimit != null">price_limit,</if>
|
|
<if test="deliveryMonth != null">delivery_month,</if>
|
|
<if test="deliveryMethod != null">delivery_method,</if>
|
|
<if test="deliveryLocation != null">delivery_location,</if>
|
|
<if test="marginRatio != null">margin_ratio,</if>
|
|
<if test="pricingUnit != null">pricing_unit,</if>
|
|
<if test="lastTradingDay != null">last_trading_day,</if>
|
|
<if test="deliveryDate != null">delivery_date,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
<if test="remark != null">remark,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
<if test="type != null and type != ''">#{type},</if>
|
|
<if test="code != null and code != ''">#{code},</if>
|
|
<if test="exchangeId != null">#{exchangeId},</if>
|
|
<if test="tradingUnit != null">#{tradingUnit},</if>
|
|
<if test="minimumPriceFluctuation != null">#{minimumPriceFluctuation},</if>
|
|
<if test="tradingTime != null">#{tradingTime},</if>
|
|
<if test="priceLimit != null">#{priceLimit},</if>
|
|
<if test="deliveryMonth != null">#{deliveryMonth},</if>
|
|
<if test="deliveryMethod != null">#{deliveryMethod},</if>
|
|
<if test="deliveryLocation != null">#{deliveryLocation},</if>
|
|
<if test="marginRatio != null">#{marginRatio},</if>
|
|
<if test="pricingUnit != null">#{pricingUnit},</if>
|
|
<if test="lastTradingDay != null">#{lastTradingDay},</if>
|
|
<if test="deliveryDate != null">#{deliveryDate},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateFutureStandardInfor" parameterType="FutureStandardInfor">
|
|
update invest_future_standard_infor
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
|
<if test="type != null and type != ''">type = #{type},</if>
|
|
<if test="code != null and code != ''">code = #{code},</if>
|
|
<if test="exchangeId != null">exchange_id = #{exchangeId},</if>
|
|
<if test="tradingUnit != null">trading_unit = #{tradingUnit},</if>
|
|
<if test="minimumPriceFluctuation != null">minimum_price_fluctuation = #{minimumPriceFluctuation},</if>
|
|
<if test="tradingTime != null">trading_time = #{tradingTime},</if>
|
|
<if test="priceLimit != null">price_limit = #{priceLimit},</if>
|
|
<if test="deliveryMonth != null">delivery_month = #{deliveryMonth},</if>
|
|
<if test="deliveryMethod != null">delivery_method = #{deliveryMethod},</if>
|
|
<if test="deliveryLocation != null">delivery_location = #{deliveryLocation},</if>
|
|
<if test="marginRatio != null">margin_ratio = #{marginRatio},</if>
|
|
<if test="pricingUnit != null">pricing_unit = #{pricingUnit},</if>
|
|
<if test="lastTradingDay != null">last_trading_day = #{lastTradingDay},</if>
|
|
<if test="deliveryDate != null">delivery_date = #{deliveryDate},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteFutureStandardInforById" parameterType="Long">
|
|
delete from invest_future_standard_infor where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteFutureStandardInforByIds" parameterType="String">
|
|
delete from invest_future_standard_infor where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
<update id="removeFutureStandardInforById" parameterType="Long">
|
|
update invest_future_standard_infor set del_flag='1' where id = #{id}
|
|
</update>
|
|
|
|
<update id="removeFutureStandardInforByIds" parameterType="String">
|
|
update invest_future_standard_infor set del_flag='1' where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</update>
|
|
</mapper>
|