|
|
|
@ -14,6 +14,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<result property="volume" column="volume" />
|
|
|
|
<result property="volume" column="volume" />
|
|
|
|
<result property="turnover" column="turnover" />
|
|
|
|
<result property="turnover" column="turnover" />
|
|
|
|
<result property="freeCirculationCap" column="free_circulation_cap" />
|
|
|
|
<result property="freeCirculationCap" column="free_circulation_cap" />
|
|
|
|
|
|
|
|
<result property="agenciesHold" column="agencies_hold" />
|
|
|
|
|
|
|
|
<result property="avgVolume20" column="avg_volume20" />
|
|
|
|
<result property="isLimitUp" column="is_limit_up" />
|
|
|
|
<result property="isLimitUp" column="is_limit_up" />
|
|
|
|
<result property="isLimitDown" column="is_limit_down" />
|
|
|
|
<result property="isLimitDown" column="is_limit_down" />
|
|
|
|
<result property="momentum10d" column="momentum_10d" />
|
|
|
|
<result property="momentum10d" column="momentum_10d" />
|
|
|
|
@ -31,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<sql id="selectStockDailyTradeVo">
|
|
|
|
<sql id="selectStockDailyTradeVo">
|
|
|
|
select stock_code, trade_date, open_price, close_price, high_price, low_price,
|
|
|
|
select stock_code, trade_date, open_price, close_price, high_price, low_price,
|
|
|
|
price_change_rate, volume, turnover, free_circulation_cap,
|
|
|
|
price_change_rate, volume, turnover, free_circulation_cap,
|
|
|
|
|
|
|
|
agencies_hold, avg_volume20,
|
|
|
|
is_limit_up, is_limit_down, momentum_10d, momentum_20d, momentum_60d, create_time
|
|
|
|
is_limit_up, is_limit_down, momentum_10d, momentum_20d, momentum_60d, create_time
|
|
|
|
from t_stock_daily_trade
|
|
|
|
from t_stock_daily_trade
|
|
|
|
</sql>
|
|
|
|
</sql>
|
|
|
|
@ -38,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<sql id="selectStockDailyTradeWithBasicVo">
|
|
|
|
<sql id="selectStockDailyTradeWithBasicVo">
|
|
|
|
select t.stock_code, t.trade_date, t.open_price, t.close_price, t.high_price, t.low_price,
|
|
|
|
select t.stock_code, t.trade_date, t.open_price, t.close_price, t.high_price, t.low_price,
|
|
|
|
t.price_change_rate, t.volume, t.turnover, t.free_circulation_cap,
|
|
|
|
t.price_change_rate, t.volume, t.turnover, t.free_circulation_cap,
|
|
|
|
|
|
|
|
t.agencies_hold, t.avg_volume20,
|
|
|
|
t.is_limit_up, t.is_limit_down, t.momentum_10d, t.momentum_20d, t.momentum_60d, t.create_time,
|
|
|
|
t.is_limit_up, t.is_limit_down, t.momentum_10d, t.momentum_20d, t.momentum_60d, t.create_time,
|
|
|
|
b.stock_name, b.industry_index_code, b.industry_index_name
|
|
|
|
b.stock_name, b.industry_index_code, b.industry_index_name
|
|
|
|
from t_stock_daily_trade t
|
|
|
|
from t_stock_daily_trade t
|
|
|
|
@ -156,6 +160,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="volume != null">volume,</if>
|
|
|
|
<if test="volume != null">volume,</if>
|
|
|
|
<if test="turnover != null">turnover,</if>
|
|
|
|
<if test="turnover != null">turnover,</if>
|
|
|
|
<if test="freeCirculationCap != null">free_circulation_cap,</if>
|
|
|
|
<if test="freeCirculationCap != null">free_circulation_cap,</if>
|
|
|
|
|
|
|
|
<if test="agenciesHold != null">agencies_hold,</if>
|
|
|
|
|
|
|
|
<if test="avgVolume20 != null">avg_volume20,</if>
|
|
|
|
<if test="isLimitUp != null">is_limit_up,</if>
|
|
|
|
<if test="isLimitUp != null">is_limit_up,</if>
|
|
|
|
<if test="isLimitDown != null">is_limit_down,</if>
|
|
|
|
<if test="isLimitDown != null">is_limit_down,</if>
|
|
|
|
<if test="momentum10d != null">momentum_10d,</if>
|
|
|
|
<if test="momentum10d != null">momentum_10d,</if>
|
|
|
|
@ -174,6 +180,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="volume != null">#{volume},</if>
|
|
|
|
<if test="volume != null">#{volume},</if>
|
|
|
|
<if test="turnover != null">#{turnover},</if>
|
|
|
|
<if test="turnover != null">#{turnover},</if>
|
|
|
|
<if test="freeCirculationCap != null">#{freeCirculationCap},</if>
|
|
|
|
<if test="freeCirculationCap != null">#{freeCirculationCap},</if>
|
|
|
|
|
|
|
|
<if test="agenciesHold != null">#{agenciesHold},</if>
|
|
|
|
|
|
|
|
<if test="avgVolume20 != null">#{avgVolume20},</if>
|
|
|
|
<if test="isLimitUp != null">#{isLimitUp},</if>
|
|
|
|
<if test="isLimitUp != null">#{isLimitUp},</if>
|
|
|
|
<if test="isLimitDown != null">#{isLimitDown},</if>
|
|
|
|
<if test="isLimitDown != null">#{isLimitDown},</if>
|
|
|
|
<if test="momentum10d != null">#{momentum10d},</if>
|
|
|
|
<if test="momentum10d != null">#{momentum10d},</if>
|
|
|
|
@ -194,6 +202,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<if test="volume != null">volume = #{volume},</if>
|
|
|
|
<if test="volume != null">volume = #{volume},</if>
|
|
|
|
<if test="turnover != null">turnover = #{turnover},</if>
|
|
|
|
<if test="turnover != null">turnover = #{turnover},</if>
|
|
|
|
<if test="freeCirculationCap != null">free_circulation_cap = #{freeCirculationCap},</if>
|
|
|
|
<if test="freeCirculationCap != null">free_circulation_cap = #{freeCirculationCap},</if>
|
|
|
|
|
|
|
|
<if test="agenciesHold != null">agencies_hold = #{agenciesHold},</if>
|
|
|
|
|
|
|
|
<if test="avgVolume20 != null">avg_volume20 = #{avgVolume20},</if>
|
|
|
|
<if test="isLimitUp != null">is_limit_up = #{isLimitUp},</if>
|
|
|
|
<if test="isLimitUp != null">is_limit_up = #{isLimitUp},</if>
|
|
|
|
<if test="isLimitDown != null">is_limit_down = #{isLimitDown},</if>
|
|
|
|
<if test="isLimitDown != null">is_limit_down = #{isLimitDown},</if>
|
|
|
|
<if test="momentum10d != null">momentum_10d = #{momentum10d},</if>
|
|
|
|
<if test="momentum10d != null">momentum_10d = #{momentum10d},</if>
|
|
|
|
@ -209,24 +219,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="batchInsertStockDailyTrade" parameterType="java.util.List">
|
|
|
|
<insert id="batchInsertStockDailyTrade" parameterType="java.util.List">
|
|
|
|
insert into t_stock_daily_trade(stock_code, trade_date, open_price, close_price, high_price, low_price,
|
|
|
|
insert into t_stock_daily_trade(stock_code, trade_date, open_price, close_price, high_price, low_price,
|
|
|
|
price_change_rate, volume, turnover, free_circulation_cap,
|
|
|
|
price_change_rate, volume, turnover, free_circulation_cap, agencies_hold, avg_volume20,
|
|
|
|
is_limit_up, is_limit_down, momentum_10d, momentum_20d, momentum_60d, create_time)
|
|
|
|
is_limit_up, is_limit_down, momentum_10d, momentum_20d, momentum_60d, create_time)
|
|
|
|
values
|
|
|
|
values
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
(#{item.stockCode}, #{item.tradeDate}, #{item.openPrice}, #{item.closePrice}, #{item.highPrice}, #{item.lowPrice},
|
|
|
|
(#{item.stockCode}, #{item.tradeDate}, #{item.openPrice}, #{item.closePrice}, #{item.highPrice}, #{item.lowPrice},
|
|
|
|
#{item.priceChangeRate}, #{item.volume}, #{item.turnover}, #{item.freeCirculationCap},
|
|
|
|
#{item.priceChangeRate}, #{item.volume}, #{item.turnover}, #{item.freeCirculationCap}, #{item.agenciesHold}, #{item.avgVolume20},
|
|
|
|
#{item.isLimitUp}, #{item.isLimitDown}, #{item.momentum10d}, #{item.momentum20d}, #{item.momentum60d}, NOW())
|
|
|
|
#{item.isLimitUp}, #{item.isLimitDown}, #{item.momentum10d}, #{item.momentum20d}, #{item.momentum60d}, NOW())
|
|
|
|
</foreach>
|
|
|
|
</foreach>
|
|
|
|
</insert>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="batchUpsertStockDailyTrade" parameterType="java.util.List">
|
|
|
|
<insert id="batchUpsertStockDailyTrade" parameterType="java.util.List">
|
|
|
|
insert into t_stock_daily_trade(stock_code, trade_date, open_price, close_price, high_price, low_price,
|
|
|
|
insert into t_stock_daily_trade(stock_code, trade_date, open_price, close_price, high_price, low_price,
|
|
|
|
price_change_rate, volume, turnover, free_circulation_cap,
|
|
|
|
price_change_rate, volume, turnover, free_circulation_cap, agencies_hold, avg_volume20,
|
|
|
|
is_limit_up, is_limit_down, momentum_10d, momentum_20d, momentum_60d, create_time)
|
|
|
|
is_limit_up, is_limit_down, momentum_10d, momentum_20d, momentum_60d, create_time)
|
|
|
|
values
|
|
|
|
values
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
(#{item.stockCode}, #{item.tradeDate}, #{item.openPrice}, #{item.closePrice}, #{item.highPrice}, #{item.lowPrice},
|
|
|
|
(#{item.stockCode}, #{item.tradeDate}, #{item.openPrice}, #{item.closePrice}, #{item.highPrice}, #{item.lowPrice},
|
|
|
|
#{item.priceChangeRate}, #{item.volume}, #{item.turnover}, #{item.freeCirculationCap},
|
|
|
|
#{item.priceChangeRate}, #{item.volume}, #{item.turnover}, #{item.freeCirculationCap}, #{item.agenciesHold}, #{item.avgVolume20},
|
|
|
|
#{item.isLimitUp}, #{item.isLimitDown}, #{item.momentum10d}, #{item.momentum20d}, #{item.momentum60d}, NOW())
|
|
|
|
#{item.isLimitUp}, #{item.isLimitDown}, #{item.momentum10d}, #{item.momentum20d}, #{item.momentum60d}, NOW())
|
|
|
|
</foreach>
|
|
|
|
</foreach>
|
|
|
|
ON DUPLICATE KEY UPDATE
|
|
|
|
ON DUPLICATE KEY UPDATE
|
|
|
|
@ -238,6 +248,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
volume = VALUES(volume),
|
|
|
|
volume = VALUES(volume),
|
|
|
|
turnover = VALUES(turnover),
|
|
|
|
turnover = VALUES(turnover),
|
|
|
|
free_circulation_cap = VALUES(free_circulation_cap),
|
|
|
|
free_circulation_cap = VALUES(free_circulation_cap),
|
|
|
|
|
|
|
|
agencies_hold = VALUES(agencies_hold),
|
|
|
|
|
|
|
|
avg_volume20 = VALUES(avg_volume20),
|
|
|
|
is_limit_up = VALUES(is_limit_up),
|
|
|
|
is_limit_up = VALUES(is_limit_up),
|
|
|
|
is_limit_down = VALUES(is_limit_down),
|
|
|
|
is_limit_down = VALUES(is_limit_down),
|
|
|
|
momentum_10d = VALUES(momentum_10d),
|
|
|
|
momentum_10d = VALUES(momentum_10d),
|
|
|
|
@ -248,4 +260,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
<select id="checkTradeDataExistsByDate" parameterType="Date" resultType="int">
|
|
|
|
<select id="checkTradeDataExistsByDate" parameterType="Date" resultType="int">
|
|
|
|
select count(1) from t_stock_daily_trade where trade_date = #{tradeDate}
|
|
|
|
select count(1) from t_stock_daily_trade where trade_date = #{tradeDate}
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectPreviousTradeDate" parameterType="Date" resultType="Date">
|
|
|
|
|
|
|
|
select max(trade_date) as trade_date
|
|
|
|
|
|
|
|
from t_stock_daily_trade
|
|
|
|
|
|
|
|
where trade_date < #{currentDate}
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</mapper>
|
|
|
|
</mapper>
|
|
|
|
|