IDEA整合SSM,并使用PageHelper实现分页功能

版权声明:原创文章,未经允许,禁止转载! https://blog.csdn.net/weixin_36512652/article/details/82952734
使用到的技术:
  • Spring、SpringMVC、Mybatis
  • Maven
  • MySQL
  • Bootstrap
  • PageHelper
准备工作:
  1. 创建一个Maven项目,选择webapp
    在这里插入图片描述
  2. 在pom文件中添加所需依赖
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: pom.xml 642118 2008-03-28 08:04:16Z reinhard $ -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <packaging>war</packaging>

    <name>test</name>
    <groupId>com.youngpain</groupId>
    <artifactId>test</artifactId>
    <version>1.0-SNAPSHOT</version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.mybatis.generator</groupId>
                <artifactId>mybatis-generator-maven-plugin</artifactId>
                <version>1.3.5</version>
                <configuration>
                    <configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
                    <verbose>true</verbose>
                    <overwrite>true</overwrite>
                </configuration>
                <executions>
                    <execution>
                        <id>Generate MyBatis Artifacts</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <version>8.0.11</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!--引入spring-webmvc-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>5.1.0.RELEASE</version>
        </dependency>
        <!--引入spring-jdbc-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>5.1.0.RELEASE</version>
        </dependency>
        <!--引入spring-aspects-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <version>5.1.0.RELEASE</version>
        </dependency>
        <!--引入spring-test-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>5.1.0.RELEASE</version>
            <scope>test</scope>
        </dependency>
        <!--引入mybatis-->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.4.6</version>
        </dependency>
        <!--引入mybatis-spring-->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>1.3.2</version>
        </dependency>
        <!--引入Mybatis Generator-->
        <dependency>
            <groupId>org.mybatis.generator</groupId>
            <artifactId>mybatis-generator-core</artifactId>
            <version>1.3.5</version>
        </dependency>
        <!-- 引入pageHelper分页插件 -->
        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper</artifactId>
            <version>5.1.2</version>
        </dependency>
        <!--引入c3p0-->
        <dependency>
            <groupId>com.mchange</groupId>
            <artifactId>c3p0</artifactId>
            <version>0.9.5.2</version>
        </dependency>
        <!--引入mysql驱动-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.11</version>
        </dependency>
        <!--引入jstl-->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
        <!--引入junit-->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <!--引入servlet-api-->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    
</project>
  1. 配置web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
         id="WebApp_ID" version="3.0">

    <!-- 启动Spring -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext.xml</param-value>
    </context-param>

    <!-- Spring监听器 -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!-- SpringMVC配置 -->
    <servlet>
        <servlet-name>spring-mvc</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:spring-mvc.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <!-- 拦截所有请求 -->
    <servlet-mapping>
        <servlet-name>spring-mvc</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <!--字符编码过滤器,放在其他过滤器之前-->
    <filter>
        <filter-name>characterEncodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>utf-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceRequestEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
        <init-param>
            <param-name>forceResponseEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>characterEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!--将post请求转为delete、put请求-->
    <filter>
        <filter-name>hiddenHttpMethodFilter</filter-name>
        <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>hiddenHttpMethodFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

</web-app>
  1. 配置spring-mvc.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">

    <!-- 扫描控制器 -->
    <context:component-scan base-package="com.youngpain.controller">
    </context:component-scan>

    <!-- 视图解析器 -->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/pages/"></property>
        <property name="suffix" value=".jsp"></property>
    </bean>

    <!--使用springmvc更高级功能-->
    <mvc:annotation-driven></mvc:annotation-driven>

    <!--将springmvc不能处理的请求交给tomcat-->
    <mvc:default-servlet-handler/>

</beans>
  1. 创建数据库配置文件jdbc.properties
