174 lines
8.3 KiB
XML
174 lines
8.3 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.FutureBaseInforMapper">
|
|
|
|
<resultMap type="FutureBaseInforVo" id="FutureBaseInforResult">
|
|
<result property="id" column="id" />
|
|
<result property="name" column="name" />
|
|
<result property="code" column="code" />
|
|
<result property="standardId" column="standard_id" />
|
|
<result property="standardName" column="standard_name" />
|
|
<result property="exchangeName" column="exchange_name" />
|
|
<result property="tradingTimeName" column="trading_time" />
|
|
<result property="referencePrice" column="reference_price" />
|
|
<result property="tradingMultiplier" column="trading_multiplier" />
|
|
<result property="priceLimit" column="price_limit" />
|
|
<result property="deliveryMonth" column="delivery_month" />
|
|
<result property="marginRatio" column="margin_ratio" />
|
|
<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" />
|
|
<result property="listingDate" column="listing_date" />
|
|
<result property="tsCode" column="ts_code" />
|
|
</resultMap>
|
|
|
|
<sql id="selectFutureBaseInforVo">
|
|
select
|
|
a.id,
|
|
a.name,
|
|
a.code,
|
|
a.standard_id,
|
|
a.reference_price,
|
|
a.trading_multiplier,
|
|
a.price_limit,
|
|
a.delivery_month,
|
|
a.margin_ratio,
|
|
a.last_trading_day,
|
|
a.delivery_date,
|
|
a.create_by,
|
|
a.create_time,
|
|
a.update_by,
|
|
a.update_time,
|
|
a.del_flag,
|
|
a.remark,
|
|
a.listing_date,
|
|
a.ts_code,
|
|
ie."name" as exchange_name,
|
|
ifsi."name" as standard_name,
|
|
ifsi.trading_time
|
|
from
|
|
invest_future_base_infor a
|
|
left join invest_future_standard_infor ifsi on ifsi.id =a.standard_id
|
|
left join invest_exchange ie on ie.id =ifsi.exchange_id
|
|
|
|
</sql>
|
|
|
|
<select id="selectFutureBaseInforList" parameterType="FutureBaseInforDto" resultMap="FutureBaseInforResult">
|
|
<include refid="selectFutureBaseInforVo"/>
|
|
<where>
|
|
a.del_flag='0'
|
|
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
|
<if test="code != null and code != ''"> and a.code = #{code}</if>
|
|
<if test="standardId != null "> and a.standard_id = #{standardId}</if>
|
|
<if test="lastTradingDay!=null and lastTradingDay !=''">
|
|
and to_char(a.last_trading_day, 'yyyy-MM-dd')>=#{lastTradingDay}
|
|
</if>
|
|
</where>
|
|
order by a.create_time desc
|
|
</select>
|
|
|
|
<select id="selectFutureBaseInforById" parameterType="Long" resultMap="FutureBaseInforResult">
|
|
<include refid="selectFutureBaseInforVo"/>
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertFutureBaseInfor" parameterType="FutureBaseInfor">
|
|
insert into invest_future_base_infor
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="name != null">name,</if>
|
|
<if test="code != null">code,</if>
|
|
<if test="standardId != null">standard_id,</if>
|
|
<if test="referencePrice != null">reference_price,</if>
|
|
<if test="tradingMultiplier != null">trading_multiplier,</if>
|
|
<if test="priceLimit != null">price_limit,</if>
|
|
<if test="deliveryMonth != null">delivery_month,</if>
|
|
<if test="marginRatio != null">margin_ratio,</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>
|
|
<if test="listingDate != null">listing_date,</if>
|
|
<if test="tsCode != null">ts_code,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="name != null">#{name},</if>
|
|
<if test="code != null">#{code},</if>
|
|
<if test="standardId != null">#{standardId},</if>
|
|
<if test="referencePrice != null">#{referencePrice},</if>
|
|
<if test="tradingMultiplier != null">#{tradingMultiplier},</if>
|
|
<if test="priceLimit != null">#{priceLimit},</if>
|
|
<if test="deliveryMonth != null">#{deliveryMonth},</if>
|
|
<if test="marginRatio != null">#{marginRatio},</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>
|
|
<if test="listingDate != null">#{listingDate},</if>
|
|
<if test="tsCode != null">#{tsCode},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateFutureBaseInfor" parameterType="FutureBaseInfor">
|
|
update invest_future_base_infor
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="name != null">name = #{name},</if>
|
|
<if test="code != null">code = #{code},</if>
|
|
<if test="standardId != null">standard_id = #{standardId},</if>
|
|
<if test="referencePrice != null">reference_price = #{referencePrice},</if>
|
|
<if test="tradingMultiplier != null">trading_multiplier = #{tradingMultiplier},</if>
|
|
<if test="priceLimit != null">price_limit = #{priceLimit},</if>
|
|
<if test="deliveryMonth != null">delivery_month = #{deliveryMonth},</if>
|
|
<if test="marginRatio != null">margin_ratio = #{marginRatio},</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>
|
|
<if test="listingDate != null">listing_date = #{listingDate},</if>
|
|
<if test="tsCode != null">ts_code = #{tsCode},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteFutureBaseInforById" parameterType="Long">
|
|
delete from invest_future_base_infor where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteFutureBaseInforByIds" parameterType="String">
|
|
delete from invest_future_base_infor where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
<update id="removeFutureBaseInforById" parameterType="Long">
|
|
update invest_future_base_infor set del_flag='1' where id = #{id}
|
|
</update>
|
|
|
|
<update id="removeFutureBaseInforByIds" parameterType="String">
|
|
update invest_future_base_infor set del_flag='1' where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</update>
|
|
</mapper>
|