CREATE TABLE `lab_orgbase` (
  `id` BIGINT NOT NULL AUTO_INCREMENT,
  `name` VARCHAR (100) NOT NULL COMMENT '全称',
  `shortname` VARCHAR (50) NOT NULL COMMENT '简称',
  `areacode` BIGINT NOT NULL COMMENT '所在地区,CATM,ciy_arearpc',
  `addr` VARCHAR (100) NOT NULL COMMENT '地址',
  `lat` DOUBLE NOT NULL COMMENT '',
  `lng` DOUBLE NOT NULL COMMENT '地理位置,LOC,lat',
  `signname` VARCHAR (50) NOT NULL COMMENT '签约人',
  `contact` VARCHAR (50) NOT NULL COMMENT '联系方式',
  `email` VARCHAR (50) NOT NULL COMMENT '邮箱',
  `addtimes` BIGINT NOT NULL COMMENT '开通日,DATE,Y-m-d', -- 新增“开通日期”字段
  `exptimes` BIGINT NOT NULL COMMENT '到期日,DATE,Y-m-d',
  PRIMARY KEY (`id`)
) COMMENT = '科研机构';

CREATE TABLE `lab_user` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`name` VARCHAR (50) NOT NULL COMMENT '姓名',
`usertitle` INT NOT NULL COMMENT '头衔,CATA,usertitle',
`sn` VARCHAR (50) NOT NULL COMMENT '编号',
`sex` INT NOT NULL COMMENT '性别,CATA,sex',
`addtimes` BIGINT NOT NULL COMMENT '加入日期,DATE,Y-m-d',
`mobile` VARCHAR (50) NOT NULL COMMENT '手机号,MSK,****',
`email` VARCHAR (100) NOT NULL COMMENT '信箱',
`password` VARCHAR (100) NOT NULL COMMENT ',密码',
`stpstatus` INT NOT NULL COMMENT '|状态|,CATA,stpstatus',
`userlevel` INT NOT NULL COMMENT '|等级|,CATA,userlevel',
`totalpnt` BIGINT NOT NULL COMMENT '总积分|,INT',
`dvotecnt` BIGINT NOT NULL COMMENT '互动贡献|,INT,次',
PRIMARY KEY (
`id`
)) COMMENT = '实验室成员';

CREATE TABLE `lab_usronline` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`vuser` BIGINT NOT NULL COMMENT '所属成员,CATU,labuser',
`targettype` INT NOT NULL COMMENT '登录来源',
`sid` VARCHAR (50) NOT NULL COMMENT 'SID',
`logintimes` BIGINT NOT NULL COMMENT '登录时间,DATE',
`exptimes` BIGINT NOT NULL COMMENT '过期时间,DATE',
`ip` VARCHAR (50) NOT NULL COMMENT 'IP',
PRIMARY KEY (
`id`
)) COMMENT = '成员在线';

CREATE TABLE `lab_rproject` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`isweb` INT NOT NULL COMMENT '是否公开,BOOL',
`rcate` INT NOT NULL COMMENT '科研类目,CATA,rcate',
`name` VARCHAR (180) NOT NULL COMMENT '标题',
`descs` VARCHAR (180) NOT NULL COMMENT '摘要,BR',
`mdeptname` VARCHAR (100) NOT NULL COMMENT '主管部门',
`mdeptlevel` VARCHAR (50) NOT NULL COMMENT '层次',
`budgetmoney` BIGINT NOT NULL COMMENT '预算|,CNY',
`serviceorg` VARCHAR (100) NOT NULL COMMENT '服务机构',
`rprojectstatus` INT NOT NULL COMMENT '|状态|,CATA,rprojectstatus',
`vuser` BIGINT NOT NULL COMMENT '负责人,CATU,labuser',
`progress` INT NOT NULL COMMENT '|进度|,PCT',
`lasttimes` BIGINT NOT NULL COMMENT '最新进展,DATE,Y-m-d',
`numachive` VARCHAR (100) NOT NULL COMMENT '编号成果',
PRIMARY KEY (
`id`
)) COMMENT = '在研课题';

