|
|
|
|
@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<resultMap type="TTrends" id="TTrendsResult">
|
|
|
|
|
<id property="id" column="id" />
|
|
|
|
|
<result property="tradeDate" column="trade_date" />
|
|
|
|
|
<result property="industryName" column="industry_name" />
|
|
|
|
|
<result property="eastmoneyIndustryCode" column="eastmoney_industry_code" />
|
|
|
|
|
<result property="eastmoneyIndustryName" column="eastmoney_industry_name" />
|
|
|
|
|
<result property="stocksCount" column="stocks_count" />
|
|
|
|
|
@ -20,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectTTrendsVo">
|
|
|
|
|
select id, trade_date, eastmoney_industry_code, eastmoney_industry_name, stocks_count, trend_value, trend_value_change, rank, rank_change, momentum_type, create_time, update_time from t_trends
|
|
|
|
|
select id, trade_date, industry_name, eastmoney_industry_code, eastmoney_industry_name, stocks_count, trend_value, trend_value_change, rank, rank_change, momentum_type, create_time, update_time from t_trends
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectTTrendsById" parameterType="Long" resultMap="TTrendsResult">
|
|
|
|
|
@ -32,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<include refid="selectTTrendsVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="tradeDate != null ">and trade_date = #{tradeDate}</if>
|
|
|
|
|
<if test="industryName != null and industryName != ''">and industry_name = #{industryName}</if>
|
|
|
|
|
<if test="eastmoneyIndustryCode != null and eastmoneyIndustryCode != ''">and eastmoney_industry_code = #{eastmoneyIndustryCode}</if>
|
|
|
|
|
<if test="eastmoneyIndustryName != null and eastmoneyIndustryName != ''">and eastmoney_industry_name = #{eastmoneyIndustryName}</if>
|
|
|
|
|
<if test="stocksCount != null ">and stocks_count = #{stocksCount}</if>
|
|
|
|
|
@ -47,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
insert into t_trends
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="tradeDate != null">trade_date,</if>
|
|
|
|
|
<if test="industryName != null and industryName != ''">industry_name,</if>
|
|
|
|
|
<if test="eastmoneyIndustryCode != null and eastmoneyIndustryCode != ''">eastmoney_industry_code,</if>
|
|
|
|
|
<if test="eastmoneyIndustryName != null and eastmoneyIndustryName != ''">eastmoney_industry_name,</if>
|
|
|
|
|
<if test="stocksCount != null">stocks_count,</if>
|
|
|
|
|
@ -60,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="tradeDate != null">#{tradeDate},</if>
|
|
|
|
|
<if test="industryName != null and industryName != ''">#{industryName},</if>
|
|
|
|
|
<if test="eastmoneyIndustryCode != null and eastmoneyIndustryCode != ''">#{eastmoneyIndustryCode},</if>
|
|
|
|
|
<if test="eastmoneyIndustryName != null and eastmoneyIndustryName != ''">#{eastmoneyIndustryName},</if>
|
|
|
|
|
<if test="stocksCount != null">#{stocksCount},</if>
|
|
|
|
|
@ -77,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
update t_trends
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="tradeDate != null">trade_date = #{tradeDate},</if>
|
|
|
|
|
<if test="industryName != null and industryName != ''">industry_name = #{industryName},</if>
|
|
|
|
|
<if test="eastmoneyIndustryCode != null and eastmoneyIndustryCode != ''">eastmoney_industry_code = #{eastmoneyIndustryCode},</if>
|
|
|
|
|
<if test="eastmoneyIndustryName != null and eastmoneyIndustryName != ''">eastmoney_industry_name = #{eastmoneyIndustryName},</if>
|
|
|
|
|
<if test="stocksCount != null">stocks_count = #{stocksCount},</if>
|
|
|
|
|
@ -104,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<insert id="batchUpsert" parameterType="java.util.List">
|
|
|
|
|
INSERT INTO t_trends (
|
|
|
|
|
trade_date,
|
|
|
|
|
industry_name,
|
|
|
|
|
eastmoney_industry_code,
|
|
|
|
|
eastmoney_industry_name,
|
|
|
|
|
stocks_count,
|
|
|
|
|
@ -118,6 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
|
(
|
|
|
|
|
#{item.tradeDate},
|
|
|
|
|
#{item.industryName},
|
|
|
|
|
#{item.eastmoneyIndustryCode},
|
|
|
|
|
#{item.eastmoneyIndustryName},
|
|
|
|
|
#{item.stocksCount},
|
|
|
|
|
@ -136,6 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
trend_value_change = VALUES(trend_value_change),
|
|
|
|
|
rank = VALUES(rank),
|
|
|
|
|
rank_change = VALUES(rank_change),
|
|
|
|
|
eastmoney_industry_name = VALUES(eastmoney_industry_name),
|
|
|
|
|
update_time = VALUES(update_time)
|
|
|
|
|
</insert>
|
|
|
|
|
</mapper>
|