orm_tables.go 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. package models
  2. import (
  3. "github.com/astaxie/beego/orm"
  4. )
  5. type Alarm_event struct {
  6. Id int `orm:"pk;auto"` // int// NOT NULL AUTO_INCREMENT COMMENT '告警事件表',
  7. Eventid int64 // int64//(20) NOT NULL COMMENT '事件ID,全局唯一',
  8. Subeventid int64 //int64//(20) DEFAULT NULL COMMENT '测点告警时,对应的复归事件ID',
  9. Eventdesc string //string // COMMENT '告警事件描述',
  10. Eventtype int //int// DEFAULT NULL COMMENT '事件类别。1-测点告警,2-系统告警,3-告警复归',
  11. Timestamp int64 //int64//(20) DEFAULT NULL COMMENT '事件产生时的时间戳',
  12. Strategyid int64 //int64//(20) DEFAULT NULL COMMENT '关联的告警策略ID,只用于测点告警',
  13. Confirm int // int// DEFAULT '1' COMMENT '用户是否确认。1-未确认,2-已确认',
  14. Confirmtime string // string // DEFAULT NULL COMMENT '用户确认时间',
  15. Result string //string // COMMENT '用户处理结果',
  16. Appid int //int// DEFAULT NULL,
  17. Alarmlevel int // int// DEFAULT NULL COMMENT '告警级别,1 预警,2 一般,3 严重,4 危急',
  18. CreateAt string //string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  19. UpdateAt string //string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  20. }
  21. type Alarm_relation struct {
  22. Id int `orm:"pk;auto"` //int// NOT NULL AUTO_INCREMENT COMMENT '告警策略表',
  23. Strategyid int64 //(20) DEFAULT NULL COMMENT '策略ID。全局唯一',
  24. Mpid int64 //(20) DEFAULT NULL COMMENT '测点ID。全局唯一',
  25. Alarmtype int //int// DEFAULT NULL COMMENT '测点告警类型。1-阈值告警,2-开关量告警,3-差值告警,4-视频告警,5-测点离线告警',
  26. Uplimit float64 //(16,6) DEFAULT NULL COMMENT '阈值上限',
  27. Dnlimit float64 //(16,6) DEFAULT NULL COMMENT '阈值下限',
  28. Dio int //int// DEFAULT NULL COMMENT '开关量(0、1),或者视频告警类型。',
  29. Diffvalue float64 //(16,6) DEFAULT NULL COMMENT '差值',
  30. Relation int //int// DEFAULT NULL COMMENT '多测点间告警关系。1-与,2-或,3-无',
  31. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  32. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  33. }
  34. type Alarm_strategy struct {
  35. Id int `orm:"pk;auto"` //int// NOT NULL AUTO_INCREMENT COMMENT '告警策略表',
  36. Strategyid int64 //(20) NOT NULL COMMENT '策略ID,全局唯一',
  37. Appid int //int// DEFAULT NULL COMMENT '所属APP id',
  38. Strategyname string //(255) DEFAULT NULL COMMENT '策略名称,告警策略描述',
  39. Alarmlevel int //int// DEFAULT NULL COMMENT '告警级别,1 预警,2 一般,3 严重,4 危急',
  40. Disable int //int// DEFAULT '1' COMMENT '策略停用标志。1-启用 2-停用, 默认启用',
  41. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  42. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  43. }
  44. type Dev_cpaction struct {
  45. Id int `orm:"pk;auto"` //int// NOT NULL AUTO_INCREMENT COMMENT '控制点动作表',
  46. Actid int64 //(20) DEFAULT NULL COMMENT '动作ID,全局唯一',
  47. Cpid int64 //(20) DEFAULT NULL COMMENT '所属控制点ID,全局唯一',
  48. Acttype int //int// DEFAULT NULL COMMENT '动作分类。开关量动作-1, 模拟量动作-2',
  49. Actdesc string //(255) DEFAULT NULL COMMENT '动作描述',
  50. Value float64 //(16,6) DEFAULT NULL COMMENT '动作取值',
  51. Delay int //int// DEFAULT NULL COMMENT '动作执行时对外部命令的封闭时间(不响应外部指令),单位秒',
  52. Successval float64 //(16,6) DEFAULT NULL COMMENT '录入的控制成功的状态值',
  53. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  54. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  55. }
  56. type Dev_cpinfo struct {
  57. Id int `orm:"pk;auto"` //int// NOT NULL AUTO_INCREMENT COMMENT '控制点信息表',
  58. Cpid int64 //(20) DEFAULT NULL COMMENT '控制点ID,全局唯一',
  59. Cpname string //(255) DEFAULT NULL COMMENT '控制点名称',
  60. Zonename string //(255) DEFAULT NULL COMMENT '所在区域名称',
  61. Positionname string //(255) DEFAULT NULL COMMENT '区域内位置',
  62. Appid int // DEFAULT NULL COMMENT '所属APP id',
  63. Modelid int // DEFAULT NULL COMMENT '所属模型id',
  64. Deviceid int // DEFAULT NULL COMMENT '所属设备id ',
  65. Attrname string //(255) DEFAULT NULL COMMENT '对应模型属性',
  66. Mpid int64 //(20) DEFAULT NULL COMMENT '关联的测点id,关联控制点影响的设备状态(状态作为一个测点存在,如无可忽略),全局唯一',
  67. CreateAt string // DEFAULT CURRENT_TIMESTAMP,
  68. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
  69. }
  70. type Dev_data_optimize struct {
  71. Id int `orm:"pk;auto"` // NOT NULL AUTO_INCREMENT COMMENT '数据优化表',
  72. Mpid int64 //(20) DEFAULT NULL COMMENT '测点ID',
  73. Algoid int // DEFAULT NULL COMMENT '算法ID',
  74. Refid int64 //(20) DEFAULT NULL COMMENT '算法参考测点ID',
  75. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  76. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  77. }
  78. type Dev_devinfo struct {
  79. Id int `orm:"pk;auto"` // NOT NULL AUTO_INCREMENT COMMENT '设备信息表',
  80. Stationid int // DEFAULT NULL COMMENT '所属变电站ID',
  81. Deviceid int // DEFAULT NULL COMMENT '设备ID,查询变电框架返回',
  82. Devicename string //(255) DEFAULT NULL COMMENT '设备名称',
  83. Appid int // DEFAULT NULL COMMENT '所属APP ID',
  84. Modelid int // DEFAULT NULL COMMENT '所属模型ID',
  85. Protocol string //(255) DEFAULT NULL COMMENT '采集协议',
  86. Serial string //(255) DEFAULT NULL COMMENT '串口地址',
  87. Baudrate int // DEFAULT NULL COMMENT '串口波特率',
  88. Stopbit int // DEFAULT NULL COMMENT '串口停止位',
  89. Checkbit string //(2) DEFAULT NULL COMMENT '串口检测位',
  90. Databit int // DEFAULT NULL COMMENT '串口数据位',
  91. Slaveid int // DEFAULT NULL COMMENT '从设备ID',
  92. Ip string //(64) DEFAULT NULL COMMENT 'IP地址',
  93. Port int // DEFAULT NULL COMMENT '端口号(modbus tcp)',
  94. Eid string //(255) DEFAULT NULL COMMENT '微功耗传感器ID',
  95. Mqtttopic string //(255) DEFAULT NULL COMMENT 'mqtt采集协议时对应的主题',
  96. Disable int // DEFAULT '1' COMMENT '设备禁用标志。1未禁用 2禁用',
  97. Online int // DEFAULT '2' COMMENT '设备在线状态。1离线 2在线 3超时,持续超时次数5次则离线',
  98. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  99. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  100. }
  101. type Dev_mpinfo struct {
  102. Id int `orm:"pk;auto"` // unsigned zerofill NOT NULL AUTO_INCREMENT COMMENT '测点信息表',
  103. Mpid int64 //(20) DEFAULT NULL COMMENT '测点ID,全局唯一索引',
  104. Mpname string //(255) DEFAULT NULL COMMENT '测点名称',
  105. Zonename string //(255) DEFAULT NULL COMMENT '所在区域名称',
  106. Positionname string //(255) DEFAULT NULL COMMENT '区域内位置',
  107. Appid int // DEFAULT NULL COMMENT '所属APP id',
  108. Modelid int // DEFAULT NULL COMMENT '所属模型id',
  109. Deviceid int // DEFAULT NULL COMMENT '所属设备id ',
  110. Attrname string //(255) DEFAULT NULL COMMENT '对应模型属性',
  111. Unit string //(255) DEFAULT NULL COMMENT '测点单位',
  112. Online int // DEFAULT '1' COMMENT '1离线/2 在线 / 3 超时。持续超时次数5次则离线',
  113. Disable int // DEFAULT '1' COMMENT '测点停用标志。1-启用 2-停用, 默认启用',
  114. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  115. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  116. }
  117. type Dev_task struct {
  118. Id int `orm:"pk;auto"` // NOT NULL AUTO_INCREMENT COMMENT '设备计划任务表',
  119. Taskid int64 //(20) DEFAULT NULL COMMENT '计划任务ID。全局唯一',
  120. Appid int // DEFAULT NULL COMMENT '所属APP ID',
  121. Taskdesc string //(255) DEFAULT NULL COMMENT '计划任务描述',
  122. Tasktype int // DEFAULT NULL COMMENT '任务分类。1-普通任务 2-循环任务',
  123. Starttime string // DEFAULT NULL COMMENT '任务开始时间',
  124. Runtime int // DEFAULT NULL COMMENT '任务执行时间。单位秒',
  125. Period int // DEFAULT NULL COMMENT '循环间隔时间。只适用于循环任务(普通任务固定为0),代表任务循环执行的周期,单位秒',
  126. Actid int64 //(20) DEFAULT NULL COMMENT '动作ID',
  127. Status int // DEFAULT NULL COMMENT '任务执行状态。1-执行中 2-执行结束 3-计时中 4-暂停',
  128. Pause int // DEFAULT '1' COMMENT '任务暂停控制。1-不暂停 2-暂停',
  129. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  130. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
  131. }
  132. type Dev_task_action struct {
  133. Id int `orm:"pk;auto"` // NOT NULL AUTO_INCREMENT COMMENT '联动动作关联表',
  134. Taskid int64 //(20) DEFAULT NULL COMMENT '任务ID。',
  135. Dstid int64 //(20) DEFAULT NULL COMMENT '目标ID。动作id或者视频测点id',
  136. Actindex int // DEFAULT NULL COMMENT '动作序列号。动作顺序执行的编号',
  137. Actid int64 //(20) DEFAULT NULL COMMENT '目标动作ID。',
  138. Delay int // DEFAULT NULL COMMENT '动作执行后的延迟等待时间,秒',
  139. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  140. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  141. }
  142. type Dev_task_event struct {
  143. Id int `orm:"pk;auto"` // NOT NULL AUTO_INCREMENT COMMENT '计划任务事件表',
  144. Eventid int64 //(20) DEFAULT NULL COMMENT '事件ID。全局唯一',
  145. Execid int64 //(20) DEFAULT NULL COMMENT '任务执行ID。',
  146. Taskid int64 //(20) DEFAULT NULL COMMENT '任务ID。全局唯一',
  147. Starttime string // DEFAULT NULL COMMENT '开始任务时间',
  148. Endtime string // DEFAULT NULL COMMENT '结束任务时间',
  149. Status int // DEFAULT NULL COMMENT '任务的状态。1-执行中 2-执行结束',
  150. Balarm int // DEFAULT NULL COMMENT '任务过程中是否告警。1-不告警 2-告警',
  151. Alarmlevel int // DEFAULT NULL COMMENT '告警级别,1 预警,2 一般,3 严重,4 危急',
  152. Alarmeventid int64 //(20) DEFAULT NULL COMMENT '关联的告警事件id',
  153. Result string // COMMENT '动作执行结果。动作描述+执行结果',
  154. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  155. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  156. }
  157. type Dev_task_exec struct {
  158. Id int `orm:"pk;auto"` // NOT NULL AUTO_INCREMENT COMMENT '计划任务执行记录总览表',
  159. Execid int64 //(20) DEFAULT NULL COMMENT '任务执行ID。全局唯一',
  160. Taskid int64 //(20) DEFAULT NULL COMMENT '任务ID。全局唯一',
  161. Starttime string // DEFAULT NULL COMMENT '开始任务时间',
  162. Endtime string // DEFAULT NULL COMMENT '结束任务时间',
  163. Status int // DEFAULT NULL COMMENT '任务的状态。1-执行中 2-执行结束 3-中断',
  164. Balarm int // DEFAULT NULL COMMENT '任务过程中是否告警。1-不告警 2-告警',
  165. Alarmlevel int // DEFAULT NULL COMMENT '告警级别,1 预警,2 一般,3 严重,4 危急',
  166. Result string // COMMENT '动作执行结果。',
  167. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  168. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  169. }
  170. type Link_event struct {
  171. Id int `orm:"pk;auto"` // NOT NULL AUTO_INCREMENT COMMENT '联动事件表',
  172. Eventid int64 //(20) DEFAULT NULL COMMENT '联动事件ID,全局唯一',
  173. Eventdesc string // COMMENT '联动事件描述',
  174. Timestamp int64 //(20) DEFAULT NULL COMMENT '事件产生时的时间戳',
  175. Strategyid int64 //(20) DEFAULT NULL COMMENT '关联的联动策略ID',
  176. Linktoid int64 //(20) DEFAULT NULL COMMENT '联动目标ID',
  177. Beforestatus string // COMMENT '联动前目标状态。变电采集设备状态为控制点关联的测点数据。视频设备状态为预置位名称',
  178. Afterstatus string // COMMENT '联动后目标状态',
  179. Result string // COMMENT '执行结果',
  180. Srcappid int // DEFAULT NULL COMMENT '来源app id',
  181. Dstappid int // DEFAULT NULL COMMENT '目标app id',
  182. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  183. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  184. }
  185. type Link_relation_action struct {
  186. Id int `orm:"pk;auto"` // NOT NULL AUTO_INCREMENT COMMENT '联动动作关联表',
  187. Strategyid int64 //(20) DEFAULT NULL COMMENT '联动策略ID。全局唯一',
  188. Linktoid int64 //(20) DEFAULT NULL COMMENT '联动目标ID。动作id或者视频测点id',
  189. Actindex int // DEFAULT NULL COMMENT '动作序列号。动作顺序执行的编号',
  190. Actid int64 //(20) DEFAULT NULL COMMENT '目标动作ID或者视频动作点ID。',
  191. Delay int // DEFAULT NULL COMMENT '动作执行后的延迟等待时间,秒',
  192. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  193. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  194. }
  195. type Link_relation_obj struct {
  196. Id int `orm:"pk;auto"` // NOT NULL AUTO_INCREMENT COMMENT '联动目标关联表',
  197. Strategyid int64 //(20) DEFAULT NULL COMMENT '联动策略ID',
  198. Linkfromid int64 //(20) DEFAULT NULL COMMENT '联动来源ID',
  199. Value string //(512) DEFAULT NULL COMMENT '来源ID对应的联动触发取值(对应测点联动类型)',
  200. Than int // DEFAULT NULL COMMENT '1-大于 2-等于 3-小于 4-大于等于 5-小于等于',
  201. Relation int // DEFAULT NULL COMMENT '1-与 2-或 3-差 4-无',
  202. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  203. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  204. }
  205. type Link_strategy struct {
  206. Id int `orm:"pk;auto"` // NOT NULL AUTO_INCREMENT COMMENT '联动策略表',
  207. Strategyid int64 //(20) DEFAULT NULL COMMENT '联动策略ID,全局唯一',
  208. Appid int // DEFAULT NULL COMMENT '所属APP id',
  209. Strategyname string //(255) DEFAULT NULL COMMENT '联动策略名称',
  210. Linktype int // DEFAULT NULL COMMENT '联动类型。1测点联动 2模拟IO量输入事件联动 3数字量IO量输入联动 4 模拟IO量输出事件联动 5 数字量IO量输出联动 6 辅控事件联动',
  211. Disable int // DEFAULT '1' COMMENT '策略停用标志。1-启用 2-停用, 默认启用',
  212. Donum int // DEFAULT '1' COMMENT '联动动作次数。0为一直动作',
  213. Donenum int // DEFAULT '0' COMMENT '联动动作次数。0为复归',
  214. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  215. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  216. }
  217. type Map_info struct {
  218. Id int `orm:"pk;auto"` // NOT NULL AUTO_INCREMENT,
  219. Stageid string //(32) DEFAULT NULL COMMENT '场景id',
  220. Index int // DEFAULT NULL COMMENT '是否首页 0-不是 1-是',
  221. Maptype int // DEFAULT NULL COMMENT '地图类型 1:网络拓扑图 2:三维图',
  222. Stationid int64 //(20) DEFAULT NULL COMMENT '变电站id',
  223. Appid int64 //(20) DEFAULT NULL COMMENT '地图所属app id',
  224. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  225. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  226. }
  227. type Sys_app struct {
  228. Id int `orm:"pk;auto"` // NOT NULL AUTO_INCREMENT,
  229. Appid int // DEFAULT NULL COMMENT 'app id',
  230. Nickname string //(255) DEFAULT NULL COMMENT 'app别称',
  231. Appname string //(255) DEFAULT NULL COMMENT 'app名称标识',
  232. Path string //(255) DEFAULT NULL COMMENT 'app安装路径',
  233. Url string //(255) DEFAULT NULL COMMENT 'app url地址',
  234. Version string //(32) DEFAULT NULL COMMENT 'app版本号',
  235. Icon string // COMMENT 'App图标',
  236. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  237. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  238. }
  239. type Video_action struct {
  240. Id int // NOT NULL AUTO_INCREMENT COMMENT '视频设备动作表',
  241. Actid int64 //(20) DEFAULT NULL COMMENT '动作ID。全局唯一',
  242. Mpid int64 //(20) DEFAULT NULL COMMENT '测点ID。全局唯一',
  243. Acttype int // DEFAULT NULL COMMENT '动作分类。录像-1,拍照-2,录像并拍照-3,4-无 ',
  244. Capnum int // DEFAULT NULL COMMENT '快照次数',
  245. Rectime int // DEFAULT NULL COMMENT '录像时长 。单位秒',
  246. Actdesc string //(255) DEFAULT NULL COMMENT '动作描述',
  247. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  248. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  249. }
  250. type Video_devinfo struct {
  251. Id int `orm:"pk;auto"` // NOT NULL AUTO_INCREMENT COMMENT '视频设备信息表',
  252. DeviceId int64 //(20) DEFAULT NULL COMMENT '设备ID。视频采集框架返回',
  253. Channel int // DEFAULT NULL COMMENT '通道号。视频采集框架返回',
  254. DeviceIp string //(255) DEFAULT NULL COMMENT '设备ip',
  255. DeviceCode string //(255) DEFAULT NULL COMMENT '设备编码。nvr/ipc, 表示是网络摄像机或者是网络摄像头',
  256. DeviceName string //(255) DEFAULT NULL COMMENT '设备名称',
  257. Stationid int64 //(20) DEFAULT NULL COMMENT '所属变电站ID',
  258. Appid int // DEFAULT NULL COMMENT '所属APP ID',
  259. Manufacturer string //(255) DEFAULT NULL COMMENT '厂商名称',
  260. Model string //(255) DEFAULT NULL COMMENT '型号',
  261. RtspUrl string //(255) DEFAULT NULL COMMENT '视频流地址',
  262. RtspPort int // DEFAULT NULL COMMENT 'rtsp端口',
  263. Longitude string //(255) DEFAULT NULL COMMENT '经度',
  264. Latitude string //(255) DEFAULT NULL COMMENT '纬度',
  265. Position string // COMMENT '安装位置',
  266. IsRotate int //(2) DEFAULT '1' COMMENT '当前摄像头是否能转动,1能转动,-1不能转动',
  267. Online int // DEFAULT NULL COMMENT '设备在线状态 1离线 /2 在线 ',
  268. DeviceUsername string //(255) DEFAULT NULL COMMENT '设备登录用户名',
  269. DevicePassword string //(255) DEFAULT NULL COMMENT '设备登录密码',
  270. DeviceChannel int // DEFAULT NULL COMMENT '设备实际通道',
  271. DeviceType string //(255) DEFAULT NULL COMMENT '1枪机,2网络球机,3nvr',
  272. IsAlarmNotify int //(2) DEFAULT '0' COMMENT '是否开启告警上报,1为开启,其他为不开启',
  273. Disable int // DEFAULT '1' COMMENT '设备禁用标志。1未禁用 2禁用',
  274. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  275. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  276. }
  277. type Video_mpinfo struct {
  278. Id int `orm:"pk;auto"` // NOT NULL AUTO_INCREMENT COMMENT '视频测点信息表',
  279. Mpid int64 //(20) DEFAULT NULL COMMENT '测点ID。全局唯一索引',
  280. Mpname string //(255) DEFAULT NULL COMMENT '测点名称',
  281. Zonename string //(255) DEFAULT NULL COMMENT '所在区域名称',
  282. Positionname string //(255) DEFAULT NULL COMMENT '区域内位置',
  283. Appid int // DEFAULT NULL COMMENT '所属APP id',
  284. Deviceid int64 //(20) DEFAULT NULL COMMENT '所属设备id',
  285. Channel int // DEFAULT NULL COMMENT '通道号',
  286. Presetindex int // DEFAULT NULL COMMENT '预置位编号',
  287. Presetname string //(255) DEFAULT NULL COMMENT '预置位名称',
  288. Disable int // DEFAULT '1' COMMENT '停用标志。1-启用 2-停用, 默认启用',
  289. CreateAt string // DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  290. UpdateAt string // DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
  291. }
  292. type Log_operate struct {
  293. Id int64 `orm:"pk;auto"` // int(11) NOT NULL AUTO_INCREMENT,
  294. Context string // text COMMENT '日志内容',
  295. Appid int // int(11) DEFAULT NULL COMMENT '所属APP id',
  296. Usrname string // varchar(255) DEFAULT NULL COMMENT '操作用户名',
  297. CreateAt string // datetime DEFAULT CURRENT_TIMESTAMP COMMENT '操作时间',
  298. }
  299. type Sys_usr struct {
  300. Id int `orm:"pk;auto"`
  301. Usrname string
  302. Role int
  303. Status int
  304. Ip string
  305. }
  306. type T_base_blacklist struct {
  307. Id int64 `orm:"pk;auto"` // bigint NOT NULL AUTO_INCREMENT,
  308. Area string // varchar(100) DEFAULT NULL COMMENT '区域',
  309. Deviceid int64 // bigint DEFAULT NULL COMMENT '设备id',
  310. Devicename string // varchar(100) DEFAULT NULL COMMENT '设备名称',
  311. Devicecode string // varchar(100) DEFAULT NULL COMMENT '设备编号'
  312. Creator string // varchar(100) DEFAULT NULL COMMENT '添加人'
  313. }
  314. type T_base_blacklist_mplist struct {
  315. Id int64 `orm:"pk;auto"` // bigint NOT NULL AUTO_INCREMENT,
  316. Deviceid int64 // bigint DEFAULT NULL COMMENT '设备id',
  317. Mpid int64 // bigint DEFAULT NULL COMMENT '测点id',
  318. }
  319. type T_base_absolute_alarm struct {
  320. Id int64 `orm:"pk;auto"` // bigint NOT NULL AUTO_INCREMENT,
  321. Strategy_name string // varchar(100) NOT NULL COMMENT '策略名称',
  322. Alarm_level int // int NOT NULL COMMENT '告警等级',
  323. Mod_name string // varchar(100) NOT NULL COMMENT '模型名称',
  324. Mod_id int64 // bigint NOT NULL COMMENT '模型id',
  325. Operation_symbol string // varchar(100) NOT NULL COMMENT '操作符号',
  326. Threshold float32 // float NOT NULL COMMENT '阈值'
  327. }
  328. type T_base_rise_alarm struct {
  329. Id int64 `orm:"pk;auto"` // bigint NOT NULL AUTO_INCREMENT,
  330. Strategy_name string // varchar(100) NOT NULL COMMENT '策略名称',
  331. Alarm_level int // int NOT NULL COMMENT '告警等级',
  332. Mod_name string // varchar(100) NOT NULL COMMENT '模型名称',
  333. Mod_id int64 // bigint NOT NULL COMMENT '模型id',
  334. Upcycle int // int NOT NULL COMMENT '上升周期',
  335. Scope float32 // int NOT NULL COMMENT '升温范围'
  336. }
  337. type T_base_unbalance_alarm struct {
  338. Id int64 `orm:"pk;auto"` // bigint NOT NULL AUTO_INCREMENT,
  339. Strategy_name string // varchar(100) NOT NULL COMMENT '策略名称',
  340. Alarm_level int // int NOT NULL COMMENT '告警等级',
  341. Operation_symbol string // varchar(100) NOT NULL COMMENT '操作符号',
  342. Threshold float32 // float NOT NULL COMMENT '阈值'
  343. }
  344. type T_base_alone_alarm struct {
  345. Id int64 `orm:"pk;auto"` // bigint NOT NULL AUTO_INCREMENT,
  346. Deviceid int64 // bigint DEFAULT NULL COMMENT '设备id',
  347. Mpid int64 // bigint DEFAULT NULL COMMENT '测点id',
  348. Attrname string // varchar(100) NOT NULL COMMENT '测点属性名称',
  349. Mpname string // varchar(100) NOT NULL COMMENT '测点名称',
  350. Alarm_type int // int NOT NULL COMMENT '告警策略类型',
  351. Alarm_id int64 // bigint DEFAULT NULL COMMENT '告警id',
  352. Upcycle int // int NOT NULL COMMENT '上升周期',
  353. Threshold float32 // float NOT NULL COMMENT '阈值'
  354. }
  355. type T_base_alarm_his struct {
  356. Id int64 `orm:"pk;auto"` // bigint NOT NULL AUTO_INCREMENT,
  357. Deviceid int64 // bigint NOT NULL COMMENT '设备id',
  358. Devicename string // varchar(100) DEFAULT NULL COMMENT '设备名称',
  359. Mpid int64 // bigint NOT NULL COMMENT '测点id',
  360. Mpname string // varchar(50) DEFAULT NULL COMMENT '测点名称',
  361. Alarm_desc string // varchar(500) DEFAULT NULL COMMENT '告警描述',
  362. Alarm_type int // int DEFAULT NULL COMMENT '告警策略类型',
  363. Strategyid int64 // bigint DEFAULT NULL COMMENT '策略id',
  364. Alarm_value float32 // float DEFAULT NULL COMMENT '报警数值',
  365. Confirm int // int DEFAULT NULL COMMENT '用户是否确认',
  366. Confirmtime string // varchar(20) DEFAULT NULL COMMENT '否确认时间',
  367. Alarm_level int // int DEFAULT NULL COMMENT '告警等级',
  368. Region_id int // int DEFAULT NULL COMMENT '区域',
  369. Is_reset int // int DEFAULT NULL COMMENT '是否复归',
  370. Create_at string // varchar(20) DEFAULT NULL COMMENT '告警发生时间'
  371. }
  372. func init() {
  373. orm.RegisterModel(new(Alarm_event))
  374. orm.RegisterModel(new(Alarm_relation))
  375. orm.RegisterModel(new(Alarm_strategy))
  376. orm.RegisterModel(new(Dev_cpaction))
  377. orm.RegisterModel(new(Dev_cpinfo))
  378. orm.RegisterModel(new(Dev_task))
  379. orm.RegisterModel(new(Dev_task_action))
  380. orm.RegisterModel(new(Dev_task_event))
  381. orm.RegisterModel(new(Dev_task_exec))
  382. orm.RegisterModel(new(Link_event))
  383. orm.RegisterModel(new(Link_relation_action))
  384. orm.RegisterModel(new(Link_relation_obj))
  385. orm.RegisterModel(new(Link_strategy))
  386. orm.RegisterModel(new(Map_info))
  387. orm.RegisterModel(new(Sys_app))
  388. orm.RegisterModel(new(Video_action))
  389. orm.RegisterModel(new(Video_devinfo))
  390. orm.RegisterModel(new(Video_mpinfo))
  391. orm.RegisterModel(new(Dev_data_optimize))
  392. orm.RegisterModel(new(Dev_devinfo))
  393. orm.RegisterModel(new(Dev_mpinfo))
  394. orm.RegisterModel(new(Log_operate))
  395. orm.RegisterModel(new(Sys_usr))
  396. orm.RegisterModel(new(T_base_blacklist))
  397. orm.RegisterModel(new(T_base_absolute_alarm))
  398. orm.RegisterModel(new(T_base_rise_alarm))
  399. orm.RegisterModel(new(T_base_unbalance_alarm))
  400. orm.RegisterModel(new(T_base_alone_alarm))
  401. orm.RegisterModel(new(T_base_alarm_his))
  402. orm.RegisterModel(new(T_base_blacklist_mplist))
  403. }