1
0

fix: 修复year字段在不同数据库的表现

This commit is contained in:
2025-09-24 21:57:07 +08:00
parent a9b2561be1
commit 8011a4f2cb
5 changed files with 18 additions and 7 deletions

View File

@@ -2,6 +2,7 @@ package com.lanyuanxiaoyao.leopard.core.entity;
import com.lanyuanxiaoyao.leopard.core.Constants;
import com.lanyuanxiaoyao.service.template.entity.SimpleEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.ManyToOne;
@@ -27,6 +28,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener;
public class FinanceIndicator extends SimpleEntity {
@ManyToOne
private Stock stock;
@Column(name = "`year`", nullable = false)
@Comment("年报年度")
private Integer year;
@Comment("总股本")

View File

@@ -30,7 +30,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener;
@EntityListeners(AuditingEntityListener.class)
@Table(name = Constants.DATABASE_PREFIX + "yearly")
public class Yearly extends SimpleEntity {
@Column(nullable = false)
@Column(name = "`year`", nullable = false)
@Comment("年份")
private Integer year;
@Comment("开盘价")

View File

@@ -25,8 +25,6 @@ public interface DailyRepository extends SimpleRepository<Daily> {
@Query("select min(daily.tradeDate) from Daily daily")
LocalDate findMinTradeDate();
List<Daily> findAllByTradeDate_YearAndStock_Code(int tradeDateYear, String stockCode);
@EntityGraph(attributePaths = {"stock"})
@Override
Optional<Daily> findOne(Predicate predicate);