fix: 新行情数据调整到新的模块中,与老接口隔离开

dev_refactor_0118
Lxy 4 months ago
parent f2e36a3ecb
commit aef00b9b6e

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>newstock-system</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
</dependencies>
</project>

@ -1,12 +1,12 @@
package com.ruoyi.stocksystem.controller;
package com.ruoyi.newstocksystem.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.stocksystem.domain.NewStockBasic;
import com.ruoyi.stocksystem.domain.NewStocks;
import com.ruoyi.stocksystem.domain.service.INewStockBasicService;
import com.ruoyi.newstocksystem.domain.NewStockBasic;
import com.ruoyi.newstocksystem.domain.NewStocks;
import com.ruoyi.newstocksystem.service.INewStockBasicService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -21,7 +21,7 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.stocksystem.domain.service.INewStocksService;
import com.ruoyi.newstocksystem.service.INewStocksService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
@ -33,7 +33,7 @@ import org.springframework.web.multipart.MultipartFile;
* @date 2026-01-18
*/
@RestController
@RequestMapping("/stocksystem/newstocks")
@RequestMapping("/newstocksystem/newstocks")
public class NewStocksController extends BaseController
{
@Autowired
@ -191,4 +191,4 @@ public class NewStocksController extends BaseController
List<NewStockBasic> list = newStockBasicService.selectNewStockBasicList(newStockBasic);
return AjaxResult.success(list);
}
}
}

@ -1,4 +1,4 @@
package com.ruoyi.stocksystem.domain;
package com.ruoyi.newstocksystem.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;

@ -1,4 +1,4 @@
package com.ruoyi.stocksystem.domain;
package com.ruoyi.newstocksystem.domain;
import com.ruoyi.common.core.domain.BaseEntity;

@ -1,4 +1,4 @@
package com.ruoyi.stocksystem.domain;
package com.ruoyi.newstocksystem.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
@ -90,8 +90,8 @@ public class NewStocks extends BaseEntity
private String industryName;
@Excel(name = "行业级别", sort = 19, type = Excel.Type.ALL)
private Integer industryLevel;
@Excel(name = "所属东财行业指数代码\\n\" +\n" +
" \"[行业类别]2级\"", sort = 20, type = Excel.Type.ALL)
@Excel(name = "所属东财行业指数代码\n" +
"[行业类别]2级", sort = 20, type = Excel.Type.ALL)
private String industryCode;
@Excel(name = "父行业代码", sort = 21, type = Excel.Type.ALL)
private String parentCode;

@ -1,6 +1,6 @@
package com.ruoyi.stocksystem.mapper;
package com.ruoyi.newstocksystem.mapper;
import com.ruoyi.stocksystem.domain.NewStockBasic;
import com.ruoyi.newstocksystem.domain.NewStockBasic;
import java.util.List;

@ -1,6 +1,6 @@
package com.ruoyi.stocksystem.mapper;
package com.ruoyi.newstocksystem.mapper;
import com.ruoyi.stocksystem.domain.NewStockIndustry;
import com.ruoyi.newstocksystem.domain.NewStockIndustry;
import java.util.List;

@ -1,6 +1,6 @@
package com.ruoyi.stocksystem.mapper;
package com.ruoyi.newstocksystem.mapper;
import com.ruoyi.stocksystem.domain.NewStocks;
import com.ruoyi.newstocksystem.domain.NewStocks;
import java.util.List;

