feat: 智聪记账管理,新增股票日行情、期货日行情功能。

This commit is contained in:
tianyongbao
2025-04-02 15:49:14 +08:00
parent 17884422f5
commit 3625edca22
31 changed files with 1931 additions and 0 deletions

View File

@@ -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>