CREATE TABLE `lab_rprojmember` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`rprojectid` BIGINT NOT NULL COMMENT '所属课题,DB,lab_rproject',
`vuser` BIGINT NOT NULL COMMENT '所属成员,CATU,labuser',
`mainduty` VARCHAR (180) NOT NULL COMMENT '主要职责',
`addtimes` BIGINT NOT NULL COMMENT '参与日期,DATE,Y-m-d',
PRIMARY KEY (
`id`
)) COMMENT = '课题成员';

CREATE TABLE `lab_rprojprogress` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`rprojectid` BIGINT NOT NULL COMMENT '所属课题,DB,lab_rproject',
`vuser` BIGINT NOT NULL COMMENT '所属成员,CATU,labuser',
`content` TEXT NOT NULL COMMENT ',进展内容,MD',
`addtimes` BIGINT NOT NULL COMMENT '进展日期,DATE',
`rppfiles` VARCHAR (180) NOT NULL COMMENT '进展附件,DOWN',
PRIMARY KEY (
`id`
)) COMMENT = '课题进展';

CREATE TABLE `lab_achievement` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`rcate` INT NOT NULL COMMENT '科研类目,CATA,rcate',
`name` VARCHAR (100) NOT NULL COMMENT '名称',
`numachive` VARCHAR (100) NOT NULL COMMENT '编号成果',
`descs` VARCHAR (180) NOT NULL COMMENT '摘要,BR',
`amurl` VARCHAR (180) NOT NULL COMMENT '链接,DOWN',
`ampdf` VARCHAR (50) NOT NULL COMMENT 'PDF,DOWN',
`pubtimes` BIGINT NOT NULL COMMENT '发表日期,DATE,Y-m-d',
`author` VARCHAR (100) NOT NULL COMMENT '负责人',
PRIMARY KEY (
`id`
)) COMMENT = '科研成果';

CREATE TABLE `lab_achievemember` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`achievementid` BIGINT NOT NULL COMMENT '所属成果,DB,lab_achievement',
`vuser` BIGINT NOT NULL COMMENT '所属成员,CATU,labuser',
`name` VARCHAR (50) NOT NULL COMMENT '|姓名|',
`email` VARCHAR (100) NOT NULL COMMENT '邮箱',
`seqno` INT NOT NULL COMMENT '|顺序位|',
`maincontribution` VARCHAR (180) NOT NULL COMMENT '主要贡献',
PRIMARY KEY (
`id`
)) COMMENT = '成果贡献人';

CREATE TABLE `lab_discussion` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`name` VARCHAR (180) NOT NULL COMMENT '研讨标题',
`vuser` BIGINT NOT NULL COMMENT '发起人,CATU,labuser',
`addtimes` BIGINT NOT NULL COMMENT '发起日期,DATE,Y-m-d',
`closetimes` BIGINT NOT NULL COMMENT '关闭日期,DATE,Y-m-d',
`interactioncnt` BIGINT NOT NULL COMMENT '互动数|',
`visitcnt` BIGINT NOT NULL COMMENT '访问量|',
`lasttimes` BIGINT NOT NULL COMMENT '最后活跃时间,DATE',
PRIMARY KEY (
`id`
)) COMMENT = '研讨';

CREATE TABLE `lab_discusstate` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`discussionid` BIGINT NOT NULL COMMENT '所属研讨,DB,lab_discussion',
`discuscommentid` BIGINT NOT NULL COMMENT '所属评论,DB,lab_discuscomment',
`dstate` INT NOT NULL COMMENT '表态,CATA,dstate',
`addtimes` BIGINT NOT NULL COMMENT '表态时间,DATE',
PRIMARY KEY (
`id`
)) COMMENT = '研讨表态';

CREATE TABLE `lab_discuscomment` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`discussionid` BIGINT NOT NULL COMMENT '所属研讨,DB,lab_discussion',
`upid` BIGINT NOT NULL COMMENT '所属评论,DB,lab_discuscomment',
`content` TEXT NOT NULL COMMENT ',评论内容,MD',
`addtimes` BIGINT NOT NULL COMMENT '评论日期,DATE',
`approvecnt` BIGINT NOT NULL COMMENT '赞成数|',
`opposecnt` BIGINT NOT NULL COMMENT '反对数|',
PRIMARY KEY (
`id`
)) COMMENT = '研讨评论';

