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.
142 lines
7.0 KiB
142 lines
7.0 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">
|
||
|
|
<mapper namespace="com.ruoyi.newstocksystem.mapper.TStockBasicMapper">
|
||
|
|
<resultMap type="com.ruoyi.newstocksystem.domain.TStockBasic" id="StockBasicResult">
|
||
|
|
<id property="stockCode" column="stock_code" />
|
||
|
|
<result property="stockName" column="stock_name" />
|
||
|
|
<result property="listingDate" column="listing_date" />
|
||
|
|
<result property="listingDays" column="listing_days" />
|
||
|
|
<result property="isSt" column="is_st" />
|
||
|
|
<result property="isStarSt" column="is_star_st" />
|
||
|
|
<result property="industryIndexCode" column="industry_index_code" />
|
||
|
|
<result property="industryIndexName" column="industry_index_name" />
|
||
|
|
<result property="createTime" column="create_time" />
|
||
|
|
<result property="updateTime" column="update_time" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectStockBasicVo">
|
||
|
|
select stock_code, stock_name, listing_date, listing_days, is_st, is_star_st,
|
||
|
|
industry_index_code, industry_index_name, create_time, update_time
|
||
|
|
from t_stock_basic
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectStockBasicByCode" parameterType="String" resultMap="StockBasicResult">
|
||
|
|
<include refid="selectStockBasicVo" />
|
||
|
|
where stock_code = #{stockCode}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectStockBasicList" parameterType="com.ruoyi.newstocksystem.domain.TStockBasic" resultMap="StockBasicResult">
|
||
|
|
<include refid="selectStockBasicVo" />
|
||
|
|
<where>
|
||
|
|
<if test="stockCode != null and stockCode != ''">
|
||
|
|
and stock_code like concat('%', #{stockCode}, '%')
|
||
|
|
</if>
|
||
|
|
<if test="stockName != null and stockName != ''">
|
||
|
|
and stock_name like concat('%', #{stockName}, '%')
|
||
|
|
</if>
|
||
|
|
<if test="isSt != null">
|
||
|
|
and is_st = #{isSt}
|
||
|
|
</if>
|
||
|
|
<if test="isStarSt != null">
|
||
|
|
and is_star_st = #{isStarSt}
|
||
|
|
</if>
|
||
|
|
<if test="industryIndexCode != null and industryIndexCode != ''">
|
||
|
|
and industry_index_code = #{industryIndexCode}
|
||
|
|
</if>
|
||
|
|
<if test="industryIndexName != null and industryIndexName != ''">
|
||
|
|
and industry_index_name like concat('%', #{industryIndexName}, '%')
|
||
|
|
</if>
|
||
|
|
</where>
|
||
|
|
order by stock_code asc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectStockBasicByIndustryCode" parameterType="String" resultMap="StockBasicResult">
|
||
|
|
<include refid="selectStockBasicVo" />
|
||
|
|
where industry_index_code = #{industryIndexCode}
|
||
|
|
order by stock_code asc
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertStockBasic" parameterType="com.ruoyi.newstocksystem.domain.TStockBasic">
|
||
|
|
insert into t_stock_basic
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="stockCode != null and stockCode != ''">stock_code,</if>
|
||
|
|
<if test="stockName != null and stockName != ''">stock_name,</if>
|
||
|
|
<if test="listingDate != null">listing_date,</if>
|
||
|
|
<if test="listingDays != null">listing_days,</if>
|
||
|
|
<if test="isSt != null">is_st,</if>
|
||
|
|
<if test="isStarSt != null">is_star_st,</if>
|
||
|
|
<if test="industryIndexCode != null and industryIndexCode != ''">industry_index_code,</if>
|
||
|
|
<if test="industryIndexName != null and industryIndexName != ''">industry_index_name,</if>
|
||
|
|
create_time,
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="stockCode != null and stockCode != ''">#{stockCode},</if>
|
||
|
|
<if test="stockName != null and stockName != ''">#{stockName},</if>
|
||
|
|
<if test="listingDate != null">#{listingDate},</if>
|
||
|
|
<if test="listingDays != null">#{listingDays},</if>
|
||
|
|
<if test="isSt != null">#{isSt},</if>
|
||
|
|
<if test="isStarSt != null">#{isStarSt},</if>
|
||
|
|
<if test="industryIndexCode != null and industryIndexCode != ''">#{industryIndexCode},</if>
|
||
|
|
<if test="industryIndexName != null and industryIndexName != ''">#{industryIndexName},</if>
|
||
|
|
NOW(),
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateStockBasic" parameterType="com.ruoyi.newstocksystem.domain.TStockBasic">
|
||
|
|
update t_stock_basic
|
||
|
|
<trim prefix="set" suffixOverrides=",">
|
||
|
|
<if test="stockName != null and stockName != ''">stock_name = #{stockName},</if>
|
||
|
|
<if test="listingDate != null">listing_date = #{listingDate},</if>
|
||
|
|
<if test="listingDays != null">listing_days = #{listingDays},</if>
|
||
|
|
<if test="isSt != null">is_st = #{isSt},</if>
|
||
|
|
<if test="isStarSt != null">is_star_st = #{isStarSt},</if>
|
||
|
|
<if test="industryIndexCode != null and industryIndexCode != ''">industry_index_code = #{industryIndexCode},</if>
|
||
|
|
<if test="industryIndexName != null and industryIndexName != ''">industry_index_name = #{industryIndexName},</if>
|
||
|
|
update_time = NOW(),
|
||
|
|
</trim>
|
||
|
|
where stock_code = #{stockCode}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteStockBasicByCode" parameterType="String">
|
||
|
|
delete from t_stock_basic where stock_code = #{stockCode}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteStockBasicByCodes" parameterType="String">
|
||
|
|
delete from t_stock_basic where stock_code in
|
||
|
|
<foreach item="stockCode" collection="array" open="(" separator="," close=")">
|
||
|
|
#{stockCode}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<insert id="batchInsertStockBasic" parameterType="java.util.List">
|
||
|
|
insert into t_stock_basic(stock_code, stock_name, listing_date, listing_days,
|
||
|
|
is_st, is_star_st, industry_index_code, industry_index_name, create_time)
|
||
|
|
values
|
||
|
|
<foreach collection="list" item="item" separator=",">
|
||
|
|
(#{item.stockCode}, #{item.stockName}, #{item.listingDate}, #{item.listingDays},
|
||
|
|
#{item.isSt}, #{item.isStarSt}, #{item.industryIndexCode}, #{item.industryIndexName}, NOW())
|
||
|
|
</foreach>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<insert id="batchUpsertStockBasic" parameterType="java.util.List">
|
||
|
|
insert into t_stock_basic(stock_code, stock_name, listing_date, listing_days,
|
||
|
|
is_st, is_star_st, industry_index_code, industry_index_name, create_time)
|
||
|
|
values
|
||
|
|
<foreach collection="list" item="item" separator=",">
|
||
|
|
(#{item.stockCode}, #{item.stockName}, #{item.listingDate}, #{item.listingDays},
|
||
|
|
#{item.isSt}, #{item.isStarSt}, #{item.industryIndexCode}, #{item.industryIndexName}, NOW())
|
||
|
|
</foreach>
|
||
|
|
ON DUPLICATE KEY UPDATE
|
||
|
|
stock_name = VALUES(stock_name),
|
||
|
|
listing_date = VALUES(listing_date),
|
||
|
|
listing_days = VALUES(listing_days),
|
||
|
|
is_st = VALUES(is_st),
|
||
|
|
is_star_st = VALUES(is_star_st),
|
||
|
|
industry_index_code = VALUES(industry_index_code),
|
||
|
|
industry_index_name = VALUES(industry_index_name),
|
||
|
|
update_time = NOW()
|
||
|
|
</insert>
|
||
|
|
</mapper>
|