drop language IF  EXISTS  plpgsql cascade;
drop language IF  EXISTS  plpgsql cascade;
DROP FUNCTION IF  EXISTS  createtable();
Create language  plpgsql;

CREATE OR REPLACE FUNCTION createtable()
RETURNS void  AS $$
DECLARE
	users_rec RECORD;
BEGIN
	DROP VIEW IF EXISTS patientview;
----检查表创建表
	--(1) 病人基本信息表(Patient)
	SELECT INTO users_rec * FROM pg_tables where tablename = 'patient';
	IF users_rec.tablename IS NULL THEN
		CREATE TABLE patient
		(
		patientno varchar(20) NOT NULL,
		patientname varchar(40) ,
		brithday date,
		telephone varchar(20),
		address varchar(255),
		patientownno varchar(20),
		initdate  timestamp without time zone DEFAULT now() NOT NULL,  /*创建时间*/
		idnumber varchar(20),/*身份证号码 */
		lastname varchar(40),
		CONSTRAINT patient_pkey PRIMARY KEY (patientno)
		);
	END IF;
	--(2)病人检查表（patientexamine）
	SELECT INTO users_rec * FROM pg_tables where tablename = 'patientexamine';
	IF users_rec.tablename IS NULL THEN
		CREATE TABLE patientexamine
		(
		examineno		varchar(20) NOT NULL,
		patientno		varchar(20) NOT NULL,
		age			integer,
		pregnanttime		integer,
		brithtime		integer,
		abortedtime		integer,
		marriage		varchar(20),
		hcg			varchar(20),
		lastmenses		date,
		conceptiontype	varchar(20),
		SocialDisease		varchar(20),
		remark			varchar(1000),
		evaluatescore			integer,
		--evaluateresult character varying(50), --评估意见，分数对应表中
		tell 				varchar(1000),  		--主诉
		ecc  				varchar(1000),  		--细胞学/ECC
		pathology 			varchar(1000),		--病理
		see     			varchar(1000),		--阴道镜所见
		deal    			varchar(1000),  		--处理
		attention			varchar(1000),  		--检查后注意事项
		color     			int ,  			--颜色
		verge				int ,			--病变边界和表面轮廓
		bloodvessel			int ,			--血管
		iodin				int ,			--碘染色
		plandiagnoseresult		varchar(1000),
		imageflag				integer DEFAULT 0,
		imagepath				varchar(260),     -- 图片存储路径
		examineseq			integer NOT NULL DEFAULT 1,
		requestdoctor			varchar(40),
		examinedoctor			varchar(40),
		examinetime			timestamp without time zone DEFAULT now() NOT NULL,
		initdate				timestamp without time zone DEFAULT now(),
		modifydate			timestamp without time zone,
		state					int ,
		hpv					varchar(1000),		--HPV
		biopsy				varchar(1000),		--活检诊断
		menopause			varchar(20),		--绝经
		pregnancy			varchar(20),		--妊娠状态
		pregweek				int,			--周
		pregday				int,			--天
		source				varchar(100),		--病人来源
		physicalexam			int DEFAULT -1,		--体检
		gestationlesion			int DEFAULT -1,		--妊娠期高等级病变
		ulceration				int DEFAULT -1,		--溃疡
		exophyticlesion			int DEFAULT -1,		--外生型病变
		vaginalbleeding			int DEFAULT -1,		--阴道镜不规则出血
		referralremark			varchar(1000),		--转诊指征备注
		rendiagremark			varchar(1000),		--最近一次宫颈疾病诊断备注
		colexamsat			varchar(100),		--充分不充分
		dissatreason			varchar(200),		--不充分原因
		scjvisible			varchar(100),		--鳞柱交界可见
		tz			varchar(100),		--转化区类型
		directbiopsy			varchar(20),		--是否直接活检
		seeremark			varchar(1000),		--阴道镜所见备注（其他所见）
		diagremark			varchar(1000),		--拟诊备注（拟诊结果2）
		dealremark			varchar(1000),		--处理备注（处理意见2）
		biopsyremark			varchar(1000),		--活检诊断备注
		softwaretype			integer NOT NULL DEFAULT 0,
		followupdate		date,						--随访日期
		menopauseage		integer,						--绝经年龄
		eccdate		date,						--TCT检查日期
		hpvdate		date,						--HPV检查日期
		pathologydate		date,						--病理检查日期
		diagrway			varchar(1000),		--Rway拟诊结果
		dealrway			varchar(1000),		--Rway处理意见
		followuptime           smallint,		--随访日期上、下午
		followupweek			varchar(200),		--随访周期(月后)	
		uploadstate				integer DEFAULT 0,						--上传状态
		applyreview				integer DEFAULT 0,						--申请复核
		serverid				integer DEFAULT -1,						--服务器ID
		imageuploadstate				integer DEFAULT 0,						--检查或者手术记录图像上传状态
		infouploadstate				integer DEFAULT 0,						--病人信息上传状态
		callnumstate integer DEFAULT 0,
  
		followupstate integer DEFAULT 0,
  
		swedetotalscore integer DEFAULT (-1),
  
		aceticacidchange integer DEFAULT (-1),
  
		border integer DEFAULT (-1),
  
		vessel integer DEFAULT (-1),
  
		illnessscop integer DEFAULT (-1),
  
		iodinedve integer DEFAULT (-1),
  
		lable integer,
        		studyuid    		varchar(60),
        		seriesuid  		 	varchar(60),
		vaginasee     		varchar(1000),		--阴道镜所见(阴道)
		CONSTRAINT patientexamine_pkey PRIMARY KEY (examineno)
		);
		--创建索引
		CREATE INDEX ix_examinetime ON patientexamine USING btree  (examinetime DESC);
	END IF;
	
	--(3)术语表（Term）
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'term';
	IF users_rec.tablename IS NULL THEN
		create table Term
		(
		ID		serial PRIMARY KEY ,			/*序号*/					
		PID 		int ,				   	/*检查记录项目代码*/
		SID		int,					/*该检查记录项目名称*/
		Name		varchar(1000),				/*名称*/
		Score		int,					/*分数*/
		Seq		int,					/*显示次序*/
		factory    int DEFAULT 0		/*厂家术语为1，默认为用户术语*/
		);
	END IF;

	--(4)	图谱表(ReferenceImage)
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'referenceimage';
	IF users_rec.tablename IS NULL THEN
		create table ReferenceImage
		(
		No              serial	PRIMARY KEY,
		TermID	 		int not null,    		/*有对照图片项目的代码，如检查、拟诊、评估项目的代码*/
		RefImagePath	varchar(100) ,				/*图像文件的存在路径*/
		Seq		int ,
		groupnum		int DEFAULT 0,				/*图像所在的组名*/
		groupseq		int DEFAULT 0				/*图像组的顺序*/
		) ;
	END IF;

	--(5)	病人检查图像记录表(PatientExamineImage)
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'patientexamineimage';
	IF users_rec.tablename IS NULL THEN
		create table PatientExamineImage
		(
		ImageNo      	serial PRIMARY KEY,			/*图片编号*/		
		ExamineNo 	varchar(20) not null,    		/*检查编号*/
		ImageName	varchar(40), 				/*图像文件名称*/
		ImageNote	varchar(100), 				/*图像注释*/
		ImageType	int default 0, 				/*图像类型 0表示JPG文件 1表示BMP文件 2表示MPEG文件*/
		ImagePrint  	int default 0,
		opsprint		int,
		CONSTRAINT patientexamineimage_examineno_fkey FOREIGN KEY(examineno) REFERENCES patientexamine (examineno)  ON UPDATE CASCADE ON DELETE CASCADE
		) ;	
	END IF;

	--(6)	图象标注(ImageMark)
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'patientimagemark';
	IF users_rec.tablename IS NULL THEN
		create table PatientImageMark
		(
		No		serial PRIMARY KEY,			/*序号*/	
		ImageNo		int not null,				/*图像序号*/
		MarkText	varchar(40) not null,				/*标注内容*/
		MarkX 		int not null,				/*X字段*/
		MarkY		int not null, 				/*Y字段*/
		CONSTRAINT patientimagemark_imageno_fkey FOREIGN KEY(imageno) REFERENCES patientexamineimage (imageno)  ON UPDATE CASCADE ON DELETE CASCADE
		) ;
	END IF;

	--(7)	评估分数对应结果(EvaluateScoreReference)
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'evaluatescorereference';
	IF users_rec.tablename IS NULL THEN
		create table EvaluateScoreReference
		(
		no 			serial PRIMARY KEY,
		EvaluateScore		int  ,			/*评估指数得分*/
		EvaluatesResult 	varchar(100)				/*得分对应评估意见*/
		);
	END IF;

	--(8)	活检图象标注(PatientActiveMark)
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'patientactivemark';
	IF users_rec.tablename IS NULL THEN
		create table PatientActiveMark
		(
		No		serial PRIMARY KEY,			/*序号*/	
		ExamineNo 	varchar(20) not null,			/*检查编号*/
		MarkValue       varchar(100),				/*标注值*/
		FontName	varchar(20),				/*字体名称*/
		FontSize	int,					/*字体大小*/
		FontColor	numeric,				/*字体颜色*/
		MX 		int not null,				/*X字段*/
		MY		int not null, 				/*Y字段*/
		MarkType	int not null,		/*标记类型*/
		grade		varchar(100),
		quadrant		int,
		clockdirection	int,
		position		int,
		directbiopsy	int,
		CONSTRAINT patientactivemark_examineno_fkey FOREIGN KEY(examineno) REFERENCES patientexamine (examineno)  ON UPDATE CASCADE ON DELETE CASCADE
		);
	END IF;

	--(9) Code
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'code';
	IF users_rec.tablename IS NULL THEN
		Create table Code
		(
		id    serial PRIMARY KEY,
		ctype  varchar(60),
		code  varchar(60),
		codename  varchar(200),
		seq	  int
		) ;
	END IF;

	SELECT INTO users_rec * FROM code WHERE code = 'B0010';
	IF users_rec.code IS NULL THEN
			--begin transaction;
			delete from code where ctype ='BigLoop' or ctype ='MiddleLoop' or ctype= 'SmallLoop';
			insert into code(id,ctype,code,codename,seq) values (15,'BigLoop','B0010','2.0*1.5','1');
			insert into code(id,ctype,code,codename,seq) values (16,'BigLoop','B0020','2.0*1.2',2);
			insert into code(id,ctype,code,codename,seq) values (17,'BigLoop','B0030','2.0*0.8',3);
			insert into code(id,ctype,code,codename,seq) values (18,'MiddleLoop','M0010','1.5*1.0',1);
			insert into code(id,ctype,code,codename,seq) values (19,'MiddleLoop','M0020','1.2*0.8',2);
			insert into code(id,ctype,code,codename,seq) values (20,'SmallLoop','S0010','1.0*1.0',1);
			insert into code(id,ctype,code,codename,seq) values (21,'SmallLoop','S0020','0.8*0.7',2);
			insert into code(id,ctype,code,codename,seq) values (22,'Triangle','T0010','2.0*1.5',1);
			insert into code(id,ctype,code,codename,seq) values (23,'Triangle','T0020','2.0*1.0',2);
			insert into code(id,ctype,code,codename,seq) values (24,'Triangle','T0030','1.0*0.8',3);
			--commit transaction;
	END IF;

	-- (10)用户表 UserDoctor
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'userdoctor';
	IF users_rec.tablename IS NULL THEN
		create table UserDoctor
		(
		ID		serial primary key,			/*序号*/
		UserName	varchar(40) not null,			/*用户姓名*/
		--WorkGroup	varchar(20) null,				/*工作组,如系统管理员、主任、医生等*/
		Password	varchar(30),				/*密码*/
		Power           smallint,
		USERTYPE	varchar(30),				/*类型*/
		SignPicture	varchar(255),				/*电子签名图片路径*/
		seq             int
		);
	END IF;

	--(11) 申请医生信息表
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'applydoctor';
	IF users_rec.tablename IS NULL THEN
		create table ApplyDoctor
		(
		No		serial primary key,					/*序号*/
		ApplyDoctorName	 varchar(60) not null			/*申请医生姓名*/
		);
	END IF;

	--(12)	医院信息(HospitalInfo)
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'hospitalinfo';
	IF users_rec.tablename IS NULL THEN
		create table HospitalInfo
		(
		HospitalName	varchar(100) not null,			/*医院名称*/
		HospitalAddress	varchar(100) ,			/*医院地址*/
		HospitalPhone	varchar(30) ,		/*电话*/		
		HospitalPost	varchar(20) ,			/*邮编*/
		HospitalLogo    varchar(255),			/*Logo路径*/
		ReportDesc	varchar(200), 			/*报告单描述*/
		Subname     varchar(100)
		);
	END IF;
	
	--13 检查表bistouryused是否存在，不存在则创建
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'bistouryused';
	IF users_rec.tablename IS NULL THEN
		CREATE TABLE bistouryused
		(
		"no" serial NOT NULL,
		examineno character varying(20) NOT NULL,
		bistouryid character varying(20),
		CONSTRAINT bistouryused_pkey PRIMARY KEY (no),
		CONSTRAINT bistouryused_examineno_fkey FOREIGN KEY(examineno) REFERENCES patientexamine (examineno)  ON UPDATE CASCADE ON DELETE CASCADE
		)
		WITH (OIDS=FALSE);
		ALTER TABLE bistouryused OWNER TO postgres;
	END IF;
	
	--14 检查表operationrecord是否存在，不存在则创建
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'operationrecord';
	IF users_rec.tablename IS NULL THEN
		CREATE TABLE operationrecord
		(
		"no" serial NOT NULL,
		examineno character varying(20) NOT NULL,
		beforediag character varying(1000),	--手术适应症组织病理学
		operationtype character varying(200),
		anaesthsiatype character varying(80),
		length integer,
		width integer,
		deepness integer,
		operationtime integer,
		operationbleeding integer,
		afterdiag character varying(1000),
		operationattention character varying(1000),
		markremark character varying(1000),
		initdate timestamp without time zone DEFAULT now(),
		modifydate timestamp without time zone,
		hsil integer,
		agc integer,
		ais  integer,
		dissatisfied integer,
		cin1 integer,
		cin23 integer,
		hyperplasia integer,
		ring	character varying(100),
		triangle	character varying(100),
		process	character varying(1000),
		visitdate   timestamp without time zone,
		visittime           smallint,		--随访日期上、下午
		visitweek	varchar(200),		--随访周期(月后)
		square	character varying(100),	--方形
		acus	character varying(100),	--针形
		sphericity	character varying(100),	--球形
		fitcytology character varying(1000),	--手术适应症细胞学
		fitother	 character varying(1000),	--手术适应症其他
		mode	 character varying(80),	--手术种类
		anaesother character varying(100),	--麻醉类型其他
		menese	integer DEFAULT -1,			--月经干净天数，默认-1
		melt	character varying(1000),	--消融
		hyperlength	integer DEFAULT -1,		--赘生物长度，默认-1
		hyperwidth	integer DEFAULT -1,		--赘生物宽度，默认-1
		hyperheight	integer DEFAULT -1,		--赘生物高度，默认-1	
		opuploadstate				integer DEFAULT 0,						--上传状态
		CONSTRAINT operationrecord_pkey PRIMARY KEY (no),
		CONSTRAINT operationrecord_examineno_fkey FOREIGN KEY(examineno) REFERENCES patientexamine (examineno)  ON UPDATE CASCADE ON DELETE CASCADE
		)
		WITH (OIDS=FALSE);
		ALTER TABLE operationrecord OWNER TO postgres;
	END IF;

	--15 镜头配置表(1.11版本)
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'cameratype';
	IF users_rec.tablename IS NOT NULL THEN
		DROP TABLE cameratype;	
	END IF;
	Create table cameratype
	(
	id    		serial PRIMARY KEY,
	ctype  		varchar(20),
	Brightness  	int,
	Contrast	int,
	Hue		int,
	Saturation	int,
	Sharpness	int,
	seq	  int,
	CardType		varchar(40)
	) ;

	--begin transaction;
	delete from cameratype;
	insert into cameratype(id,ctype,brightness,contrast,hue,saturation,sharpness,seq,cardtype) values (1,'48P',116,71,1,56,0,1,'PCI');
	insert into cameratype(id,ctype,brightness,contrast,hue,saturation,sharpness,seq,cardtype) values (2,'990P',116,71,1,80,0,2,'PCI');
	insert into cameratype(id,ctype,brightness,contrast,hue,saturation,sharpness,seq,cardtype) values (4,'48P',128,-10,0,-10,0,101,'USB');
	insert into cameratype(id,ctype,brightness,contrast,hue,saturation,sharpness,seq,cardtype) values (5,'990P',114,-1,0,50,0,102,'USB');
	insert into cameratype(id,ctype,brightness,contrast,hue,saturation,sharpness,seq,cardtype) values (6,'1020P',128,0,1,0,0,103,'USB');
	insert into cameratype(id,ctype,brightness,contrast,hue,saturation,sharpness,seq,cardtype) values (7,'1020P',116,71,1,65,0,4,'PCI');
	insert into cameratype(id,ctype,brightness,contrast,hue,saturation,sharpness,seq,cardtype) values (8,'48N',128,-10,0,-10,0,104,'USB');
	insert into cameratype(id,ctype,brightness,contrast,hue,saturation,sharpness,seq,cardtype) values (9,'1020N',128,0,1,0,0,105,'USB');
	--commit transaction;
	
	--16 TCT等术语选择表examtermselect是否存在，不存在则创建
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'examtermselect';
	IF users_rec.tablename IS NULL THEN
		CREATE TABLE examtermselect
		(
		"no" serial NOT NULL,
		examineno character varying(20) NOT NULL,
		termid integer,
		seq      integer,
		CONSTRAINT examtermselect_pkey PRIMARY KEY (no),
		CONSTRAINT examtermselect_examineno_fkey FOREIGN KEY(examineno) REFERENCES patientexamine (examineno)  ON UPDATE CASCADE ON DELETE CASCADE
		)
		WITH (OIDS=FALSE);
		ALTER TABLE examtermselect OWNER TO postgres;
	END IF;

	--17 病人检查流表patientexamflow是否存在，不存在则创建
	SELECT INTO users_rec * FROM pg_tables WHERE tablename = 'patientexamflow';
	IF users_rec.tablename IS NULL THEN
		CREATE TABLE patientexamflow
		(
		"no" serial NOT NULL,
		examineno character varying(20) NOT NULL,
		flowid character varying(500),
  		flowitem character varying(100),
  		seq integer,
		CONSTRAINT patientexamflow_pkey PRIMARY KEY (no),
		CONSTRAINT patientexamflow_examineno_fkey FOREIGN KEY(examineno) REFERENCES patientexamine (examineno)  ON UPDATE CASCADE ON DELETE CASCADE
		)
		WITH (OIDS=FALSE);
		ALTER TABLE patientexamflow OWNER TO postgres;
	END IF;
