--
-- Host: localhost    Database: ciss_db
-- ------------------------------------------------------


--
-- Table structure for table `ciss_check_in`
--

CREATE TABLE `ciss_check_in` (
  `check_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '签到记录唯一id',
  `check_time` datetime NOT NULL COMMENT '签到记录',
  `check_user_id` varchar(40) NOT NULL COMMENT '签到的用户id',
  PRIMARY KEY (`check_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='签到记录表';

--
-- Dumping data for table `ciss_check_in`
--


--
-- Temporary table structure for view `ciss_ip_num_24_hour`
--

/*!50001 DROP VIEW IF EXISTS `ciss_ip_num_24_hour`*/;
/*!50001 CREATE VIEW `ciss_ip_num_24_hour` AS SELECT 
 1 AS `visit_ip`,
 1 AS `num`*/;

--
-- Table structure for table `ciss_ip_visit`
--

CREATE TABLE `ciss_ip_visit` (
  `visit_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '访问记录唯一id',
  `visit_time` datetime NOT NULL COMMENT '访问时间',
  `visit_ip` varchar(20) DEFAULT NULL COMMENT 'IP地址',
  PRIMARY KEY (`visit_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='IP访问记录表';

--
-- Dumping data for table `ciss_ip_visit`
--


--
-- Table structure for table `ciss_user`
--

CREATE TABLE `ciss_user` (
  `user_id` varchar(40) NOT NULL COMMENT '用户唯一id',
  `user_name` varchar(20) NOT NULL COMMENT '用户名',
  `user_passwd` varchar(70) NOT NULL COMMENT '密码',
  `user_last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='账户信息表';

--
-- Dumping data for table `ciss_user`
--


--
-- Final view structure for view `ciss_ip_num_24_hour`
--

/*!50001 DROP VIEW IF EXISTS `ciss_ip_num_24_hour`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `ciss_ip_num_24_hour` AS select `ciss_ip_visit`.`visit_ip` AS `visit_ip`,count(1) AS `num` from `ciss_ip_visit` where (`ciss_ip_visit`.`visit_time` >= (now() - interval 24 hour)) group by `ciss_ip_visit`.`visit_ip` order by `num` desc */;


