fix: 修复year字段在不同数据库的表现
This commit is contained in:
@@ -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("总股本")
|
||||
|
||||
@@ -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("开盘价")
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user