----修改字段
	--以下为1.1版本所加字段
	--检查表patientexamine是否存在hpv字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='hpv';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN hpv character varying(400);
		ALTER TABLE patientexamine ALTER COLUMN hpv SET STORAGE EXTENDED;
	END IF;
	--检查表patientexamine是否存在biopsy字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='biopsy';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN biopsy character varying(400);
		ALTER TABLE patientexamine ALTER COLUMN biopsy SET STORAGE EXTENDED;
	END IF;
	--检查表patientactivemark是否存在marktype字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientactivemark' and a.attnum >0 and a.attname='marktype';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientactivemark ADD COLUMN marktype integer not null;
		ALTER TABLE patientactivemark ALTER COLUMN marktype SET STORAGE PLAIN;
	END IF;
	--以下1.2版本所加
	--检查表patientexamine是否存在menopause 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='menopause';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN menopause character varying(20);
		ALTER TABLE patientexamine ALTER COLUMN menopause  SET STORAGE EXTENDED;
	END IF;
	--检查表patientexamine是否存在pregnancy 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='pregnancy';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN pregnancy character varying(20);
		ALTER TABLE patientexamine ALTER COLUMN pregnancy SET STORAGE EXTENDED;	
	END IF;
	--检查表patientexamine是否存在pregweek 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='pregweek';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN pregweek integer;
		ALTER TABLE patientexamine ALTER COLUMN pregweek SET STORAGE PLAIN;
	END IF;
	--检查表patientexamine是否存在pregday 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='pregday';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN pregday integer;
		ALTER TABLE patientexamine ALTER COLUMN pregday SET STORAGE PLAIN;
	END IF;

	--1.3版本修改加入的字段在此一次性加入
	--病人信息表patient是否存在idnumber字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patient' and a.attnum >0 and a.attname='idnumber';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patient ADD COLUMN idnumber character varying(20);
		ALTER TABLE patient ALTER COLUMN idnumber SET STORAGE EXTENDED;
	END IF;
		----检查表
	--检查表patientexamine是否存在source 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='source';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN source character varying(100);
		ALTER TABLE patientexamine ALTER COLUMN source SET STORAGE EXTENDED;
	END IF;
	--检查表patientexamine是否存在physicalexam 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='physicalexam';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN physicalexam integer DEFAULT -1;
		ALTER TABLE patientexamine ALTER COLUMN physicalexam SET STORAGE PLAIN;
	END IF;
	--检查表patientexamine是否存在gestationlesion 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='gestationlesion';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN gestationlesion integer DEFAULT -1;
		ALTER TABLE patientexamine ALTER COLUMN gestationlesion SET STORAGE PLAIN;
	END IF;
	--检查表patientexamine是否存在ulceration 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='ulceration';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN  ulceration integer DEFAULT -1;
		ALTER TABLE patientexamine ALTER COLUMN ulceration SET STORAGE PLAIN;
	END IF;
	--检查表patientexamine是否存在exophyticlesion字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='exophyticlesion';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN exophyticlesion integer DEFAULT -1;
		ALTER TABLE patientexamine ALTER COLUMN exophyticlesion SET STORAGE PLAIN;
	END IF;
	--检查表patientexamine是否存在vaginalbleeding 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='vaginalbleeding';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN vaginalbleeding integer DEFAULT -1;
		ALTER TABLE patientexamine ALTER COLUMN vaginalbleeding SET STORAGE PLAIN;
	END IF;
	--检查表patientexamine是否存在referralremark 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='referralremark';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN referralremark character varying(300);
		ALTER TABLE patientexamine ALTER COLUMN referralremark SET STORAGE EXTENDED;
	END IF;
	--检查表patientexamine是否存在rendiagremark 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='rendiagremark';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN rendiagremark character varying(300);
		ALTER TABLE patientexamine ALTER COLUMN rendiagremark SET STORAGE EXTENDED;
	END IF;
	--检查表patientexamine是否存在colexamsat 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='colexamsat';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN colexamsat character varying(100);
		ALTER TABLE patientexamine ALTER COLUMN colexamsat SET STORAGE PLAIN;
	END IF;
	--检查表patientexamine是否存在dissatreason 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='dissatreason';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN dissatreason character varying(200);
		ALTER TABLE patientexamine ALTER COLUMN dissatreason SET STORAGE EXTENDED;
	END IF;
		--检查表patientexamine是否存在scjvisible 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='scjvisible';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN scjvisible character varying(100);
		ALTER TABLE patientexamine ALTER COLUMN scjvisible SET STORAGE EXTENDED;
	END IF;
		--检查表patientexamine是否存在tz 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='tz';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN tz character varying(100);
		ALTER TABLE patientexamine ALTER COLUMN tz SET STORAGE EXTENDED;
	END IF;
		--检查表patientexamine是否存在directbiopsy 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='directbiopsy';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN directbiopsy character varying(20);
		ALTER TABLE patientexamine ALTER COLUMN directbiopsy SET STORAGE EXTENDED;
	END IF;
	--检查表patientexamine是否存在seeremark 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='seeremark';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN seeremark character varying(300);
		ALTER TABLE patientexamine ALTER COLUMN seeremark SET STORAGE EXTENDED;
	END IF;
	--检查表patientexamine是否存在diagremark 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='diagremark';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN diagremark character varying(300);
		ALTER TABLE patientexamine ALTER COLUMN diagremark SET STORAGE EXTENDED;
	END IF;
	--检查表patientexamine是否存在dealremark 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='dealremark';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN dealremark character varying(300);
		ALTER TABLE patientexamine ALTER COLUMN dealremark SET STORAGE EXTENDED;
	END IF;
	--检查表patientexamine是否存在biopsyremark 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='biopsyremark';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN biopsyremark character varying(300);
		ALTER TABLE patientexamine ALTER COLUMN biopsyremark SET STORAGE EXTENDED;
	END IF;
	--检查表patientexamine是否存在softwaretype 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='softwaretype';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN softwaretype integer DEFAULT 0;
		ALTER TABLE patientexamine ALTER COLUMN softwaretype SET STORAGE PLAIN;
	END IF;
	--检查表patientexamine是否存在followupdate 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='followupdate';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN followupdate date;
		ALTER TABLE patientexamine ALTER COLUMN followupdate SET STORAGE PLAIN;
	END IF;
	--检查表patientexamine是否存在menopauseage 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='menopauseage';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN menopauseage integer;
		ALTER TABLE patientexamine ALTER COLUMN menopauseage SET STORAGE PLAIN;
	END IF;
		--检查表patientexamine是否存在eccdate 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='eccdate';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN eccdate date;
		ALTER TABLE patientexamine ALTER COLUMN eccdate SET STORAGE PLAIN;
	END IF;
		--检查表patientexamine是否存在hpvdate 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='hpvdate';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN hpvdate date;
		ALTER TABLE patientexamine ALTER COLUMN hpvdate SET STORAGE PLAIN;
	END IF;
		--检查表patientexamine是否存在pathologydate 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='pathologydate';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN pathologydate date;
		ALTER TABLE patientexamine ALTER COLUMN pathologydate SET STORAGE PLAIN;
	END IF;
		--检查表patientexamine是否存在diagrway 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='diagrway';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN diagrway character varying(300);
		ALTER TABLE patientexamine ALTER COLUMN diagrway SET STORAGE EXTENDED;
	END IF;
		--检查表patientexamine是否存在dealrway 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='dealrway';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN dealrway character varying(300);
		ALTER TABLE patientexamine ALTER COLUMN dealrway SET STORAGE EXTENDED;
	END IF;	
	--检查表patientexamine是否存在followuptime 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='followuptime';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN followuptime smallint;
		ALTER TABLE patientexamine ALTER COLUMN followuptime SET STORAGE PLAIN;
	END IF;
			--检查表patientexamine是否存在followupweek 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='followupweek';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN followupweek character varying(300);
		ALTER TABLE patientexamine ALTER COLUMN followupweek SET STORAGE EXTENDED;
	END IF;
		--检查表patientexamine是否存在uploadstate 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='uploadstate';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN uploadstate integer DEFAULT 0;
		ALTER TABLE patientexamine ALTER COLUMN uploadstate SET STORAGE PLAIN;
	END IF;
		--检查表patientexamine是否存在applyreview 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='applyreview';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN applyreview integer DEFAULT 0;
		ALTER TABLE patientexamine ALTER COLUMN applyreview SET STORAGE PLAIN;
	END IF;
		--检查表patientexamine是否存在serverid 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='serverid';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN serverid integer DEFAULT -1;
		ALTER TABLE patientexamine ALTER COLUMN serverid SET STORAGE PLAIN;
	END IF;
		--检查表patientexamine是否存在imageuploadstate 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='imageuploadstate';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN imageuploadstate integer DEFAULT 0;
		ALTER TABLE patientexamine ALTER COLUMN imageuploadstate SET STORAGE PLAIN;
	END IF;	
			--检查表patientexamine是否存在infouploadstate 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='infouploadstate';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN infouploadstate integer DEFAULT 0;
		ALTER TABLE patientexamine ALTER COLUMN infouploadstate SET STORAGE PLAIN;
	END IF;	
        
	--1.4版本加入
        		--检查表patientexamine是否存在callnumstate 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='callnumstate';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN callnumstate integer DEFAULT 0;
		ALTER TABLE patientexamine ALTER COLUMN callnumstate SET STORAGE PLAIN;
	END IF;	

        		--检查表patientexamine是否存在callnumstate 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='followupstate';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN followupstate integer DEFAULT 0;
		ALTER TABLE patientexamine ALTER COLUMN followupstate SET STORAGE PLAIN;
	END IF;	
        		--检查表patientexamine是否存在swedetotalscore 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='swedetotalscore';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN swedetotalscore integer DEFAULT -1;
		ALTER TABLE patientexamine ALTER COLUMN swedetotalscore SET STORAGE PLAIN;
	END IF;	
        		--检查表patientexamine是否存在aceticacidchange 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='aceticacidchange';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN aceticacidchange integer DEFAULT -1;
		ALTER TABLE patientexamine ALTER COLUMN aceticacidchange SET STORAGE PLAIN;
	END IF;	
        		--检查表patientexamine是否存在border 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='border';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN border integer DEFAULT -1;
		ALTER TABLE patientexamine ALTER COLUMN border SET STORAGE PLAIN;
	END IF;	
        		--检查表patientexamine是否存在vessel 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='vessel';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN vessel integer DEFAULT -1;
		ALTER TABLE patientexamine ALTER COLUMN vessel SET STORAGE PLAIN;
	END IF;	
        		--检查表patientexamine是否存在illnessscop字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='illnessscop';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN illnessscop integer DEFAULT -1;
		ALTER TABLE patientexamine ALTER COLUMN illnessscop SET STORAGE PLAIN;
	END IF;	
        		--检查表patientexamine是否存在iodinedve字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='iodinedve';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN iodinedve integer DEFAULT -1;
		ALTER TABLE patientexamine ALTER COLUMN iodinedve SET STORAGE PLAIN;
	END IF;	
        		--检查表patientexamine是否存在iodinedve字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='lable';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN lable integer;
		ALTER TABLE patientexamine ALTER COLUMN lable SET STORAGE PLAIN;
	END IF;
	--以上1.4版本所加
	--以下为1.43版本所加	
        		--检查表patientexamine是否存在studyuid字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='studyuid';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN studyuid character varying(60);
		ALTER TABLE patientexamine ALTER COLUMN studyuid SET STORAGE EXTENDED;		
	END IF;
        		--检查表patientexamine是否存在seriesuid字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='seriesuid';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN seriesuid character varying(60);
		ALTER TABLE patientexamine ALTER COLUMN seriesuid SET STORAGE EXTENDED;		
	END IF;
        		--检查表patientexamine是否存在vaginasee字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamine' and a.attnum >0 and a.attname='vaginasee';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamine ADD COLUMN vaginasee  character varying(1000);
		ALTER TABLE patientexamine ALTER COLUMN vaginasee SET STORAGE EXTENDED;		
	END IF;
	--以上1.43版本所加
	
	--活检
	--检查表patientactivemark是否存在grade 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientactivemark' and a.attnum >0 and a.attname='grade';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientactivemark ADD COLUMN grade character varying(100);
		ALTER TABLE patientactivemark ALTER COLUMN grade SET STORAGE EXTENDED;
	END IF;
	--检查表patientactivemark是否存在quadrant 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientactivemark' and a.attnum >0 and a.attname='quadrant';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientactivemark ADD COLUMN quadrant integer;
		ALTER TABLE patientactivemark ALTER COLUMN quadrant SET STORAGE PLAIN;
	END IF;
	--检查表patientactivemark是否存在clockdirection 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientactivemark' and a.attnum >0 and a.attname='clockdirection';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientactivemark ADD COLUMN clockdirection integer;
		ALTER TABLE patientactivemark ALTER COLUMN clockdirection SET STORAGE PLAIN;
	END IF;
	--检查表patientactivemark是否存在position 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientactivemark' and a.attnum >0 and a.attname='position';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientactivemark ADD COLUMN position integer;
		ALTER TABLE patientactivemark ALTER COLUMN position SET STORAGE PLAIN;
	END IF;
	--检查表patientactivemark是否存在directbiopsy 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientactivemark' and a.attnum >0 and a.attname='directbiopsy';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientactivemark ADD COLUMN directbiopsy integer;
		ALTER TABLE patientactivemark ALTER COLUMN directbiopsy SET STORAGE PLAIN;		
	END IF;
	--检查表operationrecord是否存在hsil字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='operationrecord' and a.attnum >0 and a.attname='hsil';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE operationrecord ADD COLUMN hsil integer;
		ALTER TABLE operationrecord ALTER COLUMN hsil SET STORAGE PLAIN;
		ALTER TABLE operationrecord ADD COLUMN agc integer;
		ALTER TABLE operationrecord ALTER COLUMN agc SET STORAGE PLAIN;
		ALTER TABLE operationrecord ADD COLUMN ais integer;
		ALTER TABLE operationrecord ALTER COLUMN ais SET STORAGE PLAIN;
		ALTER TABLE operationrecord ADD COLUMN dissatisfied integer;
		ALTER TABLE operationrecord ALTER COLUMN dissatisfied SET STORAGE PLAIN;
		ALTER TABLE operationrecord ADD COLUMN cin1 integer;
		ALTER TABLE operationrecord ALTER COLUMN cin1 SET STORAGE PLAIN;
		ALTER TABLE operationrecord ADD COLUMN cin2 integer;
		ALTER TABLE operationrecord ALTER COLUMN cin2 SET STORAGE PLAIN;
		ALTER TABLE operationrecord ADD COLUMN hyperplasia integer;
		ALTER TABLE operationrecord ALTER COLUMN hyperplasia SET STORAGE PLAIN;
		ALTER TABLE operationrecord ADD COLUMN ring character varying(80);
		ALTER TABLE operationrecord ALTER COLUMN ring SET STORAGE EXTENDED;
		ALTER TABLE operationrecord ADD COLUMN triangle character varying(80);
		ALTER TABLE operationrecord ALTER COLUMN triangle SET STORAGE EXTENDED;
		ALTER TABLE operationrecord ADD COLUMN process character varying(400);
		ALTER TABLE operationrecord ALTER COLUMN process SET STORAGE EXTENDED;
		ALTER TABLE operationrecord ADD COLUMN visitdate timestamp without time zone;
		ALTER TABLE operationrecord ALTER COLUMN visitdate SET STORAGE PLAIN;
	END IF;
	--检查表operationrecord是否存在visitweek字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='operationrecord' and a.attnum >0 and a.attname='visitweek';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE operationrecord ADD COLUMN visittime smallint;
		ALTER TABLE operationrecord ALTER COLUMN visittime SET STORAGE PLAIN;
		ALTER TABLE operationrecord ADD COLUMN visitweek character varying(200);
		ALTER TABLE operationrecord ALTER COLUMN visitweek SET STORAGE EXTENDED;
	END IF;
	--检查表operationrecord是否存在square字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='operationrecord' and a.attnum >0 and a.attname='square';
	IF users_rec.attname IS NULL THEN	
		ALTER TABLE operationrecord ADD COLUMN square character varying(100);
		ALTER TABLE operationrecord ALTER COLUMN square SET STORAGE EXTENDED;
		ALTER TABLE operationrecord ADD COLUMN acus character varying(100);
		ALTER TABLE operationrecord ALTER COLUMN acus SET STORAGE EXTENDED;
		ALTER TABLE operationrecord ADD COLUMN sphericity character varying(100);
		ALTER TABLE operationrecord ALTER COLUMN sphericity SET STORAGE EXTENDED;
		ALTER TABLE operationrecord ADD COLUMN fitcytology  character varying(1000);
		ALTER TABLE operationrecord ALTER COLUMN fitcytology SET STORAGE EXTENDED;
		ALTER TABLE operationrecord ADD COLUMN fitother character varying(1000);
		ALTER TABLE operationrecord ALTER COLUMN fitother SET STORAGE EXTENDED;
		ALTER TABLE operationrecord ADD COLUMN mode character varying(80);
		ALTER TABLE operationrecord ALTER COLUMN mode SET STORAGE EXTENDED;
		ALTER TABLE operationrecord ADD COLUMN anaesother character varying(100);
		ALTER TABLE operationrecord ALTER COLUMN anaesother SET STORAGE EXTENDED;
		ALTER TABLE operationrecord ADD COLUMN menese integer DEFAULT -1;
		ALTER TABLE operationrecord ALTER COLUMN menese SET STORAGE PLAIN;
		ALTER TABLE operationrecord ADD COLUMN melt character varying(1000);
		ALTER TABLE operationrecord ALTER COLUMN melt SET STORAGE EXTENDED;
		ALTER TABLE operationrecord ADD COLUMN hyperlength integer DEFAULT -1;
		ALTER TABLE operationrecord ALTER COLUMN hyperlength SET STORAGE PLAIN;
		ALTER TABLE operationrecord ADD COLUMN hyperwidth integer DEFAULT -1;
		ALTER TABLE operationrecord ALTER COLUMN hyperwidth SET STORAGE PLAIN;
		ALTER TABLE operationrecord ADD COLUMN hyperheight integer DEFAULT -1;
		ALTER TABLE operationrecord ALTER COLUMN hyperheight SET STORAGE PLAIN;
	END IF;
	--检查表operationrecord是否存在opuploadstate 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='operationrecord' and a.attnum >0 and a.attname='opuploadstate';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE operationrecord ADD COLUMN opuploadstate integer DEFAULT 0;
		ALTER TABLE operationrecord ALTER COLUMN opuploadstate SET STORAGE PLAIN;
	END IF;
	--术语表Term是否存在factory 字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='term' and a.attnum >0 and a.attname='factory';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE term ADD COLUMN factory integer DEFAULT 0;
		ALTER TABLE term ALTER COLUMN factory SET STORAGE PLAIN;		
	END IF;
	--图像表patientexamineimage是否存在opsprint字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patientexamineimage' and a.attnum >0 and a.attname='opsprint';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patientexamineimage ADD COLUMN opsprint integer ;
		ALTER TABLE patientexamineimage ALTER COLUMN opsprint SET STORAGE PLAIN;		
	END IF;
	--图像表HospitalInfo是否存在subname字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='hospitalinfo' and a.attnum >0 and a.attname='subname';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE hospitalinfo ADD COLUMN subname character varying(100) ;
		ALTER TABLE hospitalinfo ALTER COLUMN subname SET STORAGE EXTENDED;	
	END IF;
	--lastname
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='patient' and a.attnum >0 and a.attname='lastname';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE patient ADD COLUMN lastname character varying(40) ;
		ALTER TABLE patient ALTER COLUMN lastname SET STORAGE EXTENDED;
		ALTER TABLE patient ALTER COLUMN patientname DROP NOT NULL;
	END IF;

	--参考图谱表是否存在groupname字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='referenceimage' and a.attnum >0 and a.attname='groupnum';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE referenceimage ADD COLUMN groupnum integer DEFAULT 0;
		ALTER TABLE referenceimage ALTER COLUMN groupnum SET STORAGE PLAIN;		
	END IF;
	
	--参考图谱表是否存在groupseq字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='referenceimage' and a.attnum >0 and a.attname='groupseq';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE referenceimage ADD COLUMN groupseq integer DEFAULT 0;
		ALTER TABLE referenceimage ALTER COLUMN groupseq SET STORAGE PLAIN;		
	END IF;

	--镜头型号参数表是否存在cardtype字段，不存在则创建
	SELECT INTO users_rec a.* from  pg_class c JOIN pg_attribute a ON c.oid = a.attrelid where c.relname='cameratype' and a.attnum >0 and a.attname='cardtype';
	IF users_rec.attname IS NULL THEN
		ALTER TABLE cameratype ADD COLUMN cardtype character varying(40);
		ALTER TABLE cameratype ALTER COLUMN cardtype SET STORAGE EXTENDED;		
	END IF;

	--修改术语名称的字段长度
	ALTER TABLE term ALTER "name" TYPE character varying(1000);
	--修改检查表中术语字段长度
	ALTER TABLE patientexamine ALTER "tell" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "ecc" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "pathology" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "see" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "deal" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "attention" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "plandiagnoseresult" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "hpv" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "biopsy" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "referralremark" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "rendiagremark" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "seeremark" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "diagremark" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "dealremark" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "biopsyremark" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "diagrway" TYPE character varying(1000);
	ALTER TABLE patientexamine ALTER "dealrway" TYPE character varying(1000);
	--修改手术记录中术语字段长度
	ALTER TABLE term ALTER "name" TYPE character varying(1000);
	--修改手术记录表中术语字段长度
	ALTER TABLE operationrecord ALTER "beforediag" TYPE character varying(1000);
	ALTER TABLE operationrecord ALTER "afterdiag" TYPE character varying(1000);
	ALTER TABLE operationrecord ALTER "operationattention" TYPE character varying(1000);
	ALTER TABLE operationrecord ALTER "markremark" TYPE character varying(1000);
	ALTER TABLE operationrecord ALTER "process" TYPE character varying(1000);
	ALTER TABLE operationrecord ALTER "operationtype" TYPE character varying(200);
	