CREATE TABLE `lab_gmeeting` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`name` VARCHAR (180) NOT NULL COMMENT '标题',
`starttimes` BIGINT NOT NULL COMMENT '开始时间,DATE',
`plansec` INT NOT NULL COMMENT '预计用时,SEC',
`usesec` INT NOT NULL COMMENT '实际用时,SEC',
`maintopic` VARCHAR (250) NOT NULL COMMENT '主要议题',
`addr` VARCHAR (180) NOT NULL COMMENT '地址',
`vuser` BIGINT NOT NULL COMMENT '主持人,CATU,labuser',
`joincnt` INT NOT NULL COMMENT '与会人数,INT,人',
`addtimes` BIGINT NOT NULL COMMENT '发布时间,DATE',
PRIMARY KEY (
`id`
)) COMMENT = '组会';

CREATE TABLE `lab_gmeetmember` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`gmeetingid` BIGINT NOT NULL COMMENT '所属组会,DB,lab_gmeeting',
`vuser` BIGINT NOT NULL COMMENT '所属成员,CATU,labuser',
`gmeetingusrstatus` INT NOT NULL COMMENT '|状态|,CATA,gmeetingusrstatus',
`nexttimes` BIGINT NOT NULL COMMENT '下次通知日期,DATE,Y-m-d',
`gmeetingusrsign` INT NOT NULL COMMENT '签到,CATA,gmeetingusrsign',
PRIMARY KEY (
`id`
)) COMMENT = '组会成员';

CREATE TABLE `lab_experience` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`name` VARCHAR (180) NOT NULL COMMENT '一句话概括',
`content` TEXT NOT NULL COMMENT '详情,BR',
`vfiles` VARCHAR (180) NOT NULL COMMENT '文档附件,IMG',
`addtimes` BIGINT NOT NULL COMMENT '发布日期,DATE,Y-m-d',
`vuser` BIGINT NOT NULL COMMENT '发布人,CATU,labuser',
PRIMARY KEY (
`id`
)) COMMENT = '经验积累';

CREATE TABLE `lab_experienvisit` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`experienceid` BIGINT NOT NULL COMMENT '所属经验,DB,lab_experience',
`vuser` BIGINT NOT NULL COMMENT '访问人,CATU,labuser',
`addtimes` BIGINT NOT NULL COMMENT '访问日期,DATE,Y-m-d',
PRIMARY KEY (
`id`
)) COMMENT = '访问记录';

CREATE TABLE `lab_fundproject` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`name` VARCHAR (100) NOT NULL COMMENT '项目名称',
`totalmoney` BIGINT NOT NULL COMMENT '可用总经费|,CNY',
`closetime` BIGINT NOT NULL COMMENT '关闭时间,DATE,Y-m-d',
PRIMARY KEY (
`id`
)) COMMENT = '项目经费';

CREATE TABLE `lab_fundcate` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`name` VARCHAR (100) NOT NULL COMMENT '分项名',
`descs` VARCHAR (180) NOT NULL COMMENT '解释说明,BR',
`vfile` VARCHAR (50) NOT NULL COMMENT '示例附件,DOWN',
PRIMARY KEY (
`id`
)) COMMENT = '分项分类';

CREATE TABLE `lab_funditem` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`fundprojectid` BIGINT NOT NULL COMMENT '所属项目经费,DB,lab_fundproject',
`fundcateid` BIGINT NOT NULL COMMENT '所属分项分类,DB,lab_fundcate',
`usablemoney` BIGINT NOT NULL COMMENT '可用经费|,CNY',
`memo` VARCHAR (180) NOT NULL COMMENT '备注',
PRIMARY KEY (
`id`
)) COMMENT = '项目分项经费';

CREATE TABLE `lab_fundexpense` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`vuser` BIGINT NOT NULL COMMENT '报销人,CATU,labuser',
`name` VARCHAR (180) NOT NULL COMMENT '事由',
`fundexpensestatus` INT NOT NULL COMMENT '|状态|,CATA,fundexpensestatus',
`totalamount` BIGINT NOT NULL COMMENT '总金额|,CNY',
`receiptcount` INT NOT NULL COMMENT '票据数量|,INT,张',
`fefiles` VARCHAR (180) NOT NULL COMMENT '电子票据附件,IMG',
`reason` VARCHAR (180) NOT NULL COMMENT '驳回理由',
`submittimes` BIGINT NOT NULL COMMENT '提交日期,DATE',
`financetimes` BIGINT NOT NULL COMMENT '财务日期,DATE',
`paymenttimes` BIGINT NOT NULL COMMENT '打款日期,DATE',
`actualamount` BIGINT NOT NULL COMMENT '实报金额|,CNY',
`assistantuser` BIGINT NOT NULL COMMENT '协助人,CATU,labuser',
PRIMARY KEY (
`id`
)) COMMENT = '经费报销';