jdbc.url=jdbc:mysql://localhost:3306/hospitalonline?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8
jdbc.driverClass=com.mysql.jdbc.Driver
jdbc.username=root
jdbc.password=1741248769
  1. 配置mybatis-conf.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration  PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>

    <!--开启驼峰命名规则-->
    <settings>
        <setting name="mapUnderscoreToCamelCase" value="true"/>
    </settings>

    <!--使用别名-->
    <typeAliases>
        <package name="com.youngpain.entity"></package>
    </typeAliases>

    <!--引入pageHelper分页插件,注意plugin标签位置-->
    <plugins>
        <plugin interceptor="com.github.pagehelper.PageInterceptor"></plugin>
    </plugins>

</configuration>
  1. 配置applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:mybatis-spring="http://mybatis.org/schema/mybatis-spring"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://mybatis.org/schema/mybatis-spring http://mybatis.org/schema/mybatis-spring-1.2.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">

    <!--配置要扫描的包-->
    <context:component-scan base-package="com.youngpain">
        <context:exclude-filter type="annotation"
                                expression="org.springframework.stereotype.Controller"/>
    </context:component-scan>

    <!--扫描mapper接口所在的包-->
    <mybatis-spring:scan base-package="com.youngpain.dao"></mybatis-spring:scan>

    <!--引入数据库配置文件-->
    <context:property-placeholder location="classpath:jdbc.properties"/>

    <!--***************************配置数据源***************************-->
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
        <property name="jdbcUrl" value="${jdbc.url}"></property>
        <property name="driverClass" value="${jdbc.driverClass}"></property>
        <property name="user" value="${jdbc.username}"></property>
        <property name="password" value="${jdbc.password}"></property>
    </bean>

    <!--***************************配置事务管理***************************-->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"></property>
    </bean>

    <!--配置aop-->
    <aop:config>
        <!--配置切入点,..*(..)包下(包括子包)的所有类中的所有方法,参数个数任意-->
        <aop:pointcut id="txPoint" expression="execution(* com.youngpain.service..*(..))"></aop:pointcut>
        <aop:advisor advice-ref="txAdvice" pointcut-ref="txPoint"></aop:advisor>
    </aop:config>

    <!--事务如何切入-->
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <!--所有方法-->
            <tx:method name="*"/>
            <!--形似getXXX的方法是只读的-->
            <tx:method name="get*" read-only="true"></tx:method>
        </tx:attributes>
    </tx:advice>

    <!--***************************整合Mybatis***************************-->
    <bean id="sessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <!--指定Mybatis配置文件位置-->
        <property name="configLocation" value="classpath:mybatis-config.xml"></property>
        <!--指定数据源-->
        <property name="dataSource" ref="dataSource"></property>
        <!--扫描mapper文件-->
        <property name="mapperLocations" value="classpath:mapper/*.xml"></property>
    </bean>

    <!--配置可以执行批量操作的SqlSession-->
    <bean id="sessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
        <constructor-arg name="sqlSessionFactory" ref="sessionFactory"></constructor-arg>
        <constructor-arg name="executorType" value="BATCH"></constructor-arg>
    </bean>

</beans>
  1. 创建generatorConfig.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
        PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">

<generatorConfiguration>

    <context id="DB2Tables" targetRuntime="MyBatis3">
        <!--不生成注释-->
        <commentGenerator>
            <property name="suppressAllComments" value="true"></property>
        </commentGenerator>
        <!--数据库信息-->
        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                        connectionURL="jdbc:mysql://localhost:3306/hospitalonline?serverTimezone=GMT%2B8"
                        userId="root"
                        password="1741248769">
        </jdbcConnection>

        <javaTypeResolver>
            <property name="forceBigDecimals" value="false"/>
        </javaTypeResolver>

        <!--指定生成的model位置-->
        <javaModelGenerator targetPackage="com.youngpain.entity" targetProject=".\src\main\java">
            <property name="enableSubPackages" value="true"/>
            <property name="trimStrings" value="true"/>
        </javaModelGenerator>

        <!--指定生成的mapper文件位置-->
        <sqlMapGenerator targetPackage="mapper" targetProject=".\src\main\resources">
            <property name="enableSubPackages" value="true"/>
        </sqlMapGenerator>

        <!--指定生成的mapper接口位置-->
        <javaClientGenerator type="XMLMAPPER" targetPackage="com.youngpain.dao" targetProject=".\src\main\java">
            <property name="enableSubPackages" value="true"/>
        </javaClientGenerator>

        <!--指定生成策略-->
        <table tableName="doctoruser" domainObjectName="Doctor"></table>
        <table tableName="patientuser" domainObjectName="Patient"></table>
        <table tableName="orders" domainObjectName="Order"></table>

    </context>
