-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 2017-04-14 15:35:57
-- 服务器版本： 5.7.17-13
-- PHP Version: 7.0.15-0ubuntu0.16.04.4

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

-- --------------------------------------------------------

--
-- 表的结构 `jl_attachment`
--

CREATE TABLE `jl_attachment` (
  `aid` int(11) NOT NULL,
  `pid` mediumint(9) NOT NULL,
  `stid` mediumint(9) NOT NULL,
  `mpid` mediumint(9) NOT NULL,
  `pmid` mediumint(9) NOT NULL,
  `numpname` smallint(6) NOT NULL,
  `times` smallint(6) NOT NULL DEFAULT '0',
  `auditoruid` mediumint(9) NOT NULL,
  `filepath` char(255) NOT NULL,
  `ziphashcode` char(32) NOT NULL,
  `filehashcode` char(32) NOT NULL,
  `isnew` tinyint(4) NOT NULL DEFAULT '1',
  `intime` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `jl_auser`
--

CREATE TABLE `jl_auser` (
  `auid` mediumint(9) NOT NULL,
  `auname` char(255) NOT NULL,
  `aupass` char(255) NOT NULL,
  `aemail` char(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- 转存表中的数据 `jl_auser`
--

INSERT INTO `jl_auser` (`auid`, `auname`, `aupass`, `aemail`) VALUES
(1, 'madmin', '$2a$08$TbScA7uWG/VGm6KWqMfkiOAuCdC4wqRlSWcafwObi5PS71jJVXXve', '');

-- --------------------------------------------------------

--
-- 表的结构 `jl_config`
--

CREATE TABLE `jl_config` (
  `conid` tinyint(4) NOT NULL,
  `proname` char(255) NOT NULL,
  `onoff` tinyint(2) NOT NULL DEFAULT '0',
  `upgradeinfo` text NOT NULL,
  `smsswitch` tinyint(4) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- 转存表中的数据 `jl_config`
--

INSERT INTO `jl_config` (`conid`, `proname`, `onoff`, `upgradeinfo`, `smsswitch`) VALUES
(1, '', 0, '', 1);

-- --------------------------------------------------------

--
-- 表的结构 `jl_item_attachment`
--

CREATE TABLE `jl_item_attachment` (
  `iaid` mediumint(11) NOT NULL,
  `ownerid` smallint(11) NOT NULL,
  `pid` int(11) NOT NULL DEFAULT '0',
  `pmid` int(11) NOT NULL DEFAULT '0',
  `filename` varchar(255) NOT NULL,
  `fileext` char(5) NOT NULL,
  `filesize` char(255) NOT NULL,
  `filepath` char(255) NOT NULL,
  `intime` int(11) NOT NULL,
  `isdel` tinyint(2) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `jl_item_measure_numofper`
--

CREATE TABLE `jl_item_measure_numofper` (
  `imnid` int(11) NOT NULL,
  `iaid` int(11) NOT NULL,
  `pid` int(11) NOT NULL,
  `pmid` int(11) NOT NULL,
  `numpname` smallint(6) NOT NULL,
  `softwareitemid` int(11) NOT NULL,
  `isdel` tinyint(4) NOT NULL DEFAULT '0',
  `intime` int(11) NOT NULL DEFAULT '0',
  `deltime` int(11) NOT NULL DEFAULT '0',
  `deluid` mediumint(9) NOT NULL,
  `ownerid` mediumint(9) NOT NULL DEFAULT '0',
  `categoryid` mediumint(9) NOT NULL DEFAULT '0',
  `tips` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `jl_measure_audit`
--

CREATE TABLE `jl_measure_audit` (
  `maid` smallint(6) NOT NULL,
  `pid` mediumint(9) NOT NULL,
  `creatoruid` mediumint(9) NOT NULL,
  `auditoruid` mediumint(9) NOT NULL DEFAULT '0',
  `mpid` mediumint(9) NOT NULL DEFAULT '0',
  `pmid` mediumint(9) NOT NULL,
  `stid` mediumint(9) NOT NULL,
  `numpname` mediumint(9) NOT NULL,
  `times` smallint(6) NOT NULL DEFAULT '0',
  `mastatus` enum('uncheck','checking','checked','checkno') NOT NULL DEFAULT 'uncheck',
  `last` tinyint(4) NOT NULL DEFAULT '2',
  `audittime` int(11) NOT NULL,
  `auditcontent` text,
  `intime` int(11) DEFAULT NULL,
  `onlineaudit` tinyint(4) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `jl_measure_numofper`
--

CREATE TABLE `jl_measure_numofper` (
  `mpid` mediumint(9) NOT NULL,
  `iszero` tinyint(3) UNSIGNED NOT NULL,
  `uid` mediumint(9) NOT NULL,
  `pid` smallint(6) UNSIGNED NOT NULL,
  `pmid` smallint(5) UNSIGNED NOT NULL,
  `stid` smallint(5) UNSIGNED NOT NULL,
  `numpname` smallint(5) UNSIGNED NOT NULL,
  `times` smallint(6) NOT NULL DEFAULT '0',
  `currcontractval` char(255) NOT NULL COMMENT '本期合同计量',
  `currchangeval` char(255) NOT NULL COMMENT '本期数量变更计量',
  `stopnowtotal` char(255) NOT NULL COMMENT '截止上期累计完成',
  `currdone` char(255) NOT NULL COMMENT '本期完成计量',
  `curralltotal` char(255) NOT NULL COMMENT '累计完成计量',
  `currstatus` enum('uncheck','checking','checked','checkno') NOT NULL DEFAULT 'checking',
  `audittime` int(11) NOT NULL,
  `intime` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `jl_project`
--

CREATE TABLE `jl_project` (
  `pid` int(11) NOT NULL,
  `uid` mediumint(9) NOT NULL,
  `pname` char(255) NOT NULL,
  `intime` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `jl_project_measure`
--

CREATE TABLE `jl_project_measure` (
  `pmid` int(11) NOT NULL,
  `pid` mediumint(8) DEFAULT '0',
  `stid` mediumint(8) NOT NULL DEFAULT '0',
  `uid` mediumint(9) NOT NULL,
  `pmname` char(255) DEFAULT NULL,
  `contracttotal` char(255) NOT NULL DEFAULT '0',
  `intime` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `jl_section_type`
--

CREATE TABLE `jl_section_type` (
  `stid` int(11) NOT NULL,
  `pid` mediumint(8) NOT NULL DEFAULT '0',
  `uid` mediumint(9) NOT NULL,
  `stname` char(255) NOT NULL,
  `stkey` char(255) NOT NULL,
  `intime` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `jl_share`
--

CREATE TABLE `jl_share` (
  `sid` mediumint(8) UNSIGNED NOT NULL,
  `hashcode` char(255) NOT NULL,
  `ids` int(11) NOT NULL,
  `idtype` tinyint(3) UNSIGNED NOT NULL,
  `intime` int(10) UNSIGNED NOT NULL,
  `endtime` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `jl_sign`
--

CREATE TABLE `jl_sign` (
  `sid` int(11) NOT NULL COMMENT '主键',
  `project` int(11) NOT NULL COMMENT '项目主键',
  `tender` int(11) NOT NULL COMMENT '标段主键',
  `phaseno` int(11) NOT NULL COMMENT '期数',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '报表名',
  `ownuid` smallint(6) NOT NULL COMMENT '生成人id',
  `intime` int(11) NOT NULL COMMENT '生成时间',
  `pagenum` smallint(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT '共有多少张报表，未解压默认为0',
  `widhei` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '报表纸张大小 以mm为单位',
  `audituid` smallint(6) UNSIGNED DEFAULT NULL COMMENT '发起人id',
  `aintime` varchar(15) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '发起时间',
  `status` enum('uncheck','checking','checked') NOT NULL DEFAULT 'uncheck' COMMENT '签署状态',
  `sintime` varchar(15) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '签署完成时间',
  `ishare` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否分享,0不分享（默认），1分享'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='在线签署报表信息表';

-- --------------------------------------------------------

--
-- 表的结构 `jl_sign_attachment`
--

CREATE TABLE `jl_sign_attachment` (
  `said` int(11) UNSIGNED NOT NULL COMMENT '主键',
  `sid` int(11) UNSIGNED NOT NULL COMMENT '报表id主键',
  `curnum` smallint(5) UNSIGNED NOT NULL COMMENT '编号，第几张',
  `filepath` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '报表文件路径'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='签署文件信息表';

-- --------------------------------------------------------

--
-- 表的结构 `jl_sign_audit`
--

CREATE TABLE `jl_sign_audit` (
  `satid` int(11) UNSIGNED NOT NULL COMMENT '主键',
  `sid` int(11) UNSIGNED NOT NULL COMMENT '报表id主键',
  `status` enum('uncheck','checking','checked') NOT NULL DEFAULT 'uncheck' COMMENT '个人签署状态',
  `audituid` int(11) UNSIGNED NOT NULL COMMENT '签署人id',
  `aname` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT '签署人姓名',
  `intime` int(11) NOT NULL COMMENT '签署时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户签署表';

-- --------------------------------------------------------

--
-- 表的结构 `jl_sign_audit_attachment`
--

CREATE TABLE `jl_sign_audit_attachment` (
  `saaid` int(11) NOT NULL COMMENT '主键',
  `audituid` int(11) NOT NULL COMMENT '签署人id',
  `said` int(11) NOT NULL COMMENT '报表文件id',
  `picpath` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '签名图片地址',
  `position` varchar(500) CHARACTER SET utf8 NOT NULL COMMENT '签名所在位置'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='用户签名关联表' ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- 表的结构 `jl_users`
--

CREATE TABLE `jl_users` (
  `uid` int(11) NOT NULL,
  `uemail` char(255) NOT NULL,
  `upass` char(60) NOT NULL,
  `intime` int(11) NOT NULL,
  `isstop` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `jl_users_auth`
--

CREATE TABLE `jl_users_auth` (
  `aid` int(11) NOT NULL,
  `token` char(255) NOT NULL,
  `expirestime` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `jl_users_friends`
--

CREATE TABLE `jl_users_friends` (
  `uid` int(11) NOT NULL,
  `fuid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `jl_user_profiles`
--

CREATE TABLE `jl_user_profiles` (
  `userid` int(11) NOT NULL,
  `name` char(50) NOT NULL,
  `company` char(255) NOT NULL,
  `jobs` char(255) NOT NULL,
  `phone` char(255) NOT NULL,
  `mobile` char(255) NOT NULL,
  `qq` char(50) NOT NULL,
  `groups` enum('vip','anonymous') NOT NULL DEFAULT 'anonymous',
  `avatar` char(255) NOT NULL DEFAULT 'global/avatar/avtra.jpg',
  `isnotice` tinyint(4) NOT NULL DEFAULT '0',
  `signpath` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'global/signpath/signavatar.png' COMMENT '签名图片地址',
  `remark` varchar(500) NOT NULL COMMENT '备注信息'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- 表的结构 `jl_zero_audit`
--

CREATE TABLE `jl_zero_audit` (
  `zaid` smallint(6) NOT NULL,
  `uid` int(11) NOT NULL,
  `catid` int(11) NOT NULL,
  `auditstatus` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `jl_attachment`
--
ALTER TABLE `jl_attachment`
  ADD PRIMARY KEY (`aid`),
  ADD KEY `isnew` (`isnew`),
  ADD KEY `numpname` (`numpname`),
  ADD KEY `times` (`times`);

--
-- Indexes for table `jl_auser`
--
ALTER TABLE `jl_auser`
  ADD PRIMARY KEY (`auid`);

--
-- Indexes for table `jl_config`
--
ALTER TABLE `jl_config`
  ADD PRIMARY KEY (`conid`);

--
-- Indexes for table `jl_item_attachment`
--
ALTER TABLE `jl_item_attachment`
  ADD PRIMARY KEY (`iaid`);

--
-- Indexes for table `jl_item_measure_numofper`
--
ALTER TABLE `jl_item_measure_numofper`
  ADD PRIMARY KEY (`imnid`);

--
-- Indexes for table `jl_measure_audit`
--
ALTER TABLE `jl_measure_audit`
  ADD PRIMARY KEY (`maid`),
  ADD UNIQUE KEY `auditoruid` (`auditoruid`,`pmid`,`numpname`,`times`);

--
-- Indexes for table `jl_measure_numofper`
--
ALTER TABLE `jl_measure_numofper`
  ADD PRIMARY KEY (`mpid`),
  ADD UNIQUE KEY `pmid_numpname_times` (`pmid`,`numpname`,`times`),
  ADD UNIQUE KEY `mpid` (`mpid`);

--
-- Indexes for table `jl_project`
--
ALTER TABLE `jl_project`
  ADD PRIMARY KEY (`pid`);

--
-- Indexes for table `jl_project_measure`
--
ALTER TABLE `jl_project_measure`
  ADD PRIMARY KEY (`pmid`);

--
-- Indexes for table `jl_section_type`
--
ALTER TABLE `jl_section_type`
  ADD PRIMARY KEY (`stid`);

--
-- Indexes for table `jl_share`
--
ALTER TABLE `jl_share`
  ADD PRIMARY KEY (`sid`);

--
-- Indexes for table `jl_sign`
--
ALTER TABLE `jl_sign`
  ADD PRIMARY KEY (`sid`);

--
-- Indexes for table `jl_sign_attachment`
--
ALTER TABLE `jl_sign_attachment`
  ADD PRIMARY KEY (`said`);

--
-- Indexes for table `jl_sign_audit`
--
ALTER TABLE `jl_sign_audit`
  ADD PRIMARY KEY (`satid`);

--
-- Indexes for table `jl_sign_audit_attachment`
--
ALTER TABLE `jl_sign_audit_attachment`
  ADD PRIMARY KEY (`saaid`);

--
-- Indexes for table `jl_users`
--
ALTER TABLE `jl_users`
  ADD PRIMARY KEY (`uid`),
  ADD UNIQUE KEY `uemail` (`uemail`);

--
-- Indexes for table `jl_users_auth`
--
ALTER TABLE `jl_users_auth`
  ADD PRIMARY KEY (`aid`);

--
-- Indexes for table `jl_user_profiles`
--
ALTER TABLE `jl_user_profiles`
  ADD UNIQUE KEY `userid` (`userid`);

--
-- Indexes for table `jl_zero_audit`
--
ALTER TABLE `jl_zero_audit`
  ADD PRIMARY KEY (`zaid`);

--
-- 在导出的表使用AUTO_INCREMENT
--

--
-- 使用表AUTO_INCREMENT `jl_attachment`
--
ALTER TABLE `jl_attachment`
  MODIFY `aid` int(11) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `jl_auser`
--
ALTER TABLE `jl_auser`
  MODIFY `auid` mediumint(9) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- 使用表AUTO_INCREMENT `jl_config`
--
ALTER TABLE `jl_config`
  MODIFY `conid` tinyint(4) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- 使用表AUTO_INCREMENT `jl_item_attachment`
--
ALTER TABLE `jl_item_attachment`
  MODIFY `iaid` mediumint(11) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `jl_item_measure_numofper`
--
ALTER TABLE `jl_item_measure_numofper`
  MODIFY `imnid` int(11) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `jl_measure_audit`
--
ALTER TABLE `jl_measure_audit`
  MODIFY `maid` smallint(6) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `jl_measure_numofper`
--
ALTER TABLE `jl_measure_numofper`
  MODIFY `mpid` mediumint(9) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `jl_project`
--
ALTER TABLE `jl_project`
  MODIFY `pid` int(11) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `jl_project_measure`
--
ALTER TABLE `jl_project_measure`
  MODIFY `pmid` int(11) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `jl_section_type`
--
ALTER TABLE `jl_section_type`
  MODIFY `stid` int(11) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `jl_share`
--
ALTER TABLE `jl_share`
  MODIFY `sid` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT;COMMIT;
--
-- 使用表AUTO_INCREMENT `jl_sign`
--
ALTER TABLE `jl_sign`
  MODIFY `sid` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', AUTO_INCREMENT=1;
--
-- 使用表AUTO_INCREMENT `jl_sign_attachment`
--
ALTER TABLE `jl_sign_attachment`
  MODIFY `said` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', AUTO_INCREMENT=1;
--
-- 使用表AUTO_INCREMENT `jl_sign_audit`
--
ALTER TABLE `jl_sign_audit`
  MODIFY `satid` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', AUTO_INCREMENT=1;
--
-- 使用表AUTO_INCREMENT `jl_sign_audit_attachment`
--
ALTER TABLE `jl_sign_audit_attachment`
  MODIFY `saaid` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', AUTO_INCREMENT=1;COMMIT;
--
-- 使用表AUTO_INCREMENT `jl_users`
--
ALTER TABLE `jl_users`
  MODIFY `uid` int(11) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `jl_users_auth`
--
ALTER TABLE `jl_users_auth`
  MODIFY `aid` int(11) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `jl_zero_audit`
--
ALTER TABLE `jl_zero_audit`
  MODIFY `zaid` smallint(6) NOT NULL AUTO_INCREMENT;COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
