Browse Source

新增sql

kobe6258 1 month ago
parent
commit
bda3cf99e0

+ 1 - 1
qhtx-eta-integrator/qhtx-integrator-infra/src/main/resources/mapper/ETAClassifyIndexFrameMappingDao.xml

@@ -7,7 +7,7 @@
         <result property="indexFrameId" column="INDEX_FRAME_ID" jdbcType="VARCHAR"/>
         <result property="uniqueCode" column="UNIQUE_CODE" jdbcType="VARCHAR"/>
         <result property="classifyName" column="CLASSIFY_NAME" jdbcType="DATE"/>
-        <result property="sort" column="SORT" jdbcType="DATE"/>
+        <result property="sort" column="SORT" jdbcType="INTEGER"/>
         <result property="frameLevel" column="FRAME_LEVEL" jdbcType="DATE"/>
         <result property="parentId" column="PARENT_ID" jdbcType="INTEGER"/>
     </resultMap>

+ 13 - 1
qhtx-eta-integrator/sql/init.sql

@@ -77,8 +77,20 @@ CREATE INDEX IDX_UNIQUE_CODE_DATA_TIME ON ETA_API_QUOTA_DATA ("UNIQUE_CODE", "DA
 CREATE INDEX ETA_API_DATA_UNIQUE_CODE_INDEX ON ETA_API_QUOTA_DATA ("UNIQUE_CODE")
 
 
+/*
+ * 辅助表,用于建立指标与指标分类之间的映射关系
+ */
+CREATE SEQUENCE SEQ_ETA_CLASSIFY_INDEX_MAPPING
+    START WITH 1
+    INCREMENT BY 1
+    NOMAXVALUE;
 
-
+CREATE OR REPLACE TRIGGER trg_SEQ_ETA_CLASSIFY_insert
+                               BEFORE INSERT ON t_eta_CLASSIFY_INDEX_MAPPING
+                                          FOR EACH ROW
+BEGIN
+SELECT SEQ_ETA_CLASSIFY_INDEX_MAPPING.NEXTVAL INTO :new.id FROM dual;
+END;