-- phpMyAdmin SQL Dump
-- version 4.2.8.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 2015-09-16 16:43:12
-- 服务器版本： 10.1.4-MariaDB-1~trusty-wsrep-log
-- PHP Version: 5.5.29-1+deb.sury.org~trusty+3

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;

--
-- Database: `jlweb`
--

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

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

CREATE TABLE IF NOT EXISTS `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 AUTO_INCREMENT=2351 DEFAULT CHARSET=utf8;

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

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

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

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

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

CREATE TABLE IF NOT EXISTS `jl_item_attachment` (
`iaid` mediumint(11) NOT NULL,
  `mpid` mediumint(11) NOT NULL,
  `ownerid` smallint(11) NOT NULL,
  `itemid` char(255) CHARACTER SET utf8 NOT NULL,
  `filename` char(255) CHARACTER SET utf8 NOT NULL,
  `fileext` char(5) CHARACTER SET utf8 NOT NULL,
  `filesize` char(255) CHARACTER SET utf8 NOT NULL,
  `filepath` char(255) CHARACTER SET utf8 NOT NULL,
  `categoryid` smallint(6) NOT NULL,
  `intime` int(11) NOT NULL,
  `isdel` tinyint(2) NOT NULL DEFAULT '0',
  `tips` text NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4;

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

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

CREATE TABLE IF NOT EXISTS `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 NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=3551 DEFAULT CHARSET=utf8;

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

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

CREATE TABLE IF NOT EXISTS `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
) ENGINE=InnoDB AUTO_INCREMENT=740 DEFAULT CHARSET=utf8;

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

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

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

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

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

CREATE TABLE IF NOT EXISTS `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'
) ENGINE=InnoDB AUTO_INCREMENT=681 DEFAULT CHARSET=utf8;

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

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

CREATE TABLE IF NOT EXISTS `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
) ENGINE=InnoDB AUTO_INCREMENT=221 DEFAULT CHARSET=utf8;

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

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

CREATE TABLE IF NOT EXISTS `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 AUTO_INCREMENT=165 DEFAULT CHARSET=utf8;

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

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

CREATE TABLE IF NOT EXISTS `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 IF NOT EXISTS `jl_users_friends` (
  `uid` int(11) NOT NULL,
  `fuid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

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

CREATE TABLE IF NOT EXISTS `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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

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

CREATE TABLE IF NOT EXISTS `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`);

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

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

--
-- 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_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 for dumped tables
--

--
-- AUTO_INCREMENT for table `jl_attachment`
--
ALTER TABLE `jl_attachment`
MODIFY `aid` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2351;
--
-- AUTO_INCREMENT for table `jl_auser`
--
ALTER TABLE `jl_auser`
MODIFY `auid` mediumint(9) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `jl_item_attachment`
--
ALTER TABLE `jl_item_attachment`
MODIFY `iaid` mediumint(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=27;
--
-- AUTO_INCREMENT for table `jl_measure_audit`
--
ALTER TABLE `jl_measure_audit`
MODIFY `maid` smallint(6) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3551;
--
-- AUTO_INCREMENT for table `jl_measure_numofper`
--
ALTER TABLE `jl_measure_numofper`
MODIFY `mpid` mediumint(9) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=740;
--
-- AUTO_INCREMENT for table `jl_project`
--
ALTER TABLE `jl_project`
MODIFY `pid` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=147;
--
-- AUTO_INCREMENT for table `jl_project_measure`
--
ALTER TABLE `jl_project_measure`
MODIFY `pmid` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=681;
--
-- AUTO_INCREMENT for table `jl_section_type`
--
ALTER TABLE `jl_section_type`
MODIFY `stid` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=221;
--
-- AUTO_INCREMENT for table `jl_users`
--
ALTER TABLE `jl_users`
MODIFY `uid` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=165;
--
-- AUTO_INCREMENT for table `jl_users_auth`
--
ALTER TABLE `jl_users_auth`
MODIFY `aid` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `jl_zero_audit`
--
ALTER TABLE `jl_zero_audit`
MODIFY `zaid` smallint(6) NOT NULL AUTO_INCREMENT;
/*!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 */;