</generatorConfiguration>
  1. 点击Edit Configuration添加tomcat和maven,在maven命令行中输入mybatis-generator:generate自动生成model、mapper接口和文件
    在这里插入图片描述
  2. 生成对应的文件
    在这里插入图片描述
  3. 创建Controller
package com.youngpain.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.youngpain.entity.Order;
import com.youngpain.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @ClassName OrderController
 * @Author pain
 * @Date 2018/10/6 14:52
 * @Version 1.0
 **/
@Controller
public class OrderController {

    @Autowired
    OrderService orderService;

    //显示所有的预约信息
    @GetMapping("/orders")
    public String getOrders(@RequestParam(value = "page", defaultValue = "1") Integer page, Model model) {
        //获取指定页数据,大小为8
        PageHelper.startPage(page, 8);
        //紧跟的第一个select方法被分页
        List<Order> orders = orderService.listOrders();
        //使用PageInfo包装数据
        PageInfo pageInfo = new PageInfo(orders, 5);
        model.addAttribute("pageInfo", pageInfo);
        return "order_list";
    }

}
  1. 创建jsp页面负责显示数据,实现分页效果
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%--引入标签--%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>预约信息</title>
    <%
        pageContext.setAttribute("BASE_PATH", request.getContextPath());
    %>
    <!-- jquery -->
    <script type="text/javascript" src="${BASE_PATH}/static/js/jquery-1.11.1.min.js"></script>
    <!-- Bootstrap -->
    <link href="${BASE_PATH}/static/css/bootstrap.min.css" rel="stylesheet">
    <script src="${BASE_PATH}/static/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-12" align="center;">
            <h2>预约详细信息</h2>
        </div>
    </div>
    <div class="row">
        <div class="col-md-2 offset-md-10">
            <button class="btn btn-primary btn-sm">添加</button>
            <button class="btn btn-danger btn-sm">删除</button>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <table class="table table-hover">
                <tr>
                    <th>预约号</th>
                    <th>预约时间</th>
                    <th>医院</th>
                    <th>科室</th>
                    <th>医生姓名</th>
                    <th>患者姓名</th>
                    <th>患者性别</th>
                    <th>患者联系方式</th>
                    <th>操作</th>
                </tr>
                <c:forEach items="${pageInfo.list}" var="orders">
                    <tr>
                        <th>${orders.id}</th>
                        <th>${orders.orderDate}</th>
                        <th>${orders.doctor.dHospital}</th>
                        <th>${orders.doctor.dDepartment}</th>
                        <th>${orders.doctor.dName}</th>
                        <th>${orders.patient.pName}</th>
                        <th>${orders.patient.pGender=="m"?"男":"女"}</th>
                        <th>${orders.patient.pPhone}</th>
                        <th>
                            <button class="btn btn-primary btn-sm">
                                <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
                                修改
                            </button>
                            <button class="btn btn-danger btn-sm">
                                <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
                                修改
                            </button>
                        </th>
                    </tr>
                </c:forEach>
            </table>
        </div>
    </div>
    <div class="row">
        <div class="col-md-6">
            第${pageInfo.pageNum}页,共${pageInfo.pages}页,共${pageInfo.total}条记录
        </div>
        <div class="col-md-6 offset-md-4">
            <nav aria-label="Page navigation example">
                <ul class="pagination pagination-sm">
                    <li class="page-item"><a class="page-link" href="${BASE_PATH}/orders?page=1">首页</a></li>
                    <c:if test="${pageInfo.hasPreviousPage}">
                        <li class="page-item"><a class="page-link"
                                                 href="${BASE_PATH}/orders?page=${pageInfo.pageNum-1}">上一页</a></li>
                    </c:if>
                    <c:forEach items="${pageInfo.navigatepageNums}" var="page">
                        <c:if test="${page==pageInfo.pageNum}">
                            <li class="page-item active"><a class="page-link" href="#">${page}</a></li>
                        </c:if>
                        <c:if test="${page!=pageInfo.pageNum}">
                            <li class="page-item"><a class="page-link"
                                                     href="${BASE_PATH}/orders?page=${page}">${page}</a></li>
                        </c:if>
                    </c:forEach>
                    <c:if test="${pageInfo.hasNextPage}">
                        <li class="page-item"><a class="page-link"
                                                 href="${BASE_PATH}/orders?page=${pageInfo.pageNum+1}">下一页</a></li>
                    </c:if>
                    <li class="page-item"><a class="page-link" href="${BASE_PATH}/orders?page=${pageInfo.pages}">末页</a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</div>

