Initial commit

main
pvje3i7lq 1 year ago committed by YU
commit f2e2614c4c

@ -0,0 +1,2 @@
# study

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1 @@
Online_Study_System

@ -0,0 +1,14 @@
<component name="ArtifactManager">
<artifact type="war" name="Online_Study_System:war">
<output-path>$PROJECT_DIR$/target</output-path>
<properties id="maven-jee-properties">
<options>
<module>Online_Study_System</module>
<packaging>war</packaging>
</options>
</properties>
<root id="archive" name="Examination_System.war">
<element id="artifact" artifact-name="Online_Study_System:war exploded" />
</root>
</artifact>
</component>

@ -0,0 +1,58 @@
<component name="ArtifactManager">
<artifact type="exploded-war" name="Online_Study_System:war exploded">
<output-path>$PROJECT_DIR$/target/Examination_System</output-path>
<properties id="maven-jee-properties">
<options>
<exploded>true</exploded>
<module>Online_Study_System</module>
<packaging>war</packaging>
</options>
</properties>
<root id="root">
<element id="directory" name="WEB-INF">
<element id="directory" name="classes">
<element id="module-output" name="Online_Study_System" />
</element>
<element id="directory" name="lib">
<element id="library" level="project" name="Maven: org.apache.commons:commons-lang3:3.6" />
<element id="library" level="project" name="Maven: commons-codec:commons-codec:1.10" />
<element id="library" level="project" name="Maven: org.slf4j:slf4j-log4j12:1.7.25" />
<element id="library" level="project" name="Maven: org.slf4j:slf4j-api:1.7.25" />
<element id="library" level="project" name="Maven: org.apache.shiro:shiro-core:1.2.3" />
<element id="library" level="project" name="Maven: commons-beanutils:commons-beanutils:1.8.3" />
<element id="library" level="project" name="Maven: org.apache.shiro:shiro-web:1.2.3" />
<element id="library" level="project" name="Maven: org.apache.shiro:shiro-spring:1.2.3" />
<element id="library" level="project" name="Maven: org.springframework:spring-context:4.3.8.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-beans:4.3.8.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-core:4.3.8.RELEASE" />
<element id="library" level="project" name="Maven: commons-logging:commons-logging:1.2" />
<element id="library" level="project" name="Maven: org.springframework:spring-expression:4.3.8.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-web:4.3.8.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-webmvc:4.3.7.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-tx:4.3.8.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-aop:4.3.9.RELEASE" />
<element id="library" level="project" name="Maven: org.aspectj:aspectjweaver:1.8.10" />
<element id="library" level="project" name="Maven: org.springframework:spring-jdbc:4.2.5.RELEASE" />
<element id="library" level="project" name="Maven: javax.servlet:jstl:1.2" />
<element id="library" level="project" name="Maven: log4j:log4j:1.2.17" />
<element id="library" level="project" name="Maven: org.mybatis:mybatis:3.4.1" />
<element id="library" level="project" name="Maven: org.mybatis.generator:mybatis-generator-core:1.3.5" />
<element id="library" level="project" name="Maven: org.mybatis:mybatis-spring:1.3.0" />
<element id="library" level="project" name="Maven: org.hibernate:hibernate-validator:5.4.1.Final" />
<element id="library" level="project" name="Maven: javax.validation:validation-api:1.1.0.Final" />
<element id="library" level="project" name="Maven: org.jboss.logging:jboss-logging:3.3.0.Final" />
<element id="library" level="project" name="Maven: com.fasterxml:classmate:1.3.1" />
<element id="library" level="project" name="Maven: com.mchange:c3p0:0.9.5.2" />
<element id="library" level="project" name="Maven: com.mchange:mchange-commons-java:0.2.11" />
<element id="library" level="project" name="Maven: mysql:mysql-connector-java:8.0.28" />
<element id="library" level="project" name="Maven: com.google.protobuf:protobuf-java:3.11.4" />
<element id="library" level="project" name="Maven: org.jetbrains:annotations-java5:24.1.0" />
</element>
</element>
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/target/Examination_System/META-INF/MANIFEST.MF" />
</element>
<element id="javaee-facet-resources" facet="Online_Study_System/web/Web" />
</root>
</artifact>
</component>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="Online_Study_System" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel target="1.8">
<module name="Online_Study_System" target="1.6" />
</bytecodeTargetLevel>
</component>
</project>

@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.fasterxml:classmate:1.3.1">
<CLASSES>
<root url="jar://D:/学习文件/repository/com/fasterxml/classmate/1.3.1/classmate-1.3.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/com/fasterxml/classmate/1.3.1/classmate-1.3.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/com/fasterxml/classmate/1.3.1/classmate-1.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.google.protobuf:protobuf-java:3.11.4">
<CLASSES>
<root url="jar://D:/学习文件/repository/com/google/protobuf/protobuf-java/3.11.4/protobuf-java-3.11.4.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/com/google/protobuf/protobuf-java/3.11.4/protobuf-java-3.11.4-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/com/google/protobuf/protobuf-java/3.11.4/protobuf-java-3.11.4-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.mchange:c3p0:0.9.5.2">
<CLASSES>
<root url="jar://D:/学习文件/repository/com/mchange/c3p0/0.9.5.2/c3p0-0.9.5.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/com/mchange/c3p0/0.9.5.2/c3p0-0.9.5.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/com/mchange/c3p0/0.9.5.2/c3p0-0.9.5.2-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.mchange:mchange-commons-java:0.2.11">
<CLASSES>
<root url="jar://D:/学习文件/repository/com/mchange/mchange-commons-java/0.2.11/mchange-commons-java-0.2.11.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/com/mchange/mchange-commons-java/0.2.11/mchange-commons-java-0.2.11-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/com/mchange/mchange-commons-java/0.2.11/mchange-commons-java-0.2.11-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: commons-beanutils:commons-beanutils:1.8.3">
<CLASSES>
<root url="jar://D:/学习文件/repository/commons-beanutils/commons-beanutils/1.8.3/commons-beanutils-1.8.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/commons-beanutils/commons-beanutils/1.8.3/commons-beanutils-1.8.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/commons-beanutils/commons-beanutils/1.8.3/commons-beanutils-1.8.3-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: commons-codec:commons-codec:1.10">
<CLASSES>
<root url="jar://D:/学习文件/repository/commons-codec/commons-codec/1.10/commons-codec-1.10.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/commons-codec/commons-codec/1.10/commons-codec-1.10-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/commons-codec/commons-codec/1.10/commons-codec-1.10-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: commons-logging:commons-logging:1.2">
<CLASSES>
<root url="jar://D:/学习文件/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/commons-logging/commons-logging/1.2/commons-logging-1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/commons-logging/commons-logging/1.2/commons-logging-1.2-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: javax.servlet:javax.servlet-api:3.1.0">
<CLASSES>
<root url="jar://D:/学习文件/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: javax.servlet:jstl:1.2">
<CLASSES>
<root url="jar://D:/学习文件/repository/javax/servlet/jstl/1.2/jstl-1.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/javax/servlet/jstl/1.2/jstl-1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/javax/servlet/jstl/1.2/jstl-1.2-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: javax.validation:validation-api:1.1.0.Final">
<CLASSES>
<root url="jar://D:/学习文件/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: junit:junit:4.12">
<CLASSES>
<root url="jar://D:/学习文件/repository/junit/junit/4.12/junit-4.12.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/junit/junit/4.12/junit-4.12-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/junit/junit/4.12/junit-4.12-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: log4j:log4j:1.2.17">
<CLASSES>
<root url="jar://D:/学习文件/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/log4j/log4j/1.2.17/log4j-1.2.17-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/log4j/log4j/1.2.17/log4j-1.2.17-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: mysql:mysql-connector-java:8.0.28">
<CLASSES>
<root url="jar://D:/学习文件/repository/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.commons:commons-lang3:3.6">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/apache/commons/commons-lang3/3.6/commons-lang3-3.6.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/apache/commons/commons-lang3/3.6/commons-lang3-3.6-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/apache/commons/commons-lang3/3.6/commons-lang3-3.6-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.shiro:shiro-core:1.2.3">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/apache/shiro/shiro-core/1.2.3/shiro-core-1.2.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/apache/shiro/shiro-core/1.2.3/shiro-core-1.2.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/apache/shiro/shiro-core/1.2.3/shiro-core-1.2.3-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.shiro:shiro-spring:1.2.3">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/apache/shiro/shiro-spring/1.2.3/shiro-spring-1.2.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/apache/shiro/shiro-spring/1.2.3/shiro-spring-1.2.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/apache/shiro/shiro-spring/1.2.3/shiro-spring-1.2.3-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.shiro:shiro-web:1.2.3">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/apache/shiro/shiro-web/1.2.3/shiro-web-1.2.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/apache/shiro/shiro-web/1.2.3/shiro-web-1.2.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/apache/shiro/shiro-web/1.2.3/shiro-web-1.2.3-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.aspectj:aspectjweaver:1.8.10">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/aspectj/aspectjweaver/1.8.10/aspectjweaver-1.8.10.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/aspectj/aspectjweaver/1.8.10/aspectjweaver-1.8.10-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/aspectj/aspectjweaver/1.8.10/aspectjweaver-1.8.10-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.hamcrest:hamcrest-core:1.3">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.hibernate:hibernate-validator:5.4.1.Final">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/hibernate/hibernate-validator/5.4.1.Final/hibernate-validator-5.4.1.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/hibernate/hibernate-validator/5.4.1.Final/hibernate-validator-5.4.1.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/hibernate/hibernate-validator/5.4.1.Final/hibernate-validator-5.4.1.Final-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.jboss.logging:jboss-logging:3.3.0.Final">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.jetbrains:annotations-java5:24.1.0">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/jetbrains/annotations-java5/24.1.0/annotations-java5-24.1.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/jetbrains/annotations-java5/24.1.0/annotations-java5-24.1.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/jetbrains/annotations-java5/24.1.0/annotations-java5-24.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.mybatis.generator:mybatis-generator-core:1.3.5">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/mybatis/generator/mybatis-generator-core/1.3.5/mybatis-generator-core-1.3.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/mybatis/generator/mybatis-generator-core/1.3.5/mybatis-generator-core-1.3.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/mybatis/generator/mybatis-generator-core/1.3.5/mybatis-generator-core-1.3.5-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.mybatis:mybatis:3.4.1">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/mybatis/mybatis/3.4.1/mybatis-3.4.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/mybatis/mybatis/3.4.1/mybatis-3.4.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/mybatis/mybatis/3.4.1/mybatis-3.4.1-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.mybatis:mybatis-spring:1.3.0">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/mybatis/mybatis-spring/1.3.0/mybatis-spring-1.3.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/mybatis/mybatis-spring/1.3.0/mybatis-spring-1.3.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/mybatis/mybatis-spring/1.3.0/mybatis-spring-1.3.0-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.slf4j:slf4j-api:1.7.25">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.slf4j:slf4j-log4j12:1.7.25">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-aop:4.3.9.RELEASE">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-aop/4.3.9.RELEASE/spring-aop-4.3.9.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/springframework/spring-aop/4.3.9.RELEASE/spring-aop-4.3.9.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-aop/4.3.9.RELEASE/spring-aop-4.3.9.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-beans:4.3.8.RELEASE">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-beans/4.3.8.RELEASE/spring-beans-4.3.8.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/springframework/spring-beans/4.3.8.RELEASE/spring-beans-4.3.8.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-beans/4.3.8.RELEASE/spring-beans-4.3.8.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-context:4.3.8.RELEASE">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-context/4.3.8.RELEASE/spring-context-4.3.8.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/springframework/spring-context/4.3.8.RELEASE/spring-context-4.3.8.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-context/4.3.8.RELEASE/spring-context-4.3.8.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-core:4.3.8.RELEASE">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-core/4.3.8.RELEASE/spring-core-4.3.8.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/springframework/spring-core/4.3.8.RELEASE/spring-core-4.3.8.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-core/4.3.8.RELEASE/spring-core-4.3.8.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-expression:4.3.8.RELEASE">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-expression/4.3.8.RELEASE/spring-expression-4.3.8.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/springframework/spring-expression/4.3.8.RELEASE/spring-expression-4.3.8.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-expression/4.3.8.RELEASE/spring-expression-4.3.8.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-jdbc:4.2.5.RELEASE">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-jdbc/4.2.5.RELEASE/spring-jdbc-4.2.5.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/springframework/spring-jdbc/4.2.5.RELEASE/spring-jdbc-4.2.5.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-jdbc/4.2.5.RELEASE/spring-jdbc-4.2.5.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-tx:4.3.8.RELEASE">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-tx/4.3.8.RELEASE/spring-tx-4.3.8.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/springframework/spring-tx/4.3.8.RELEASE/spring-tx-4.3.8.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-tx/4.3.8.RELEASE/spring-tx-4.3.8.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-web:4.3.8.RELEASE">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-web/4.3.8.RELEASE/spring-web-4.3.8.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/springframework/spring-web/4.3.8.RELEASE/spring-web-4.3.8.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-web/4.3.8.RELEASE/spring-web-4.3.8.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-webmvc:4.3.7.RELEASE">
<CLASSES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-webmvc/4.3.7.RELEASE/spring-webmvc-4.3.7.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/学习文件/repository/org/springframework/spring-webmvc/4.3.7.RELEASE/spring-webmvc-4.3.7.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/学习文件/repository/org/springframework/spring-webmvc/4.3.7.RELEASE/spring-webmvc-4.3.7.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Online_Study_System.iml" filepath="$PROJECT_DIR$/Online_Study_System.iml" />
</modules>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="" />
</component>
</project>

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
</webroots>
</configuration>
</facet>
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.6" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-core:1.2.3" level="project" />
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.8.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-web:1.2.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring:1.2.3" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:4.3.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:4.3.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.10" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:4.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:jstl:1.2" level="project" />
<orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.1" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.generator:mybatis-generator-core:1.3.5" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.0" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.4.1.Final" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.0.Final" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.1" level="project" />
<orderEntry type="library" name="Maven: com.mchange:c3p0:0.9.5.2" level="project" />
<orderEntry type="library" name="Maven: com.mchange:mchange-commons-java:0.2.11" level="project" />
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.28" level="project" />
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.11.4" level="project" />
<orderEntry type="library" name="Maven: org.jetbrains:annotations-java5:24.1.0" level="project" />
</component>
</module>

@ -0,0 +1,193 @@
<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>
<groupId>com.wxs</groupId>
<artifactId>Online_Study_System</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>EOnline_Study_System Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
</dependency>
<!--servletAPI-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!--shiro依赖-->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>1.2.3</version>
</dependency>
<!--spring-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.8.RELEASE</version>
</dependency>
<!--springWEB-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.8.RELEASE</version>
</dependency>
<!--springMVC-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.7.RELEASE</version>
</dependency>
<!--spring tx 事务处理-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>4.3.8.RELEASE</version>
</dependency>
<!--spring aop-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.3.9.RELEASE</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.10</version>
</dependency>
<!--spring-jdbc-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.2.5.RELEASE</version>
</dependency>
<!--jstl-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!--log4j-->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!--mybatis-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.1</version>
</dependency>
<!--mybatis逆向工程-->
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.5</version>
</dependency>
<!--mybatis spring整合包-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.0</version>
</dependency>
<!--hibernate 数据校验器包-->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.4.1.Final</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.28</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations-java5</artifactId>
<version>RELEASE</version>
</dependency>
</dependencies>
<build>
<finalName>Examination_System</finalName>
<!--在IDEA中maven 默认编译的时候 只搬运src/main/java里面的java文件到target/classes,其他文件会被忽略-->
<!--这时我们Mybatis的Mapper.xml文件就不能被加载进去也就是不能映射成功-->
<!--下面配置就能解决这个问题-->
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource> <directory>${basedir}/src/main/resources</directory> </resource>
</resources>
</build>
</project>