@ -1,8 +1,8 @@
package com.ruoyi.stocksystem.domain.service;
package com.ruoyi.newstocksystem.service;
import java.util.List;
import com.ruoyi.stocksystem.domain.NewStockBasic;
import com.ruoyi.newstocksystem.domain.NewStockBasic;
/**
* Service

@ -1,8 +1,8 @@
package com.ruoyi.stocksystem.domain.service;
package com.ruoyi.newstocksystem.service;
import java.util.List;
import com.ruoyi.stocksystem.domain.NewStockIndustry;
import com.ruoyi.newstocksystem.domain.NewStockIndustry;
/**
* Service

@ -1,8 +1,8 @@
package com.ruoyi.stocksystem.domain.service;
package com.ruoyi.newstocksystem.service;
import java.util.List;
import com.ruoyi.stocksystem.domain.NewStocks;
import com.ruoyi.newstocksystem.domain.NewStocks;
/**
* Service

@ -1,4 +1,4 @@
package com.ruoyi.stocksystem.domain.service.impl;
package com.ruoyi.newstocksystem.service.impl;
import java.util.ArrayList;
import java.util.List;
@ -7,9 +7,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.stocksystem.domain.NewStockBasic;
import com.ruoyi.stocksystem.domain.service.INewStockBasicService;
import com.ruoyi.stocksystem.mapper.NewStockBasicMapper;
import com.ruoyi.newstocksystem.domain.NewStockBasic;
import com.ruoyi.newstocksystem.service.INewStockBasicService;
import com.ruoyi.newstocksystem.mapper.NewStockBasicMapper;
/**
* Service

@ -1,4 +1,4 @@
package com.ruoyi.stocksystem.domain.service.impl;
package com.ruoyi.newstocksystem.service.impl;
import java.util.ArrayList;
import java.util.List;
@ -7,9 +7,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.stocksystem.domain.NewStockIndustry;
import com.ruoyi.stocksystem.domain.service.INewStockIndustryService;
import com.ruoyi.stocksystem.mapper.NewStockIndustryMapper;
import com.ruoyi.newstocksystem.domain.NewStockIndustry;
import com.ruoyi.newstocksystem.service.INewStockIndustryService;
import com.ruoyi.newstocksystem.mapper.NewStockIndustryMapper;
/**
* Service

@ -1,4 +1,4 @@
package com.ruoyi.stocksystem.domain.service.impl;
package com.ruoyi.newstocksystem.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
@ -12,13 +12,13 @@ import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.stocksystem.domain.NewStockBasic;
import com.ruoyi.stocksystem.domain.NewStockIndustry;
import com.ruoyi.stocksystem.domain.NewStocks;
import com.ruoyi.stocksystem.domain.service.INewStockBasicService;
import com.ruoyi.stocksystem.domain.service.INewStockIndustryService;
import com.ruoyi.stocksystem.domain.service.INewStocksService;
import com.ruoyi.stocksystem.mapper.NewStocksMapper;
import com.ruoyi.newstocksystem.domain.NewStockBasic;
import com.ruoyi.newstocksystem.domain.NewStockIndustry;
import com.ruoyi.newstocksystem.domain.NewStocks;
import com.ruoyi.newstocksystem.service.INewStockBasicService;
import com.ruoyi.newstocksystem.service.INewStockIndustryService;
import com.ruoyi.newstocksystem.service.INewStocksService;
import com.ruoyi.newstocksystem.mapper.NewStocksMapper;
/**
* Service

@ -0,0 +1,132 @@
<?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.NewStockBasicMapper">
<resultMap type="com.ruoyi.newstocksystem.domain.NewStockBasic" id="NewStockBasicResult">
<id property="id" column="id" />
<result property="code" column="code" />
<result property="name" column="name" />
<result property="industryId" column="industry_id" />
<result property="industryName" column="industry_name" />
<result property="market" column="market" />
<result property="listDate" column="list_date" />
<result property="status" column="status" />
<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="remark" column="remark" />
</resultMap>
<sql id="selectNewStockBasicVo">
select id, code, name, industry_id, industry_name, market, list_date, status, create_by, create_time, update_by, update_time, remark from new_stock_basic
</sql>
<select id="selectNewStockBasicById" parameterType="Integer" resultMap="NewStockBasicResult">
<include refid="selectNewStockBasicVo" />
where id = #{id}
</select>
<select id="selectNewStockBasicByCode" parameterType="String" resultMap="NewStockBasicResult">
<include refid="selectNewStockBasicVo" />
where code = #{code}
</select>
<select id="selectNewStockBasicList" parameterType="com.ruoyi.newstocksystem.domain.NewStockBasic" resultMap="NewStockBasicResult">
<include refid="selectNewStockBasicVo" />
<where>
<if test="code != null and code != ''">
and code = #{code}
</if>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="industryId != null">
and industry_id = #{industryId}
</if>
<if test="industryName != null and industryName != ''">
and industry_name like concat('%', #{industryName}, '%')
</if>
<if test="market != null and market != ''">
and market = #{market}
</if>
<if test="listDate != null and listDate != ''">
and list_date = #{listDate}
</if>
<if test="status != null">
and status = #{status}
</if>
</where>
</select>
<insert id="insertNewStockBasic" parameterType="com.ruoyi.newstocksystem.domain.NewStockBasic" useGeneratedKeys="true" keyProperty="id">
insert into new_stock_basic
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null and code != ''">code,</if>
<if test="name != null and name != ''">name,</if>
<if test="industryId != null">industry_id,</if>
<if test="industryName != null and industryName != ''">industry_name,</if>
<if test="market != null and market != ''">market,</if>
<if test="listDate != null and listDate != ''">list_date,</if>
<if test="status != null">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null and remark != ''">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null and code != ''">#{code},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="industryId != null">#{industryId},</if>
<if test="industryName != null and industryName != ''">#{industryName},</if>
<if test="market != null and market != ''">#{market},</if>
<if test="listDate != null and listDate != ''">#{listDate},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null and remark != ''">#{remark},</if>
</trim>
</insert>
<update id="updateNewStockBasic" parameterType="com.ruoyi.newstocksystem.domain.NewStockBasic">
update new_stock_basic
<trim prefix="set" suffixOverrides=",">
<if test="code != null and code != ''">code = #{code},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="industryId != null">industry_id = #{industryId},</if>
<if test="industryName != null and industryName != ''">industry_name = #{industryName},</if>
<if test="market != null and market != ''">market = #{market},</if>
<if test="listDate != null and listDate != ''">list_date = #{listDate},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteNewStockBasicById" parameterType="Integer">
delete from new_stock_basic where id = #{id}
</delete>
<delete id="deleteNewStockBasicByIds" parameterType="String">
delete from new_stock_basic where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="batchInsertNewStockBasic" parameterType="java.util.List">
insert into new_stock_basic(code, name, industry_id, industry_name, market, list_date, status, create_by, create_time, update_by, update_time, remark)
values
<foreach collection="list" item="item" separator=",">
(#{item.code}, #{item.name}, #{item.industryId}, #{item.industryName}, #{item.market}, #{item.listDate}, #{item.status}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
</foreach>
</insert>
</mapper>

@ -0,0 +1,111 @@
<?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.NewStockIndustryMapper">
<resultMap type="com.ruoyi.newstocksystem.domain.NewStockIndustry" id="NewStockIndustryResult">
<id property="industryId" column="industry_id" />
<result property="industryCode" column="industry_code" />
<result property="industryName" column="industry_name" />
<result property="level" column="level" />
<result property="parentId" column="parent_id" />
<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="remark" column="remark" />
</resultMap>
<sql id="selectNewStockIndustryVo">
select industry_id, industry_code, industry_name, level, parent_id, create_by, create_time, update_by, update_time, remark from new_stock_industry
</sql>
<select id="selectNewStockIndustryById" parameterType="Integer" resultMap="NewStockIndustryResult">
<include refid="selectNewStockIndustryVo" />
where industry_id = #{industryId}
</select>
<select id="selectNewStockIndustryByCode" parameterType="String" resultMap="NewStockIndustryResult">
<include refid="selectNewStockIndustryVo" />
where industry_code = #{industryCode}
</select>
<select id="selectNewStockIndustryList" parameterType="com.ruoyi.newstocksystem.domain.NewStockIndustry" resultMap="NewStockIndustryResult">
<include refid="selectNewStockIndustryVo" />
<where>
<if test="industryCode != null and industryCode != ''">
and industry_code = #{industryCode}
</if>
<if test="industryName != null and industryName != ''">
and industry_name like concat('%', #{industryName}, '%')
</if>
<if test="level != null">
and level = #{level}
</if>
<if test="parentId != null">
and parent_id = #{parentId}
</if>
</where>
</select>
<insert id="insertNewStockIndustry" parameterType="com.ruoyi.newstocksystem.domain.NewStockIndustry" useGeneratedKeys="true" keyProperty="industryId">
insert into new_stock_industry
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="industryCode != null and industryCode != ''">industry_code,</if>
<if test="industryName != null and industryName != ''">industry_name,</if>
<if test="level != null">level,</if>
<if test="parentId != null">parent_id,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null and remark != ''">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="industryCode != null and industryCode != ''">#{industryCode},</if>
<if test="industryName != null and industryName != ''">#{industryName},</if>
<if test="level != null">#{level},</if>
<if test="parentId != null">#{parentId},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null and remark != ''">#{remark},</if>
</trim>
</insert>
<update id="updateNewStockIndustry" parameterType="com.ruoyi.newstocksystem.domain.NewStockIndustry">
update new_stock_industry
<trim prefix="set" suffixOverrides=",">
<if test="industryCode != null and industryCode != ''">industry_code = #{industryCode},</if>
<if test="industryName != null and industryName != ''">industry_name = #{industryName},</if>
<if test="level != null">level = #{level},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
</trim>
where industry_id = #{industryId}
</update>
<delete id="deleteNewStockIndustryById" parameterType="Integer">
delete from new_stock_industry where industry_id = #{industryId}
</delete>
<delete id="deleteNewStockIndustryByIds" parameterType="String">
delete from new_stock_industry where industry_id in
<foreach item="industryId" collection="array" open="(" separator="," close=")">
#{industryId}
</foreach>
</delete>
<insert id="batchInsertNewStockIndustry" parameterType="java.util.List">
insert into new_stock_industry(industry_code, industry_name, level, parent_id, create_by, create_time, update_by, update_time, remark)
values
<foreach collection="list" item="item" separator=",">
(#{item.industryCode}, #{item.industryName}, #{item.level}, #{item.parentId}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
</foreach>
</insert>
</mapper>

@ -2,9 +2,8 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.stocksystem.mapper.NewStocksMapper">
<resultMap type="com.ruoyi.stocksystem.domain.NewStocks" id="NewStocksResult">
<mapper namespace="com.ruoyi.newstocksystem.mapper.NewStocksMapper">
<resultMap type="com.ruoyi.newstocksystem.domain.NewStocks" id="NewStocksResult">
<id property="id" column="id" />
<result property="code" column="code" />
<result property="tradeDate" column="trade_date" />
@ -27,8 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectNewStocksVo">
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
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
</sql>
<select id="selectNewStocksById" parameterType="Integer" resultMap="NewStocksResult">
@ -36,20 +34,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<select id="selectNewStocksList" parameterType="com.ruoyi.stocksystem.domain.NewStocks" resultMap="NewStocksResult">
<select id="selectNewStocksList" parameterType="com.ruoyi.newstocksystem.domain.NewStocks" resultMap="NewStocksResult">
<include refid="selectNewStocksVo" />
<where>
<if test="code != null and code != ''">
and code = #{code}
</if>
<if test="tradeDate != null">
<if test="tradeDate != null and tradeDate != ''">
and trade_date = #{tradeDate}
</if>
<if test="changeRate != null">
and change_rate = #{changeRate}
</if>
</where>
order by trade_date desc, code
</select>
<select id="selectNewStocksListB" parameterType="com.ruoyi.stocksystem.domain.NewStocks" resultMap="NewStocksResult">
<select id="selectNewStocksListB" 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
@ -58,41 +59,92 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="code != null and code != ''">
and s.code = #{code}
</if>
<if test="name != null and name != ''">
and b.name like concat('%', #{name}, '%')
</if>
<if test="tradeDate != null">
<if test="tradeDate != null and tradeDate != ''">
and s.trade_date = #{tradeDate}
</if>
<if test="changeRate != null">
and s.change_rate = #{changeRate}
</if>
<if test="industryId != null">
and b.industry_id = #{industryId}
<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}, '%')
</if>
</where>
order by s.trade_date desc, s.code
</select>
<select id="selectNewStrongStocksList" parameterType="com.ruoyi.stocksystem.domain.NewStocks" resultMap="NewStocksResult">
<include refid="selectNewStocksVo" />
where change_rate > 0
order by change_rate desc, volume desc
limit 10
<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
</select>
<select id="selectNewLimitStocksList" parameterType="com.ruoyi.stocksystem.domain.NewStocks" resultMap="NewStocksResult">
<include refid="selectNewStocksVo" />
where change_rate >= 9.9
order by change_rate desc, volume desc
<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 &gt;= 9.8
</where>
order by s.change_rate desc
</select>
<insert id="insertNewStocks" parameterType="com.ruoyi.stocksystem.domain.NewStocks">
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 (
#{code}, #{tradeDate}, #{open}, #{close}, #{changeRate}, #{tradeDays}, #{volume}, #{amount}, #{changeRate10}, #{changeRate20}, #{changeRate60}, #{avgVolume20}, #{freeFloatMarketValue}, #{totalMarketValue}, #{agenciesHold}
)
<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>
</insert>
<insert id="batchInsertNewStocks" parameterType="java.util.List">
@ -106,11 +158,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</insert>
<update id="updateNewStocks" parameterType="com.ruoyi.stocksystem.domain.NewStocks">
<update id="updateNewStocks" parameterType="com.ruoyi.newstocksystem.domain.NewStocks">
update new_stocks
<set>
<trim prefix="set" suffixOverrides=",">
<if test="code != null and code != ''">code = #{code},</if>
<if test="tradeDate != null">trade_date = #{tradeDate},</if>
<if test="tradeDate != null and tradeDate != ''">trade_date = #{tradeDate},</if>
<if test="open != null">open = #{open},</if>
<if test="close != null">close = #{close},</if>
<if test="changeRate != null">change_rate = #{changeRate},</if>
@ -124,7 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
</set>
</trim>
where id = #{id}
</update>
@ -132,7 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from new_stocks where id = #{id}
</delete>
<delete id="deleteNewStocksByIds" parameterType="Integer[]">
<delete id="deleteNewStocksByIds" parameterType="String">
delete from new_stocks where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
@ -143,5 +195,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectNewStocksVo" />
where code = #{code} and trade_date = #{tradeDate}
</select>
</mapper>

@ -218,6 +218,12 @@
<version>${ruoyi.version}</version>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>newstock-system</artifactId>
<version>${ruoyi.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
@ -229,6 +235,7 @@
<module>ruoyi-generator</module>
<module>ruoyi-common</module>
<module>stock-system</module>
<module>newstock-system</module>
<module>book-system</module>
</modules>
<packaging>pom</packaging>

@ -67,6 +67,11 @@
<artifactId>stock-system</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>newstock-system</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>book-system</artifactId>

@ -37,7 +37,11 @@ server:
logging:
level:
com.ruoyi: debug
org.springframework: warn
# org.springframework: warn
# 打印RequestMapping映射详情
org.springframework.web.servlet.mvc.method.annotation: TRACE
# 简化版也可只开启web模块的DEBUG
org.springframework.web: DEBUG
# Spring配置
spring:

@ -5,7 +5,7 @@ export default {
// 查询行情数据列表
listNewStocks(query) {
return request({
url: '/stocksystem/newstocks/list',
url: '/newstocksystem/newstocks/list',
method: 'get',
params: query
})
@ -14,7 +14,7 @@ export default {
// 查询行情数据列表含基础数据
listNewStocksB(query) {
return request({
url: '/stocksystem/newstocks/listB',
url: '/newstocksystem/newstocks/listB',
method: 'get',
params: query
})
@ -23,7 +23,7 @@ export default {
// 查询强势股列表
listNewStrongStocks(query) {
return request({
url: '/stocksystem/newstocks/listStrongStocks',
url: '/newstocksystem/newstocks/listStrongStocks',
method: 'get',
params: query
})
@ -32,7 +32,7 @@ export default {
// 查询涨停股列表
listNewLimitStocks(query) {
return request({
url: '/stocksystem/newstocks/listLimitStocks',
url: '/newstocksystem/newstocks/listLimitStocks',
method: 'get',
params: query
})
@ -41,7 +41,7 @@ export default {
// 获取行情数据详细信息
getNewStocks(id) {
return request({
url: `/stocksystem/newstocks/${id}`,
url: `/newstocksystem/newstocks/${id}`,
method: 'get'
})
},
@ -49,7 +49,7 @@ export default {
// 新增行情数据
addNewStocks(data) {
return request({
url: '/stocksystem/newstocks',
url: '/newstocksystem/newstocks',
method: 'post',
data: data
})
@ -58,7 +58,7 @@ export default {
// 修改行情数据
updateNewStocks(data) {
return request({
url: '/stocksystem/newstocks',
url: '/newstocksystem/newstocks',
method: 'put',
data: data
})
@ -67,7 +67,7 @@ export default {
// 删除行情数据
deleteNewStocks(ids) {
return request({
url: `/stocksystem/newstocks/${ids}`,
url: `/newstocksystem/newstocks/${ids}`,
method: 'delete'
})
},
@ -75,7 +75,7 @@ export default {
// 导出行情数据
exportNewStocks(query) {
return request({
url: '/stocksystem/newstocks/export',
url: '/newstocksystem/newstocks/export',
method: 'post',
params: query,
responseType: 'blob'
@ -85,7 +85,7 @@ export default {
// 导入行情数据
importNewStocks(data) {
return request({
url: '/stocksystem/newstocks/importData',
url: '/newstocksystem/newstocks/importData',
method: 'post',
data: data
})
@ -94,7 +94,7 @@ export default {
// 分析行情数据
analyzeNewStocks(data) {
return request({
url: '/stocksystem/newstocks/analyze',
url: '/newstocksystem/newstocks/analyze',
method: 'post',
data: data
})
@ -103,7 +103,7 @@ export default {
// 获取联想的数据(股票代码)
stockQueryData(query) {
return request({
url: '/stocksystem/newstocks/stockQueryData',
url: '/newstocksystem/newstocks/stockQueryData',
method: 'get',
params: { query }
})
@ -112,7 +112,7 @@ export default {
// 获取联想的数据(股票名称)
stockNameQueryData(query) {
return request({
url: '/stocksystem/newstocks/stockNameQueryData',
url: '/newstocksystem/newstocks/stockNameQueryData',
method: 'get',
params: { query }
})

@ -52,7 +52,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['stocksystem:newstocks:add']"
v-hasPermi="['newstocksystem:newstocks:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
@ -63,7 +63,7 @@
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['stocksystem:newstocks:edit']"
v-hasPermi="['newstocksystem:newstocks:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
@ -74,7 +74,7 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['stocksystem:newstocks:remove']"
v-hasPermi="['newstocksystem:newstocks:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
@ -84,7 +84,7 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['stocksystem:newstocks:export']"
v-hasPermi="['newstocksystem:newstocks:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@ -116,14 +116,14 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['stocksystem:newstocks:edit']"
v-hasPermi="['newstocksystem:newstocks:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['stocksystem:newstocks:remove']"
v-hasPermi="['newstocksystem:newstocks:remove']"
>删除</el-button>
</template>
</el-table-column>
@ -254,7 +254,7 @@
import { getToken } from '@/utils/auth'
import { parseTime } from '@/utils/ruoyi'
import request from '@/utils/request'
import newstocksApi from '@/api/stocksystem/newstocks'
import newstocksApi from '@/api/newstocksystem/newstocks'
export default {
name: 'NewStocks',
@ -319,7 +319,7 @@ export default {
//
tradeDate: new Date().toISOString().split('T')[0],
//
url: '/stocksystem/newstocks/importData'
url: '/newstocksystem/newstocks/importData'
},
//
fileList: []
@ -529,4 +529,4 @@ export default {
.fixed-width {
width: 150px;
}
</style>
</style>

@ -1,97 +0,0 @@
<?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.stocksystem.mapper.NewStockBasicMapper">
<resultMap type="com.ruoyi.stocksystem.domain.NewStockBasic" id="NewStockBasicResult">
<id property="id" column="id" />
<result property="code" column="code" />
<result property="name" column="name" />
<result property="industryId" column="industry_id" />
<result property="listDate" column="list_date" />
<result property="marketType" column="market_type" />
<result property="status" column="status" />
</resultMap>
<sql id="selectNewStockBasicVo">
select id, code, name, industry_id, list_date, market_type, status
from new_stock_basic
</sql>
<select id="selectNewStockBasicById" parameterType="Integer" resultMap="NewStockBasicResult">
<include refid="selectNewStockBasicVo" />
where id = #{id}
</select>
<select id="selectNewStockBasicByCode" parameterType="String" resultMap="NewStockBasicResult">
<include refid="selectNewStockBasicVo" />
where code = #{code}
</select>
<select id="selectNewStockBasicList" parameterType="com.ruoyi.stocksystem.domain.NewStockBasic" resultMap="NewStockBasicResult">
<include refid="selectNewStockBasicVo" />
<where>
<if test="code != null and code != ''">
and code = #{code}
</if>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="industryId != null">
and industry_id = #{industryId}
</if>
<if test="status != null">
and status = #{status}
</if>
</where>
order by code
</select>
<insert id="insertNewStockBasic" parameterType="com.ruoyi.stocksystem.domain.NewStockBasic">
insert into new_stock_basic(
code, name, industry_id, list_date, market_type, status
) values (
#{code}, #{name}, #{industryId}, #{listDate}, #{marketType}, #{status}
)
</insert>
<insert id="batchInsertNewStockBasic" parameterType="java.util.List">
insert into new_stock_basic(
code, name, industry_id, list_date, market_type, status
) values
<foreach collection="list" item="item" separator=",">
(
#{item.code}, #{item.name}, #{item.industryId}, #{item.listDate}, #{item.marketType}, #{item.status}
)
</foreach>
</insert>
<update id="updateNewStockBasic" parameterType="com.ruoyi.stocksystem.domain.NewStockBasic">
update new_stock_basic
<set>
<if test="name != null and name != ''">name = #{name},</if>
<if test="industryId != null">industry_id = #{industryId},</if>
<if test="listDate != null">list_date = #{listDate},</if>
<if test="marketType != null and marketType != ''">market_type = #{marketType},</if>
<if test="status != null">status = #{status},</if>
</set>
where code = #{code}
</update>
<delete id="deleteNewStockBasicById" parameterType="Integer">
delete from new_stock_basic where id = #{id}
</delete>
<delete id="deleteNewStockBasicByCode" parameterType="String">
delete from new_stock_basic where code = #{code}
</delete>
<delete id="deleteNewStockBasicByIds" parameterType="Integer[]">
delete from new_stock_basic where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -1,79 +0,0 @@
<?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.stocksystem.mapper.NewStockIndustryMapper">
<resultMap type="com.ruoyi.stocksystem.domain.NewStockIndustry" id="NewStockIndustryResult">
<id property="industryId" column="industry_id" />
<result property="industryLevel" column="industry_level" />
<result property="industryCode" column="industry_code" />
<result property="industryName" column="industry_name" />
<result property="parentCode" column="parent_code" />
</resultMap>
<sql id="selectNewStockIndustryVo">
select industry_id, industry_level, industry_code, industry_name, parent_code
from new_stock_industry
</sql>
<select id="selectNewStockIndustryById" parameterType="Integer" resultMap="NewStockIndustryResult">
<include refid="selectNewStockIndustryVo" />
where industry_id = #{industryId}
</select>
<select id="selectNewStockIndustryList" parameterType="com.ruoyi.stocksystem.domain.NewStockIndustry" resultMap="NewStockIndustryResult">
<include refid="selectNewStockIndustryVo" />
<where>
<if test="industryName != null and industryName != ''">
and industry_name like concat('%', #{industryName}, '%')
</if>
<if test="industryCode != null and industryCode != ''">
and industry_code = #{industryCode}
</if>
</where>
order by industry_code
</select>
<insert id="insertNewStockIndustry" parameterType="com.ruoyi.stocksystem.domain.NewStockIndustry">
insert into new_stock_industry(
industry_id, industry_level, industry_code, industry_name, parent_code
) values (
#{industryId}, #{industryLevel}, #{industryCode}, #{industryName}, #{parentCode}
)
</insert>
<insert id="batchInsertNewStockIndustry" parameterType="java.util.List">
insert into new_stock_industry(
industry_id, industry_level, industry_code, industry_name, parent_code
) values
<foreach collection="list" item="item" separator=",">
(
#{item.industryId}, #{item.industryLevel}, #{item.industryCode}, #{item.industryName}, #{item.parentCode}
)
</foreach>
</insert>
<update id="updateNewStockIndustry" parameterType="com.ruoyi.stocksystem.domain.NewStockIndustry">
update new_stock_industry
<set>
<if test="industryLevel != null">industry_level = #{industryLevel},</if>
<if test="industryCode != null and industryCode != ''">industry_code = #{industryCode},</if>
<if test="industryName != null and industryName != ''">industry_name = #{industryName},</if>
<if test="parentCode != null and parentCode != ''">parent_code = #{parentCode},</if>
</set>
where industry_id = #{industryId}
</update>
<delete id="deleteNewStockIndustryById" parameterType="Integer">
delete from new_stock_industry where industry_id = #{industryId}
</delete>
<delete id="deleteNewStockIndustryByIds" parameterType="Integer[]">
delete from new_stock_industry where industry_id in
<foreach item="industryId" collection="array" open="(" separator="," close=")">
#{industryId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save