</body>
</html>

  1. 在浏览器中请求页面,分页功能可正常使用(为节省时间,只实现了查询功能,增删改可根据mapper接口自行实现)
    在这里插入图片描述
忘记sql文件了
/*
 Navicat Premium Data Transfer

 Source Server         : pain
 Source Server Type    : MySQL
 Source Server Version : 80011
 Source Host           : localhost:3306
 Source Schema         : hospitalonline

 Target Server Type    : MySQL
 Target Server Version : 80011
 File Encoding         : 65001

 Date: 06/10/2018 18:11:35
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for doctoruser
-- ----------------------------
DROP TABLE IF EXISTS `doctoruser`;
CREATE TABLE `doctoruser`  (
  `d_id` int(11) NOT NULL AUTO_INCREMENT,
  `d_age` int(11) NULL DEFAULT NULL,
  `d_department` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `d_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `d_gender` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `d_hospital` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `d_password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`d_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1002 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of doctoruser
-- ----------------------------
INSERT INTO `doctoruser` VALUES (1001, 21, '内科', '张三', 'm', '安徽省人民医院', '123456');

-- ----------------------------
-- Table structure for orders
-- ----------------------------
DROP TABLE IF EXISTS `orders`;
CREATE TABLE `orders`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `order_date` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `order_status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `patient_id` int(11) NULL DEFAULT NULL,
  `doctor_id` int(11) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `fk_d_id`(`doctor_id`) USING BTREE,
  INDEX `fk_p_id`(`patient_id`) USING BTREE,
  CONSTRAINT `fk_d_id` FOREIGN KEY (`doctor_id`) REFERENCES `doctoruser` (`d_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `fk_p_id` FOREIGN KEY (`patient_id`) REFERENCES `patientuser` (`p_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 100 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of orders
-- ----------------------------
INSERT INTO `orders` VALUES (1, '2018-10-06 08:00', '待处理', 1, 1001);
INSERT INTO `orders` VALUES (2, '2018-10-06 08:00', '待处理', 2, 1001);
INSERT INTO `orders` VALUES (3, '2018-10-06 08:00', '待处理', 3, 1001);
INSERT INTO `orders` VALUES (4, '2018-10-06 08:00', '待处理', 4, 1001);
INSERT INTO `orders` VALUES (5, '2018-10-06 08:00', '待处理', 5, 1001);
INSERT INTO `orders` VALUES (6, '2018-10-06 08:00', '待处理', 6, 1001);
INSERT INTO `orders` VALUES (7, '2018-10-06 08:00', '待处理', 7, 1001);
INSERT INTO `orders` VALUES (8, '2018-10-06 08:00', '待处理', 8, 1001);
INSERT INTO `orders` VALUES (9, '2018-10-06 08:00', '待处理', 9, 1001);
INSERT INTO `orders` VALUES (10, '2018-10-06 08:00', '待处理', 10, 1001);
INSERT INTO `orders` VALUES (11, '2018-10-06 08:00', '待处理', 11, 1001);
INSERT INTO `orders` VALUES (12, '2018-10-06 08:00', '待处理', 12, 1001);
INSERT INTO `orders` VALUES (13, '2018-10-06 08:00', '待处理', 13, 1001);
INSERT INTO `orders` VALUES (14, '2018-06-18 10:00', '已接受', 1291476018, 1001);
INSERT INTO `orders` VALUES (15, '2018-06-18 10:00', '已接受', 1291476018, 1001);
INSERT INTO `orders` VALUES (16, '2018-06-08 10:00', '已接受', 1291476018, 1001);
INSERT INTO `orders` VALUES (17, '2018-06-18 10:00', '已接受', 1291476018, 1001);
INSERT INTO `orders` VALUES (18, '2018-06-18 10:00', '待处理', 1291476018, 1001);
INSERT INTO `orders` VALUES (19, '2018-10-06 10:00', '待处理', 19, 1001);
INSERT INTO `orders` VALUES (20, '2018-10-06 10:00', '待处理', 20, 1001);
INSERT INTO `orders` VALUES (21, '2018-10-06 10:00', '待处理', 21, 1001);
INSERT INTO `orders` VALUES (22, '2018-10-06 10:00', '待处理', 22, 1001);
INSERT INTO `orders` VALUES (23, '2018-10-06 10:00', '待处理', 23, 1001);
INSERT INTO `orders` VALUES (24, '2018-10-06 10:00', '待处理', 24, 1001);
INSERT INTO `orders` VALUES (25, '2018-10-06 10:00', '待处理', 25, 1001);
INSERT INTO `orders` VALUES (26, '2018-10-06 10:00', '待处理', 26, 1001);
INSERT INTO `orders` VALUES (27, '2018-10-06 10:00', '待处理', 27, 1001);
INSERT INTO `orders` VALUES (28, '2018-10-06 10:00', '待处理', 28, 1001);
INSERT INTO `orders` VALUES (29, '2018-10-06 10:00', '待处理', 29, 1001);
INSERT INTO `orders` VALUES (30, '2018-10-06 10:00', '待处理', 30, 1001);
INSERT INTO `orders` VALUES (31, '2018-10-06 10:00', '待处理', 31, 1001);
INSERT INTO `orders` VALUES (32, '2018-10-06 10:00', '待处理', 32, 1001);
INSERT INTO `orders` VALUES (33, '2018-10-06 10:00', '待处理', 33, 1001);
INSERT INTO `orders` VALUES (34, '2018-10-06 10:00', '待处理', 34, 1001);
INSERT INTO `orders` VALUES (35, '2018-10-06 10:00', '待处理', 35, 1001);
INSERT INTO `orders` VALUES (36, '2018-10-06 10:00', '待处理', 36, 1001);
INSERT INTO `orders` VALUES (37, '2018-10-06 10:00', '待处理', 37, 1001);
INSERT INTO `orders` VALUES (38, '2018-10-06 10:00', '待处理', 38, 1001);
INSERT INTO `orders` VALUES (39, '2018-10-06 10:00', '待处理', 39, 1001);
INSERT INTO `orders` VALUES (40, '2018-10-06 10:00', '待处理', 40, 1001);
INSERT INTO `orders` VALUES (41, '2018-10-06 10:00', '待处理', 41, 1001);
INSERT INTO `orders` VALUES (42, '2018-10-06 10:00', '待处理', 42, 1001);
INSERT INTO `orders` VALUES (43, '2018-10-06 10:00', '待处理', 43, 1001);
INSERT INTO `orders` VALUES (44, '2018-10-06 10:00', '待处理', 44, 1001);
INSERT INTO `orders` VALUES (45, '2018-10-06 10:00', '待处理', 45, 1001);
INSERT INTO `orders` VALUES (46, '2018-10-06 10:00', '待处理', 46, 1001);
INSERT INTO `orders` VALUES (47, '2018-10-06 10:00', '待处理', 47, 1001);
INSERT INTO `orders` VALUES (48, '2018-10-06 10:00', '待处理', 48, 1001);
INSERT INTO `orders` VALUES (49, '2018-10-06 10:00', '待处理', 49, 1001);
INSERT INTO `orders` VALUES (50, '2018-10-06 10:00', '待处理', 50, 1001);
INSERT INTO `orders` VALUES (51, '2018-10-06 10:00', '待处理', 51, 1001);
INSERT INTO `orders` VALUES (52, '2018-10-06 10:00', '待处理', 52, 1001);
INSERT INTO `orders` VALUES (53, '2018-10-06 10:00', '待处理', 53, 1001);
INSERT INTO `orders` VALUES (54, '2018-10-06 10:00', '待处理', 54, 1001);
INSERT INTO `orders` VALUES (55, '2018-10-06 10:00', '待处理', 55, 1001);
INSERT INTO `orders` VALUES (56, '2018-10-06 10:00', '待处理', 56, 1001);
INSERT INTO `orders` VALUES (57, '2018-10-06 10:00', '待处理', 57, 1001);
INSERT INTO `orders` VALUES (58, '2018-10-06 10:00', '待处理', 58, 1001);
INSERT INTO `orders` VALUES (59, '2018-10-06 10:00', '待处理', 59, 1001);
INSERT INTO `orders` VALUES (60, '2018-10-06 10:00', '待处理', 60, 1001);
INSERT INTO `orders` VALUES (61, '2018-10-06 10:00', '待处理', 61, 1001);
INSERT INTO `orders` VALUES (62, '2018-10-06 10:00', '待处理', 62, 1001);
INSERT INTO `orders` VALUES (63, '2018-10-06 10:00', '待处理', 63, 1001);
INSERT INTO `orders` VALUES (64, '2018-10-06 10:00', '待处理', 64, 1001);
INSERT INTO `orders` VALUES (65, '2018-10-06 10:00', '待处理', 65, 1001);
INSERT INTO `orders` VALUES (66, '2018-10-06 10:00', '待处理', 66, 1001);
INSERT INTO `orders` VALUES (67, '2018-10-06 10:00', '待处理', 67, 1001);
INSERT INTO `orders` VALUES (68, '2018-10-06 10:00', '待处理', 68, 1001);
INSERT INTO `orders` VALUES (69, '2018-10-06 10:00', '待处理', 69, 1001);
INSERT INTO `orders` VALUES (70, '2018-10-06 10:00', '待处理', 70, 1001);
INSERT INTO `orders` VALUES (71, '2018-10-06 10:00', '待处理', 71, 1001);
INSERT INTO `orders` VALUES (72, '2018-10-06 10:00', '待处理', 72, 1001);
INSERT INTO `orders` VALUES (73, '2018-10-06 10:00', '待处理', 73, 1001);
INSERT INTO `orders` VALUES (74, '2018-10-06 10:00', '待处理', 74, 1001);
INSERT INTO `orders` VALUES (75, '2018-10-06 10:00', '待处理', 75, 1001);
INSERT INTO `orders` VALUES (76, '2018-10-06 10:00', '待处理', 76, 1001);
INSERT INTO `orders` VALUES (77, '2018-10-06 10:00', '待处理', 77, 1001);
INSERT INTO `orders` VALUES (78, '2018-10-06 10:00', '待处理', 78, 1001);
INSERT INTO `orders` VALUES (79, '2018-10-06 10:00', '待处理', 79, 1001);
INSERT INTO `orders` VALUES (80, '2018-10-06 10:00', '待处理', 80, 1001);
INSERT INTO `orders` VALUES (81, '2018-10-06 10:00', '待处理', 81, 1001);
INSERT INTO `orders` VALUES (82, '2018-10-06 10:00', '待处理', 82, 1001);
INSERT INTO `orders` VALUES (83, '2018-10-06 10:00', '待处理', 83, 1001);
INSERT INTO `orders` VALUES (84, '2018-10-06 10:00', '待处理', 84, 1001);
INSERT INTO `orders` VALUES (85, '2018-10-06 10:00', '待处理', 85, 1001);
INSERT INTO `orders` VALUES (86, '2018-10-06 10:00', '待处理', 86, 1001);
INSERT INTO `orders` VALUES (87, '2018-10-06 10:00', '待处理', 87, 1001);
INSERT INTO `orders` VALUES (88, '2018-10-06 10:00', '待处理', 88, 1001);
INSERT INTO `orders` VALUES (89, '2018-10-06 10:00', '待处理', 89, 1001);
INSERT INTO `orders` VALUES (90, '2018-10-06 10:00', '待处理', 90, 1001);
INSERT INTO `orders` VALUES (91, '2018-10-06 10:00', '待处理', 91, 1001);
INSERT INTO `orders` VALUES (92, '2018-10-06 10:00', '待处理', 92, 1001);
INSERT INTO `orders` VALUES (93, '2018-10-06 10:00', '待处理', 93, 1001);
INSERT INTO `orders` VALUES (94, '2018-10-06 10:00', '待处理', 94, 1001);
INSERT INTO `orders` VALUES (95, '2018-10-06 10:00', '待处理', 95, 1001);
INSERT INTO `orders` VALUES (96, '2018-10-06 10:00', '待处理', 96, 1001);
INSERT INTO `orders` VALUES (97, '2018-10-06 10:00', '待处理', 97, 1001);
INSERT INTO `orders` VALUES (98, '2018-10-06 10:00', '待处理', 98, 1001);
INSERT INTO `orders` VALUES (99, '2018-10-06 10:00', '待处理', 99, 1001);

-- ----------------------------
-- Table structure for patientuser
-- ----------------------------
DROP TABLE IF EXISTS `patientuser`;
CREATE TABLE `patientuser`  (
  `p_id` int(11) NOT NULL AUTO_INCREMENT,
  `p_age` int(11) NULL DEFAULT NULL,
  `p_gender` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `p_password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `p_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `p_phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`p_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1291476019 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of patientuser
-- ----------------------------
INSERT INTO `patientuser` VALUES (1, 22, 'm', '12345', '小美', '12222222222');
INSERT INTO `patientuser` VALUES (2, 22, 'm', '12345', '小美', '12222222222');
INSERT INTO `patientuser` VALUES (3, 22, 'm', '12345', '小美', '12222222222');
INSERT INTO `patientuser` VALUES (4, 22, 'm', '12345', '小美', '12222222222');
INSERT INTO `patientuser` VALUES (5, 22, 'm', '12345', '小美', '12222222222');
INSERT INTO `patientuser` VALUES (6, 22, 'm', '12345', '小美', '12222222222');
INSERT INTO `patientuser` VALUES (7, 22, 'm', '12345', '小美', '12222222222');
INSERT INTO `patientuser` VALUES (8, 22, 'm', '12345', '小美', '12222222222');
INSERT INTO `patientuser` VALUES (9, 22, 'm', '12345', '小美', '12222222222');
INSERT INTO `patientuser` VALUES (10, 22, 'm', '12345', '小美', '12222222222');
INSERT INTO `patientuser` VALUES (11, 22, 'm', '12345', '小美', '12222222222');
INSERT INTO `patientuser` VALUES (12, 22, 'm', '12345', '小美', '12222222222');
INSERT INTO `patientuser` VALUES (13, 22, 'm', '12345', '小美', '12222222222');
INSERT INTO `patientuser` VALUES (14, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (15, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (16, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (17, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (18, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (19, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (20, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (21, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (22, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (23, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (24, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (25, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (26, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (27, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (28, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (29, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (30, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (31, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (32, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (33, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (34, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (35, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (36, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (37, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (38, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (39, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (40, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (41, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (42, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (43, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (44, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (45, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (46, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (47, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (48, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (49, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (50, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (51, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (52, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (53, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (54, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (55, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (56, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (57, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (58, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (59, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (60, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (61, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (62, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (63, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (64, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (65, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (66, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (67, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (68, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (69, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (70, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (71, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (72, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (73, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (74, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (75, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (76, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (77, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (78, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (79, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (80, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (81, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (82, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (83, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (84, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (85, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (86, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (87, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (88, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (89, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (90, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (91, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (92, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (93, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (94, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (95, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (96, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (97, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (98, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (99, 23, 'm', '12345', '小丽', '12222222223');
INSERT INTO `patientuser` VALUES (1291476018, 22, 'f', '1291476018', '小菀', '18756989050');

SET FOREIGN_KEY_CHECKS = 1;

源码:下载

猜你喜欢

转载自blog.csdn.net/weixin_36512652/article/details/82952734