@ -0,0 +1,438 @@
package com.wxs.controller;
import com.wxs.controller.common.GlobalConstant;
import com.wxs.controller.common.SHA1Utils;
import com.wxs.exception.CustomException;
import com.wxs.po.*;
import com.wxs.service.*;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Controller
@RequestMapping("/admin")
public class AdminController {
@Resource(name = "studentServiceImpl")
private StudentService studentService;
@Resource(name = "teacherServiceImpl")
private TeacherService teacherService;
@Resource(name = "courseServiceImpl")
private CourseService courseService;
@Resource(name = "studentCourseServiceImpl")
private StudentCourseService studentCourseService;
@Resource(name = "userloginServiceImpl")
private UserloginService userloginService;
List<CourseCustom> getCourseCustomList(List<Course> courseList) throws Exception{
List<CourseCustom> list = new ArrayList<CourseCustom>();
for (Course course : courseList) {
CourseCustom courseCustom = new CourseCustom();
BeanUtils.copyProperties(course,courseCustom);
Integer teacherId = course.getTeacherId();
if(teacherId != null) {
Teacher teacher = teacherService.findById(teacherId);
String teacherName = teacher.getName();
courseCustom.setTeacherName(teacherName);
} else {
courseCustom.setTeacherName("");
}
list.add(courseCustom);
}
return list;
}
/**
* CourseCourseCustom
* @param course
* @return
* @throws Exception
*/
CourseCustom getCourseCustom(Course course) throws Exception{
CourseCustom courseCustom = new CourseCustom();
BeanUtils.copyProperties(course,courseCustom);
Integer teacherId = course.getTeacherId();
if(teacherId != null) {
Teacher teacher = teacherService.findById(teacherId);
String teacherName = teacher.getName();
courseCustom.setTeacherName(teacherName);
} else {
courseCustom.setTeacherName("");
}
return courseCustom;
}
/* ----- 普通方法区 END ----- */
/* ----- 课程管理区 START ----- */
@RequestMapping("/showCourse")
public String showCourse(Model model, Integer page) throws Exception {
List<Course> list = null;
//页码对象
PagingVO pagingVO = new PagingVO();
//设置总页数
pagingVO.setTotalCount(courseService.getCountCourse());
if (page == null || page == 0) {
pagingVO.setToPageNo(1);
list = courseService.findByPaging(1);
} else {
pagingVO.setToPageNo(page);
list = courseService.findByPaging(page);
}
List<CourseCustom> courseCustomList = getCourseCustomList(list);
model.addAttribute("courseCustomList", courseCustomList);
model.addAttribute("pagingVO", pagingVO);
return "admin/showCourse";
}
@RequestMapping(value = "/editCourse", method = {RequestMethod.GET})
public String editCourseUI(Integer id, Model model) throws Exception {
if (id == null) {
return "redirect:/admin/showCourse";
}
Course course = courseService.findById(id);
if (course == null) {
throw new CustomException("未找到该课程");
}
List<Teacher> list = teacherService.findAll();
model.addAttribute("teacherList", list);
model.addAttribute("course", course);
return "admin/editCourse";
}
@RequestMapping(value = "/editCourse", method = {RequestMethod.POST})
public String editCourse(Course course) throws Exception {
courseService.upadteById(course);
return "redirect:/admin/showCourse";
}
@RequestMapping("/removeCourse")
public String removeCourse(Integer id) throws Exception {
if (id == null) {
return "admin/showCourse";
}
boolean flag = courseService.removeById(id);
//删除失败说明selectCourse表中存在关联数据,先删除关联信息
while(flag == false) {
List<StudentCourse> lists = studentCourseService.findByCourseID(id);
for (StudentCourse studentCourse: lists) {
studentCourseService.remove(studentCourse);
}
flag = courseService.removeById(id);
}
return "redirect:/admin/showCourse";
}
@RequestMapping(value = "/selectCourse", method = {RequestMethod.POST})
public String selectCourse(String name, Model model) throws Exception {
List<Course> list = courseService.findByName(name);
List<CourseCustom> courseCustomList = getCourseCustomList(list);
model.addAttribute("courseCustomList", courseCustomList);
return "admin/showCourse";
}
@RequestMapping(value = "/addCourse", method = {RequestMethod.GET})
public String addCourseUI(Model model) throws Exception {
List<Teacher> list = teacherService.findAll();
model.addAttribute("teacherList", list);
return "admin/addCourse";
}
@RequestMapping(value = "/addCourse", method = {RequestMethod.POST})
public String addCourse(Course course) throws Exception {
courseService.save(course);
return "redirect:/admin/showCourse";
}
/* ----- 课程管理区 END ----- */
/* ----- 学生管理区 START ----- */
@RequestMapping("/showStudent")
public String showStudent(Model model, Integer page) throws Exception {
List<Student> list = null;
//页码对象
PagingVO pagingVO = new PagingVO();
//设置总页数
pagingVO.setTotalCount(studentService.getCountStudent());
if (page == null || page == 0) {
pagingVO.setToPageNo(1);
list = studentService.findByPaging(1);
} else {
pagingVO.setToPageNo(page);
list = studentService.findByPaging(page);
}
model.addAttribute("studentList", list);
model.addAttribute("pagingVO", pagingVO);
return "admin/showStudent";
}
@RequestMapping(value = "/addStudent", method = {RequestMethod.GET})
public String addStudentUI() throws Exception {
return "admin/addStudent";
}
@RequestMapping(value = "/addStudent", method = {RequestMethod.POST})
public String addStudent(Student student) throws Exception {
Userlogin userlogin = null;
if(userlogin != null) {
throw new CustomException("该名称已被注册,无法添加!");
} else {
userlogin = new Userlogin();
userlogin.setName(student.getName());
userlogin.setPassword(SHA1Utils.entryptPassword(GlobalConstant.DEFAULT_PASSWD));
userlogin.setRole(GlobalConstant.ROle_Type.STUDENT.getIndex());
userloginService.save(userlogin);
student.setId(userlogin.getId());
student.setBalance(GlobalConstant.DEFAULT_BALANCE);
studentService.save(student);
}
return "redirect:/admin/showStudent";
}
@RequestMapping(value = "/editStudent", method = {RequestMethod.GET})
public String editStudentUI(Integer id, Model model) throws Exception {
Student student = null;
student = studentService.findById(id);
if(student == null) {
throw new CustomException("该用户不存在!");
}
model.addAttribute("student", student);
return "admin/editStudent";
}
@RequestMapping(value = "/editStudent", method = {RequestMethod.POST})
public String editStudent(Student student) throws Exception {
Userlogin userLogin = userloginService.findById(student.getId());
userLogin.setName(student.getName());
userloginService.updateById(student.getId(),userLogin);
studentService.updataById(student);
return "redirect:/admin/showStudent";
}
@RequestMapping(value = "/removeStudent", method = {RequestMethod.GET} )
public String removeStudent(Integer id) throws Exception {
boolean flag = studentService.removeById(id);
//flag false 表示该学生有课程,递归删除该学生课程
while(flag == false){
List<StudentCourse> lists = studentCourseService.findByStudentID(id);
for (StudentCourse studentCourse: lists) {
studentCourseService.remove(studentCourse);
}
flag = studentService.removeById(id);
}
userloginService.removeById(id);
return "redirect:/admin/showStudent";
}
@RequestMapping(value = "selectStudent", method = {RequestMethod.POST})
public String selectStudent(String name, Model model) throws Exception {
List<Student> list = studentService.findByName(name);
model.addAttribute("studentList", list);
return "admin/showStudent";
}
/* ----- 学生管理区 END ----- */
/* ----- 教师管理区 START ----- */
@RequestMapping("/showTeacher")
public String showTeacher(Model model, Integer page) throws Exception {
List<Teacher> list = null;
//页码对象
PagingVO pagingVO = new PagingVO();
//设置总页数
pagingVO.setTotalCount(teacherService.getCountTeacher());
if (page == null || page == 0) {
pagingVO.setToPageNo(1);
list = teacherService.findByPaging(1);
} else {
pagingVO.setToPageNo(page);
list = teacherService.findByPaging(page);
}
model.addAttribute("teacherList", list);
model.addAttribute("pagingVO", pagingVO);
return "admin/showTeacher";
}
@RequestMapping(value = "/addTeacher", method = {RequestMethod.GET})
public String addTeacherUI() throws Exception {
return "admin/addTeacher";
}
@RequestMapping(value = "/addTeacher", method = {RequestMethod.POST})
public String addTeacher(Teacher teacher) throws Exception {
Userlogin userlogin = null;
userlogin = userloginService.findByName(teacher.getName());
if(userlogin != null) {
throw new CustomException("该名称已被注册,无法注册!");
} else {
userlogin = new Userlogin();
userlogin.setName(teacher.getName());
userlogin.setPassword(SHA1Utils.entryptPassword(GlobalConstant.DEFAULT_PASSWD));
userlogin.setRole(GlobalConstant.ROle_Type.TEACHER.getIndex());
userloginService.save(userlogin);
teacher.setId(userlogin.getId());
teacherService.save(teacher);
}
return "redirect:/admin/showTeacher";
}
@RequestMapping(value = "/editTeacher", method = {RequestMethod.GET})
public String editTeacherUI(Integer id, Model model) throws Exception {
Teacher teacher = teacherService.findById(id);
if (teacher == null) {
throw new CustomException("未找到该教师");
}
model.addAttribute("teacher", teacher);
return "admin/editTeacher";
}
@RequestMapping(value = "/editTeacher", method = {RequestMethod.POST})
public String editTeacher(Teacher teacher) throws Exception {
teacherService.updateById(teacher);
return "redirect:/admin/showTeacher";
}
@RequestMapping("/removeTeacher")
public String removeTeacher(Integer id) throws Exception {
boolean flag = teacherService.removeById(id);
if(flag == false) {
throw new CustomException("该老师存在相应课程,无法删除");
}
userloginService.removeById(id);
return "redirect:/admin/showTeacher";
}
@RequestMapping(value = "selectTeacher", method = {RequestMethod.POST})
public String selectTeacher(String name, Model model) throws Exception {
List<Teacher> list = teacherService.findByName(name);
model.addAttribute("teacherList", list);
return "admin/showTeacher";
}
/* ----- 教师管理区 END ----- */
/* ----- 其他区 START ----- */
@RequestMapping(value = "/logout")
public String logout(){
return "redirect:/logout";
}
/**
* UI
* @return
* @throws Exception
*/
@RequestMapping("/userPasswordRest")
public String userPasswordRestUI() throws Exception {
return "admin/userPasswordRest";
}
/**
*
* @param userlogin Userlogin
* @return
* @throws Exception
*/
@RequestMapping(value = "/userPasswordRest", method = {RequestMethod.POST})
public String userPasswordRest(Userlogin userlogin) throws Exception {
Userlogin u = userloginService.findByName(userlogin.getName());
if (u != null) {
if (u.getRole() == 0) {
throw new CustomException("该账户为管理员账户,无法修改");
}
u.setPassword(SHA1Utils.entryptPassword(userlogin.getPassword()));
userloginService.updateByName(userlogin.getName(), u);
} else {
throw new CustomException("未找到该用户");
}
return "admin/userPasswordRest";
}
/**
*
* @return
* @throws Exception
*/
@RequestMapping("/passwordRest")
public String passwordRestUI() throws Exception {
return "admin/passwordRest";
}
/* ----- 其他区 END ----- */
}

@ -0,0 +1,50 @@
package com.wxs.controller;
import com.wxs.controller.common.GlobalConstant;
import com.wxs.po.Userlogin;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
public class LoginController {
/**
*
*/
@RequestMapping(value = "/login", method = {RequestMethod.GET})
public String loginUI() throws Exception {
return "../../login";
}
/**
*
*/
@RequestMapping(value = "/login", method = {RequestMethod.POST})
public String login(Userlogin userlogin) throws Exception {
//Shiro实现登录
UsernamePasswordToken token = new UsernamePasswordToken(userlogin.getName(),
userlogin.getPassword());
Subject subject = SecurityUtils.getSubject();
//如果获取不到用户名就是登录失败,但登录失败的话,会直接抛出异常
subject.login(token);
//所有用户均重定向对应的展示课程页面
if (subject.hasRole(GlobalConstant.ROle_Type.ADMIN.getName())) {
return "redirect:/admin/showCourse";
} else if (subject.hasRole(GlobalConstant.ROle_Type.TEACHER.getName())) {
return "redirect:/teacher/showCourse";
} else if (subject.hasRole(GlobalConstant.ROle_Type.STUDENT.getName())) {
return "redirect:/student/showCourse";
}
return "../../login";
}
}

@ -0,0 +1,43 @@
package com.wxs.controller;
import com.wxs.controller.common.SHA1Utils;
import com.wxs.exception.CustomException;
import com.wxs.po.Userlogin;
import com.wxs.service.UserloginService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.annotation.Resource;
@Controller
public class RestPasswordController {
@Resource(name = "userloginServiceImpl")
private UserloginService userloginService;
/**
*
*/
@RequestMapping(value = "/passwordRest", method = {RequestMethod.POST})
public String passwordRest(String oldPassword, String password1) throws Exception {
Subject subject = SecurityUtils.getSubject();
String username = (String) subject.getPrincipal();
Userlogin userlogin = userloginService.findByName(username);
if (!SHA1Utils.validatePassword(oldPassword,userlogin.getPassword())) {
throw new CustomException("旧密码不正确");
} else {
userlogin.setPassword(SHA1Utils.entryptPassword(password1));
userloginService.updateByName(username, userlogin);
}
return "redirect:/logout";
}
}