CREATE TABLE `lab_fundexpendetail` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`fundexpenseid` BIGINT NOT NULL COMMENT '所属报销,DB,lab_fundexpense',
`funditemid` BIGINT NOT NULL COMMENT '所属分项经费,DB,lab_funditem',
`fedamount` BIGINT NOT NULL COMMENT '金额|,CNY',
`memo` VARCHAR (180) NOT NULL COMMENT '备注',
PRIMARY KEY (
`id`
)) COMMENT = '报销明细';

CREATE TABLE `lab_realasset` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构 ID,DB,lab_orgbase',
`name` VARCHAR (180) NOT NULL COMMENT '资产名称',
`sn` VARCHAR (50) NOT NULL COMMENT '资产编号',
`num` INT NOT NULL COMMENT '数量|,INT,个',
`pos` VARCHAR (180) NOT NULL COMMENT '位置',
`vuser` BIGINT NOT NULL COMMENT '管理人,CATU,labuser',
`addtimes` BIGINT NOT NULL COMMENT '加入日期,DATE,Y-m-d',
`lduser` VARCHAR (100) NOT NULL COMMENT '使用人',
`ldtimes` BIGINT NOT NULL COMMENT '使用时间,DATE',
`memo` VARCHAR (180) NOT NULL COMMENT '备注',
PRIMARY KEY (
`id`
)) COMMENT = '实验室实物资产';

CREATE TABLE `lab_webmain` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`templatepath` VARCHAR (180) NOT NULL COMMENT '模版路径',
`binddomain` VARCHAR (100) NOT NULL COMMENT '绑定独立域名',
`predomain` VARCHAR (50) NOT NULL COMMENT '三级域名',
`labintro` TEXT NOT NULL COMMENT ',实验室简介,MD',
`founder` TEXT NOT NULL COMMENT ',主任事迹,MD',
`uptimes` BIGINT NOT NULL COMMENT '更新时间,DATE',
PRIMARY KEY (
`id`
)) COMMENT = '官网模版';

CREATE TABLE `lab_webachievement` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`achievementid` BIGINT NOT NULL COMMENT '所属成果,DB,lab_achievement',
`keytag` VARCHAR (50) NOT NULL COMMENT '关键词标签',
`ispub` INT NOT NULL COMMENT '公开详情,BOOL',
`visitcnt` BIGINT NOT NULL COMMENT '访问量|',
`vuser` BIGINT NOT NULL COMMENT '添加人,CATU,labuser',
`addtimes` BIGINT NOT NULL COMMENT '添加时间,DATE,Y-m-d',
PRIMARY KEY (
`id`
)) COMMENT = '官网成果';

CREATE TABLE `lab_weblead` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`mobile` VARCHAR (50) NOT NULL COMMENT '手机号,MSK,****',
`name` VARCHAR (50) NOT NULL COMMENT '联系人',
`sourceurl` VARCHAR (180) NOT NULL COMMENT '来源页面,URL',
`demand` VARCHAR (180) NOT NULL COMMENT '需求',
`addtimes` BIGINT NOT NULL COMMENT '提交日期,DATE,Y-m-d',
`vuser` BIGINT NOT NULL COMMENT '对接人,CATU,labuser',
`contracttimes` BIGINT NOT NULL COMMENT '最后沟通时间,DATE',
`contractcontent` TEXT NOT NULL COMMENT '最后沟通记录,BR',
PRIMARY KEY (
`id`
)) COMMENT = '官网线索';

CREATE TABLE `lab_webmember` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`vuser` BIGINT NOT NULL COMMENT '所属成员,CATU,labuser',
`photo` VARCHAR (50) NOT NULL COMMENT '近照,IMG1',
`pintro` TEXT NOT NULL COMMENT ',个人介绍,MD',
`uptimes` BIGINT NOT NULL COMMENT '更新日期,DATE',
PRIMARY KEY (
`id`
)) COMMENT = '官网成员';

