feat: 智聪记账管理,新增股票日行情、期货日行情功能。
This commit is contained in:
@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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">
|
||||
@@ -48,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.del_flag,
|
||||
a.remark,
|
||||
a.listing_date,
|
||||
a.ts_code,
|
||||
ie."name" as exchange_name,
|
||||
ifsi."name" as standard_name,
|
||||
ifsi.trading_time
|
||||
@@ -95,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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>
|
||||
@@ -115,6 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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>
|
||||
|
||||
@@ -138,6 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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>
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
<?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.FuturesDailyHistoryMapper">
|
||||
|
||||
<resultMap type="FuturesDailyHistoryVo" id="FuturesDailyHistoryResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="tsCode" column="ts_code" />
|
||||
<result property="tradeDate" column="trade_date" />
|
||||
<result property="preClose" column="pre_close" />
|
||||
<result property="preSettle" column="pre_settle" />
|
||||
<result property="open" column="open" />
|
||||
<result property="high" column="high" />
|
||||
<result property="low" column="low" />
|
||||
<result property="close" column="close" />
|
||||
<result property="settle" column="settle" />
|
||||
<result property="change1" column="change1" />
|
||||
<result property="vol" column="vol" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="change2" column="change2" />
|
||||
<result property="oi" column="oi" />
|
||||
<result property="oiChg" column="oi_chg" />
|
||||
<result property="delvSettle" column="delv_settle" />
|
||||
<result property="remark" column="remark" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFuturesDailyHistoryVo">
|
||||
select a.id, a.ts_code, a.trade_date, a.pre_close, a.pre_settle, a.open, a.high, a.low, a.close, a.settle, a.change1, a.vol, a.amount, a.change2, a.oi, a.oi_chg, a.delv_settle, a.remark, a.create_by, a.create_time, a.update_by, a.update_time, a.del_flag from futures_daily_history a
|
||||
</sql>
|
||||
|
||||
<select id="selectFuturesDailyHistoryList" parameterType="FuturesDailyHistoryDto" resultMap="FuturesDailyHistoryResult">
|
||||
<include refid="selectFuturesDailyHistoryVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="tsCode != null and tsCode != ''"> and a.ts_code = #{tsCode}</if>
|
||||
<if test="tradeDate != null and tradeDate != ''"> and a.trade_date = #{tradeDate}</if>
|
||||
<if test="preClose != null and preClose != ''"> and a.pre_close = #{preClose}</if>
|
||||
<if test="preSettle != null and preSettle != ''"> and a.pre_settle = #{preSettle}</if>
|
||||
<if test="open != null and open != ''"> and a.open = #{open}</if>
|
||||
<if test="high != null and high != ''"> and a.high = #{high}</if>
|
||||
<if test="low != null and low != ''"> and a.low = #{low}</if>
|
||||
<if test="close != null and close != ''"> and a.close = #{close}</if>
|
||||
<if test="settle != null and settle != ''"> and a.settle = #{settle}</if>
|
||||
<if test="change1 != null and change1 != ''"> and a.change1 = #{change1}</if>
|
||||
<if test="vol != null and vol != ''"> and a.vol = #{vol}</if>
|
||||
<if test="amount != null and amount != ''"> and a.amount = #{amount}</if>
|
||||
<if test="change2 != null and change2 != ''"> and a.change2 = #{change2}</if>
|
||||
<if test="oi != null and oi != ''"> and a.oi = #{oi}</if>
|
||||
<if test="oiChg != null and oiChg != ''"> and a.oi_chg = #{oiChg}</if>
|
||||
<if test="delvSettle != null and delvSettle != ''"> and a.delv_settle = #{delvSettle}</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectFuturesDailyHistoryById" parameterType="String" resultMap="FuturesDailyHistoryResult">
|
||||
<include refid="selectFuturesDailyHistoryVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertFuturesDailyHistory" parameterType="FuturesDailyHistory">
|
||||
insert into futures_daily_history
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="tsCode != null">ts_code,</if>
|
||||
<if test="tradeDate != null">trade_date,</if>
|
||||
<if test="preClose != null">pre_close,</if>
|
||||
<if test="preSettle != null">pre_settle,</if>
|
||||
<if test="open != null">open,</if>
|
||||
<if test="high != null">high,</if>
|
||||
<if test="low != null">low,</if>
|
||||
<if test="close != null">close,</if>
|
||||
<if test="settle != null">settle,</if>
|
||||
<if test="change1 != null">change1,</if>
|
||||
<if test="vol != null">vol,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="change2 != null">change2,</if>
|
||||
<if test="oi != null">oi,</if>
|
||||
<if test="oiChg != null">oi_chg,</if>
|
||||
<if test="delvSettle != null">delv_settle,</if>
|
||||
<if test="remark != null">remark,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="tsCode != null">#{tsCode},</if>
|
||||
<if test="tradeDate != null">#{tradeDate},</if>
|
||||
<if test="preClose != null">#{preClose},</if>
|
||||
<if test="preSettle != null">#{preSettle},</if>
|
||||
<if test="open != null">#{open},</if>
|
||||
<if test="high != null">#{high},</if>
|
||||
<if test="low != null">#{low},</if>
|
||||
<if test="close != null">#{close},</if>
|
||||
<if test="settle != null">#{settle},</if>
|
||||
<if test="change1 != null">#{change1},</if>
|
||||
<if test="vol != null">#{vol},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="change2 != null">#{change2},</if>
|
||||
<if test="oi != null">#{oi},</if>
|
||||
<if test="oiChg != null">#{oiChg},</if>
|
||||
<if test="delvSettle != null">#{delvSettle},</if>
|
||||
<if test="remark != null">#{remark},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateFuturesDailyHistory" parameterType="FuturesDailyHistory">
|
||||
update futures_daily_history
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="tsCode != null">ts_code = #{tsCode},</if>
|
||||
<if test="tradeDate != null">trade_date = #{tradeDate},</if>
|
||||
<if test="preClose != null">pre_close = #{preClose},</if>
|
||||
<if test="preSettle != null">pre_settle = #{preSettle},</if>
|
||||
<if test="open != null">open = #{open},</if>
|
||||
<if test="high != null">high = #{high},</if>
|
||||
<if test="low != null">low = #{low},</if>
|
||||
<if test="close != null">close = #{close},</if>
|
||||
<if test="settle != null">settle = #{settle},</if>
|
||||
<if test="change1 != null">change1 = #{change1},</if>
|
||||
<if test="vol != null">vol = #{vol},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="change2 != null">change2 = #{change2},</if>
|
||||
<if test="oi != null">oi = #{oi},</if>
|
||||
<if test="oiChg != null">oi_chg = #{oiChg},</if>
|
||||
<if test="delvSettle != null">delv_settle = #{delvSettle},</if>
|
||||
<if test="remark != null">remark = #{remark},</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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteFuturesDailyHistoryById" parameterType="String">
|
||||
delete from futures_daily_history where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFuturesDailyHistoryByIds" parameterType="String">
|
||||
delete from futures_daily_history where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeFuturesDailyHistoryById" parameterType="String">
|
||||
update futures_daily_history set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeFuturesDailyHistoryByIds" parameterType="String">
|
||||
update futures_daily_history set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="region" column="region" />
|
||||
<result property="shortName" column="short_name" />
|
||||
<result property="exchangeName" column="exchange_name" />
|
||||
<result property="tsCode" column="ts_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectStockBaseInforVo">
|
||||
@@ -44,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.introduce,
|
||||
a.region,
|
||||
a.short_name,
|
||||
a.ts_code,
|
||||
ie."name" as exchange_name
|
||||
from
|
||||
invest_stock_base_infor a
|
||||
@@ -90,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="introduce != null">introduce,</if>
|
||||
<if test="region != null">region,</if>
|
||||
<if test="shortName != null and shortName != ''">short_name,</if>
|
||||
<if test="tsCode != null">ts_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
@@ -109,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="introduce != null">#{introduce},</if>
|
||||
<if test="region != null">#{region},</if>
|
||||
<if test="shortName != null and shortName != ''">#{shortName},</if>
|
||||
<if test="tsCode != null">#{tsCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -131,6 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="introduce != null">introduce = #{introduce},</if>
|
||||
<if test="region != null">region = #{region},</if>
|
||||
<if test="shortName != null and shortName != ''">short_name = #{shortName},</if>
|
||||
<if test="tsCode != null">ts_code = #{tsCode},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
<?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.StocksDailyHistoryMapper">
|
||||
|
||||
<resultMap type="StocksDailyHistoryVo" id="StocksDailyHistoryResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="tsCode" column="ts_code" />
|
||||
<result property="tradeDate" column="trade_date" />
|
||||
<result property="open" column="open" />
|
||||
<result property="high" column="high" />
|
||||
<result property="low" column="low" />
|
||||
<result property="close" column="close" />
|
||||
<result property="preClose" column="pre_close" />
|
||||
<result property="change" column="change" />
|
||||
<result property="pctChg" column="pct_chg" />
|
||||
<result property="vol" column="vol" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="remark" column="remark" />
|
||||
<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="stockId" column="stock_id" />
|
||||
<result property="stockName" column="stock_name" />
|
||||
<result property="exchangeName" column="exchange_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectStocksDailyHistoryVo">
|
||||
select
|
||||
a.id,
|
||||
a.ts_code,
|
||||
a.stock_id,
|
||||
a.trade_date,
|
||||
a.open,
|
||||
a.high,
|
||||
a.low,
|
||||
a.close,
|
||||
a.pre_close,
|
||||
a.change,
|
||||
a.pct_chg,
|
||||
a.vol,
|
||||
a.amount,
|
||||
a.remark,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
isbi.short_name as stock_name,
|
||||
ie.short_name as exchange_name
|
||||
from
|
||||
stocks_daily_history a
|
||||
left join invest_stock_base_infor isbi on
|
||||
isbi.id = a.stock_id
|
||||
left join invest_exchange ie on
|
||||
ie.id = isbi.exchange_id
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="selectStocksDailyHistoryList" parameterType="StocksDailyHistoryDto" resultMap="StocksDailyHistoryResult">
|
||||
<include refid="selectStocksDailyHistoryVo"/>
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="tsCode != null and tsCode != ''"> and (a.ts_code like '%'|| #{tsCode}||'%' or isbi.short_name like '%'|| #{tsCode}||'%')</if>
|
||||
<if test="endTime!=null and endTime !=''">
|
||||
and #{endTime}>=to_char(a.trade_date, 'yyyy-MM-dd')
|
||||
</if>
|
||||
<if test="startTime!=null and startTime !=''">
|
||||
and to_char(a.trade_date, 'yyyy-MM-dd')>=#{startTime}
|
||||
</if>
|
||||
</where>
|
||||
order by a.trade_date desc
|
||||
</select>
|
||||
|
||||
<select id="selectStocksDailyHistoryById" parameterType="Long" resultMap="StocksDailyHistoryResult">
|
||||
<include refid="selectStocksDailyHistoryVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertStocksDailyHistory" parameterType="StocksDailyHistory">
|
||||
insert into stocks_daily_history
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="tsCode != null">ts_code,</if>
|
||||
<if test="tradeDate != null">trade_date,</if>
|
||||
<if test="open != null">open,</if>
|
||||
<if test="high != null">high,</if>
|
||||
<if test="low != null">low,</if>
|
||||
<if test="close != null">close,</if>
|
||||
<if test="preClose != null">pre_close,</if>
|
||||
<if test="change != null">change,</if>
|
||||
<if test="pctChg != null">pct_chg,</if>
|
||||
<if test="vol != null">vol,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="remark != null">remark,</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="stockId != null">stock_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="tsCode != null">#{tsCode},</if>
|
||||
<if test="tradeDate != null">#{tradeDate},</if>
|
||||
<if test="open != null">#{open},</if>
|
||||
<if test="high != null">#{high},</if>
|
||||
<if test="low != null">#{low},</if>
|
||||
<if test="close != null">#{close},</if>
|
||||
<if test="preClose != null">#{preClose},</if>
|
||||
<if test="change != null">#{change},</if>
|
||||
<if test="pctChg != null">#{pctChg},</if>
|
||||
<if test="vol != null">#{vol},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="remark != null">#{remark},</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="stockId != null">#{stockId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateStocksDailyHistory" parameterType="StocksDailyHistory">
|
||||
update stocks_daily_history
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="tsCode != null">ts_code = #{tsCode},</if>
|
||||
<if test="tradeDate != null">trade_date = #{tradeDate},</if>
|
||||
<if test="open != null">open = #{open},</if>
|
||||
<if test="high != null">high = #{high},</if>
|
||||
<if test="low != null">low = #{low},</if>
|
||||
<if test="close != null">close = #{close},</if>
|
||||
<if test="preClose != null">pre_close = #{preClose},</if>
|
||||
<if test="change != null">change = #{change},</if>
|
||||
<if test="pctChg != null">pct_chg = #{pctChg},</if>
|
||||
<if test="vol != null">vol = #{vol},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="remark != null">remark = #{remark},</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="stockId != null">stock_id = #{stockId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteStocksDailyHistoryById" parameterType="Long">
|
||||
delete from stocks_daily_history where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteStocksDailyHistoryByIds" parameterType="String">
|
||||
delete from stocks_daily_history where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="removeStocksDailyHistoryById" parameterType="Long">
|
||||
update stocks_daily_history set del_flag='1' where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeStocksDailyHistoryByIds" parameterType="String">
|
||||
update stocks_daily_history set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<insert id="batchInsertStocksDailyHistory">
|
||||
insert into stocks_daily_history(id, stock_id, ts_code, trade_date, open, high, low, close, pre_close, change, pct_chg, vol, amount, remark, create_by, create_time, update_by, update_time) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.id},
|
||||
#{item.stockId},
|
||||
#{item.tsCode},
|
||||
#{item.tradeDate},
|
||||
#{item.open},
|
||||
#{item.high},
|
||||
#{item.low},
|
||||
#{item.close},
|
||||
#{item.preClose},
|
||||
#{item.change},
|
||||
#{item.pctChg},
|
||||
#{item.vol},
|
||||
#{item.amount},
|
||||
#{item.remark},
|
||||
#{item.createBy},
|
||||
#{item.createTime},
|
||||
#{item.updateBy},
|
||||
#{item.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user