@ -0,0 +1,426 @@
package com.wxs.controller;
import com.wxs.exception.CustomException;
import com.wxs.po.*;
import com.wxs.service.*;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Controller
@RequestMapping(value = "/student")
public class StudentController {
@Resource(name = "userloginServiceImpl")
private UserloginService userloginService;
@Resource(name = "courseServiceImpl")
private CourseService courseService;
@Resource(name = "studentServiceImpl")
private StudentService studentService;
@Resource(name = "teacherServiceImpl")
private TeacherService teacherService;
@Resource(name = "studentCourseServiceImpl")
private StudentCourseService studentCourseService;
/* ----- 普通方法区 START ----- */
/**
*
*/
private String getUserName() {
Subject subject = SecurityUtils.getSubject();
return (String) subject.getPrincipal();
}
/**
* id
*/
private Integer getUserId() throws Exception{
Userlogin userlogin = userloginService.findByName(getUserName());
return userlogin.getId();
}
/**
* CourseCustom
*/
private CourseCustom getCourseCustom(Course course) throws Exception{
CourseCustom courseCustom = new CourseCustom();
BeanUtils.copyProperties(course, courseCustom);
Teacher teacher = teacherService.findById(course.getTeacherId());
courseCustom.setTeacherName(teacher.getName());
return courseCustom;
}
/**
* CourseCustom
*/
private List<CourseCustom> getCourseCustomList(List<Course> list) throws Exception{
List<CourseCustom> lists = new ArrayList<CourseCustom>();
for (Course course: list) {
lists.add(getCourseCustom(course));
}
return lists;
}
/**
* StudentCourseCustom
*/
private StudentCourseCustom getStudentCourseCustom(StudentCourse studentCourse) throws Exception{
Course course = courseService.findById(studentCourse.getCourseId());
String teacherName = teacherService.findById(course.getTeacherId()).getName();
StudentCourseCustom studentCourseCustom = new StudentCourseCustom();
BeanUtils.copyProperties(studentCourse, studentCourseCustom);
studentCourseCustom.setCourse(course);
studentCourseCustom.setTeacherName(teacherName);
return studentCourseCustom;
}
/**
* StudentCourseCustom
*/
private List<StudentCourseCustom> getStudentCourseCustomList(List<StudentCourse> list) throws Exception{
List<StudentCourseCustom> lists = new ArrayList<StudentCourseCustom>();
for (StudentCourse studentCourse: list) {
lists.add(getStudentCourseCustom(studentCourse));
}
return lists;
}
/* ----- 普通方法区 END ----- */
/* ----- 所有课程区 START ----- */
/**
*
*/
@RequestMapping(value = "/showCourse")
public String stuCourseShow(Model model, Integer page) throws Exception {
List<Course> list = null;
//页码对象
PagingVO pagingVO = new PagingVO();
//设置总页数
pagingVO.setTotalCount(courseService.getCountCourse());
if (page == null || page == 0) {
pagingVO.setToPageNo(1);
list = courseService.findByPaging(1);
} else {
pagingVO.setToPageNo(page);
list = courseService.findByPaging(page);
}
List<CourseCustom> lists = getCourseCustomList(list);
model.addAttribute("courseList", lists);
model.addAttribute("pagingVO", pagingVO);
return "student/showCourse";
}
@RequestMapping(value = "/findCourse")
public String findCourse(String name, Model model) throws Exception {
List<Course> list = courseService.findByName(name);
List<CourseCustom> lists = getCourseCustomList(list);
model.addAttribute("courseList", lists);
return "student/showCourse";
}
/**
*
* @param id id
*/
@RequestMapping(value = "/stuSelectedCourse")
public String stuSelectedCourse(int id) throws Exception {
int stuId = getUserId();
StudentCourse s = studentCourseService.findOne(id,stuId);
//是否选过逻辑判断
if (s == null) {
//获取当前用户余额
Student student = studentService.findById(stuId);
int balance = student.getBalance();
//获取当前课程售价
Course course = courseService.findById(id);
int price = course.getPrice();
if(price > balance){
throw new CustomException("当前账户余额不足,无法选课,请充值!");
}else{
//更新余额
balance -= price;
//只有在余额发生改变的情况下,才更新余额信息
if(balance != student.getBalance()){
student.setBalance(balance);
studentService.updataById(student);
}
//保存选课信息
StudentCourse studentCourse = new StudentCourse();
studentCourse.setCourseId(id);
studentCourse.setStudentId(stuId);
studentCourseService.save(studentCourse);
}
} else {
throw new CustomException("该门课程已经选过或修过!");
}
return "redirect:/student/selectedCourse";
}
/* ----- 所有课程区 END ----- */
/* ----- 已选课程区 START ----- */
/**
*
*/
@RequestMapping(value = "/selectedCourse")
public String selectedCourse(Model model) throws Exception {
int stuId = getUserId();
try{
List<StudentCourse> list = studentCourseService.findByStudentID(stuId, false);
List<StudentCourseCustom> lists = getStudentCourseCustomList(list);
model.addAttribute("StudentCourseCustomList", lists);
return "student/selectCourse";
}
catch (Exception e){
throw new CustomException("未获取到已选课程!");
}
}
/**
*
* @param id id
* @param model Model
* @return
* @throws Exception
*/
@RequestMapping(value = "/startStudy")
public String startStudy(int id,Model model) throws Exception {
int stuId = getUserId();
StudentCourse studentCourse = studentCourseService.findOne(id, stuId);
StudentCourseCustom studentCourseCustom = getStudentCourseCustom(studentCourse);
model.addAttribute("studentCourseCustom", studentCourseCustom);
return "/student/study";
}
/**
*
*/
@RequestMapping(value = "/prePeriod")
public String changePeriod(int id,Model model) throws Exception {
int stuId = getUserId();
//得到当前学时数
StudentCourse studentCourse = studentCourseService.findOne(id,stuId);
int currentPeriod = studentCourse.getProgress();
//如果当前学时大于1进入上一学时
if(currentPeriod > 0){
currentPeriod -= 1;
studentCourse.setProgress(currentPeriod);
studentCourseService.update(studentCourse);
}
StudentCourseCustom studentCourseCustom = getStudentCourseCustom(studentCourse);
model.addAttribute("studentCourseCustom", studentCourseCustom);
return "/student/study";
}
/**
*
*/
@RequestMapping(value = "/backPeriod")
public String backPeriod(int id,Model model) throws Exception {
int stuId = getUserId();
//得到当前学时数
StudentCourse studentCourse = studentCourseService.findOne(id,stuId);
int currentPeriod = studentCourse.getProgress();
//得到所有学时数
Course course = courseService.findById(id);
int totalPeriod = course.getPeriod();
//如果当前学时小于总学时数,进入下一学时
if(currentPeriod < totalPeriod){
currentPeriod += 1;
studentCourse.setProgress(currentPeriod);
studentCourseService.update(studentCourse);
}
StudentCourseCustom studentCourseCustom = getStudentCourseCustom(studentCourse);
model.addAttribute("studentCourseCustom", studentCourseCustom);
return "/student/study";
}
/**
*
*/
@RequestMapping(value = "/startExam")
public String startExam(int id, Model model) throws Exception {
int stuId = getUserId();
StudentCourse studentCourse = studentCourseService.findOne(id,stuId);
int process = studentCourse.getProgress();
//得到所有学时数
Course course = courseService.findById(id);
int period = course.getPeriod();
if(process != period) {
throw new CustomException("请先完成全部学时学习!");
}else if (studentCourse.getHasExam() == true) {
throw new CustomException("您已参加过考试!");
}
StudentCourseCustom studentCourseCustom = getStudentCourseCustom(studentCourse);
model.addAttribute("studentCourseCustom", studentCourseCustom);
return "/student/exam";
}
/**
*
*/
@RequestMapping(value = "/saveExam")
public String saveExam(int id, Model model) throws Exception {
int stuId = getUserId();
StudentCourse studentCourse = studentCourseService.findOne(id,stuId);
//设置是否考过试为true
studentCourse.setHasExam(true);
studentCourseService.update(studentCourse);
List<StudentCourse> list = studentCourseService.findByStudentID(stuId);
List<StudentCourseCustom> lists = getStudentCourseCustomList(list);
model.addAttribute("StudentCourseCustomList", lists);
return "/student/selectCourse";
}
/**
* 退
*/
@RequestMapping(value = "/outCourse")
public String outCourse(int id) throws Exception {
int stuId = getUserId();
StudentCourse studentCourse = new StudentCourse();
studentCourse.setCourseId(id);
studentCourse.setStudentId(stuId);
studentCourseService.remove(studentCourse);
return "redirect:/student/selectedCourse";
}
/* ----- 已选课程区 END ----- */
/* ----- 已修课程区 START ----- */
/**
*
*/
@RequestMapping(value = "/overCourse")
public String overCourse(Model model) throws Exception {
int stuId = getUserId();
try{
List<StudentCourse> list = studentCourseService.findByStudentID(stuId, true);
List<StudentCourseCustom> lists = getStudentCourseCustomList(list);
model.addAttribute("StudentCourseCustomList", lists);
}
catch(Exception e) {
throw new CustomException("未获取到已修课程!");
}
return "student/overCourse";
}
/* ----- 已修课程区 END ----- */
/* ----- 其他区 START ----- */
/**
* 退
*/
@RequestMapping(value = "/logout")
public String logout() {
return "redirect:/logout";
}
/**
*
*/
@RequestMapping(value = "/showSelf")
public String showSelf(Model model) throws Exception {
Student student = studentService.findById(getUserId());
model.addAttribute("student", student);
return "student/showSelf";
}
/**
*
*/
@RequestMapping(value = "/recharge")
public String recharge(Model model) throws Exception {
Student student = studentService.findById(getUserId());
model.addAttribute("student", student);
return "student/recharge";
}
/**
*
*/
@RequestMapping(value = "/updateBalance")
public String updateBalance(Integer money, Model model) throws Exception {
Student student = studentService.findById(getUserId());
if (student != null) {
student.setBalance(student.getBalance() + money);
}
studentService.updataById(student);
model.addAttribute("student", student);
return "student/recharge";
}
/**
*
*/
@RequestMapping(value = "/passwordRest")
public String passwordRest() throws Exception {
return "student/passwordRest";
}
/* ----- 其他区 END ----- */
}

@ -0,0 +1,203 @@
package com.wxs.controller;
import com.wxs.exception.CustomException;
import com.wxs.po.*;
import com.wxs.service.*;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Controller
@RequestMapping(value = "/teacher")
public class TeacherController {
@Resource(name = "userloginServiceImpl")
private UserloginService userloginService;
@Resource(name = "teacherServiceImpl")
private TeacherService teacherService;
@Resource(name = "studentServiceImpl")
private StudentService studentService;
@Resource(name = "courseServiceImpl")
private CourseService courseService;
@Resource(name = "studentCourseServiceImpl")
private StudentCourseService studentCourseService;
/**
*
* @return
*/
private String getUserName() {
Subject subject = SecurityUtils.getSubject();
String userName = (String) subject.getPrincipal();
return userName;
}
/**
* id
* @return
*/
private Integer getUserId() throws Exception{
Userlogin userlogin = userloginService.findByName(getUserName());
return userlogin.getId();
}
/**
* CourseCustom
*/
private CourseCustom getCourseCustom(Course course) throws Exception{
CourseCustom courseCustom = new CourseCustom();
BeanUtils.copyProperties(course, courseCustom);
Teacher teacher = teacherService.findById(course.getTeacherId());
courseCustom.setTeacherName(teacher.getName());
return courseCustom;
}
/**
* CourseCustom
*/
private List<CourseCustom> getCourseCustomList(List<Course> list) throws Exception{
List<CourseCustom> lists = new ArrayList<CourseCustom>();
for (Course course: list) {
lists.add(getCourseCustom(course));
}
return lists;
}
/**
* StudentCourseCustom
*/
private StudentCourseCustom getStudentCourseCustom(StudentCourse studentCourse) throws Exception{
Course course = courseService.findById(studentCourse.getCourseId());
String teacherName = teacherService.findById(course.getTeacherId()).getName();
String studentName = studentService.findById(studentCourse.getStudentId()).getName();
StudentCourseCustom studentCourseCustom = new StudentCourseCustom();
BeanUtils.copyProperties(studentCourse, studentCourseCustom);
studentCourseCustom.setCourse(course);
studentCourseCustom.setTeacherName(teacherName);
studentCourseCustom.setStudentName(studentName);
return studentCourseCustom;
}
/**
* StudentCourseCustom
*/
private List<StudentCourseCustom> getStudentCourseCustomList(List<StudentCourse> list) throws Exception{
List<StudentCourseCustom> lists = new ArrayList<StudentCourseCustom>();
for (StudentCourse studentCourse: list) {
lists.add(getStudentCourseCustom(studentCourse));
}
return lists;
}
/**
* 退
*/
@RequestMapping(value = "/logout")
public String logout(){
return "redirect:/logout";
}
/**
*
*/
@RequestMapping(value = "/showSelf")
public String showSelf (Model model) throws Exception {
Teacher teacher = teacherService.findById(getUserId());
model.addAttribute("teacher", teacher);
return "teacher/showSelf";
}
/**
*
*/
@RequestMapping(value = "/showCourse")
public String stuCourseShow(Model model) throws Exception {
List<Course> list = courseService.findByTeacherID(getUserId());
model.addAttribute("courseList", list);
return "teacher/showCourse";
}
@RequestMapping(value = "/findCourse" ,method = {RequestMethod.POST})
public String findCourse(String name, Model model) throws Exception {
List<Course> list = courseService.findByName(name);
model.addAttribute("courseList", list);
return "teacher/showCourse";
}
/**
*
*/
@RequestMapping(value = "/gradeCourse")
public String gradeCourse(Integer id, Model model) throws Exception {
if (id == null) {
return "";
}
List<StudentCourse> list = studentCourseService.findByCourseID(id);
List<StudentCourseCustom> lists = getStudentCourseCustomList(list);
model.addAttribute("StudentCourseCustomList", lists);
return "teacher/showGrade";
}
/**
* UI
*/
@RequestMapping(value = "/mark", method = {RequestMethod.GET})
public String markUI(Integer studentId, Integer courseId, Model model) throws Exception {
StudentCourse studentCourse = studentCourseService.findOne(courseId, studentId);
if(studentCourse.getHasExam() == false) {
throw new CustomException("该学生未参加考试,无法评分!");
}
StudentCourseCustom studentCourseCustom = getStudentCourseCustom(studentCourse);
model.addAttribute("studentCourseCustom", studentCourseCustom);
return "teacher/mark";
}
/**
*
*/
@RequestMapping(value = "/saveMark", method = {RequestMethod.POST})
public String mark(Integer courseId, Integer studentId, StudentCourse sc) throws Exception {
StudentCourse studentCourse = studentCourseService.findOne(courseId, studentId);
studentCourse.setMark(sc.getMark());
studentCourseService.update(studentCourse);
return "redirect:/teacher/gradeCourse?id="+sc.getCourseId();
}
/**
*
*/
@RequestMapping(value = "/passwordRest")
public String passwordRest() throws Exception {
return "teacher/passwordRest";
}
}