CREATE TABLE `lab_lang` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`lang` VARCHAR (50) NOT NULL COMMENT '语言代码,CATA,lang',
`tabname` VARCHAR (50) NOT NULL COMMENT '表名称',
`fieldname` VARCHAR (50) NOT NULL COMMENT '字段名',
`tabid` BIGINT NOT NULL COMMENT 'ID',
`trantxt` VARCHAR (250) NOT NULL COMMENT '翻译文本',
`langstatus` INT NOT NULL COMMENT '|状态|,CATA,langstatus',
PRIMARY KEY (
`id`
)) COMMENT = '多语言';

CREATE TABLE `lab_orgorder` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`orgsaleplanid` BIGINT NOT NULL COMMENT '销售方案,DB,lab_orgsaleplan',
`recvamount` BIGINT NOT NULL COMMENT '收款金额|,CNY',
`vuser` BIGINT NOT NULL COMMENT '操作人,CATU,labuser',
`addtimes` BIGINT NOT NULL COMMENT '创建时间,DATE',
`memo` VARCHAR (180) NOT NULL COMMENT '备注',
`invoicecate` VARCHAR (180) NOT NULL COMMENT '发票类目',
PRIMARY KEY (
`id`
)) COMMENT = '机构业务订单';

CREATE TABLE `lab_orgsaleplan` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`name` VARCHAR (100) NOT NULL COMMENT '方案名称',
`daycyc` INT NOT NULL COMMENT '递延时长,CYC',
`planprice` BIGINT NOT NULL COMMENT '标价|,CNY',
PRIMARY KEY (
`id`
)) COMMENT = '销售方案';

CREATE TABLE `lab_marriedori` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`laborgid` BIGINT NOT NULL COMMENT '所属机构,DB,lab_orgbase',
`name` VARCHAR (100) NOT NULL COMMENT '干系人',
`onecap` VARCHAR (180) NOT NULL COMMENT '能力,BR',
`onedem` VARCHAR (180) NOT NULL COMMENT '需求,BR',
`uptimes` BIGINT NOT NULL COMMENT '更新日期,DATE,Y-m-d',
PRIMARY KEY (
`id`
)) COMMENT = '撮合元数据';

CREATE TABLE `lab_marriedchg` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`marriedoriid` BIGINT NOT NULL COMMENT '所属元数据,DB,lab_marriedori',
`mchan` INT NOT NULL COMMENT '信息渠道,CATA,mchan',
`chgdata` TEXT NOT NULL COMMENT ',变动数据',
`addtimes` BIGINT NOT NULL COMMENT '变动日期,DATE,Y-m-d',
`vuser` BIGINT NOT NULL COMMENT '变动人,CATU,labuser',
`adminuser` BIGINT NOT NULL COMMENT '监管人,CATU,labuser',
`mfen` INT NOT NULL COMMENT '打分|,INT,分',
PRIMARY KEY (
`id`
)) COMMENT = '元数据变动';

CREATE TABLE `lab_crmbase` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`name` VARCHAR (100) NOT NULL COMMENT '单位名称',
`crmsource` INT NOT NULL COMMENT '数据来源,CATA,crmsource',
`content` VARCHAR (250) NOT NULL COMMENT '干系数据,BR',
`crmlevel` INT NOT NULL COMMENT '标记,CATA,crmlevel',
`lat` DOUBLE NOT NULL COMMENT '地图位置',
`lng` DOUBLE NOT NULL COMMENT '地图位置,LOC,lat',
`followtimes` BIGINT NOT NULL COMMENT '最新跟进日期,DATE,Y-m-d',
`vuser` BIGINT NOT NULL COMMENT '销售人,CATU,labuser',
PRIMARY KEY (
`id`
)) COMMENT = '客户CRM';

CREATE TABLE `lab_crmfollow` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`crmid` BIGINT NOT NULL COMMENT '所属单位,DB,lab_crmbase',
`content` TEXT NOT NULL COMMENT '跟进内容,BR',
`addtimes` BIGINT NOT NULL COMMENT '跟进时间,DATE',
`vuser` BIGINT NOT NULL COMMENT '跟进人,CATU,labuser',
PRIMARY KEY (
`id`
)) COMMENT = '销售跟进';