You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
198 lines
10 KiB
198 lines
10 KiB
|
4 months ago
|
<?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">
|
||
|
4 months ago
|
<mapper namespace="com.ruoyi.newstocksystem.mapper.NewStocksMapper">
|
||
|
|
<resultMap type="com.ruoyi.newstocksystem.domain.NewStocks" id="NewStocksResult">
|
||
|
4 months ago
|
<id property="id" column="id" />
|
||
|
|
<result property="code" column="code" />
|
||
|
|
<result property="tradeDate" column="trade_date" />
|
||
|
|
<result property="open" column="open" />
|
||
|
|
<result property="close" column="close" />
|
||
|
|
<result property="changeRate" column="change_rate" />
|
||
|
|
<result property="tradeDays" column="trade_days" />
|
||
|
|
<result property="volume" column="volume" />
|
||
|
|
<result property="amount" column="amount" />
|
||
|
|
<result property="changeRate10" column="change_rate_10" />
|
||
|
|
<result property="changeRate20" column="change_rate_20" />
|
||
|
|
<result property="changeRate60" column="change_rate_60" />
|
||
|
|
<result property="avgVolume20" column="avg_volume_20" />
|
||
|
|
<result property="freeFloatMarketValue" column="free_float_market_value" />
|
||
|
|
<result property="totalMarketValue" column="total_market_value" />
|
||
|
|
<result property="agenciesHold" column="agencies_hold" />
|
||
|
|
<result property="name" column="name" />
|
||
|
|
<result property="industryId" column="industry_id" />
|
||
|
|
<result property="industryName" column="industry_name" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectNewStocksVo">
|
||
|
4 months ago
|
select id, code, trade_date, open, close, change_rate, trade_days, volume, amount, change_rate_10, change_rate_20, change_rate_60, avg_volume_20, free_float_market_value, total_market_value, agencies_hold from new_stocks
|
||
|
4 months ago
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectNewStocksById" parameterType="Integer" resultMap="NewStocksResult">
|
||
|
|
<include refid="selectNewStocksVo" />
|
||
|
|
where id = #{id}
|
||
|
|
</select>
|
||
|
|
|
||
|
4 months ago
|
<select id="selectNewStocksList" parameterType="com.ruoyi.newstocksystem.domain.NewStocks" resultMap="NewStocksResult">
|
||
|
4 months ago
|
<include refid="selectNewStocksVo" />
|
||
|
|
<where>
|
||
|
|
<if test="code != null and code != ''">
|
||
|
|
and code = #{code}
|
||
|
|
</if>
|
||
|
4 months ago
|
<if test="tradeDate != null and tradeDate != ''">
|
||
|
4 months ago
|
and trade_date = #{tradeDate}
|
||
|
|
</if>
|
||
|
4 months ago
|
<if test="changeRate != null">
|
||
|
|
and change_rate = #{changeRate}
|
||
|
|
</if>
|
||
|
4 months ago
|
</where>
|
||
|
|
order by trade_date desc, code
|
||
|
|
</select>
|
||
|
|
|
||
|
4 months ago
|
<select id="selectNewStocksListB" parameterType="com.ruoyi.newstocksystem.domain.NewStocks" resultMap="NewStocksResult">
|
||
|
4 months ago
|
select s.id, s.code, s.trade_date, s.open, s.close, s.change_rate, s.trade_days, s.volume, s.amount, s.change_rate_10, s.change_rate_20, s.change_rate_60, s.avg_volume_20, s.free_float_market_value, s.total_market_value, s.agencies_hold, b.name, b.industry_id, i.industry_name
|
||
|
|
from new_stocks s
|
||
|
|
left join new_stock_basic b on s.code = b.code
|
||
|
|
left join new_stock_industry i on b.industry_id = i.industry_id
|
||
|
|
<where>
|
||
|
|
<if test="code != null and code != ''">
|
||
|
|
and s.code = #{code}
|
||
|
|
</if>
|
||
|
4 months ago
|
<if test="tradeDate != null and tradeDate != ''">
|
||
|
4 months ago
|
and s.trade_date = #{tradeDate}
|
||
|
|
</if>
|
||
|
|
<if test="changeRate != null">
|
||
|
|
and s.change_rate = #{changeRate}
|
||
|
|
</if>
|
||
|
4 months ago
|
<if test="name != null and name != ''">
|
||
|
|
and b.name like concat('%', #{name}, '%')
|
||
|
|
</if>
|
||
|
|
<if test="industryName != null and industryName != ''">
|
||
|
|
and i.industry_name like concat('%', #{industryName}, '%')
|
||
|
4 months ago
|
</if>
|
||
|
|
</where>
|
||
|
|
order by s.trade_date desc, s.code
|
||
|
|
</select>
|
||
|
|
|
||
|
4 months ago
|
<select id="selectNewStrongStocksList" parameterType="com.ruoyi.newstocksystem.domain.NewStocks" resultMap="NewStocksResult">
|
||
|
|
select s.id, s.code, s.trade_date, s.open, s.close, s.change_rate, s.trade_days, s.volume, s.amount, s.change_rate_10, s.change_rate_20, s.change_rate_60, s.avg_volume_20, s.free_float_market_value, s.total_market_value, s.agencies_hold, b.name, b.industry_id, i.industry_name
|
||
|
|
from new_stocks s
|
||
|
|
left join new_stock_basic b on s.code = b.code
|
||
|
|
left join new_stock_industry i on b.industry_id = i.industry_id
|
||
|
|
<where>
|
||
|
|
<if test="tradeDate != null and tradeDate != ''">
|
||
|
|
and s.trade_date = #{tradeDate}
|
||
|
|
</if>
|
||
|
|
<if test="industryName != null and industryName != ''">
|
||
|
|
and i.industry_name like concat('%', #{industryName}, '%')
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
order by s.change_rate_20 desc, s.change_rate_10 desc
|
||
|
|
limit 100
|
||
|
4 months ago
|
</select>
|
||
|
|
|
||
|
4 months ago
|
<select id="selectNewLimitStocksList" parameterType="com.ruoyi.newstocksystem.domain.NewStocks" resultMap="NewStocksResult">
|
||
|
|
select s.id, s.code, s.trade_date, s.open, s.close, s.change_rate, s.trade_days, s.volume, s.amount, s.change_rate_10, s.change_rate_20, s.change_rate_60, s.avg_volume_20, s.free_float_market_value, s.total_market_value, s.agencies_hold, b.name, b.industry_id, i.industry_name
|
||
|
|
from new_stocks s
|
||
|
|
left join new_stock_basic b on s.code = b.code
|
||
|
|
left join new_stock_industry i on b.industry_id = i.industry_id
|
||
|
|
<where>
|
||
|
|
<if test="tradeDate != null and tradeDate != ''">
|
||
|
|
and s.trade_date = #{tradeDate}
|
||
|
|
</if>
|
||
|
|
<if test="industryName != null and industryName != ''">
|
||
|
|
and i.industry_name like concat('%', #{industryName}, '%')
|
||
|
|
</if>
|
||
|
|
and s.change_rate >= 9.8
|
||
|
|
</where>
|
||
|
|
order by s.change_rate desc
|
||
|
4 months ago
|
</select>
|
||
|
|
|
||
|
4 months ago
|
<insert id="insertNewStocks" parameterType="com.ruoyi.newstocksystem.domain.NewStocks" useGeneratedKeys="true" keyProperty="id">
|
||
|
|
insert into new_stocks
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="code != null and code != ''">code,</if>
|
||
|
|
<if test="tradeDate != null and tradeDate != ''">trade_date,</if>
|
||
|
|
<if test="open != null">open,</if>
|
||
|
|
<if test="close != null">close,</if>
|
||
|
|
<if test="changeRate != null">change_rate,</if>
|
||
|
|
<if test="tradeDays != null">trade_days,</if>
|
||
|
|
<if test="volume != null">volume,</if>
|
||
|
|
<if test="amount != null">amount,</if>
|
||
|
|
<if test="changeRate10 != null">change_rate_10,</if>
|
||
|
|
<if test="changeRate20 != null">change_rate_20,</if>
|
||
|
|
<if test="changeRate60 != null">change_rate_60,</if>
|
||
|
|
<if test="avgVolume20 != null">avg_volume_20,</if>
|
||
|
|
<if test="freeFloatMarketValue != null">free_float_market_value,</if>
|
||
|
|
<if test="totalMarketValue != null">total_market_value,</if>
|
||
|
|
<if test="agenciesHold != null">agencies_hold,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="code != null and code != ''">#{code},</if>
|
||
|
|
<if test="tradeDate != null and tradeDate != ''">#{tradeDate},</if>
|
||
|
|
<if test="open != null">#{open},</if>
|
||
|
|
<if test="close != null">#{close},</if>
|
||
|
|
<if test="changeRate != null">#{changeRate},</if>
|
||
|
|
<if test="tradeDays != null">#{tradeDays},</if>
|
||
|
|
<if test="volume != null">#{volume},</if>
|
||
|
|
<if test="amount != null">#{amount},</if>
|
||
|
|
<if test="changeRate10 != null">#{changeRate10},</if>
|
||
|
|
<if test="changeRate20 != null">#{changeRate20},</if>
|
||
|
|
<if test="changeRate60 != null">#{changeRate60},</if>
|
||
|
|
<if test="avgVolume20 != null">#{avgVolume20},</if>
|
||
|
|
<if test="freeFloatMarketValue != null">#{freeFloatMarketValue},</if>
|
||
|
|
<if test="totalMarketValue != null">#{totalMarketValue},</if>
|
||
|
|
<if test="agenciesHold != null">#{agenciesHold},</if>
|
||
|
|
</trim>
|
||
|
4 months ago
|
</insert>
|
||
|
|
|
||
|
|
<insert id="batchInsertNewStocks" parameterType="java.util.List">
|
||
|
|
insert into new_stocks(
|
||
|
|
code, trade_date, open, close, change_rate, trade_days, volume, amount, change_rate_10, change_rate_20, change_rate_60, avg_volume_20, free_float_market_value, total_market_value, agencies_hold
|
||
|
|
) values
|
||
|
|
<foreach collection="list" item="item" separator=",">
|
||
|
|
(
|
||
|
|
#{item.code}, #{item.tradeDate}, #{item.open}, #{item.close}, #{item.changeRate}, #{item.tradeDays}, #{item.volume}, #{item.amount}, #{item.changeRate10}, #{item.changeRate20}, #{item.changeRate60}, #{item.avgVolume20}, #{item.freeFloatMarketValue}, #{item.totalMarketValue}, #{item.agenciesHold}
|
||
|
|
)
|
||
|
|
</foreach>
|
||
|
|
</insert>
|
||
|
|
|
||
|
4 months ago
|
<update id="updateNewStocks" parameterType="com.ruoyi.newstocksystem.domain.NewStocks">
|
||
|
4 months ago
|
update new_stocks
|
||
|
4 months ago
|
<trim prefix="set" suffixOverrides=",">
|
||
|
4 months ago
|
<if test="code != null and code != ''">code = #{code},</if>
|
||
|
4 months ago
|
<if test="tradeDate != null and tradeDate != ''">trade_date = #{tradeDate},</if>
|
||
|
4 months ago
|
<if test="open != null">open = #{open},</if>
|
||
|
|
<if test="close != null">close = #{close},</if>
|
||
|
|
<if test="changeRate != null">change_rate = #{changeRate},</if>
|
||
|
|
<if test="tradeDays != null">trade_days = #{tradeDays},</if>
|
||
|
|
<if test="volume != null">volume = #{volume},</if>
|
||
|
|
<if test="amount != null">amount = #{amount},</if>
|
||
|
|
<if test="changeRate10 != null">change_rate_10 = #{changeRate10},</if>
|
||
|
|
<if test="changeRate20 != null">change_rate_20 = #{changeRate20},</if>
|
||
|
|
<if test="changeRate60 != null">change_rate_60 = #{changeRate60},</if>
|
||
|
|
<if test="avgVolume20 != null">avg_volume_20 = #{avgVolume20},</if>
|
||
|
|
<if test="freeFloatMarketValue != null">free_float_market_value = #{freeFloatMarketValue},</if>
|
||
|
|
<if test="totalMarketValue != null">total_market_value = #{totalMarketValue},</if>
|
||
|
|
<if test="agenciesHold != null">agencies_hold = #{agenciesHold},</if>
|
||
|
4 months ago
|
</trim>
|
||
|
4 months ago
|
where id = #{id}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteNewStocksById" parameterType="Integer">
|
||
|
|
delete from new_stocks where id = #{id}
|
||
|
|
</delete>
|
||
|
|
|
||
|
4 months ago
|
<delete id="deleteNewStocksByIds" parameterType="String">
|
||
|
4 months ago
|
delete from new_stocks where id in
|
||
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
|
#{id}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<select id="selectNewStocksByCodeAndDate" resultMap="NewStocksResult">
|
||
|
|
<include refid="selectNewStocksVo" />
|
||
|
|
where code = #{code} and trade_date = #{tradeDate}
|
||
|
|
</select>
|
||
|
|
</mapper>
|