@ -0,0 +1,82 @@
package com.wxs.controller.common;
/**
* @author jitwxs
* @description
*/
public class GlobalConstant {
/**
* @author jitwxs
* @description
*/
public static final String DEFAULT_PASSWD = "123";
/**
*
*/
public static final Integer DEFAULT_BALANCE = 0;
/**
* @description
*/
public static final Integer DEFAULT_PAGESIZE = 10;
/**
* @description
*/
public static String INNER_ERROR = "内部错误";
/**
* @description
*/
public static enum ROle_Type {
/**
*
*/
ADMIN("admin",1),
/**
*
*/
TEACHER("teacher",2),
/**
*
*/
STUDENT("student",3);
private String name;
private int index;
private ROle_Type(String name, int index) {
this.name = name;
this.index = index;
}
public static String getName(int index) {
for (ROle_Type rOleType : ROle_Type.values()) {
if (rOleType.getIndex() == index) {
return rOleType.name;
}
}
return null;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
}
}

@ -0,0 +1,95 @@
package com.wxs.controller.common;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.lang3.Validate;
import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.security.SecureRandom;
/**
* SHA-1
*/
public class SHA1Utils {
public static final int HASH_INTERATIONS = 1024;
public static final int SALT_SIZE = 8;
private static final String SHA1 = "SHA-1";
private static SecureRandom random = new SecureRandom();
/**
* 16salt1024 sha-1 hash
* @param plainPassword
* @return (56)
*/
public static String entryptPassword(String plainPassword) {
byte[] salt = generateSalt(SALT_SIZE);
byte[] hashPassword = sha1(plainPassword.getBytes(), salt, HASH_INTERATIONS);
return encodeHex(salt)+encodeHex(hashPassword);
}
/**
*
* @param plainPassword
* @param password
* @return
*/
public static boolean validatePassword(String plainPassword, String password) {
byte[] salt = decodeHex(password.substring(0,16));
byte[] hashPassword = sha1(plainPassword.getBytes(), salt, HASH_INTERATIONS);
return password.equals(encodeHex(salt)+encodeHex(hashPassword));
}
/**
* Byte[]salt
* @param numBytes byte
* @return
*/
public static byte[] generateSalt(int numBytes) {
Validate.isTrue(numBytes > 0, "numBytes argument must be a positive integer (1 or larger)", numBytes);
byte[] bytes = new byte[numBytes];
random.nextBytes(bytes);
return bytes;
}
public static String encodeHex(byte[] input) {
return new String(Hex.encodeHex(input));
}
/**
* Hex
*/
public static byte[] decodeHex(String input) {
try {
return Hex.decodeHex(input.toCharArray());
} catch (DecoderException e) {
return null;
}
}
public static byte[] sha1(byte[] input, byte[] salt, int iterations) {
return digest(input, SHA1, salt, iterations);
}
private static byte[] digest(byte[] input, String algorithm, byte[] salt, int iterations) {
try {
MessageDigest digest = MessageDigest.getInstance(algorithm);
if (salt != null) {
digest.update(salt);
}
byte[] result = digest.digest(input);
for (int i = 1; i < iterations; i++) {
digest.reset();
result = digest.digest(result);
}
return result;
} catch (GeneralSecurityException e) {
return null;
}
}
}

@ -0,0 +1,28 @@
package com.wxs.controller.converter;
import org.springframework.core.convert.converter.Converter;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class CustomDateConverter implements Converter<String, Date> {
@Override
public Date convert(String s) {
//实现 将日期串转成日期类型(格式是yyyy-MM-dd)
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
try {
//转成直接返回
return simpleDateFormat.parse(s);
} catch (ParseException e) {
e.printStackTrace();
}
//如果参数绑定失败返回null
return null;
}
}

@ -0,0 +1,20 @@
package com.wxs.exception;
public class CustomException extends Exception {
public String message;
public CustomException(String message) {
super(message);
this.message=message;
}
@Override
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}

@ -0,0 +1,47 @@
package com.wxs.exception;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.UnknownAccountException;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class CustomExceptionResolver implements HandlerExceptionResolver {
@Override
public ModelAndView resolveException(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) {
ModelAndView modelAndView = new ModelAndView();
CustomException customException;
if (e instanceof CustomException) {
customException = (CustomException)e;
} else if (e instanceof UnknownAccountException) {
//用户名错误异常
modelAndView.addObject("message", "没有该用户");
modelAndView.setViewName("error");
return modelAndView;
} else if (e instanceof IncorrectCredentialsException) {
//用户名错误异常
modelAndView.addObject("message", "密码错误");
modelAndView.setViewName("error");
return modelAndView;
} else {
customException = new CustomException("未知错误");
}
//错误信息
String message = customException.getMessage();
//错误信息传递和错误页面跳转
modelAndView.addObject("message", message);
modelAndView.setViewName("error");
return modelAndView;
}
}

@ -0,0 +1,36 @@
package com.wxs.mapper;
import com.wxs.po.Course;
import com.wxs.po.CourseExample;
import com.wxs.po.PagingVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface CourseMapper {
int countByExample(CourseExample example);
int deleteByExample(CourseExample example);
int deleteByPrimaryKey(Integer id);
int insert(Course record);
int insertSelective(Course record);
List<Course> selectByExample(CourseExample example);
Course selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") Course record, @Param("example") CourseExample example);
int updateByExample(@Param("record") Course record, @Param("example") CourseExample example);
int updateByPrimaryKeySelective(Course record);
int updateByPrimaryKey(Course record);
List<Course> findByPaging(PagingVO pagingVO);
List<Course> findByName(String name);
}

@ -0,0 +1,225 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.wxs.mapper.CourseMapper" >
<resultMap id="BaseResultMap" type="com.wxs.po.Course" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="teacher_id" property="teacherId" jdbcType="INTEGER" />
<result column="period" property="period" jdbcType="INTEGER" />
<result column="price" property="price" jdbcType="INTEGER" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause" >
<where >
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
id, name, teacher_id, period, price
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.wxs.po.CourseExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from course
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from course
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from course
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wxs.po.CourseExample" >
delete from course
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wxs.po.Course" >
insert into course (id, name, teacher_id,
period, price)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{teacherId,jdbcType=INTEGER},
#{period,jdbcType=INTEGER}, #{price,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.wxs.po.Course" >
insert into course
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="name != null" >
name,
</if>
<if test="teacherId != null" >
teacher_id,
</if>
<if test="period != null" >
period,
</if>
<if test="price != null" >
price,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="name != null" >
#{name,jdbcType=VARCHAR},
</if>
<if test="teacherId != null" >
#{teacherId,jdbcType=INTEGER},
</if>
<if test="period != null" >
#{period,jdbcType=INTEGER},
</if>
<if test="price != null" >
#{price,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wxs.po.CourseExample" resultType="java.lang.Integer" >
select count(*) from course
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update course
<set >
<if test="record.id != null" >
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.name != null" >
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.teacherId != null" >
teacher_id = #{record.teacherId,jdbcType=INTEGER},
</if>
<if test="record.period != null" >
period = #{record.period,jdbcType=INTEGER},
</if>
<if test="record.price != null" >
price = #{record.price,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update course
set id = #{record.id,jdbcType=INTEGER},
name = #{record.name,jdbcType=VARCHAR},
teacher_id = #{record.teacherId,jdbcType=INTEGER},
period = #{record.period,jdbcType=INTEGER},
price = #{record.price,jdbcType=INTEGER}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wxs.po.Course" >
update course
<set >
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="teacherId != null" >
teacher_id = #{teacherId,jdbcType=INTEGER},
</if>
<if test="period != null" >
period = #{period,jdbcType=INTEGER},
</if>
<if test="price != null" >
price = #{price,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wxs.po.Course" >
update course
set name = #{name,jdbcType=VARCHAR},
teacher_id = #{teacherId,jdbcType=INTEGER},
period = #{period,jdbcType=INTEGER},
price = #{price,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="findByPaging" parameterType="PagingVO" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from course
limit #{toPageNo}, #{pageSize}
</select>
<select id="findByName" parameterType="String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from course
where name LIKE "%"#{name}"%"
</select>
</mapper>

@ -0,0 +1,31 @@
package com.wxs.mapper;
import com.wxs.po.Role;
import com.wxs.po.RoleExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface RoleMapper {
int countByExample(RoleExample example);
int deleteByExample(RoleExample example);
int deleteByPrimaryKey(Integer id);
int insert(Role record);
int insertSelective(Role record);
List<Role> selectByExample(RoleExample example);
Role selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example);
int updateByExample(@Param("record") Role record, @Param("example") RoleExample example);
int updateByPrimaryKeySelective(Role record);
int updateByPrimaryKey(Role record);
}

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.wxs.mapper.RoleMapper" >
<resultMap id="BaseResultMap" type="com.wxs.po.Role" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="permissions" property="permissions" jdbcType="VARCHAR" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause" >
<where >
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
id, name, permissions
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.wxs.po.RoleExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from role
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from role
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from role
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wxs.po.RoleExample" >
delete from role
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wxs.po.Role" >
insert into role (id, name, permissions
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{permissions,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.wxs.po.Role" >
insert into role
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="name != null" >
name,
</if>
<if test="permissions != null" >
permissions,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="name != null" >
#{name,jdbcType=VARCHAR},
</if>
<if test="permissions != null" >
#{permissions,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wxs.po.RoleExample" resultType="java.lang.Integer" >
select count(*) from role
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update role
<set >
<if test="record.id != null" >
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.name != null" >
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.permissions != null" >
permissions = #{record.permissions,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update role
set id = #{record.id,jdbcType=INTEGER},
name = #{record.name,jdbcType=VARCHAR},
permissions = #{record.permissions,jdbcType=VARCHAR}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wxs.po.Role" >
update role
<set >
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="permissions != null" >
permissions = #{permissions,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wxs.po.Role" >
update role
set name = #{name,jdbcType=VARCHAR},
permissions = #{permissions,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

@ -0,0 +1,23 @@
package com.wxs.mapper;
import com.wxs.po.StudentCourse;
import com.wxs.po.StudentCourseExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface StudentCourseMapper {
int countByExample(StudentCourseExample example);
int deleteByExample(StudentCourseExample example);
int insert(StudentCourse record);
int insertSelective(StudentCourse record);
List<StudentCourse> selectByExample(StudentCourseExample example);
int updateByExampleSelective(@Param("record") StudentCourse record, @Param("example") StudentCourseExample example);
int updateByExample(@Param("record") StudentCourse record, @Param("example") StudentCourseExample example);
}

@ -0,0 +1,175 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.wxs.mapper.StudentCourseMapper" >
<resultMap id="BaseResultMap" type="com.wxs.po.StudentCourse" >
<result column="course_id" property="courseId" jdbcType="INTEGER" />
<result column="student_id" property="studentId" jdbcType="INTEGER" />
<result column="progress" property="progress" jdbcType="INTEGER" />
<result column="mark" property="mark" jdbcType="INTEGER" />
<result column="has_exam" property="hasExam" jdbcType="BIT" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause" >
<where >
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
course_id, student_id, progress, mark, has_exam
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.wxs.po.StudentCourseExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from student_course
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<delete id="deleteByExample" parameterType="com.wxs.po.StudentCourseExample" >
delete from student_course
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wxs.po.StudentCourse" >
insert into student_course (course_id, student_id, progress,
mark, has_exam)
values (#{courseId,jdbcType=INTEGER}, #{studentId,jdbcType=INTEGER}, #{progress,jdbcType=INTEGER},
#{mark,jdbcType=INTEGER}, #{hasExam,jdbcType=BIT})
</insert>
<insert id="insertSelective" parameterType="com.wxs.po.StudentCourse" >
insert into student_course
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="courseId != null" >
course_id,
</if>
<if test="studentId != null" >
student_id,
</if>
<if test="progress != null" >
progress,
</if>
<if test="mark != null" >
mark,
</if>
<if test="hasExam != null" >
has_exam,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="courseId != null" >
#{courseId,jdbcType=INTEGER},
</if>
<if test="studentId != null" >
#{studentId,jdbcType=INTEGER},
</if>
<if test="progress != null" >
#{progress,jdbcType=INTEGER},
</if>
<if test="mark != null" >
#{mark,jdbcType=INTEGER},
</if>
<if test="hasExam != null" >
#{hasExam,jdbcType=BIT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wxs.po.StudentCourseExample" resultType="java.lang.Integer" >
select count(*) from student_course
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update student_course
<set >
<if test="record.courseId != null" >
course_id = #{record.courseId,jdbcType=INTEGER},
</if>
<if test="record.studentId != null" >
student_id = #{record.studentId,jdbcType=INTEGER},
</if>
<if test="record.progress != null" >
progress = #{record.progress,jdbcType=INTEGER},
</if>
<if test="record.mark != null" >
mark = #{record.mark,jdbcType=INTEGER},
</if>
<if test="record.hasExam != null" >
has_exam = #{record.hasExam,jdbcType=BIT},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update student_course
set course_id = #{record.courseId,jdbcType=INTEGER},
student_id = #{record.studentId,jdbcType=INTEGER},
progress = #{record.progress,jdbcType=INTEGER},
mark = #{record.mark,jdbcType=INTEGER},
has_exam = #{record.hasExam,jdbcType=BIT}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
</mapper>

@ -0,0 +1,34 @@
package com.wxs.mapper;
import com.wxs.po.PagingVO;
import com.wxs.po.Student;
import com.wxs.po.StudentExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface StudentMapper {
int countByExample(StudentExample example);
int deleteByExample(StudentExample example);
int deleteByPrimaryKey(Integer id);
int insert(Student record);
int insertSelective(Student record);
List<Student> selectByExample(StudentExample example);
Student selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") Student record, @Param("example") StudentExample example);
int updateByExample(@Param("record") Student record, @Param("example") StudentExample example);
int updateByPrimaryKeySelective(Student record);
int updateByPrimaryKey(Student record);
List<Student> findByPaging(PagingVO pagingVO);
}

@ -0,0 +1,235 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.wxs.mapper.StudentMapper" >
<resultMap id="BaseResultMap" type="com.wxs.po.Student" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="sex" property="sex" jdbcType="VARCHAR" />
<result column="birthday" property="birthday" jdbcType="DATE" />
<result column="register_time" property="registerTime" jdbcType="DATE" />
<result column="balance" property="balance" jdbcType="INTEGER" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause" >
<where >
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
id, name, sex, birthday, register_time, balance
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.wxs.po.StudentExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from student
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from student
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from student
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wxs.po.StudentExample" >
delete from student
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wxs.po.Student" >
insert into student (id, name, sex,
birthday, register_time, balance
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR},
#{birthday,jdbcType=DATE}, #{registerTime,jdbcType=DATE}, #{balance,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.wxs.po.Student" >
insert into student
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="name != null" >
name,
</if>
<if test="sex != null" >
sex,
</if>
<if test="birthday != null" >
birthday,
</if>
<if test="registerTime != null" >
register_time,
</if>
<if test="balance != null" >
balance,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="name != null" >
#{name,jdbcType=VARCHAR},
</if>
<if test="sex != null" >
#{sex,jdbcType=VARCHAR},
</if>
<if test="birthday != null" >
#{birthday,jdbcType=DATE},
</if>
<if test="registerTime != null" >
#{registerTime,jdbcType=DATE},
</if>
<if test="balance != null" >
#{balance,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wxs.po.StudentExample" resultType="java.lang.Integer" >
select count(*) from student
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update student
<set >
<if test="record.id != null" >
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.name != null" >
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.sex != null" >
sex = #{record.sex,jdbcType=VARCHAR},
</if>
<if test="record.birthday != null" >
birthday = #{record.birthday,jdbcType=DATE},
</if>
<if test="record.registerTime != null" >
register_time = #{record.registerTime,jdbcType=DATE},
</if>
<if test="record.balance != null" >
balance = #{record.balance,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update student
set id = #{record.id,jdbcType=INTEGER},
name = #{record.name,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=VARCHAR},
birthday = #{record.birthday,jdbcType=DATE},
register_time = #{record.registerTime,jdbcType=DATE},
balance = #{record.balance,jdbcType=INTEGER}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wxs.po.Student" >
update student
<set >
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="sex != null" >
sex = #{sex,jdbcType=VARCHAR},
</if>
<if test="birthday != null" >
birthday = #{birthday,jdbcType=DATE},
</if>
<if test="registerTime != null" >
register_time = #{registerTime,jdbcType=DATE},
</if>
<if test="balance != null" >
balance = #{balance,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wxs.po.Student" >
update student
set name = #{name,jdbcType=VARCHAR},
sex = #{sex,jdbcType=VARCHAR},
birthday = #{birthday,jdbcType=DATE},
register_time = #{registerTime,jdbcType=DATE},
balance = #{balance,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="findByPaging" parameterType="PagingVO" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from student
limit #{toPageNo}, #{pageSize}
</select>
</mapper>

@ -0,0 +1,34 @@
package com.wxs.mapper;
import com.wxs.po.PagingVO;
import com.wxs.po.Teacher;
import com.wxs.po.TeacherExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TeacherMapper {
int countByExample(TeacherExample example);
int deleteByExample(TeacherExample example);
int deleteByPrimaryKey(Integer id);
int insert(Teacher record);
int insertSelective(Teacher record);
List<Teacher> selectByExample(TeacherExample example);
Teacher selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") Teacher record, @Param("example") TeacherExample example);
int updateByExample(@Param("record") Teacher record, @Param("example") TeacherExample example);
int updateByPrimaryKeySelective(Teacher record);
int updateByPrimaryKey(Teacher record);
List<Teacher> findByPaging(PagingVO pagingVO);
}

@ -0,0 +1,235 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.wxs.mapper.TeacherMapper" >
<resultMap id="BaseResultMap" type="com.wxs.po.Teacher" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="sex" property="sex" jdbcType="VARCHAR" />
<result column="birthday" property="birthday" jdbcType="DATE" />
<result column="degree" property="degree" jdbcType="VARCHAR" />
<result column="register_time" property="registerTime" jdbcType="DATE" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause" >
<where >
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
id, name, sex, birthday, degree, register_time
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.wxs.po.TeacherExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from teacher
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from teacher
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from teacher
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wxs.po.TeacherExample" >
delete from teacher
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wxs.po.Teacher" >
insert into teacher (id, name, sex,
birthday, degree, register_time
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR},
#{birthday,jdbcType=DATE}, #{degree,jdbcType=VARCHAR}, #{registerTime,jdbcType=DATE}
)
</insert>
<insert id="insertSelective" parameterType="com.wxs.po.Teacher" >
insert into teacher
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="name != null" >
name,
</if>
<if test="sex != null" >
sex,
</if>
<if test="birthday != null" >
birthday,
</if>
<if test="degree != null" >
degree,
</if>
<if test="registerTime != null" >
register_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="name != null" >
#{name,jdbcType=VARCHAR},
</if>
<if test="sex != null" >
#{sex,jdbcType=VARCHAR},
</if>
<if test="birthday != null" >
#{birthday,jdbcType=DATE},
</if>
<if test="degree != null" >
#{degree,jdbcType=VARCHAR},
</if>
<if test="registerTime != null" >
#{registerTime,jdbcType=DATE},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wxs.po.TeacherExample" resultType="java.lang.Integer" >
select count(*) from teacher
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update teacher
<set >
<if test="record.id != null" >
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.name != null" >
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.sex != null" >
sex = #{record.sex,jdbcType=VARCHAR},
</if>
<if test="record.birthday != null" >
birthday = #{record.birthday,jdbcType=DATE},
</if>
<if test="record.degree != null" >
degree = #{record.degree,jdbcType=VARCHAR},
</if>
<if test="record.registerTime != null" >
register_time = #{record.registerTime,jdbcType=DATE},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update teacher
set id = #{record.id,jdbcType=INTEGER},
name = #{record.name,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=VARCHAR},
birthday = #{record.birthday,jdbcType=DATE},
degree = #{record.degree,jdbcType=VARCHAR},
register_time = #{record.registerTime,jdbcType=DATE}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wxs.po.Teacher" >
update teacher
<set >
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="sex != null" >
sex = #{sex,jdbcType=VARCHAR},
</if>
<if test="birthday != null" >
birthday = #{birthday,jdbcType=DATE},
</if>
<if test="degree != null" >
degree = #{degree,jdbcType=VARCHAR},
</if>
<if test="registerTime != null" >
register_time = #{registerTime,jdbcType=DATE},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wxs.po.Teacher" >
update teacher
set name = #{name,jdbcType=VARCHAR},
sex = #{sex,jdbcType=VARCHAR},
birthday = #{birthday,jdbcType=DATE},
degree = #{degree,jdbcType=VARCHAR},
register_time = #{registerTime,jdbcType=DATE}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="findByPaging" parameterType="PagingVO" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from teacher
limit #{toPageNo}, #{pageSize}
</select>
</mapper>

@ -0,0 +1,30 @@
package com.wxs.mapper;
import com.wxs.po.Userlogin;
import com.wxs.po.UserloginExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UserloginMapper {
int countByExample(UserloginExample example);
int deleteByExample(UserloginExample example);
int deleteByPrimaryKey(Integer id);
int insert(Userlogin record);
int insertSelective(Userlogin record);
List<Userlogin> selectByExample(UserloginExample example);
Userlogin selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") Userlogin record, @Param("example") UserloginExample example);
int updateByExample(@Param("record") Userlogin record, @Param("example") UserloginExample example);
int updateByPrimaryKeySelective(Userlogin record);
int updateByPrimaryKey(Userlogin record);
}

@ -0,0 +1,196 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.wxs.mapper.UserloginMapper" >
<resultMap id="BaseResultMap" type="com.wxs.po.Userlogin" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="password" property="password" jdbcType="CHAR" />
<result column="role" property="role" jdbcType="INTEGER" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause" >
<where >
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
id, name, password, role
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.wxs.po.UserloginExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from userlogin
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from userlogin
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from userlogin
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.wxs.po.UserloginExample" >
delete from userlogin
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.wxs.po.Userlogin" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
insert into userlogin (id, name, password,
role)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{password,jdbcType=CHAR},
#{role,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.wxs.po.Userlogin" >
insert into userlogin
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="name != null" >
name,
</if>
<if test="password != null" >
password,
</if>
<if test="role != null" >
role,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="name != null" >
#{name,jdbcType=VARCHAR},
</if>
<if test="password != null" >
#{password,jdbcType=CHAR},
</if>
<if test="role != null" >
#{role,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.wxs.po.UserloginExample" resultType="java.lang.Integer" >
select count(*) from userlogin
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update userlogin
<set >
<if test="record.id != null" >
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.name != null" >
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.password != null" >
password = #{record.password,jdbcType=CHAR},
</if>
<if test="record.role != null" >
role = #{record.role,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update userlogin
set id = #{record.id,jdbcType=INTEGER},
name = #{record.name,jdbcType=VARCHAR},
password = #{record.password,jdbcType=CHAR},
role = #{record.role,jdbcType=INTEGER}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.wxs.po.Userlogin" >
update userlogin
<set >
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="password != null" >
password = #{password,jdbcType=CHAR},
</if>
<if test="role != null" >
role = #{role,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.wxs.po.Userlogin" >
update userlogin
set name = #{name,jdbcType=VARCHAR},
password = #{password,jdbcType=CHAR},
role = #{role,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

@ -0,0 +1,53 @@
package com.wxs.po;
public class Course {
private Integer id;
private String name;
private Integer teacherId;
private Integer period;
private Integer price;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public Integer getTeacherId() {
return teacherId;
}
public void setTeacherId(Integer teacherId) {
this.teacherId = teacherId;
}
public Integer getPeriod() {
return period;
}
public void setPeriod(Integer period) {
this.period = period;
}
public Integer getPrice() {
return price;
}
public void setPrice(Integer price) {
this.price = price;
}
}

@ -0,0 +1,23 @@
package com.wxs.po;
/**
* Author: jitwxs
* Date: 2017-10-09
*
*/
public class CourseCustom extends Course {
/**
*
*/
private String teacherName;
public void setTeacherName(String teacherName) {
this.teacherName = teacherName;
}
public String getTeacherName() {
return teacherName;
}
}

@ -0,0 +1,510 @@
package com.wxs.po;
import java.util.ArrayList;
import java.util.List;
public class CourseExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public CourseExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andTeacherIdIsNull() {
addCriterion("teacher_id is null");
return (Criteria) this;
}
public Criteria andTeacherIdIsNotNull() {
addCriterion("teacher_id is not null");
return (Criteria) this;
}
public Criteria andTeacherIdEqualTo(Integer value) {
addCriterion("teacher_id =", value, "teacherId");
return (Criteria) this;
}
public Criteria andTeacherIdNotEqualTo(Integer value) {
addCriterion("teacher_id <>", value, "teacherId");
return (Criteria) this;
}
public Criteria andTeacherIdGreaterThan(Integer value) {
addCriterion("teacher_id >", value, "teacherId");
return (Criteria) this;
}
public Criteria andTeacherIdGreaterThanOrEqualTo(Integer value) {
addCriterion("teacher_id >=", value, "teacherId");
return (Criteria) this;
}
public Criteria andTeacherIdLessThan(Integer value) {
addCriterion("teacher_id <", value, "teacherId");
return (Criteria) this;
}
public Criteria andTeacherIdLessThanOrEqualTo(Integer value) {
addCriterion("teacher_id <=", value, "teacherId");
return (Criteria) this;
}
public Criteria andTeacherIdIn(List<Integer> values) {
addCriterion("teacher_id in", values, "teacherId");
return (Criteria) this;
}
public Criteria andTeacherIdNotIn(List<Integer> values) {
addCriterion("teacher_id not in", values, "teacherId");
return (Criteria) this;
}
public Criteria andTeacherIdBetween(Integer value1, Integer value2) {
addCriterion("teacher_id between", value1, value2, "teacherId");
return (Criteria) this;
}
public Criteria andTeacherIdNotBetween(Integer value1, Integer value2) {
addCriterion("teacher_id not between", value1, value2, "teacherId");
return (Criteria) this;
}
public Criteria andPeriodIsNull() {
addCriterion("period is null");
return (Criteria) this;
}
public Criteria andPeriodIsNotNull() {
addCriterion("period is not null");
return (Criteria) this;
}
public Criteria andPeriodEqualTo(Integer value) {
addCriterion("period =", value, "period");
return (Criteria) this;
}
public Criteria andPeriodNotEqualTo(Integer value) {
addCriterion("period <>", value, "period");
return (Criteria) this;
}
public Criteria andPeriodGreaterThan(Integer value) {
addCriterion("period >", value, "period");
return (Criteria) this;
}
public Criteria andPeriodGreaterThanOrEqualTo(Integer value) {
addCriterion("period >=", value, "period");
return (Criteria) this;
}
public Criteria andPeriodLessThan(Integer value) {
addCriterion("period <", value, "period");
return (Criteria) this;
}
public Criteria andPeriodLessThanOrEqualTo(Integer value) {
addCriterion("period <=", value, "period");
return (Criteria) this;
}
public Criteria andPeriodIn(List<Integer> values) {
addCriterion("period in", values, "period");
return (Criteria) this;
}
public Criteria andPeriodNotIn(List<Integer> values) {
addCriterion("period not in", values, "period");
return (Criteria) this;
}
public Criteria andPeriodBetween(Integer value1, Integer value2) {
addCriterion("period between", value1, value2, "period");
return (Criteria) this;
}
public Criteria andPeriodNotBetween(Integer value1, Integer value2) {
addCriterion("period not between", value1, value2, "period");
return (Criteria) this;
}
public Criteria andPriceIsNull() {
addCriterion("price is null");
return (Criteria) this;
}
public Criteria andPriceIsNotNull() {
addCriterion("price is not null");
return (Criteria) this;
}
public Criteria andPriceEqualTo(Integer value) {
addCriterion("price =", value, "price");
return (Criteria) this;
}
public Criteria andPriceNotEqualTo(Integer value) {
addCriterion("price <>", value, "price");
return (Criteria) this;
}
public Criteria andPriceGreaterThan(Integer value) {
addCriterion("price >", value, "price");
return (Criteria) this;
}
public Criteria andPriceGreaterThanOrEqualTo(Integer value) {
addCriterion("price >=", value, "price");
return (Criteria) this;
}
public Criteria andPriceLessThan(Integer value) {
addCriterion("price <", value, "price");
return (Criteria) this;
}
public Criteria andPriceLessThanOrEqualTo(Integer value) {
addCriterion("price <=", value, "price");
return (Criteria) this;
}
public Criteria andPriceIn(List<Integer> values) {
addCriterion("price in", values, "price");
return (Criteria) this;
}
public Criteria andPriceNotIn(List<Integer> values) {
addCriterion("price not in", values, "price");
return (Criteria) this;
}
public Criteria andPriceBetween(Integer value1, Integer value2) {
addCriterion("price between", value1, value2, "price");
return (Criteria) this;
}
public Criteria andPriceNotBetween(Integer value1, Integer value2) {
addCriterion("price not between", value1, value2, "price");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -0,0 +1,102 @@
package com.wxs.po;
import com.wxs.controller.common.GlobalConstant;
public class PagingVO {
/**
* ,1
*/
private int curentPageNo = 1;
/**
*
*/
private int totalCount;
/**
*
*/
private int pageSize = GlobalConstant.DEFAULT_PAGESIZE;
/**
*
*/
private int upPageNo;
/**
*
*/
private int nextPageNo;
/**
* 0
*/
private int toPageNo = 0;
public void setToPageNo(Integer toPageNo) {
//新一页
this.toPageNo = (toPageNo-1) * pageSize ;
//设置跳转后当前的页码
setCurentPageNo(toPageNo);
}
public Integer getTopageNo() {
return toPageNo;
}
public int getCurentPageNo() {
return curentPageNo;
}
/**
*
* @param curentPageNo
*/
public void setCurentPageNo(int curentPageNo) {
if (curentPageNo != 1) {
this.upPageNo = curentPageNo - 1;
}
this.nextPageNo = curentPageNo + 1;
this.curentPageNo = curentPageNo;
}
public int getTotalCount() {
return totalCount;
}
public void setTotalCount(int totalCount) {
if (totalCount%pageSize > 0) {
this.totalCount = (totalCount/pageSize)+1;
} else {
this.totalCount = totalCount/pageSize;
}
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getUpPageNo() {
return upPageNo;
}
public void setUpPageNo(int upPageNo) {
this.upPageNo = upPageNo;
}
public int getNextPageNo() {
return nextPageNo;
}
public void setNextPageNo(int nextPageNo) {
this.nextPageNo = nextPageNo;
}
}

@ -0,0 +1,33 @@
package com.wxs.po;
public class Role {
private Integer id;
private String name;
private String permissions;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getPermissions() {
return permissions;
}
public void setPermissions(String permissions) {
this.permissions = permissions == null ? null : permissions.trim();
}
}

@ -0,0 +1,400 @@
package com.wxs.po;
import java.util.ArrayList;
import java.util.List;
public class RoleExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public RoleExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andPermissionsIsNull() {
addCriterion("permissions is null");
return (Criteria) this;
}
public Criteria andPermissionsIsNotNull() {
addCriterion("permissions is not null");
return (Criteria) this;
}
public Criteria andPermissionsEqualTo(String value) {
addCriterion("permissions =", value, "permissions");
return (Criteria) this;
}
public Criteria andPermissionsNotEqualTo(String value) {
addCriterion("permissions <>", value, "permissions");
return (Criteria) this;
}
public Criteria andPermissionsGreaterThan(String value) {
addCriterion("permissions >", value, "permissions");
return (Criteria) this;
}
public Criteria andPermissionsGreaterThanOrEqualTo(String value) {
addCriterion("permissions >=", value, "permissions");
return (Criteria) this;
}
public Criteria andPermissionsLessThan(String value) {
addCriterion("permissions <", value, "permissions");
return (Criteria) this;
}
public Criteria andPermissionsLessThanOrEqualTo(String value) {
addCriterion("permissions <=", value, "permissions");
return (Criteria) this;
}
public Criteria andPermissionsLike(String value) {
addCriterion("permissions like", value, "permissions");
return (Criteria) this;
}
public Criteria andPermissionsNotLike(String value) {
addCriterion("permissions not like", value, "permissions");
return (Criteria) this;
}
public Criteria andPermissionsIn(List<String> values) {
addCriterion("permissions in", values, "permissions");
return (Criteria) this;
}
public Criteria andPermissionsNotIn(List<String> values) {
addCriterion("permissions not in", values, "permissions");
return (Criteria) this;
}
public Criteria andPermissionsBetween(String value1, String value2) {
addCriterion("permissions between", value1, value2, "permissions");
return (Criteria) this;
}
public Criteria andPermissionsNotBetween(String value1, String value2) {
addCriterion("permissions not between", value1, value2, "permissions");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -0,0 +1,65 @@
package com.wxs.po;
import java.util.Date;
public class Student {
private Integer id;
private String name;
private String sex;
private Date birthday;
private Date registerTime;
private Integer balance;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex == null ? null : sex.trim();
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public Date getRegisterTime() {
return registerTime;
}
public void setRegisterTime(Date registerTime) {
this.registerTime = registerTime;
}
public Integer getBalance() {
return balance;
}
public void setBalance(Integer balance) {
this.balance = balance;
}
}

@ -0,0 +1,53 @@
package com.wxs.po;
public class StudentCourse {
private Integer courseId;
private Integer studentId;
private Integer progress;
private Integer mark;
private Boolean hasExam;
public Integer getCourseId() {
return courseId;
}
public void setCourseId(Integer courseId) {
this.courseId = courseId;
}
public Integer getStudentId() {
return studentId;
}
public void setStudentId(Integer studentId) {
this.studentId = studentId;
}
public Integer getProgress() {
return progress;
}
public void setProgress(Integer progress) {
this.progress = progress;
}
public Integer getMark() {
return mark;
}
public void setMark(Integer mark) {
this.mark = mark;
}
public Boolean getHasExam() {
return hasExam;
}
public void setHasExam(Boolean hasExam) {
this.hasExam = hasExam;
}
}

@ -0,0 +1,33 @@
package com.wxs.po;
public class StudentCourseCustom extends StudentCourse{
private Course course;
private String teacherName;
private String studentName;
public Course getCourse() {
return course;
}
public void setCourse(Course course) {
this.course = course;
}
public String getTeacherName() {
return teacherName;
}
public void setTeacherName(String teacherName) {
this.teacherName = teacherName;
}
public String getStudentName() {
return studentName;
}
public void setStudentName(String studentName) {
this.studentName = studentName;
}
}

@ -0,0 +1,500 @@
package com.wxs.po;
import java.util.ArrayList;
import java.util.List;
public class StudentCourseExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public StudentCourseExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andCourseIdIsNull() {
addCriterion("course_id is null");
return (Criteria) this;
}
public Criteria andCourseIdIsNotNull() {
addCriterion("course_id is not null");
return (Criteria) this;
}
public Criteria andCourseIdEqualTo(Integer value) {
addCriterion("course_id =", value, "courseId");
return (Criteria) this;
}
public Criteria andCourseIdNotEqualTo(Integer value) {
addCriterion("course_id <>", value, "courseId");
return (Criteria) this;
}
public Criteria andCourseIdGreaterThan(Integer value) {
addCriterion("course_id >", value, "courseId");
return (Criteria) this;
}
public Criteria andCourseIdGreaterThanOrEqualTo(Integer value) {
addCriterion("course_id >=", value, "courseId");
return (Criteria) this;
}
public Criteria andCourseIdLessThan(Integer value) {
addCriterion("course_id <", value, "courseId");
return (Criteria) this;
}
public Criteria andCourseIdLessThanOrEqualTo(Integer value) {
addCriterion("course_id <=", value, "courseId");
return (Criteria) this;
}
public Criteria andCourseIdIn(List<Integer> values) {
addCriterion("course_id in", values, "courseId");
return (Criteria) this;
}
public Criteria andCourseIdNotIn(List<Integer> values) {
addCriterion("course_id not in", values, "courseId");
return (Criteria) this;
}
public Criteria andCourseIdBetween(Integer value1, Integer value2) {
addCriterion("course_id between", value1, value2, "courseId");
return (Criteria) this;
}
public Criteria andCourseIdNotBetween(Integer value1, Integer value2) {
addCriterion("course_id not between", value1, value2, "courseId");
return (Criteria) this;
}
public Criteria andStudentIdIsNull() {
addCriterion("student_id is null");
return (Criteria) this;
}
public Criteria andStudentIdIsNotNull() {
addCriterion("student_id is not null");
return (Criteria) this;
}
public Criteria andStudentIdEqualTo(Integer value) {
addCriterion("student_id =", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdNotEqualTo(Integer value) {
addCriterion("student_id <>", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdGreaterThan(Integer value) {
addCriterion("student_id >", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdGreaterThanOrEqualTo(Integer value) {
addCriterion("student_id >=", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdLessThan(Integer value) {
addCriterion("student_id <", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdLessThanOrEqualTo(Integer value) {
addCriterion("student_id <=", value, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdIn(List<Integer> values) {
addCriterion("student_id in", values, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdNotIn(List<Integer> values) {
addCriterion("student_id not in", values, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdBetween(Integer value1, Integer value2) {
addCriterion("student_id between", value1, value2, "studentId");
return (Criteria) this;
}
public Criteria andStudentIdNotBetween(Integer value1, Integer value2) {
addCriterion("student_id not between", value1, value2, "studentId");
return (Criteria) this;
}
public Criteria andProgressIsNull() {
addCriterion("progress is null");
return (Criteria) this;
}
public Criteria andProgressIsNotNull() {
addCriterion("progress is not null");
return (Criteria) this;
}
public Criteria andProgressEqualTo(Integer value) {
addCriterion("progress =", value, "progress");
return (Criteria) this;
}
public Criteria andProgressNotEqualTo(Integer value) {
addCriterion("progress <>", value, "progress");
return (Criteria) this;
}
public Criteria andProgressGreaterThan(Integer value) {
addCriterion("progress >", value, "progress");
return (Criteria) this;
}
public Criteria andProgressGreaterThanOrEqualTo(Integer value) {
addCriterion("progress >=", value, "progress");
return (Criteria) this;
}
public Criteria andProgressLessThan(Integer value) {
addCriterion("progress <", value, "progress");
return (Criteria) this;
}
public Criteria andProgressLessThanOrEqualTo(Integer value) {
addCriterion("progress <=", value, "progress");
return (Criteria) this;
}
public Criteria andProgressIn(List<Integer> values) {
addCriterion("progress in", values, "progress");
return (Criteria) this;
}
public Criteria andProgressNotIn(List<Integer> values) {
addCriterion("progress not in", values, "progress");
return (Criteria) this;
}
public Criteria andProgressBetween(Integer value1, Integer value2) {
addCriterion("progress between", value1, value2, "progress");
return (Criteria) this;
}
public Criteria andProgressNotBetween(Integer value1, Integer value2) {
addCriterion("progress not between", value1, value2, "progress");
return (Criteria) this;
}
public Criteria andMarkIsNull() {
addCriterion("mark is null");
return (Criteria) this;
}
public Criteria andMarkIsNotNull() {
addCriterion("mark is not null");
return (Criteria) this;
}
public Criteria andMarkEqualTo(Integer value) {
addCriterion("mark =", value, "mark");
return (Criteria) this;
}
public Criteria andMarkNotEqualTo(Integer value) {
addCriterion("mark <>", value, "mark");
return (Criteria) this;
}
public Criteria andMarkGreaterThan(Integer value) {
addCriterion("mark >", value, "mark");
return (Criteria) this;
}
public Criteria andMarkGreaterThanOrEqualTo(Integer value) {
addCriterion("mark >=", value, "mark");
return (Criteria) this;
}
public Criteria andMarkLessThan(Integer value) {
addCriterion("mark <", value, "mark");
return (Criteria) this;
}
public Criteria andMarkLessThanOrEqualTo(Integer value) {
addCriterion("mark <=", value, "mark");
return (Criteria) this;
}
public Criteria andMarkIn(List<Integer> values) {
addCriterion("mark in", values, "mark");
return (Criteria) this;
}
public Criteria andMarkNotIn(List<Integer> values) {
addCriterion("mark not in", values, "mark");
return (Criteria) this;
}
public Criteria andMarkBetween(Integer value1, Integer value2) {
addCriterion("mark between", value1, value2, "mark");
return (Criteria) this;
}
public Criteria andMarkNotBetween(Integer value1, Integer value2) {
addCriterion("mark not between", value1, value2, "mark");
return (Criteria) this;
}
public Criteria andHasExamIsNull() {
addCriterion("has_exam is null");
return (Criteria) this;
}
public Criteria andHasExamIsNotNull() {
addCriterion("has_exam is not null");
return (Criteria) this;
}
public Criteria andHasExamEqualTo(Boolean value) {
addCriterion("has_exam =", value, "hasExam");
return (Criteria) this;
}
public Criteria andHasExamNotEqualTo(Boolean value) {
addCriterion("has_exam <>", value, "hasExam");
return (Criteria) this;
}
public Criteria andHasExamGreaterThan(Boolean value) {
addCriterion("has_exam >", value, "hasExam");
return (Criteria) this;
}
public Criteria andHasExamGreaterThanOrEqualTo(Boolean value) {
addCriterion("has_exam >=", value, "hasExam");
return (Criteria) this;
}
public Criteria andHasExamLessThan(Boolean value) {
addCriterion("has_exam <", value, "hasExam");
return (Criteria) this;
}
public Criteria andHasExamLessThanOrEqualTo(Boolean value) {
addCriterion("has_exam <=", value, "hasExam");
return (Criteria) this;
}
public Criteria andHasExamIn(List<Boolean> values) {
addCriterion("has_exam in", values, "hasExam");
return (Criteria) this;
}
public Criteria andHasExamNotIn(List<Boolean> values) {
addCriterion("has_exam not in", values, "hasExam");
return (Criteria) this;
}
public Criteria andHasExamBetween(Boolean value1, Boolean value2) {
addCriterion("has_exam between", value1, value2, "hasExam");
return (Criteria) this;
}
public Criteria andHasExamNotBetween(Boolean value1, Boolean value2) {
addCriterion("has_exam not between", value1, value2, "hasExam");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -0,0 +1,608 @@
package com.wxs.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
public class StudentExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public StudentExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
protected void addCriterionForJDBCDate(String condition, Date value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value.getTime()), property);
}
protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
if (values == null || values.size() == 0) {
throw new RuntimeException("Value list for " + property + " cannot be null or empty");
}
List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
Iterator<Date> iter = values.iterator();
while (iter.hasNext()) {
dateList.add(new java.sql.Date(iter.next().getTime()));
}
addCriterion(condition, dateList, property);
}
protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andSexIsNull() {
addCriterion("sex is null");
return (Criteria) this;
}
public Criteria andSexIsNotNull() {
addCriterion("sex is not null");
return (Criteria) this;
}
public Criteria andSexEqualTo(String value) {
addCriterion("sex =", value, "sex");
return (Criteria) this;
}
public Criteria andSexNotEqualTo(String value) {
addCriterion("sex <>", value, "sex");
return (Criteria) this;
}
public Criteria andSexGreaterThan(String value) {
addCriterion("sex >", value, "sex");
return (Criteria) this;
}
public Criteria andSexGreaterThanOrEqualTo(String value) {
addCriterion("sex >=", value, "sex");
return (Criteria) this;
}
public Criteria andSexLessThan(String value) {
addCriterion("sex <", value, "sex");
return (Criteria) this;
}
public Criteria andSexLessThanOrEqualTo(String value) {
addCriterion("sex <=", value, "sex");
return (Criteria) this;
}
public Criteria andSexLike(String value) {
addCriterion("sex like", value, "sex");
return (Criteria) this;
}
public Criteria andSexNotLike(String value) {
addCriterion("sex not like", value, "sex");
return (Criteria) this;
}
public Criteria andSexIn(List<String> values) {
addCriterion("sex in", values, "sex");
return (Criteria) this;
}
public Criteria andSexNotIn(List<String> values) {
addCriterion("sex not in", values, "sex");
return (Criteria) this;
}
public Criteria andSexBetween(String value1, String value2) {
addCriterion("sex between", value1, value2, "sex");
return (Criteria) this;
}
public Criteria andSexNotBetween(String value1, String value2) {
addCriterion("sex not between", value1, value2, "sex");
return (Criteria) this;
}
public Criteria andBirthdayIsNull() {
addCriterion("birthday is null");
return (Criteria) this;
}
public Criteria andBirthdayIsNotNull() {
addCriterion("birthday is not null");
return (Criteria) this;
}
public Criteria andBirthdayEqualTo(Date value) {
addCriterionForJDBCDate("birthday =", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayNotEqualTo(Date value) {
addCriterionForJDBCDate("birthday <>", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayGreaterThan(Date value) {
addCriterionForJDBCDate("birthday >", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("birthday >=", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayLessThan(Date value) {
addCriterionForJDBCDate("birthday <", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("birthday <=", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayIn(List<Date> values) {
addCriterionForJDBCDate("birthday in", values, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayNotIn(List<Date> values) {
addCriterionForJDBCDate("birthday not in", values, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayBetween(Date value1, Date value2) {
addCriterionForJDBCDate("birthday between", value1, value2, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("birthday not between", value1, value2, "birthday");
return (Criteria) this;
}
public Criteria andRegisterTimeIsNull() {
addCriterion("register_time is null");
return (Criteria) this;
}
public Criteria andRegisterTimeIsNotNull() {
addCriterion("register_time is not null");
return (Criteria) this;
}
public Criteria andRegisterTimeEqualTo(Date value) {
addCriterionForJDBCDate("register_time =", value, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeNotEqualTo(Date value) {
addCriterionForJDBCDate("register_time <>", value, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeGreaterThan(Date value) {
addCriterionForJDBCDate("register_time >", value, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("register_time >=", value, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeLessThan(Date value) {
addCriterionForJDBCDate("register_time <", value, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("register_time <=", value, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeIn(List<Date> values) {
addCriterionForJDBCDate("register_time in", values, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeNotIn(List<Date> values) {
addCriterionForJDBCDate("register_time not in", values, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeBetween(Date value1, Date value2) {
addCriterionForJDBCDate("register_time between", value1, value2, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("register_time not between", value1, value2, "registerTime");
return (Criteria) this;
}
public Criteria andBalanceIsNull() {
addCriterion("balance is null");
return (Criteria) this;
}
public Criteria andBalanceIsNotNull() {
addCriterion("balance is not null");
return (Criteria) this;
}
public Criteria andBalanceEqualTo(Integer value) {
addCriterion("balance =", value, "balance");
return (Criteria) this;
}
public Criteria andBalanceNotEqualTo(Integer value) {
addCriterion("balance <>", value, "balance");
return (Criteria) this;
}
public Criteria andBalanceGreaterThan(Integer value) {
addCriterion("balance >", value, "balance");
return (Criteria) this;
}
public Criteria andBalanceGreaterThanOrEqualTo(Integer value) {
addCriterion("balance >=", value, "balance");
return (Criteria) this;
}
public Criteria andBalanceLessThan(Integer value) {
addCriterion("balance <", value, "balance");
return (Criteria) this;
}
public Criteria andBalanceLessThanOrEqualTo(Integer value) {
addCriterion("balance <=", value, "balance");
return (Criteria) this;
}
public Criteria andBalanceIn(List<Integer> values) {
addCriterion("balance in", values, "balance");
return (Criteria) this;
}
public Criteria andBalanceNotIn(List<Integer> values) {
addCriterion("balance not in", values, "balance");
return (Criteria) this;
}
public Criteria andBalanceBetween(Integer value1, Integer value2) {
addCriterion("balance between", value1, value2, "balance");
return (Criteria) this;
}
public Criteria andBalanceNotBetween(Integer value1, Integer value2) {
addCriterion("balance not between", value1, value2, "balance");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -0,0 +1,65 @@
package com.wxs.po;
import java.util.Date;
public class Teacher {
private Integer id;
private String name;
private String sex;
private Date birthday;
private String degree;
private Date registerTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex == null ? null : sex.trim();
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public String getDegree() {
return degree;
}
public void setDegree(String degree) {
this.degree = degree == null ? null : degree.trim();
}
public Date getRegisterTime() {
return registerTime;
}
public void setRegisterTime(Date registerTime) {
this.registerTime = registerTime;
}
}

@ -0,0 +1,618 @@
package com.wxs.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
public class TeacherExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TeacherExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
protected void addCriterionForJDBCDate(String condition, Date value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value.getTime()), property);
}
protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
if (values == null || values.size() == 0) {
throw new RuntimeException("Value list for " + property + " cannot be null or empty");
}
List<java.sql.Date> dateList = new ArrayList<java.sql.Date>();
Iterator<Date> iter = values.iterator();
while (iter.hasNext()) {
dateList.add(new java.sql.Date(iter.next().getTime()));
}
addCriterion(condition, dateList, property);
}
protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andSexIsNull() {
addCriterion("sex is null");
return (Criteria) this;
}
public Criteria andSexIsNotNull() {
addCriterion("sex is not null");
return (Criteria) this;
}
public Criteria andSexEqualTo(String value) {
addCriterion("sex =", value, "sex");
return (Criteria) this;
}
public Criteria andSexNotEqualTo(String value) {
addCriterion("sex <>", value, "sex");
return (Criteria) this;
}
public Criteria andSexGreaterThan(String value) {
addCriterion("sex >", value, "sex");
return (Criteria) this;
}
public Criteria andSexGreaterThanOrEqualTo(String value) {
addCriterion("sex >=", value, "sex");
return (Criteria) this;
}
public Criteria andSexLessThan(String value) {
addCriterion("sex <", value, "sex");
return (Criteria) this;
}
public Criteria andSexLessThanOrEqualTo(String value) {
addCriterion("sex <=", value, "sex");
return (Criteria) this;
}
public Criteria andSexLike(String value) {
addCriterion("sex like", value, "sex");
return (Criteria) this;
}
public Criteria andSexNotLike(String value) {
addCriterion("sex not like", value, "sex");
return (Criteria) this;
}
public Criteria andSexIn(List<String> values) {
addCriterion("sex in", values, "sex");
return (Criteria) this;
}
public Criteria andSexNotIn(List<String> values) {
addCriterion("sex not in", values, "sex");
return (Criteria) this;
}
public Criteria andSexBetween(String value1, String value2) {
addCriterion("sex between", value1, value2, "sex");
return (Criteria) this;
}
public Criteria andSexNotBetween(String value1, String value2) {
addCriterion("sex not between", value1, value2, "sex");
return (Criteria) this;
}
public Criteria andBirthdayIsNull() {
addCriterion("birthday is null");
return (Criteria) this;
}
public Criteria andBirthdayIsNotNull() {
addCriterion("birthday is not null");
return (Criteria) this;
}
public Criteria andBirthdayEqualTo(Date value) {
addCriterionForJDBCDate("birthday =", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayNotEqualTo(Date value) {
addCriterionForJDBCDate("birthday <>", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayGreaterThan(Date value) {
addCriterionForJDBCDate("birthday >", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("birthday >=", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayLessThan(Date value) {
addCriterionForJDBCDate("birthday <", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("birthday <=", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayIn(List<Date> values) {
addCriterionForJDBCDate("birthday in", values, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayNotIn(List<Date> values) {
addCriterionForJDBCDate("birthday not in", values, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayBetween(Date value1, Date value2) {
addCriterionForJDBCDate("birthday between", value1, value2, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("birthday not between", value1, value2, "birthday");
return (Criteria) this;
}
public Criteria andDegreeIsNull() {
addCriterion("degree is null");
return (Criteria) this;
}
public Criteria andDegreeIsNotNull() {
addCriterion("degree is not null");
return (Criteria) this;
}
public Criteria andDegreeEqualTo(String value) {
addCriterion("degree =", value, "degree");
return (Criteria) this;
}
public Criteria andDegreeNotEqualTo(String value) {
addCriterion("degree <>", value, "degree");
return (Criteria) this;
}
public Criteria andDegreeGreaterThan(String value) {
addCriterion("degree >", value, "degree");
return (Criteria) this;
}
public Criteria andDegreeGreaterThanOrEqualTo(String value) {
addCriterion("degree >=", value, "degree");
return (Criteria) this;
}
public Criteria andDegreeLessThan(String value) {
addCriterion("degree <", value, "degree");
return (Criteria) this;
}
public Criteria andDegreeLessThanOrEqualTo(String value) {
addCriterion("degree <=", value, "degree");
return (Criteria) this;
}
public Criteria andDegreeLike(String value) {
addCriterion("degree like", value, "degree");
return (Criteria) this;
}
public Criteria andDegreeNotLike(String value) {
addCriterion("degree not like", value, "degree");
return (Criteria) this;
}
public Criteria andDegreeIn(List<String> values) {
addCriterion("degree in", values, "degree");
return (Criteria) this;
}
public Criteria andDegreeNotIn(List<String> values) {
addCriterion("degree not in", values, "degree");
return (Criteria) this;
}
public Criteria andDegreeBetween(String value1, String value2) {
addCriterion("degree between", value1, value2, "degree");
return (Criteria) this;
}
public Criteria andDegreeNotBetween(String value1, String value2) {
addCriterion("degree not between", value1, value2, "degree");
return (Criteria) this;
}
public Criteria andRegisterTimeIsNull() {
addCriterion("register_time is null");
return (Criteria) this;
}
public Criteria andRegisterTimeIsNotNull() {
addCriterion("register_time is not null");
return (Criteria) this;
}
public Criteria andRegisterTimeEqualTo(Date value) {
addCriterionForJDBCDate("register_time =", value, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeNotEqualTo(Date value) {
addCriterionForJDBCDate("register_time <>", value, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeGreaterThan(Date value) {
addCriterionForJDBCDate("register_time >", value, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("register_time >=", value, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeLessThan(Date value) {
addCriterionForJDBCDate("register_time <", value, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("register_time <=", value, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeIn(List<Date> values) {
addCriterionForJDBCDate("register_time in", values, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeNotIn(List<Date> values) {
addCriterionForJDBCDate("register_time not in", values, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeBetween(Date value1, Date value2) {
addCriterionForJDBCDate("register_time between", value1, value2, "registerTime");
return (Criteria) this;
}
public Criteria andRegisterTimeNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("register_time not between", value1, value2, "registerTime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -0,0 +1,43 @@
package com.wxs.po;
public class Userlogin {
private Integer id;
private String name;
private String password;
private Integer role;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
public Integer getRole() {
return role;
}
public void setRole(Integer role) {
this.role = role;
}
}

@ -0,0 +1,460 @@
package com.wxs.po;
import java.util.ArrayList;
import java.util.List;
public class UserloginExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public UserloginExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andPasswordIsNull() {
addCriterion("password is null");
return (Criteria) this;
}
public Criteria andPasswordIsNotNull() {
addCriterion("password is not null");
return (Criteria) this;
}
public Criteria andPasswordEqualTo(String value) {
addCriterion("password =", value, "password");
return (Criteria) this;
}
public Criteria andPasswordNotEqualTo(String value) {
addCriterion("password <>", value, "password");
return (Criteria) this;
}
public Criteria andPasswordGreaterThan(String value) {
addCriterion("password >", value, "password");
return (Criteria) this;
}
public Criteria andPasswordGreaterThanOrEqualTo(String value) {
addCriterion("password >=", value, "password");
return (Criteria) this;
}
public Criteria andPasswordLessThan(String value) {
addCriterion("password <", value, "password");
return (Criteria) this;
}
public Criteria andPasswordLessThanOrEqualTo(String value) {
addCriterion("password <=", value, "password");
return (Criteria) this;
}
public Criteria andPasswordLike(String value) {
addCriterion("password like", value, "password");
return (Criteria) this;
}
public Criteria andPasswordNotLike(String value) {
addCriterion("password not like", value, "password");
return (Criteria) this;
}
public Criteria andPasswordIn(List<String> values) {
addCriterion("password in", values, "password");
return (Criteria) this;
}
public Criteria andPasswordNotIn(List<String> values) {
addCriterion("password not in", values, "password");
return (Criteria) this;
}
public Criteria andPasswordBetween(String value1, String value2) {
addCriterion("password between", value1, value2, "password");
return (Criteria) this;
}
public Criteria andPasswordNotBetween(String value1, String value2) {
addCriterion("password not between", value1, value2, "password");
return (Criteria) this;
}
public Criteria andRoleIsNull() {
addCriterion("role is null");
return (Criteria) this;
}
public Criteria andRoleIsNotNull() {
addCriterion("role is not null");
return (Criteria) this;
}
public Criteria andRoleEqualTo(Integer value) {
addCriterion("role =", value, "role");
return (Criteria) this;
}
public Criteria andRoleNotEqualTo(Integer value) {
addCriterion("role <>", value, "role");
return (Criteria) this;
}
public Criteria andRoleGreaterThan(Integer value) {
addCriterion("role >", value, "role");
return (Criteria) this;
}
public Criteria andRoleGreaterThanOrEqualTo(Integer value) {
addCriterion("role >=", value, "role");
return (Criteria) this;
}
public Criteria andRoleLessThan(Integer value) {
addCriterion("role <", value, "role");
return (Criteria) this;
}
public Criteria andRoleLessThanOrEqualTo(Integer value) {
addCriterion("role <=", value, "role");
return (Criteria) this;
}
public Criteria andRoleIn(List<Integer> values) {
addCriterion("role in", values, "role");
return (Criteria) this;
}
public Criteria andRoleNotIn(List<Integer> values) {
addCriterion("role not in", values, "role");
return (Criteria) this;
}
public Criteria andRoleBetween(Integer value1, Integer value2) {
addCriterion("role between", value1, value2, "role");
return (Criteria) this;
}
public Criteria andRoleNotBetween(Integer value1, Integer value2) {
addCriterion("role not between", value1, value2, "role");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

@ -0,0 +1,86 @@
package com.wxs.realm;
import com.wxs.controller.common.SHA1Utils;
import com.wxs.po.Role;
import com.wxs.po.Userlogin;
import com.wxs.service.RoleService;
import com.wxs.service.UserloginService;
import org.apache.shiro.authc.*;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.HashSet;
import java.util.Set;
@Component
public class LoginRealm extends AuthorizingRealm{
@Resource(name = "userloginServiceImpl")
private UserloginService userloginService;
@Resource(name = "roleServiceImpl")
private RoleService roleService;
/**
*
*/
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {
String name = (String) getAvailablePrincipal(principalCollection);
Role role = null;
try {
Userlogin userlogin = userloginService.findByName(name);
//获取角色对象
role = roleService.findByid(userlogin.getRole());
} catch (Exception e) {
e.printStackTrace();
}
//通过用户名从数据库获取权限/角色信息
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
Set<String> r = new HashSet<String>();
if (role != null) {
r.add(role.getName());
info.setRoles(r);
}
return info;
}
/**
*
*/
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
//用户名
String username = (String) token.getPrincipal();
//密码
String password = new String((char[])token.getCredentials());
Userlogin userlogin = null;
try {
userlogin = userloginService.findByName(username);
} catch (Exception e) {
e.printStackTrace();
}
if (userlogin == null) {
//没有该用户名
throw new UnknownAccountException("该用户不存在!");
} else if (!SHA1Utils.validatePassword(password, userlogin.getPassword())) {
//密码错误
throw new IncorrectCredentialsException("密码错误!");
}
//身份验证通过,返回一个身份信息
AuthenticationInfo aInfo = new SimpleAuthenticationInfo(username,password,getName());
return aInfo;
}
}

@ -0,0 +1,70 @@
package com.wxs.service;
import com.wxs.po.Course;
import java.util.List;
public interface CourseService {
/**
*
* @param course course
* @throws Exception
*/
void upadteById(Course course) throws Exception;
/**
*
* @param id id
* @return
* @throws Exception
*/
Boolean removeById(Integer id) throws Exception;
/**
*
* @param toPageNo
* @return CourseCustom
* @throws Exception
*/
List<Course> findByPaging(Integer toPageNo) throws Exception;
/**
*
* @param course course
* @return
* @throws Exception
*/
int save(Course course) throws Exception;
/**
*
* @return
* @throws Exception
*/
int getCountCourse() throws Exception;
/**
* id
* @param id id
* @return CourseCustom
* @throws Exception
*/
Course findById(Integer id) throws Exception;
/**
*
* @param name
* @return CourseCustom
* @throws Exception
*/
List<Course> findByName(String name) throws Exception;
/**
* id
* @param id id
* @return
* @throws Exception
*/
List<Course> findByTeacherID(Integer id) throws Exception;
}

@ -0,0 +1,16 @@
package com.wxs.service;
import com.wxs.po.Role;
public interface RoleService {
/**
*
* @param id id
* @return Role
* @throws Exception
*/
Role findByid(Integer id) throws Exception;
}

@ -0,0 +1,71 @@
package com.wxs.service;
import com.wxs.po.StudentCourse;
import java.util.List;
public interface StudentCourseService {
/**
* ID
* @param id id
* @return SelectedCourseCustom
* @throws Exception
*/
List<StudentCourse> findByCourseID(Integer id) throws Exception;
/**
* id
* @param id id
* @return SelectedCourseCustom
* @throws Exception
*/
List<StudentCourse> findByStudentID(Integer id) throws Exception;
/**
* id
* @param id id
* @return SelectedCourseCustom
* @throws Exception
*/
List<StudentCourse> findByStudentID(Integer id,Boolean hasExam) throws Exception;
/**
*
* @param id id
* @return
* @throws Exception
*/
Integer countByCourseID(Integer id) throws Exception;
/**
*
* @param courseId id
* @param studentId id
* @return SelectedCourseCustom
* @throws Exception
*/
StudentCourse findOne(Integer courseId, Integer studentId) throws Exception;
/**
*
* @param studentCourse studentCourse
* @throws Exception
*/
void update(StudentCourse studentCourse) throws Exception;
/**
*
* @param studentCourse studentCourse
* @throws Exception
*/
int save(StudentCourse studentCourse) throws Exception;
/**
*
* @param studentCourse studentCourse
* @throws Exception
*/
void remove(StudentCourse studentCourse) throws Exception;
}

@ -0,0 +1,64 @@
package com.wxs.service;
import com.wxs.po.Student;
import java.util.List;
public interface StudentService {
/**
*
* @param student Student
* @throws Exception
*/
void updataById(Student student) throws Exception;
/**
*
* @param id id
* @return
* @throws Exception
*/
Boolean removeById(Integer id) throws Exception;
/**
*
* @param toPageNo
* @return StudentCustom
* @throws Exception
*/
List<Student> findByPaging(Integer toPageNo) throws Exception;
/**
*
* @param studentCustoms StudentCustom
* @return
* @throws Exception
*/
int save(Student studentCustoms) throws Exception;
/**
*
* @return
* @throws Exception
*/
int getCountStudent() throws Exception;
/**
*
* @param id id
* @return StudentCustom
* @throws Exception
*/
Student findById(Integer id) throws Exception;
/**
*
* @param name
* @return StudentCustom
* @throws Exception
*/
List<Student> findByName(String name) throws Exception;
}

@ -0,0 +1,25 @@
package com.wxs.service;
import com.wxs.po.Teacher;
import java.util.List;
public interface TeacherService {
void updateById(Teacher teacher) throws Exception;
boolean removeById(Integer id) throws Exception;
List<Teacher> findByPaging(Integer toPageNo) throws Exception;
int save(Teacher teacher) throws Exception;
int getCountTeacher() throws Exception;
Teacher findById(Integer id) throws Exception;
List<Teacher> findByName(String name) throws Exception;
List<Teacher> findAll() throws Exception;
}

@ -0,0 +1,51 @@
package com.wxs.service;
import com.wxs.po.Userlogin;
public interface UserloginService {
/**
*
* @param name
* @return
* @throws Exception
*/
Userlogin findByName(String name);
/**
* Id
* @param id
* @return
*/
Userlogin findById(Integer id);
/**
*
* @param userlogin Userlogin
* @throws Exception
*/
void save(Userlogin userlogin) throws Exception;
/**
*
* @param id
* @throws Exception
*/
void removeById(Integer id) throws Exception;
/**
*
* @param name
* @param userlogin Userlogin
*/
void updateByName(String name, Userlogin userlogin);
/**
* id
* @param id
* @param userlogin
*/
void updateById(Integer id,Userlogin userlogin);
}

@ -0,0 +1,139 @@
package com.wxs.service.impl;
import com.wxs.mapper.CourseMapper;
import com.wxs.mapper.StudentCourseMapper;
import com.wxs.po.*;
import com.wxs.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CourseServiceImpl implements CourseService {
@Autowired
private CourseMapper courseMapper;
@Autowired
private StudentCourseMapper studentCourseMapper;
@Override
public void upadteById(Course course) throws Exception {
courseMapper.updateByPrimaryKey(course);
}
/**
*
* @param id id
* @return
* @throws Exception
*/
@Override
public Boolean removeById(Integer id) throws Exception {
//自定义查询条件
StudentCourseExample example = new StudentCourseExample();
StudentCourseExample.Criteria criteria = example.createCriteria();
criteria.andCourseIdEqualTo(id);
List<StudentCourse> list = studentCourseMapper.selectByExample(example);
//如果没有人选这门课,直接删除
if (list.size() == 0) {
courseMapper.deleteByPrimaryKey(id);
return true;
}
return false;
}
/**
*
* @param toPageNo
* @return CourseCustom
* @throws Exception
*/
@Override
public List<Course> findByPaging(Integer toPageNo) throws Exception {
PagingVO pagingVO = new PagingVO();
pagingVO.setToPageNo(toPageNo);
List<Course> list = courseMapper.findByPaging(pagingVO);
return list;
}
/**
*
* @return
* @throws Exception
*/
@Override
public int getCountCourse() throws Exception {
//自定义查询对象
CourseExample courseExample = new CourseExample();
//通过criteria构造查询条件
CourseExample.Criteria criteria = courseExample.createCriteria();
criteria.andIdIsNotNull();
return courseMapper.countByExample(courseExample);
}
/**
* id
* @param id id
* @return CourseCustom
* @throws Exception
*/
@Override
public Course findById(Integer id) throws Exception {
Course course = courseMapper.selectByPrimaryKey(id);
return course;
}
/**
*
* @param name
* @return CourseCustom
* @throws Exception
*/
@Override
public List<Course> findByName(String name) throws Exception {
List<Course> list = courseMapper.findByName(name);
return list;
}
/**
* id
* @param id id
* @return
* @throws Exception
*/
@Override
public List<Course> findByTeacherID(Integer id) throws Exception {
CourseExample courseExample = new CourseExample();
//自定义查询条件
CourseExample.Criteria criteria = courseExample.createCriteria();
//根据教师id查课程
criteria.andTeacherIdEqualTo(id);
List<Course> list = courseMapper.selectByExample(courseExample);
return list;
}
/**
*
* @param course course
* @return
* @throws Exception
*/
@Override
public int save(Course course) throws Exception {
int i = courseMapper.insert(course);
return i;
}
}

@ -0,0 +1,23 @@
package com.wxs.service.impl;
import com.wxs.mapper.RoleMapper;
import com.wxs.po.Role;
import com.wxs.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class RoleServiceImpl implements RoleService {
@Autowired
private RoleMapper roleMapper;
/**
*
*/
@Override
public Role findByid(Integer id) throws Exception {
return roleMapper.selectByPrimaryKey(id);
}
}

@ -0,0 +1,150 @@
package com.wxs.service.impl;
import com.wxs.mapper.StudentCourseMapper;
import com.wxs.po.StudentCourse;
import com.wxs.po.StudentCourseExample;
import com.wxs.service.StudentCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class StudentCourseServiceImpl implements StudentCourseService {
@Autowired
private StudentCourseMapper studentCourseMapper;
/**
* ID
* @param id id
*/
@Override
public List<StudentCourse> findByCourseID(Integer id) throws Exception {
StudentCourseExample example = new StudentCourseExample();
StudentCourseExample.Criteria criteria = example.createCriteria();
criteria.andCourseIdEqualTo(id);
List<StudentCourse> list = studentCourseMapper.selectByExample(example);
return list;
}
/**
*
* @param id id
* @return
*/
@Override
public Integer countByCourseID(Integer id) throws Exception {
StudentCourseExample example = new StudentCourseExample();
StudentCourseExample.Criteria criteria = example.createCriteria();
criteria.andCourseIdEqualTo(id);
return studentCourseMapper.countByExample(example);
}
/**
*
* @param courseId id
* @param studentId id
* @return SelectedCourseCustom
*/
@Override
public StudentCourse findOne(Integer courseId, Integer studentId) throws Exception {
StudentCourseExample example = new StudentCourseExample();
StudentCourseExample.Criteria criteria = example.createCriteria();
criteria.andCourseIdEqualTo(courseId);
criteria.andStudentIdEqualTo(studentId);
List<StudentCourse> list = studentCourseMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
/**
*
* @param studentCourse studentCourse
*/
@Override
public void update(StudentCourse studentCourse) throws Exception {
StudentCourseExample example = new StudentCourseExample();
StudentCourseExample.Criteria criteria = example.createCriteria();
criteria.andCourseIdEqualTo(studentCourse.getCourseId());
criteria.andStudentIdEqualTo(studentCourse.getStudentId());
studentCourseMapper.updateByExample(studentCourse, example);
}
@Override
public int save(StudentCourse studentCourse) throws Exception {
if(studentCourse.getProgress() == null) {
studentCourse.setProgress(0);
}
if(studentCourse.getHasExam() == null) {
studentCourse.setHasExam(false);
}
int i = studentCourseMapper.insert(studentCourse);
return i;
}
/**
* id
* id id
* SelectedCourseCustom
*/
@Override
public List<StudentCourse> findByStudentID(Integer id) throws Exception {
StudentCourseExample example = new StudentCourseExample();
StudentCourseExample.Criteria criteria = example.createCriteria();
criteria.andStudentIdEqualTo(id);
List<StudentCourse> list = studentCourseMapper.selectByExample(example);
return list;
}
/**
* id
id id
SelectedCourseCustom
*/
@Override
public List<StudentCourse> findByStudentID(Integer id, Boolean hasExam) throws Exception {
StudentCourseExample example = new StudentCourseExample();
StudentCourseExample.Criteria criteria = example.createCriteria();
criteria.andStudentIdEqualTo(id);
criteria.andHasExamEqualTo(hasExam);
List<StudentCourse> list = studentCourseMapper.selectByExample(example);
return list;
}
/**
*
* studentCourse studentCourse
*/
@Override
public void remove(StudentCourse studentCourse) throws Exception {
StudentCourseExample example = new StudentCourseExample();
StudentCourseExample.Criteria criteria = example.createCriteria();
criteria.andCourseIdEqualTo(studentCourse.getCourseId());
criteria.andStudentIdEqualTo(studentCourse.getStudentId());
studentCourseMapper.deleteByExample(example);
}
}

@ -0,0 +1,123 @@
package com.wxs.service.impl;
import com.wxs.mapper.StudentCourseMapper;
import com.wxs.mapper.StudentMapper;
import com.wxs.po.*;
import com.wxs.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class StudentServiceImpl implements StudentService {
@Autowired
private StudentMapper studentMapper;
@Autowired
private StudentCourseMapper studentCourseMapper;
@Override
public void updataById(Student student) throws Exception {
studentMapper.updateByPrimaryKey(student);
}
/**
*
* @param id id
* @return
* @throws Exception
*/
@Override
public Boolean removeById(Integer id) throws Exception {
//自定义查询条件
StudentCourseExample example = new StudentCourseExample();
StudentCourseExample.Criteria criteria = example.createCriteria();
criteria.andStudentIdEqualTo(id);
List<StudentCourse> list = studentCourseMapper.selectByExample(example);
//如果selectedcourse表没有约束直接删除
if (list.size() == 0) {
studentMapper.deleteByPrimaryKey(id);
return true;
}
return false;
}
/**
*
* @param toPageNo
* @return StudentCustom
* @throws Exception
*/
@Override
public List<Student> findByPaging(Integer toPageNo) throws Exception {
PagingVO pagingVO = new PagingVO();
pagingVO.setToPageNo(toPageNo);
List<Student> list = studentMapper.findByPaging(pagingVO);
return list;
}
@Override
public int save(Student student) throws Exception {
int i = studentMapper.insert(student);
return i;
}
/**
*
* @return
* @throws Exception
*/
@Override
public int getCountStudent() throws Exception {
//自定义查询对象
StudentExample studentExample = new StudentExample();
//通过criteria构造查询条件
StudentExample.Criteria criteria = studentExample.createCriteria();
criteria.andIdIsNotNull();
return studentMapper.countByExample(studentExample);
}
/**
*
* @param id id
* @return StudentCustom
* @throws Exception
*/
@Override
public Student findById(Integer id) throws Exception {
Student student = studentMapper.selectByPrimaryKey(id);
return student;
}
/**
*
* @param name
* @return StudentCustom
* @throws Exception
*/
@Override
public List<Student> findByName(String name) throws Exception {
StudentExample studentExample = new StudentExample();
//自定义查询条件
StudentExample.Criteria criteria = studentExample.createCriteria();
criteria.andNameLike("%" + name + "%");
List<Student> list = studentMapper.selectByExample(studentExample);
return list;
}
}

@ -0,0 +1,129 @@
package com.wxs.service.impl;
import com.wxs.exception.CustomException;
import com.wxs.mapper.CourseMapper;
import com.wxs.mapper.TeacherMapper;
import com.wxs.po.*;
import com.wxs.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class TeacherServiceImpl implements TeacherService {
@Autowired
private TeacherMapper teacherMapper;
@Autowired
private CourseMapper courseMapper;
@Override
public void updateById(Teacher teacher) throws Exception {
teacherMapper.updateByPrimaryKey(teacher);
}
/**
*
* @param id id
* @throws Exception
*/
@Override
public boolean removeById(Integer id) throws Exception {
CourseExample courseExample = new CourseExample();
CourseExample.Criteria criteria = courseExample.createCriteria();
criteria.andTeacherIdEqualTo(id);
List<Course> list = courseMapper.selectByExample(courseExample);
if (list.size() == 0) {
teacherMapper.deleteByPrimaryKey(id);
return true;
}
return false;
}
/**
*
* @param toPageNo
* @return TeacherCustom
*/
@Override
public List<Teacher> findByPaging(Integer toPageNo) throws Exception {
PagingVO pagingVO = new PagingVO();
pagingVO.setToPageNo(toPageNo);
List<Teacher> list = teacherMapper.findByPaging(pagingVO);
return list;
}
@Override
public int save(Teacher teacher) throws Exception {
int i = teacherMapper.insert(teacher);
return i;
}
/**
*
* @return
* @throws Exception
*/
@Override
public int getCountTeacher() throws Exception {
//自定义查询对象
TeacherExample teacherExample = new TeacherExample();
//通过criteria构造查询条件
TeacherExample.Criteria criteria = teacherExample.createCriteria();
criteria.andIdIsNotNull();
return teacherMapper.countByExample(teacherExample);
}
@Override
public Teacher findById(Integer id) throws Exception {
Teacher teacher = teacherMapper.selectByPrimaryKey(id);
return teacher;
}
/**
*
* @param name
* @return TeacherCustom
* @throws Exception
*/
@Override
public List<Teacher> findByName(String name) throws Exception {
TeacherExample teacherExample = new TeacherExample();
//自定义查询条件
TeacherExample.Criteria criteria = teacherExample.createCriteria();
criteria.andNameLike("%" + name + "%");
List<Teacher> list = teacherMapper.selectByExample(teacherExample);
return list;
}
/**
*
* @return TeacherCustom
* @throws Exception
*/
@Override
public List<Teacher> findAll() throws Exception {
TeacherExample teacherExample = new TeacherExample();
TeacherExample.Criteria criteria = teacherExample.createCriteria();
criteria.andIdIsNotNull();
List<Teacher> list = teacherMapper.selectByExample(teacherExample);
return list;
}
}

@ -0,0 +1,118 @@
package com.wxs.service.impl;
import com.wxs.mapper.UserloginMapper;
import com.wxs.po.Userlogin;
import com.wxs.po.UserloginExample;
import com.wxs.service.UserloginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class UserloginServiceImpl implements UserloginService {
@Autowired
private UserloginMapper userloginMapper;
/**
*
* @param name
* @return
* @throws Exception
*/
@Override
public Userlogin findByName(String name) {
UserloginExample userloginExample = new UserloginExample();
UserloginExample.Criteria criteria = userloginExample.createCriteria();
criteria.andNameEqualTo(name);
List<Userlogin> lists = userloginMapper.selectByExample(userloginExample);
if (lists.size() > 0) {
return lists.get(0);
} else {
return null;
}
}
/**
* id
* @param id
* @return
*/
@Override
public Userlogin findById(Integer id) {
UserloginExample userloginExample = new UserloginExample();
UserloginExample.Criteria criteria = userloginExample.createCriteria();
criteria.andIdEqualTo(id);
List<Userlogin> list = userloginMapper.selectByExample(userloginExample);
if(list.size() == 0) {
return null;
} else {
return list.get(0);
}
}
/**
*
* @param userlogin Userlogin
* @throws Exception
*/
@Override
public void save(Userlogin userlogin) throws Exception {
userloginMapper.insert(userlogin);
}
/**
*
* @param id
* @throws Exception
*/
@Override
public void removeById(Integer id) throws Exception {
UserloginExample userloginExample = new UserloginExample();
UserloginExample.Criteria criteria = userloginExample.createCriteria();
criteria.andIdEqualTo(id);
userloginMapper.deleteByExample(userloginExample);
}
/**
*
* @param name
* @param userlogin Userlogin
*/
@Override
public void updateByName(String name, Userlogin userlogin) {
UserloginExample userloginExample = new UserloginExample();
UserloginExample.Criteria criteria = userloginExample.createCriteria();
criteria.andNameEqualTo(name);
userloginMapper.updateByExample(userlogin, userloginExample);
}
/**
* id
* @param id
* @param userlogin
*/
@Override
public void updateById(Integer id, Userlogin userlogin) {
UserloginExample userloginExample = new UserloginExample();
UserloginExample.Criteria criteria = userloginExample.createCriteria();
criteria.andIdEqualTo(id);
userloginMapper.updateByExample(userlogin, userloginExample);
}
}

@ -0,0 +1,29 @@
### 设置日志级别###
log4j.rootLogger = info,stdout,I,E
### 输出信息到控制台 ###
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
### 输出INFO级别以上的日志 ###
log4j.appender.I = org.apache.log4j.DailyRollingFileAppender
#log4j.appender.I.File = E://logs/log.log
log4j.appender.I.File = ../logs/log.log
log4j.appender.I.Append = true
log4j.appender.I.Threshold = INFO
log4j.appender.I.layout = org.apache.log4j.PatternLayout
log4j.appender.I.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
### 输出ERROR级别以上的日志 ###
log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
#log4j.appender.E.File = E://logs/error.log
log4j.appender.E.File = ../logs/error.log
log4j.appender.E.Append = true
log4j.appender.E.Threshold = ERROR
log4j.appender.E.layout = org.apache.log4j.PatternLayout
log4j.appender.E.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
# mybatis显示SQL语句替换自己的包名
log4j.logger.com.wxs.mapper=DEBUG

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save