建表
DROP TABLE IF EXISTS nccs_station_aux_gz_result;
DELETE FROM "sys_column_info" WHERE "table_id" = 10673;
DELETE FROM "sys_table_info" WHERE "table_id" = 10673;
create table nccs_station_aux_gz_result (
id numeric(20) not null,
station_id numeric(20) not null,
resp_area numeric(20) not null,
light_value_1 numeric(3),
light_qual_1 numeric(10),
xf_light_value numeric(10),
xf_light_qual numeric(10),
af_light_value numeric(10),
af_light_qual numeric(10),
dh_light_value numeric(10),
dh_light_qual numeric(10),
jc_light_value numeric(10),
jc_light_qual numeric(10));
alter table nccs_station_aux_gz_result add constraint pk_nccs_station_aux_gz_result primary key (id,station_id,resp_area);
insert into sys_table_info(table_id,table_name_eng,table_name_chn,is_system_table,app_type,max_record_num,key_generate_type,is_record_app,is_record_lock,is_record_resp,is_insert_trigger,is_delete_trigger,is_update_trigger,table_version,db_id,tablespace_name,table_description,table_type,pk_index_method,pk_storage_type,pk_mem_alloc_type,reserved_1,reserved_2,reserved_3,reserved_4,reserved_5) values(10673,'nccs_station_aux_gz_result','厂站辅助光字结果表',0,1,20000,0,0,0,0,0,0,0,0,0,'OPEN_DATA','',0,-1,-1,0,0,0,0,0,0);
insert into sys_column_info(table_id,field_id,column_id,column_name_eng,column_name_chn,data_type,data_length,is_key,allow_null,app_type,is_app_syn,index_order_no,sort_order_no,is_input,is_display,display_order_no,is_fix,display_length,display_precision,align_type,display_type,menu_name,reference_flag,reference_mode,reference_table,reference_column,reference_display,init_value,min_value,max_value,column_special,auto_meas_type,gen_array_dimension,gen_array_name,column_description,search_attribute,statics_attribute,reserved_1,reserved_2,reserved_3,reserved_4,reserved_5 ) values(10673,1,1,'id','监控区域ID',15,8,1,0,1,0,0,0,1,1,1,0,20,2,0,5,'',0,0,0,0,0,'','','',0,0,0,'','',0,0,0,0,0,0,0);
insert into sys_column_info(table_id,field_id,column_id,column_name_eng,column_name_chn,data_type,data_length,is_key,allow_null,app_type,is_app_syn,index_order_no,sort_order_no,is_input,is_display,display_order_no,is_fix,display_length,display_precision,align_type,display_type,menu_name,reference_flag,reference_mode,reference_table,reference_column,reference_display,init_value,min_value,max_value,column_special,auto_meas_type,gen_array_dimension,gen_array_name,column_description,search_attribute,statics_attribute,reserved_1,reserved_2,reserved_3,reserved_4,reserved_5 ) values(10673,2,2,'station_id','厂站ID',15,8,1,0,1,0,0,0,1,1,1,0,20,2,0,5,'',0,0,0,0,0,'','','',0,0,0,'','',0,0,0,0,0,0,0);
insert into sys_column_info(table_id,field_id,column_id,column_name_eng,column_name_chn,data_type,data_length,is_key,allow_null,app_type,is_app_syn,index_order_no,sort_order_no,is_input,is_display,display_order_no,is_fix,display_length,display_precision,align_type,display_type,menu_name,reference_flag,reference_mode,reference_table,reference_column,reference_display,init_value,min_value,max_value,column_special,auto_meas_type,gen_array_dimension,gen_array_name,column_description,search_attribute,statics_attribute,reserved_1,reserved_2,reserved_3,reserved_4,reserved_5 ) values(10673,3,3,'resp_area','责任区',15,8,1,0,1,0,0,0,1,1,1,0,20,2,0,5,'',0,0,0,0,0,'','','',0,0,0,'','',0,0,0,0,0,0,0);
insert into sys_column_info(table_id,field_id,column_id,column_name_eng,column_name_chn,data_type,data_length,is_key,allow_null,app_type,is_app_syn,index_order_no,sort_order_no,is_input,is_display,display_order_no,is_fix,display_length,display_precision,align_type,display_type,menu_name,reference_flag,reference_mode,reference_table,reference_column,reference_display,init_value,min_value,max_value,column_special,auto_meas_type,gen_array_dimension,gen_array_name,column_description,search_attribute,statics_attribute,reserved_1,reserved_2,reserved_3,reserved_4,reserved_5 ) values(10673,4,4,'light_value_1','光字牌值',3,1,0,1,1,0,0,0,1,1,1,0,20,2,0,2,'',0,0,0,0,0,'','','',0,0,0,'','',0,0,0,0,0,0,0);
insert into sys_column_info(table_id,field_id,column_id,column_name_eng,column_name_chn,data_type,data_length,is_key,allow_null,app_type,is_app_syn,index_order_no,sort_order_no,is_input,is_display,display_order_no,is_fix,display_length,display_precision,align_type,display_type,menu_name,reference_flag,reference_mode,reference_table,reference_column,reference_display,init_value,min_value,max_value,column_special,auto_meas_type,gen_array_dimension,gen_array_name,column_description,search_attribute,statics_attribute,reserved_1,reserved_2,reserved_3,reserved_4,reserved_5 ) values(10673,5,5,'light_qual_1','光字状态',5,4,0,1,1,0,0,0,1,1,1,0,20,2,0,4,'',0,0,0,0,0,'','','',0,0,0,'','',0,0,0,0,0,0,0);
insert into sys_column_info(table_id,field_id,column_id,column_name_eng,column_name_chn,data_type,data_length,is_key,allow_null,app_type,is_app_syn,index_order_no,sort_order_no,is_input,is_display,display_order_no,is_fix,display_length,display_precision,align_type,display_type,menu_name,reference_flag,reference_mode,reference_table,reference_column,reference_display,init_value,min_value,max_value,column_special,auto_meas_type,gen_array_dimension,gen_array_name,column_description,search_attribute,statics_attribute,reserved_1,reserved_2,reserved_3,reserved_4,reserved_5 ) values(10673,6,6,'xf_light_value','消防光字牌值',5,4,0,1,1,0,0,0,1,1,1,0,20,2,0,4,'',0,0,0,0,0,'','','',0,0,0,'','',0,0,0,0,0,0,0);
insert into sys_column_info(table_id,field_id,column_id,column_name_eng,column_name_chn,data_type,data_length,is_key,allow_null,app_type,is_app_syn,index_order_no,sort_order_no,is_input,is_display,display_order_no,is_fix,display_length,display_precision,align_type,display_type,menu_name,reference_flag,reference_mode,reference_table,reference_column,reference_display,init_value,min_value,max_value,column_special,auto_meas_type,gen_array_dimension,gen_array_name,column_description,search_attribute,statics_attribute,reserved_1,reserved_2,reserved_3,reserved_4,reserved_5 ) values(10673,7,7,'xf_light_qual','消防光字状态',5,4,0,1,1,0,0,0,1,1,1,0,20,2,0,4,'',0,0,0,0,0,'','','',0,0,0,'','',0,0,0,0,0,0,0);
insert into sys_column_info(table_id,field_id,column_id,column_name_eng,column_name_chn,data_type,data_length,is_key,allow_null,app_type,is_app_syn,index_order_no,sort_order_no,is_input,is_display,display_order_no,is_fix,display_length,display_precision,align_type,display_type,menu_name,reference_flag,reference_mode,reference_table,reference_column,reference_display,init_value,min_value,max_value,column_special,auto_meas_type,gen_array_dimension,gen_array_name,column_description,search_attribute,statics_attribute,reserved_1,reserved_2,reserved_3,reserved_4,reserved_5 ) values(10673,8,8,'af_light_value','安防光字牌值',5,4,0,1,1,0,0,0,1,1,1,0,20,2,0,4,'',0,0,0,0,0,'','','',0,0,0,'','',0,0,0,0,0,0,0);
insert into sys_column_info(table_id,field_id,column_id,column_name_eng,column_name_chn,data_type,data_length,is_key,allow_null,app_type,is_app_syn,index_order_no,sort_order_no,is_input,is_display,display_order_no,is_fix,display_length,display_precision,align_type,display_type,menu_name,reference_flag,reference_mode,reference_table,reference_column,reference_display,init_value,min_value,max_value,column_special,auto_meas_type,gen_array_dimension,gen_array_name,column_description,search_attribute,statics_attribute,reserved_1,reserved_2,reserved_3,reserved_4,reserved_5 ) values(10673,9,9,'af_light_qual','安防光字状态',5,4,0,1,1,0,0,0,1,1,1,0,20,2,0,4,'',0,0,0,0,0,'','','',0,0,0,'','',0,0,0,0,0,0,0);
insert into sys_column_info(table_id,field_id,column_id,column_name_eng,column_name_chn,data_type,data_length,is_key,allow_null,app_type,is_app_syn,index_order_no,sort_order_no,is_input,is_display,display_order_no,is_fix,display_length,display_precision,align_type,display_type,menu_name,reference_flag,reference_mode,reference_table,reference_column,reference_display,init_value,min_value,max_value,column_special,auto_meas_type,gen_array_dimension,gen_array_name,column_description,search_attribute,statics_attribute,reserved_1,reserved_2,reserved_3,reserved_4,reserved_5 ) values(10673,10,10,'dh_light_value','动环光字牌值',5,4,0,1,1,0,0,0,1,1,1,0,20,2,0,4,'',0,0,0,0,0,'','','',0,0,0,'','',0,0,0,0,0,0,0);
insert into sys_column_info(table_id,field_id,column_id,column_name_eng,column_name_chn,data_type,data_length,is_key,allow_null,app_type,is_app_syn,index_order_no,sort_order_no,is_input,is_display,display_order_no,is_fix,display_length,display_precision,align_type,display_type,menu_name,reference_flag,reference_mode,reference_table,reference_column,reference_display,init_value,min_value,max_value,column_special,auto_meas_type,gen_array_dimension,gen_array_name,column_description,search_attribute,statics_attribute,reserved_1,reserved_2,reserved_3,reserved_4,reserved_5 ) values(10673,11,11,'dh_light_qual','动环光字状态',5,4,0,1,1,0,0,0,1,1,1,0,20,2,0,4,'',0,0,0,0,0,'','','',0,0,0,'','',0,0,0,0,0,0,0);
insert into sys_column_info(table_id,field_id,column_id,column_name_eng,column_name_chn,data_type,data_length,is_key,allow_null,app_type,is_app_syn,index_order_no,sort_order_no,is_input,is_display,display_order_no,is_fix,display_length,display_precision,align_type,display_type,menu_name,reference_flag,reference_mode,reference_table,reference_column,reference_display,init_value,min_value,max_value,column_special,auto_meas_type,gen_array_dimension,gen_array_name,column_description,search_attribute,statics_attribute,reserved_1,reserved_2,reserved_3,reserved_4,reserved_5 ) values(10673,12,12,'jc_light_value','监控光字牌值',5,4,0,1,1,0,0,0,1,1,1,0,20,2,0,4,'',0,0,0,0,0,'','','',0,0,0,'','',0,0,0,0,0,0,0);
insert into sys_column_info(table_id,field_id,column_id,column_name_eng,column_name_chn,data_type,data_length,is_key,allow_null,app_type,is_app_syn,index_order_no,sort_order_no,is_input,is_display,display_order_no,is_fix,display_length,display_precision,align_type,display_type,menu_name,reference_flag,reference_mode,reference_table,reference_column,reference_display,init_value,min_value,max_value,column_special,auto_meas_type,gen_array_dimension,gen_array_name,column_description,search_attribute,statics_attribute,reserved_1,reserved_2,reserved_3,reserved_4,reserved_5 ) values(10673,13,13,'jc_light_qual','监控光字状态',5,4,0,1,1,0,0,0,1,1,1,0,20,2,0,4,'',0,0,0,0,0,'','','',0,0,0,'','',0,0,0,0,0,0,0);
增加字段
alter table nccs_resp_area_gz_result add column if not exists zm_light_value numeric(10);
DELETE FROM sys_column_info WHERE table_id = 10672 AND column_name_eng = 'zm_light_value';
alter table nccs_resp_area_gz_result add column if not exists zm_light_qual numeric(10);
DELETE FROM sys_column_info WHERE table_id = 10672 AND column_name_eng = 'zm_light_qual';
删减字段
增加数据
insert into "D5000"."NCCS_SYS_CONFIG"("ID", "TAG_NAME", "TAG_VALUE", "NODE_NAME", "USE_FLAG", "TAG_DESC") VALUES( (SELECT max(ID)+1 FROM NCCS_SYS_CONFIG),'nccsrecordplugin','0','',0,'0:使用缺陷统计数据;1:使用光字牌数据');