|
|
|
|
@ -7,9 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="stockCode" column="stock_code" />
|
|
|
|
|
<result property="tradeDate" column="trade_date" />
|
|
|
|
|
<result property="isNewHigh" column="is_new_high" />
|
|
|
|
|
<result property="newHighDate" column="new_high_date" />
|
|
|
|
|
<result property="isNewLow" column="is_new_low" />
|
|
|
|
|
<result property="newLowDate" column="new_low_date" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
@ -20,13 +18,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectStockHighLowStatusVo">
|
|
|
|
|
select stock_code, trade_date, is_new_high, new_high_date, is_new_low, new_low_date, create_time
|
|
|
|
|
select stock_code, trade_date, is_new_high, is_new_low, create_time
|
|
|
|
|
from t_stock_high_low_status
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<sql id="selectStockHighLowStatusWithBasicVo">
|
|
|
|
|
select h.stock_code, h.trade_date, h.is_new_high, h.new_high_date, h.is_new_low, h.new_low_date, h.create_time,
|
|
|
|
|
b.stock_name, b.industry_index_code, b.industry_index_name
|
|
|
|
|
select
|
|
|
|
|
h.stock_code,
|
|
|
|
|
h.trade_date,
|
|
|
|
|
h.is_new_high,
|
|
|
|
|
h.is_new_low,
|
|
|
|
|
h.create_time,
|
|
|
|
|
b.stock_name,
|
|
|
|
|
b.industry_index_code,
|
|
|
|
|
b.industry_index_name
|
|
|
|
|
from t_stock_high_low_status h
|
|
|
|
|
left join t_stock_basic b on h.stock_code = b.stock_code
|
|
|
|
|
</sql>
|
|
|
|
|
@ -126,18 +131,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="stockCode != null and stockCode != ''">stock_code,</if>
|
|
|
|
|
<if test="tradeDate != null">trade_date,</if>
|
|
|
|
|
<if test="isNewHigh != null">is_new_high,</if>
|
|
|
|
|
<if test="newHighDate != null">new_high_date,</if>
|
|
|
|
|
<if test="isNewLow != null">is_new_low,</if>
|
|
|
|
|
<if test="newLowDate != null">new_low_date,</if>
|
|
|
|
|
create_time,
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="stockCode != null and stockCode != ''">#{stockCode},</if>
|
|
|
|
|
<if test="tradeDate != null">#{tradeDate},</if>
|
|
|
|
|
<if test="isNewHigh != null">#{isNewHigh},</if>
|
|
|
|
|
<if test="newHighDate != null">#{newHighDate},</if>
|
|
|
|
|
<if test="isNewLow != null">#{isNewLow},</if>
|
|
|
|
|
<if test="newLowDate != null">#{newLowDate},</if>
|
|
|
|
|
NOW(),
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
@ -146,9 +147,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
update t_stock_high_low_status
|
|
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
|
|
<if test="isNewHigh != null">is_new_high = #{isNewHigh},</if>
|
|
|
|
|
<if test="newHighDate != null">new_high_date = #{newHighDate},</if>
|
|
|
|
|
<if test="isNewLow != null">is_new_low = #{isNewLow},</if>
|
|
|
|
|
<if test="newLowDate != null">new_low_date = #{newLowDate},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where stock_code = #{stockCode} and trade_date = #{tradeDate}
|
|
|
|
|
</update>
|
|
|
|
|
@ -158,23 +157,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<insert id="batchInsertStockHighLowStatus" parameterType="java.util.List">
|
|
|
|
|
insert into t_stock_high_low_status(stock_code, trade_date, is_new_high, new_high_date, is_new_low, new_low_date, create_time)
|
|
|
|
|
insert into t_stock_high_low_status(stock_code, trade_date, is_new_high, is_new_low, create_time)
|
|
|
|
|
values
|
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
|
(#{item.stockCode}, #{item.tradeDate}, #{item.isNewHigh}, #{item.newHighDate}, #{item.isNewLow}, #{item.newLowDate}, NOW())
|
|
|
|
|
(#{item.stockCode}, #{item.tradeDate}, #{item.isNewHigh}, #{item.isNewLow}, NOW())
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<insert id="batchUpsertStockHighLowStatus" parameterType="java.util.List">
|
|
|
|
|
insert into t_stock_high_low_status(stock_code, trade_date, is_new_high, new_high_date, is_new_low, new_low_date, create_time)
|
|
|
|
|
insert into t_stock_high_low_status(stock_code, trade_date, is_new_high, is_new_low, create_time)
|
|
|
|
|
values
|
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
|
(#{item.stockCode}, #{item.tradeDate}, #{item.isNewHigh}, #{item.newHighDate}, #{item.isNewLow}, #{item.newLowDate}, NOW())
|
|
|
|
|
(#{item.stockCode}, #{item.tradeDate}, #{item.isNewHigh}, #{item.isNewLow}, NOW())
|
|
|
|
|
</foreach>
|
|
|
|
|
ON DUPLICATE KEY UPDATE
|
|
|
|
|
is_new_high = VALUES(is_new_high),
|
|
|
|
|
new_high_date = VALUES(new_high_date),
|
|
|
|
|
is_new_low = VALUES(is_new_low),
|
|
|
|
|
new_low_date = VALUES(new_low_date)
|
|
|
|
|
is_new_low = VALUES(is_new_low)
|
|
|
|
|
</insert>
|
|
|
|
|
</mapper>
|
|
|
|
|
|