--19 视图
	CREATE OR REPLACE VIEW patientview AS 
	SELECT a.patientno, a.patientname AS firstname, a.lastname, trim(coalesce(a.patientname,'') || ' ' ||coalesce(a.lastname,''),' ') AS patientname,
	a.brithday, a.telephone, a.address,a.patientownno,a.idnumber, b.initdate,
	b.examineno, b.age, b.pregnanttime, b.brithtime, b.abortedtime, b.marriage, b.hcg, b.lastmenses, 
	b.conceptiontype,b.socialdisease,b.remark, b.evaluatescore, b.plandiagnoseresult,b.tell,b.ecc,
	b.pathology,b.see,b.deal,b.attention,b.color,b.verge,b.bloodvessel,b.iodin,
	b.imageflag,b.imagepath,b.examineseq, b.requestdoctor,b.examinedoctor, b.examinetime,
	b.modifydate,b.state,b.hpv,b.biopsy,b.menopause,b.pregnancy,b.pregweek,b.pregday,b.source,b.physicalexam,
	b.gestationlesion,b.ulceration,b.exophyticlesion,b.vaginalbleeding,b.referralremark,b.rendiagremark,
	b.colexamsat,b.dissatreason,b.scjvisible,b.tz,b.directbiopsy,b.seeremark,b.diagremark,b.dealremark,b.biopsyremark,b.softwaretype,b.followupdate,
	b.menopauseage,b.eccdate,b.hpvdate,b.pathologydate,b.diagrway,b.dealrway,b.followuptime,b.followupweek,b.uploadstate,b.applyreview,b.serverid,b.imageuploadstate,
        	b.infouploadstate,b.callnumstate,b.followupstate,b.swedetotalscore,b.aceticacidchange,b.border,b.vessel,b.illnessscop,b.iodinedve ,b.lable,c.visitdate,c.visitweek, c.beforediag, 
	c.afterdiag, c.operationattention , b.studyuid, b.seriesuid,b.vaginasee
	FROM patient a
	LEFT JOIN patientexamine b ON a.patientno::text = b.patientno::text
	LEFT JOIN operationrecord c ON b.examineno::text = c.examineno::text;
	
 ----检查索引，创建索引
	--检查表patientexamine检查时间索引
	SELECT INTO users_rec * from  pg_stat_all_indexes where relname='patientexamine' and indexrelname='ix_examinetime';
	IF users_rec.indexrelname IS NULL THEN
		CREATE INDEX ix_examinetime
		ON patientexamine
		USING btree
		(examinetime DESC);
	END IF;
	
 ----检查触发器，创建触发器
	--删除检查记录之后，删除检查图片等表中内容.没有建外键则建触发器来删除这些数据，有外键，外键级联自动删除
	SELECT INTO users_rec * from  pg_constraint where conname='patientexamineimage_examineno_fkey';
	IF users_rec.conname IS NULL THEN
		SELECT INTO users_rec * from  pg_trigger where tgname='maint_operationrecord';
		IF users_rec.tgname IS NULL THEN
			DROP FUNCTION IF EXISTS process_patientexamine() cascade;
			CREATE OR REPLACE FUNCTION process_patientexamine() RETURNS TRIGGER AS $maint_operationrecord$
				BEGIN
				--
				IF (TG_OP = 'DELETE') THEN
					delete from patientactivemark where examineno = OLD.examineno;
					delete from patientexamineimage where examineno = OLD.examineno;
					RETURN OLD;
				END IF;
				RETURN NULL; -- 忽略结果，因为它是个 AFTER 触发器
				END;
			$maint_operationrecord$ language plpgsql;

			CREATE TRIGGER maint_operationrecord
			AFTER  DELETE ON patientexamine
			FOR EACH ROW EXECUTE PROCEDURE process_patientexamine();
		END IF;
	END IF;
	--判断图谱资料是否存在，没有存在，则插入到表中1.3版本图谱
	SELECT INTO users_rec * FROM ReferenceImage WHERE termid= 91101 or termid=99105;
	IF users_rec.RefImagePath IS NULL THEN
		--(4)	图谱表(ReferenceImage)
		--begin transaction;
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91101,E'ImageMap\\91101\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91101,E'ImageMap\\91101\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91101,E'ImageMap\\91101\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91101,E'ImageMap\\91101\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91101,E'ImageMap\\91101\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91101,E'ImageMap\\91101\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91101,E'ImageMap\\91101\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91101,E'ImageMap\\91101\\F3_3.jpg',3,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91101,E'ImageMap\\91101\\F3_4.jpg',4,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91101,E'ImageMap\\91101\\F3_5.jpg',5,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91102,E'ImageMap\\91102\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91102,E'ImageMap\\91102\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91102,E'ImageMap\\91102\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91102,E'ImageMap\\91102\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91102,E'ImageMap\\91102\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91102,E'ImageMap\\91102\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91103,E'ImageMap\\91103\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91103,E'ImageMap\\91103\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91103,E'ImageMap\\91103\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91103,E'ImageMap\\91103\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91103,E'ImageMap\\91103\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91103,E'ImageMap\\91103\\F2_4.jpg',4,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91103,E'ImageMap\\91103\\F2_5.jpg',5,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91103,E'ImageMap\\91103\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91103,E'ImageMap\\91103\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91104,E'ImageMap\\91104\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91104,E'ImageMap\\91104\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91104,E'ImageMap\\91104\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91104,E'ImageMap\\91104\\F1_4.jpg',4,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91105,E'ImageMap\\91105\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91105,E'ImageMap\\91105\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91105,E'ImageMap\\91105\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91105,E'ImageMap\\91105\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91105,E'ImageMap\\91105\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91105,E'ImageMap\\91105\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91105,E'ImageMap\\91105\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91105,E'ImageMap\\91105\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91105,E'ImageMap\\91105\\F5_1.jpg',1,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91105,E'ImageMap\\91105\\F5_2.jpg',2,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91106,E'ImageMap\\91106\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91106,E'ImageMap\\91106\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91106,E'ImageMap\\91106\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91106,E'ImageMap\\91106\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91106,E'ImageMap\\91106\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91106,E'ImageMap\\91106\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91106,E'ImageMap\\91106\\F4_3.jpg',3,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91106,E'ImageMap\\91106\\F4_4.jpg',4,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91107,E'ImageMap\\91107\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91107,E'ImageMap\\91107\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91107,E'ImageMap\\91107\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91107,E'ImageMap\\91107\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91107,E'ImageMap\\91107\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91107,E'ImageMap\\91107\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91107,E'ImageMap\\91107\\F5_1.jpg',1,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91108,E'ImageMap\\91108\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91401,E'ImageMap\\91401\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91401,E'ImageMap\\91401\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91401,E'ImageMap\\91401\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F5_1.jpg',1,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F5_2.jpg',2,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F5_3.jpg',3,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F6_1.jpg',1,6,6);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F6_2.jpg',2,6,6);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F7_1.jpg',1,7,7);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F7_2.jpg',2,7,7);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F8_1.jpg',1,8,8);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91402,E'ImageMap\\91402\\F8_2.jpg',2,8,8);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91403,E'ImageMap\\91403\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91403,E'ImageMap\\91403\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91403,E'ImageMap\\91403\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91403,E'ImageMap\\91403\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91403,E'ImageMap\\91403\\F3_3.jpg',3,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91403,E'ImageMap\\91403\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91403,E'ImageMap\\91403\\F5_1.jpg',1,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91403,E'ImageMap\\91403\\F5_2.jpg',2,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91403,E'ImageMap\\91403\\F5_3.jpg',3,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91403,E'ImageMap\\91403\\F6_1.jpg',1,6,6);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91403,E'ImageMap\\91403\\F7_1.jpg',1,7,7);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91404,E'ImageMap\\91404\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91404,E'ImageMap\\91404\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91404,E'ImageMap\\91404\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91404,E'ImageMap\\91404\\F1_4.jpg',4,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91404,E'ImageMap\\91404\\F1_5.jpg',5,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91405,E'ImageMap\\91405\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91405,E'ImageMap\\91405\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91405,E'ImageMap\\91405\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91405,E'ImageMap\\91405\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91405,E'ImageMap\\91405\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91405,E'ImageMap\\91405\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91406,E'ImageMap\\91406\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91406,E'ImageMap\\91406\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91406,E'ImageMap\\91406\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91406,E'ImageMap\\91406\\F1_4.jpg',4,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91406,E'ImageMap\\91406\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91407,E'ImageMap\\91407\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91407,E'ImageMap\\91407\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91407,E'ImageMap\\91407\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91407,E'ImageMap\\91407\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91407,E'ImageMap\\91407\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91407,E'ImageMap\\91407\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91407,E'ImageMap\\91407\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91408,E'ImageMap\\91408\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91408,E'ImageMap\\91408\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91408,E'ImageMap\\91408\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91408,E'ImageMap\\91408\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91408,E'ImageMap\\91408\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91409,E'ImageMap\\91409\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91409,E'ImageMap\\91409\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91409,E'ImageMap\\91409\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91409,E'ImageMap\\91409\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91409,E'ImageMap\\91409\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91409,E'ImageMap\\91409\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91409,E'ImageMap\\91409\\F2_4.jpg',4,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91410,E'ImageMap\\91410\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91410,E'ImageMap\\91410\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91410,E'ImageMap\\91410\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91410,E'ImageMap\\91410\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91411,E'ImageMap\\91411\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91411,E'ImageMap\\91411\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91411,E'ImageMap\\91411\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91411,E'ImageMap\\91411\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91411,E'ImageMap\\91411\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91411,E'ImageMap\\91411\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91411,E'ImageMap\\91411\\F2_4.jpg',4,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91411,E'ImageMap\\91411\\F2_5.jpg',5,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91411,E'ImageMap\\91411\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91411,E'ImageMap\\91411\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91411,E'ImageMap\\91411\\F3_3.jpg',3,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91411,E'ImageMap\\91411\\F3_4.jpg',4,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91411,E'ImageMap\\91411\\F3_5.jpg',5,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91411,E'ImageMap\\91411\\F3_6.jpg',6,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91412,E'ImageMap\\91412\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91412,E'ImageMap\\91412\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91412,E'ImageMap\\91412\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91412,E'ImageMap\\91412\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91412,E'ImageMap\\91412\\F2_4.jpg',4,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91701,E'ImageMap\\91701\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91701,E'ImageMap\\91701\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91701,E'ImageMap\\91701\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91701,E'ImageMap\\91701\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91701,E'ImageMap\\91701\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91701,E'ImageMap\\91701\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91701,E'ImageMap\\91701\\F2_4.jpg',4,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91701,E'ImageMap\\91701\\F2_5.jpg',5,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91701,E'ImageMap\\91701\\F2_6.jpg',6,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91701,E'ImageMap\\91701\\F2_7.jpg',7,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91702,E'ImageMap\\91702\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91702,E'ImageMap\\91702\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91702,E'ImageMap\\91702\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91702,E'ImageMap\\91702\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91702,E'ImageMap\\91702\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91702,E'ImageMap\\91702\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91702,E'ImageMap\\91702\\F2_4.jpg',4,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91702,E'ImageMap\\91702\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91702,E'ImageMap\\91702\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91702,E'ImageMap\\91702\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91702,E'ImageMap\\91702\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91702,E'ImageMap\\91702\\F4_3.jpg',3,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91702,E'ImageMap\\91702\\F4_4.jpg',4,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91703,E'ImageMap\\91703\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91703,E'ImageMap\\91703\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91703,E'ImageMap\\91703\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91703,E'ImageMap\\91703\\F1_4.jpg',4,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91703,E'ImageMap\\91703\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91703,E'ImageMap\\91703\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91703,E'ImageMap\\91703\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91703,E'ImageMap\\91703\\F2_4.jpg',4,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91704,E'ImageMap\\91704\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91704,E'ImageMap\\91704\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91704,E'ImageMap\\91704\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91704,E'ImageMap\\91704\\F1_4.jpg',4,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91705,E'ImageMap\\91705\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91705,E'ImageMap\\91705\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91705,E'ImageMap\\91705\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91706,E'ImageMap\\91706\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91706,E'ImageMap\\91706\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91706,E'ImageMap\\91706\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91706,E'ImageMap\\91706\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91706,E'ImageMap\\91706\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91706,E'ImageMap\\91706\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91707,E'ImageMap\\91707\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91707,E'ImageMap\\91707\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (91707,E'ImageMap\\91707\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92102,E'ImageMap\\92102\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92102,E'ImageMap\\92102\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92102,E'ImageMap\\92102\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92102,E'ImageMap\\92102\\F1_4.jpg',4,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92102,E'ImageMap\\92102\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92102,E'ImageMap\\92102\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92102,E'ImageMap\\92102\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92102,E'ImageMap\\92102\\F2_4.jpg',4,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92103,E'ImageMap\\92103\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92103,E'ImageMap\\92103\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92103,E'ImageMap\\92103\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92103,E'ImageMap\\92103\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92103,E'ImageMap\\92103\\F5_1.jpg',1,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92104,E'ImageMap\\92104\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92104,E'ImageMap\\92104\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92104,E'ImageMap\\92104\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92104,E'ImageMap\\92104\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92104,E'ImageMap\\92104\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92106,E'ImageMap\\92106\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92106,E'ImageMap\\92106\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92106,E'ImageMap\\92106\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92106,E'ImageMap\\92106\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92106,E'ImageMap\\92106\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92106,E'ImageMap\\92106\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92106,E'ImageMap\\92106\\F3_3.jpg',3,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92106,E'ImageMap\\92106\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92106,E'ImageMap\\92106\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92106,E'ImageMap\\92106\\F4_3.jpg',3,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92106,E'ImageMap\\92106\\F4_4.jpg',4,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92106,E'ImageMap\\92106\\F5_1.jpg',1,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92107,E'ImageMap\\92107\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92107,E'ImageMap\\92107\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92107,E'ImageMap\\92107\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92107,E'ImageMap\\92107\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92107,E'ImageMap\\92107\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92107,E'ImageMap\\92107\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92107,E'ImageMap\\92107\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92107,E'ImageMap\\92107\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92107,E'ImageMap\\92107\\F3_3.jpg',3,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92107,E'ImageMap\\92107\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92107,E'ImageMap\\92107\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92108,E'ImageMap\\92108\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92109,E'ImageMap\\92109\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92109,E'ImageMap\\92109\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92109,E'ImageMap\\92109\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92109,E'ImageMap\\92109\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92110,E'ImageMap\\92110\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92110,E'ImageMap\\92110\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92110,E'ImageMap\\92110\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92112,E'ImageMap\\92112\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92112,E'ImageMap\\92112\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92112,E'ImageMap\\92112\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92112,E'ImageMap\\92112\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92112,E'ImageMap\\92112\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92401,E'ImageMap\\92401\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92401,E'ImageMap\\92401\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92401,E'ImageMap\\92401\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92401,E'ImageMap\\92401\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92401,E'ImageMap\\92401\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92401,E'ImageMap\\92401\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92401,E'ImageMap\\92401\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92401,E'ImageMap\\92401\\F3_3.jpg',3,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92402,E'ImageMap\\92402\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92402,E'ImageMap\\92402\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92403,E'ImageMap\\92403\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92404,E'ImageMap\\92404\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92404,E'ImageMap\\92404\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92404,E'ImageMap\\92404\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92404,E'ImageMap\\92404\\F1_4.jpg',4,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92404,E'ImageMap\\92404\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92404,E'ImageMap\\92404\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92404,E'ImageMap\\92404\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92404,E'ImageMap\\92404\\F2_4.jpg',4,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92404,E'ImageMap\\92404\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92404,E'ImageMap\\92404\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92404,E'ImageMap\\92404\\F3_3.jpg',3,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92404,E'ImageMap\\92404\\F3_4.jpg',4,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F1_4.jpg',4,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F2_4.jpg',4,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F3_3.jpg',3,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F3_4.jpg',4,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F4_3.jpg',3,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92407,E'ImageMap\\92407\\F4_4.jpg',4,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92409,E'ImageMap\\92409\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92409,E'ImageMap\\92409\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F3_3.jpg',3,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F5_1.jpg',1,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F5_2.jpg',2,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F5_3.jpg',3,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F6_1.jpg',1,6,6);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92410,E'ImageMap\\92410\\F6_2.jpg',2,6,6);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92412,E'ImageMap\\92412\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92412,E'ImageMap\\92412\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92412,E'ImageMap\\92412\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92412,E'ImageMap\\92412\\F1_4.jpg',4,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92412,E'ImageMap\\92412\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92412,E'ImageMap\\92412\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92412,E'ImageMap\\92412\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92412,E'ImageMap\\92412\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92412,E'ImageMap\\92412\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92412,E'ImageMap\\92412\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92412,E'ImageMap\\92412\\F5_1.jpg',1,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92412,E'ImageMap\\92412\\F5_2.jpg',2,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92413,E'ImageMap\\92413\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92413,E'ImageMap\\92413\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92413,E'ImageMap\\92413\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92413,E'ImageMap\\92413\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92413,E'ImageMap\\92413\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92414,E'ImageMap\\92414\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92414,E'ImageMap\\92414\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92414,E'ImageMap\\92414\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92414,E'ImageMap\\92414\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92414,E'ImageMap\\92414\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92414,E'ImageMap\\92414\\F5_1.jpg',1,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92415,E'ImageMap\\92415\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92415,E'ImageMap\\92415\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92415,E'ImageMap\\92415\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92416,E'ImageMap\\92416\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92416,E'ImageMap\\92416\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92416,E'ImageMap\\92416\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92416,E'ImageMap\\92416\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92416,E'ImageMap\\92416\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92416,E'ImageMap\\92416\\F5_1.jpg',1,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92416,E'ImageMap\\92416\\F6_1.jpg',1,6,6);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92416,E'ImageMap\\92416\\F7_1.jpg',1,7,7);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92416,E'ImageMap\\92416\\F8_1.jpg',1,8,8);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92416,E'ImageMap\\92416\\F9_1.jpg',1,9,9);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92418,E'ImageMap\\92418\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92418,E'ImageMap\\92418\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92418,E'ImageMap\\92418\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92418,E'ImageMap\\92418\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92418,E'ImageMap\\92418\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92418,E'ImageMap\\92418\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92418,E'ImageMap\\92418\\F3_3.jpg',3,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92418,E'ImageMap\\92418\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92418,E'ImageMap\\92418\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92418,E'ImageMap\\92418\\F4_3.jpg',3,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92418,E'ImageMap\\92418\\F4_4.jpg',4,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92418,E'ImageMap\\92418\\F5_1.jpg',1,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92421,E'ImageMap\\92421\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92421,E'ImageMap\\92421\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92421,E'ImageMap\\92421\\F1_3.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92421,E'ImageMap\\92421\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92421,E'ImageMap\\92421\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92421,E'ImageMap\\92421\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92421,E'ImageMap\\92421\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92421,E'ImageMap\\92421\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92421,E'ImageMap\\92421\\F3_3.jpg',3,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92421,E'ImageMap\\92421\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92421,E'ImageMap\\92421\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92421,E'ImageMap\\92421\\F5_1.jpg',1,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92423,E'ImageMap\\92423\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92424,E'ImageMap\\92424\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92424,E'ImageMap\\92424\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92424,E'ImageMap\\92424\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92424,E'ImageMap\\92424\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92425,E'ImageMap\\92425\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92425,E'ImageMap\\92425\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92425,E'ImageMap\\92425\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92429,E'ImageMap\\92429\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92429,E'ImageMap\\92429\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92429,E'ImageMap\\92429\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92429,E'ImageMap\\92429\\F1_4.jpg',4,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92429,E'ImageMap\\92429\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92429,E'ImageMap\\92429\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92429,E'ImageMap\\92429\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92429,E'ImageMap\\92429\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92429,E'ImageMap\\92429\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92429,E'ImageMap\\92429\\F5_1.jpg',1,5,5);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (92434,E'ImageMap\\92434\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97101,E'ImageMap\\97101\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97101,E'ImageMap\\97101\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97101,E'ImageMap\\97101\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97101,E'ImageMap\\97101\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97101,E'ImageMap\\97101\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97101,E'ImageMap\\97101\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97101,E'ImageMap\\97101\\F2_4.jpg',4,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97101,E'ImageMap\\97101\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97101,E'ImageMap\\97101\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97101,E'ImageMap\\97101\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97101,E'ImageMap\\97101\\F4_2.jpg',2,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97101,E'ImageMap\\97101\\F4_3.jpg',3,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97101,E'ImageMap\\97101\\F4_4.jpg',4,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97102,E'ImageMap\\97102\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97102,E'ImageMap\\97102\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97102,E'ImageMap\\97102\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97102,E'ImageMap\\97102\\F1_4.jpg',4,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97102,E'ImageMap\\97102\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97102,E'ImageMap\\97102\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97102,E'ImageMap\\97102\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97102,E'ImageMap\\97102\\F2_4.jpg',4,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97103,E'ImageMap\\97103\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97103,E'ImageMap\\97103\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97103,E'ImageMap\\97103\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97103,E'ImageMap\\97103\\F1_4.jpg',4,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97104,E'ImageMap\\97104\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97104,E'ImageMap\\97104\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97104,E'ImageMap\\97104\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97105,E'ImageMap\\97105\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97105,E'ImageMap\\97105\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97105,E'ImageMap\\97105\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97105,E'ImageMap\\97105\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97105,E'ImageMap\\97105\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97105,E'ImageMap\\97105\\F2_3.jpg',3,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97106,E'ImageMap\\97106\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97106,E'ImageMap\\97106\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97106,E'ImageMap\\97106\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98101,E'ImageMap\\98101\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98101,E'ImageMap\\98101\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98102,E'ImageMap\\98102\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98103,E'ImageMap\\98103\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98103,E'ImageMap\\98103\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98103,E'ImageMap\\98103\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98105,E'ImageMap\\98105\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98105,E'ImageMap\\98105\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98106,E'ImageMap\\98106\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98106,E'ImageMap\\98106\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98106,E'ImageMap\\98106\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98106,E'ImageMap\\98106\\F4_1.jpg',1,4,4);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98107,E'ImageMap\\98107\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98107,E'ImageMap\\98107\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98401,E'ImageMap\\98401\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98401,E'ImageMap\\98401\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98402,E'ImageMap\\98402\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98402,E'ImageMap\\98402\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98402,E'ImageMap\\98402\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98403,E'ImageMap\\98403\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98403,E'ImageMap\\98403\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98403,E'ImageMap\\98403\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98404,E'ImageMap\\98404\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98404,E'ImageMap\\98404\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98404,E'ImageMap\\98404\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98406,E'ImageMap\\98406\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98407,E'ImageMap\\98407\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98407,E'ImageMap\\98407\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98408,E'ImageMap\\98408\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98701,E'ImageMap\\98701\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98701,E'ImageMap\\98701\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98701,E'ImageMap\\98701\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98702,E'ImageMap\\98702\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98702,E'ImageMap\\98702\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98702,E'ImageMap\\98702\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98702,E'ImageMap\\98702\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98704,E'ImageMap\\98704\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98704,E'ImageMap\\98704\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98705,E'ImageMap\\98705\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98705,E'ImageMap\\98705\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98705,E'ImageMap\\98705\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98705,E'ImageMap\\98705\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98706,E'ImageMap\\98706\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98706,E'ImageMap\\98706\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98706,E'ImageMap\\98706\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98706,E'ImageMap\\98706\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98706,E'ImageMap\\98706\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (98706,E'ImageMap\\98706\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99101,E'ImageMap\\99101\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99101,E'ImageMap\\99101\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99101,E'ImageMap\\99101\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99101,E'ImageMap\\99101\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99101,E'ImageMap\\99101\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99102,E'ImageMap\\99102\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99102,E'ImageMap\\99102\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99102,E'ImageMap\\99102\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99102,E'ImageMap\\99102\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99102,E'ImageMap\\99102\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99102,E'ImageMap\\99102\\F3_2.jpg',2,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99104,E'ImageMap\\99104\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99104,E'ImageMap\\99104\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99105,E'ImageMap\\99105\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99105,E'ImageMap\\99105\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99105,E'ImageMap\\99105\\F2_1.jpg',1,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99105,E'ImageMap\\99105\\F2_2.jpg',2,2,2);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99105,E'ImageMap\\99105\\F3_1.jpg',1,3,3);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (99105,E'ImageMap\\99105\\F3_2.jpg',2,3,3);
		--commit transaction;
	END IF;
	--判断图谱资料是否存在，没有存在，则插入到表中1.4版本图谱
	SELECT INTO users_rec * FROM ReferenceImage WHERE termid= 97201 or termid=97203;
	IF users_rec.RefImagePath IS NULL THEN
		--begin transaction;
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97201,E'ImageMap\\97201\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97201,E'ImageMap\\97201\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97201,E'ImageMap\\97201\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97202,E'ImageMap\\97202\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97202,E'ImageMap\\97202\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97203,E'ImageMap\\97203\\F1_1.jpg',1,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97203,E'ImageMap\\97203\\F1_2.jpg',2,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97203,E'ImageMap\\97203\\F1_3.jpg',3,1,1);
		insert into ReferenceImage(TermID,RefImagePath,Seq,groupnum,groupseq) values (97204,E'ImageMap\\97204\\F1_1.jpg',1,1,1);
		--commit transaction;
	END IF;
	--删除图谱中重复的记录
	delete from ReferenceImage a  where a.no <> (select min(b.no) from ReferenceImage b where a.termid = b.termid and a.RefImagePath=b.RefImagePath);
    --RETURN 1;
END;
$$ LANGUAGE plpgsql;

select CreateTable();