模型搭建
基本模型
使用框架
springdata-jpa
数据库设计
- createTable:
tableName: CAMERA_RESOURCE
columns:
- column:
name: TYPE
type: varchar(10)
remarks: 节点类型
constraints:
nullable: false
- column:
name: ID
type: INTEGER
remarks: ID
constraints:
primaryKey: true
nullable: false
- column:
name: ORDER_NO
type: INTEGER
remarks: 序号
constraints:
nullable: false
- column:
name: NAME
type: ${
string.type}(50)
remarks: 名称
- column:
name: CAM_INDEX_CODE
type: ${
string.type}(64)
remarks: 监控点唯一标识
- column:
name: CAM_TYPE
type: INTEGER
remarks: 监控点类型
- column:
name: CAM_TYPE_NAME
type: ${
string.type}(32)
remarks: 监控点类型说明
- column:
name: CAM_CAPABILITY_SET
type: ${
string.type}(500)
remarks: 能力集
- column:
name: CAM_LAT
type: NUMBER(16,13)
remarks: 纬度
- column:
name: CAM_LNG
type: NUMBER(16,13)
remarks: 经度
- column:
name: CAM_RECORD_LOCATION
type: ${
string.type}(32)
remarks: 录像存储位置
- column:
name: CAM_ADDRESS
type: ${
string.type}(256)
remarks: 联系地址
- column:
name: PARENT_ID
type: INTEGER
remarks: 外键列名
- addForeignKeyConstraint:
baseColumnNames: PARENT_ID
baseTableName: CAMERA_RESOURCE
constraintName: FK_CAMERA_RESOURCE_PARENT
onDelete: CASCADE
onUpdate: RESTRICT
referencedColumnNames: ID
referencedTableName: CAMERA_RESOURCE
- createSequence:
cycle: false
incrementBy: 1
sequenceName: SEQ_CAMERA_ID
```mermaid
flowchat
st=>start: Start|past
e=>end: End
op1=>operation: My Operation|past
op2=>operatio