caiyufan 5 سال پیش
کامیت
337428c923
100فایلهای تغییر یافته به همراه8548 افزوده شده و 0 حذف شده
  1. 8 0
      .idea/.gitignore
  2. 14 0
      .idea/artifacts/tmall_ssm_war.xml
  3. 54 0
      .idea/artifacts/tmall_ssm_war_exploded.xml
  4. 16 0
      .idea/compiler.xml
  5. 8 0
      .idea/encodings.xml
  6. 20 0
      .idea/jarRepositories.xml
  7. 13 0
      .idea/libraries/Maven__aopalliance_aopalliance_1_0.xml
  8. 13 0
      .idea/libraries/Maven__com_alibaba_druid_1_0_18.xml
  9. 13 0
      .idea/libraries/Maven__com_github_jsqlparser_jsqlparser_1_0.xml
  10. 13 0
      .idea/libraries/Maven__com_github_pagehelper_pagehelper_5_1_2_beta.xml
  11. 13 0
      .idea/libraries/Maven__com_google_protobuf_protobuf_java_3_6_1.xml
  12. 13 0
      .idea/libraries/Maven__commons_fileupload_commons_fileupload_1_2_1.xml
  13. 13 0
      .idea/libraries/Maven__commons_io_commons_io_1_3_2.xml
  14. 13 0
      .idea/libraries/Maven__commons_lang_commons_lang_2_6.xml
  15. 13 0
      .idea/libraries/Maven__commons_logging_commons_logging_1_2.xml
  16. 13 0
      .idea/libraries/Maven__javax_servlet_javax_servlet_api_3_1_0.xml
  17. 13 0
      .idea/libraries/Maven__jstl_jstl_1_2.xml
  18. 13 0
      .idea/libraries/Maven__junit_junit_4_12.xml
  19. 13 0
      .idea/libraries/Maven__log4j_log4j_1_2_16.xml
  20. 13 0
      .idea/libraries/Maven__mysql_mysql_connector_java_8_0_15.xml
  21. 13 0
      .idea/libraries/Maven__org_aspectj_aspectjweaver_1_8_4.xml
  22. 13 0
      .idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
  23. 13 0
      .idea/libraries/Maven__org_mybatis_generator_mybatis_generator_core_1_3_5.xml
  24. 13 0
      .idea/libraries/Maven__org_mybatis_mybatis_3_1_1.xml
  25. 13 0
      .idea/libraries/Maven__org_mybatis_mybatis_spring_1_2_3.xml
  26. 13 0
      .idea/libraries/Maven__org_springframework_spring_aop_4_1_3_RELEASE.xml
  27. 13 0
      .idea/libraries/Maven__org_springframework_spring_aspects_4_1_3_RELEASE.xml
  28. 13 0
      .idea/libraries/Maven__org_springframework_spring_beans_4_1_3_RELEASE.xml
  29. 13 0
      .idea/libraries/Maven__org_springframework_spring_context_4_1_3_RELEASE.xml
  30. 13 0
      .idea/libraries/Maven__org_springframework_spring_core_4_1_3_RELEASE.xml
  31. 13 0
      .idea/libraries/Maven__org_springframework_spring_expression_4_1_3_RELEASE.xml
  32. 13 0
      .idea/libraries/Maven__org_springframework_spring_jdbc_4_1_3_RELEASE.xml
  33. 13 0
      .idea/libraries/Maven__org_springframework_spring_test_4_1_3_RELEASE.xml
  34. 13 0
      .idea/libraries/Maven__org_springframework_spring_tx_4_1_3_RELEASE.xml
  35. 13 0
      .idea/libraries/Maven__org_springframework_spring_web_4_1_3_RELEASE.xml
  36. 13 0
      .idea/libraries/Maven__org_springframework_spring_webmvc_4_1_3_RELEASE.xml
  37. 16 0
      .idea/misc.xml
  38. 8 0
      .idea/modules.xml
  39. 6 0
      .idea/vcs.xml
  40. 225 0
      pom.xml
  41. 86 0
      src/main/java/com/how2java/tmall/controller/CategoryController.java
  42. 368 0
      src/main/java/com/how2java/tmall/controller/ForeController.java
  43. 53 0
      src/main/java/com/how2java/tmall/controller/OrderController.java
  44. 27 0
      src/main/java/com/how2java/tmall/controller/PageController.java
  45. 74 0
      src/main/java/com/how2java/tmall/controller/ProductController.java
  46. 119 0
      src/main/java/com/how2java/tmall/controller/ProductImageController.java
  47. 72 0
      src/main/java/com/how2java/tmall/controller/PropertyController.java
  48. 40 0
      src/main/java/com/how2java/tmall/controller/PropertyValueController.java
  49. 40 0
      src/main/java/com/how2java/tmall/controller/UserController.java
  50. 93 0
      src/main/java/com/how2java/tmall/interceptor/LoginInterceptor.java
  51. 87 0
      src/main/java/com/how2java/tmall/interceptor/OtherInterceptor.java
  52. 22 0
      src/main/java/com/how2java/tmall/mapper/CategoryMapper.java
  53. 22 0
      src/main/java/com/how2java/tmall/mapper/OrderItemMapper.java
  54. 21 0
      src/main/java/com/how2java/tmall/mapper/OrderMapper.java
  55. 22 0
      src/main/java/com/how2java/tmall/mapper/ProductImageMapper.java
  56. 22 0
      src/main/java/com/how2java/tmall/mapper/ProductMapper.java
  57. 22 0
      src/main/java/com/how2java/tmall/mapper/PropertyMapper.java
  58. 21 0
      src/main/java/com/how2java/tmall/mapper/PropertyValueMapper.java
  59. 21 0
      src/main/java/com/how2java/tmall/mapper/ReviewMapper.java
  60. 21 0
      src/main/java/com/how2java/tmall/mapper/UserMapper.java
  61. 47 0
      src/main/java/com/how2java/tmall/pojo/Category.java
  62. 330 0
      src/main/java/com/how2java/tmall/pojo/CategoryExample.java
  63. 215 0
      src/main/java/com/how2java/tmall/pojo/Order.java
  64. 1051 0
      src/main/java/com/how2java/tmall/pojo/OrderExample.java
  65. 65 0
      src/main/java/com/how2java/tmall/pojo/OrderItem.java
  66. 500 0
      src/main/java/com/how2java/tmall/pojo/OrderItemExample.java
  67. 151 0
      src/main/java/com/how2java/tmall/pojo/Product.java
  68. 702 0
      src/main/java/com/how2java/tmall/pojo/ProductExample.java
  69. 33 0
      src/main/java/com/how2java/tmall/pojo/ProductImage.java
  70. 391 0
      src/main/java/com/how2java/tmall/pojo/ProductImageExample.java
  71. 43 0
      src/main/java/com/how2java/tmall/pojo/Property.java
  72. 391 0
      src/main/java/com/how2java/tmall/pojo/PropertyExample.java
  73. 54 0
      src/main/java/com/how2java/tmall/pojo/PropertyValue.java
  74. 450 0
      src/main/java/com/how2java/tmall/pojo/PropertyValueExample.java
  75. 66 0
      src/main/java/com/how2java/tmall/pojo/Review.java
  76. 511 0
      src/main/java/com/how2java/tmall/pojo/ReviewExample.java
  77. 52 0
      src/main/java/com/how2java/tmall/pojo/User.java
  78. 400 0
      src/main/java/com/how2java/tmall/pojo/UserExample.java
  79. 16 0
      src/main/java/com/how2java/tmall/service/CategoryService.java
  80. 26 0
      src/main/java/com/how2java/tmall/service/OrderItemService.java
  81. 24 0
      src/main/java/com/how2java/tmall/service/OrderService.java
  82. 17 0
      src/main/java/com/how2java/tmall/service/ProductImageService.java
  83. 27 0
      src/main/java/com/how2java/tmall/service/ProductService.java
  84. 14 0
      src/main/java/com/how2java/tmall/service/PropertyService.java
  85. 15 0
      src/main/java/com/how2java/tmall/service/PropertyValueService.java
  86. 19 0
      src/main/java/com/how2java/tmall/service/ReviewService.java
  87. 17 0
      src/main/java/com/how2java/tmall/service/UserService.java
  88. 44 0
      src/main/java/com/how2java/tmall/service/impl/CategoryServiceImpl.java
  89. 116 0
      src/main/java/com/how2java/tmall/service/impl/OrderItemServiceImpl.java
  90. 93 0
      src/main/java/com/how2java/tmall/service/impl/OrderServiceImpl.java
  91. 48 0
      src/main/java/com/how2java/tmall/service/impl/ProductImageServiceImpl.java
  92. 148 0
      src/main/java/com/how2java/tmall/service/impl/ProductServiceImpl.java
  93. 51 0
      src/main/java/com/how2java/tmall/service/impl/PropertyServiceImpl.java
  94. 70 0
      src/main/java/com/how2java/tmall/service/impl/PropertyValueServiceImpl.java
  95. 67 0
      src/main/java/com/how2java/tmall/service/impl/ReviewServiceImpl.java
  96. 69 0
      src/main/java/com/how2java/tmall/service/impl/UserServiceImpl.java
  97. 44 0
      src/main/java/com/how2java/tmall/test/TestTmall.java
  98. 70 0
      src/main/java/com/how2java/tmall/util/ImageUtil.java
  99. 55 0
      src/main/java/com/how2java/tmall/util/MybatisGenerator.java
  100. 28 0
      src/main/java/com/how2java/tmall/util/OverIsMergeablePlugin.java

+ 8 - 0
.idea/.gitignore

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

+ 14 - 0
.idea/artifacts/tmall_ssm_war.xml

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

+ 54 - 0
.idea/artifacts/tmall_ssm_war_exploded.xml

@@ -0,0 +1,54 @@
+<component name="ArtifactManager">
+  <artifact type="exploded-war" name="tmall_ssm:war exploded">
+    <output-path>$PROJECT_DIR$/target/tmall_ssm</output-path>
+    <properties id="maven-jee-properties">
+      <options>
+        <exploded>true</exploded>
+        <module>tmall_ssm</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="tmall_ssm" />
+        </element>
+        <element id="directory" name="lib">
+          <element id="library" level="project" name="Maven: junit:junit:4.12" />
+          <element id="library" level="project" name="Maven: org.hamcrest:hamcrest-core:1.3" />
+          <element id="library" level="project" name="Maven: org.mybatis:mybatis:3.1.1" />
+          <element id="library" level="project" name="Maven: org.mybatis:mybatis-spring:1.2.3" />
+          <element id="library" level="project" name="Maven: mysql:mysql-connector-java:8.0.15" />
+          <element id="library" level="project" name="Maven: com.google.protobuf:protobuf-java:3.6.1" />
+          <element id="library" level="project" name="Maven: com.alibaba:druid:1.0.18" />
+          <element id="library" level="project" name="Maven: org.springframework:spring-context:4.1.3.RELEASE" />
+          <element id="library" level="project" name="Maven: org.springframework:spring-aop:4.1.3.RELEASE" />
+          <element id="library" level="project" name="Maven: org.springframework:spring-core:4.1.3.RELEASE" />
+          <element id="library" level="project" name="Maven: org.springframework:spring-expression:4.1.3.RELEASE" />
+          <element id="library" level="project" name="Maven: org.springframework:spring-test:4.1.3.RELEASE" />
+          <element id="library" level="project" name="Maven: org.springframework:spring-beans:4.1.3.RELEASE" />
+          <element id="library" level="project" name="Maven: org.springframework:spring-webmvc:4.1.3.RELEASE" />
+          <element id="library" level="project" name="Maven: org.springframework:spring-web:4.1.3.RELEASE" />
+          <element id="library" level="project" name="Maven: org.springframework:spring-jdbc:4.1.3.RELEASE" />
+          <element id="library" level="project" name="Maven: org.springframework:spring-tx:4.1.3.RELEASE" />
+          <element id="library" level="project" name="Maven: org.springframework:spring-aspects:4.1.3.RELEASE" />
+          <element id="library" level="project" name="Maven: org.aspectj:aspectjweaver:1.8.4" />
+          <element id="library" level="project" name="Maven: jstl:jstl:1.2" />
+          <element id="library" level="project" name="Maven: com.github.pagehelper:pagehelper:5.1.2-beta" />
+          <element id="library" level="project" name="Maven: com.github.jsqlparser:jsqlparser:1.0" />
+          <element id="library" level="project" name="Maven: log4j:log4j:1.2.16" />
+          <element id="library" level="project" name="Maven: commons-logging:commons-logging:1.2" />
+          <element id="library" level="project" name="Maven: commons-fileupload:commons-fileupload:1.2.1" />
+          <element id="library" level="project" name="Maven: commons-io:commons-io:1.3.2" />
+          <element id="library" level="project" name="Maven: commons-lang:commons-lang:2.6" />
+          <element id="library" level="project" name="Maven: aopalliance:aopalliance:1.0" />
+          <element id="library" level="project" name="Maven: org.mybatis.generator:mybatis-generator-core:1.3.5" />
+        </element>
+      </element>
+      <element id="directory" name="META-INF">
+        <element id="file-copy" path="$PROJECT_DIR$/target/tmall_ssm/META-INF/MANIFEST.MF" />
+      </element>
+      <element id="javaee-facet-resources" facet="tmall_ssm/web/Web" />
+    </root>
+  </artifact>
+</component>

+ 16 - 0
.idea/compiler.xml

@@ -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="tmall_ssm" />
+      </profile>
+    </annotationProcessing>
+    <bytecodeTargetLevel>
+      <module name="tmall_ssm" target="1.8" />
+    </bytecodeTargetLevel>
+  </component>
+</project>

+ 8 - 0
.idea/encodings.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="file://$PROJECT_DIR$" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
+  </component>
+</project>

+ 20 - 0
.idea/jarRepositories.xml

@@ -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="https://repo.maven.apache.org/maven2" />
+    </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>

+ 13 - 0
.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: aopalliance:aopalliance:1.0">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/aopalliance/aopalliance/1.0/aopalliance-1.0.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/aopalliance/aopalliance/1.0/aopalliance-1.0-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__com_alibaba_druid_1_0_18.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: com.alibaba:druid:1.0.18">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/com/alibaba/druid/1.0.18/druid-1.0.18.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/com/alibaba/druid/1.0.18/druid-1.0.18-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/com/alibaba/druid/1.0.18/druid-1.0.18-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__com_github_jsqlparser_jsqlparser_1_0.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: com.github.jsqlparser:jsqlparser:1.0">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/com/github/jsqlparser/jsqlparser/1.0/jsqlparser-1.0.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/com/github/jsqlparser/jsqlparser/1.0/jsqlparser-1.0-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/com/github/jsqlparser/jsqlparser/1.0/jsqlparser-1.0-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__com_github_pagehelper_pagehelper_5_1_2_beta.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: com.github.pagehelper:pagehelper:5.1.2-beta">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper/5.1.2-beta/pagehelper-5.1.2-beta.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper/5.1.2-beta/pagehelper-5.1.2-beta-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper/5.1.2-beta/pagehelper-5.1.2-beta-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_6_1.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: com.google.protobuf:protobuf-java:3.6.1">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/3.6.1/protobuf-java-3.6.1.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/3.6.1/protobuf-java-3.6.1-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/3.6.1/protobuf-java-3.6.1-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__commons_fileupload_commons_fileupload_1_2_1.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: commons-fileupload:commons-fileupload:1.2.1">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__commons_io_commons_io_1_3_2.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: commons-io:commons-io:1.3.2">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/commons-io/commons-io/1.3.2/commons-io-1.3.2-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/commons-io/commons-io/1.3.2/commons-io-1.3.2-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__commons_lang_commons_lang_2_6.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: commons-lang:commons-lang:2.6">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/commons-lang/commons-lang/2.6/commons-lang-2.6-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__commons_logging_commons_logging_1_2.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: commons-logging:commons-logging:1.2">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.2/commons-logging-1.2.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.2/commons-logging-1.2-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.2/commons-logging-1.2-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__javax_servlet_javax_servlet_api_3_1_0.xml

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

+ 13 - 0
.idea/libraries/Maven__jstl_jstl_1_2.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: jstl:jstl:1.2">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/jstl/jstl/1.2/jstl-1.2.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/jstl/jstl/1.2/jstl-1.2-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/jstl/jstl/1.2/jstl-1.2-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__junit_junit_4_12.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: junit:junit:4.12">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__log4j_log4j_1_2_16.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: log4j:log4j:1.2.16">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/log4j/log4j/1.2.16/log4j-1.2.16.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/log4j/log4j/1.2.16/log4j-1.2.16-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/log4j/log4j/1.2.16/log4j-1.2.16-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__mysql_mysql_connector_java_8_0_15.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: mysql:mysql-connector-java:8.0.15">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/mysql/mysql-connector-java/8.0.15/mysql-connector-java-8.0.15.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/mysql/mysql-connector-java/8.0.15/mysql-connector-java-8.0.15-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/mysql/mysql-connector-java/8.0.15/mysql-connector-java-8.0.15-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_aspectj_aspectjweaver_1_8_4.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.aspectj:aspectjweaver:1.8.4">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/aspectj/aspectjweaver/1.8.4/aspectjweaver-1.8.4.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/aspectj/aspectjweaver/1.8.4/aspectjweaver-1.8.4-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/aspectj/aspectjweaver/1.8.4/aspectjweaver-1.8.4-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml

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

+ 13 - 0
.idea/libraries/Maven__org_mybatis_generator_mybatis_generator_core_1_3_5.xml

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

+ 13 - 0
.idea/libraries/Maven__org_mybatis_mybatis_3_1_1.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.mybatis:mybatis:3.1.1">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/mybatis/3.1.1/mybatis-3.1.1.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/mybatis/3.1.1/mybatis-3.1.1-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/mybatis/3.1.1/mybatis-3.1.1-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_mybatis_mybatis_spring_1_2_3.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.mybatis:mybatis-spring:1.2.3">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/mybatis-spring/1.2.3/mybatis-spring-1.2.3.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/mybatis-spring/1.2.3/mybatis-spring-1.2.3-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/mybatis/mybatis-spring/1.2.3/mybatis-spring-1.2.3-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_springframework_spring_aop_4_1_3_RELEASE.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.springframework:spring-aop:4.1.3.RELEASE">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/4.1.3.RELEASE/spring-aop-4.1.3.RELEASE.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/4.1.3.RELEASE/spring-aop-4.1.3.RELEASE-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/4.1.3.RELEASE/spring-aop-4.1.3.RELEASE-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_springframework_spring_aspects_4_1_3_RELEASE.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.springframework:spring-aspects:4.1.3.RELEASE">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aspects/4.1.3.RELEASE/spring-aspects-4.1.3.RELEASE.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aspects/4.1.3.RELEASE/spring-aspects-4.1.3.RELEASE-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aspects/4.1.3.RELEASE/spring-aspects-4.1.3.RELEASE-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_springframework_spring_beans_4_1_3_RELEASE.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.springframework:spring-beans:4.1.3.RELEASE">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-beans/4.1.3.RELEASE/spring-beans-4.1.3.RELEASE.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-beans/4.1.3.RELEASE/spring-beans-4.1.3.RELEASE-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-beans/4.1.3.RELEASE/spring-beans-4.1.3.RELEASE-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_springframework_spring_context_4_1_3_RELEASE.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.springframework:spring-context:4.1.3.RELEASE">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/4.1.3.RELEASE/spring-context-4.1.3.RELEASE.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/4.1.3.RELEASE/spring-context-4.1.3.RELEASE-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/4.1.3.RELEASE/spring-context-4.1.3.RELEASE-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_springframework_spring_core_4_1_3_RELEASE.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.springframework:spring-core:4.1.3.RELEASE">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-core/4.1.3.RELEASE/spring-core-4.1.3.RELEASE.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-core/4.1.3.RELEASE/spring-core-4.1.3.RELEASE-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-core/4.1.3.RELEASE/spring-core-4.1.3.RELEASE-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_springframework_spring_expression_4_1_3_RELEASE.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.springframework:spring-expression:4.1.3.RELEASE">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-expression/4.1.3.RELEASE/spring-expression-4.1.3.RELEASE.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-expression/4.1.3.RELEASE/spring-expression-4.1.3.RELEASE-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-expression/4.1.3.RELEASE/spring-expression-4.1.3.RELEASE-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_springframework_spring_jdbc_4_1_3_RELEASE.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.springframework:spring-jdbc:4.1.3.RELEASE">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jdbc/4.1.3.RELEASE/spring-jdbc-4.1.3.RELEASE.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jdbc/4.1.3.RELEASE/spring-jdbc-4.1.3.RELEASE-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jdbc/4.1.3.RELEASE/spring-jdbc-4.1.3.RELEASE-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_springframework_spring_test_4_1_3_RELEASE.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.springframework:spring-test:4.1.3.RELEASE">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-test/4.1.3.RELEASE/spring-test-4.1.3.RELEASE.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-test/4.1.3.RELEASE/spring-test-4.1.3.RELEASE-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-test/4.1.3.RELEASE/spring-test-4.1.3.RELEASE-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_springframework_spring_tx_4_1_3_RELEASE.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.springframework:spring-tx:4.1.3.RELEASE">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-tx/4.1.3.RELEASE/spring-tx-4.1.3.RELEASE.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-tx/4.1.3.RELEASE/spring-tx-4.1.3.RELEASE-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-tx/4.1.3.RELEASE/spring-tx-4.1.3.RELEASE-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_springframework_spring_web_4_1_3_RELEASE.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.springframework:spring-web:4.1.3.RELEASE">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-web/4.1.3.RELEASE/spring-web-4.1.3.RELEASE.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-web/4.1.3.RELEASE/spring-web-4.1.3.RELEASE-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-web/4.1.3.RELEASE/spring-web-4.1.3.RELEASE-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 13 - 0
.idea/libraries/Maven__org_springframework_spring_webmvc_4_1_3_RELEASE.xml

@@ -0,0 +1,13 @@
+<component name="libraryTable">
+  <library name="Maven: org.springframework:spring-webmvc:4.1.3.RELEASE">
+    <CLASSES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-webmvc/4.1.3.RELEASE/spring-webmvc-4.1.3.RELEASE.jar!/" />
+    </CLASSES>
+    <JAVADOC>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-webmvc/4.1.3.RELEASE/spring-webmvc-4.1.3.RELEASE-javadoc.jar!/" />
+    </JAVADOC>
+    <SOURCES>
+      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-webmvc/4.1.3.RELEASE/spring-webmvc-4.1.3.RELEASE-sources.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 16 - 0
.idea/misc.xml

@@ -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" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/classes" />
+  </component>
+</project>

+ 8 - 0
.idea/modules.xml

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

+ 6 - 0
.idea/vcs.xml

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

+ 225 - 0
pom.xml

@@ -0,0 +1,225 @@
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>com.how2java.tmall</groupId>
+  <artifactId>tmall_ssm</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <packaging>war</packaging>
+
+  <properties>
+    <spring.version>4.1.3.RELEASE</spring.version>
+    <pagehelper.version>5.1.2-beta</pagehelper.version>
+    <mysql.version>5.1.6</mysql.version>
+    <mybatis.spring.version>1.2.3</mybatis.spring.version>
+    <mybatis.version>3.1.1</mybatis.version>
+    <junit.version>4.12</junit.version>
+    <jstl.version>1.2</jstl.version>
+    <jsqlparser.version>1.0</jsqlparser.version>
+    <jackson.version>1.2.7</jackson.version>
+    <servlet-api.version>3.1.0</servlet-api.version>
+    <druid.version>1.0.18</druid.version>
+    <log4j.version>1.2.16</log4j.version>
+    <commons-logging.version>1.2</commons-logging.version>
+    <commons-fileupload.version>1.2.1</commons-fileupload.version>
+    <commons-io.version>1.3.2</commons-io.version>
+    <commons-lang.version>2.6</commons-lang.version>
+    <aopalliance.version>1.0</aopalliance.version>
+    <mybatis-generator.version>1.3.5</mybatis-generator.version>
+  </properties>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>${junit.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mybatis</groupId>
+      <artifactId>mybatis</artifactId>
+      <version>${mybatis.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mybatis</groupId>
+      <artifactId>mybatis-spring</artifactId>
+      <version>${mybatis.spring.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+      <version>8.0.15</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.alibaba</groupId>
+      <artifactId>druid</artifactId>
+      <version>${druid.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-test</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-webmvc</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-jdbc</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-aspects</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+    <!-- JSP相关 -->
+    <dependency>
+      <groupId>jstl</groupId>
+      <artifactId>jstl</artifactId>
+      <version>${jstl.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>javax.servlet-api</artifactId>
+      <version>${servlet-api.version}</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <!-- pageHelper -->
+    <dependency>
+      <groupId>com.github.pagehelper</groupId>
+      <artifactId>pagehelper</artifactId>
+      <version>${pagehelper.version}</version>
+    </dependency>
+
+    <!--jsqlparser-->
+    <dependency>
+      <groupId>com.github.jsqlparser</groupId>
+      <artifactId>jsqlparser</artifactId>
+      <version>${jsqlparser.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>${log4j.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>${commons-logging.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-fileupload</groupId>
+      <artifactId>commons-fileupload</artifactId>
+      <version>${commons-fileupload.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>${commons-io.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>${commons-lang.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>aopalliance</groupId>
+      <artifactId>aopalliance</artifactId>
+      <version>${aopalliance.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mybatis.generator</groupId>
+      <artifactId>mybatis-generator-core</artifactId>
+      <version>${mybatis-generator.version}</version>
+    </dependency>
+
+  </dependencies>
+
+  <build>
+    <finalName>${project.artifactId}</finalName>
+    <plugins>
+      <!-- 资源文件拷贝插件 -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>2.7</version>
+        <configuration>
+          <encoding>UTF-8</encoding>
+        </configuration>
+      </plugin>
+      <!-- java编译插件 -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.2</version>
+        <configuration>
+          <source>1.8</source>
+          <target>1.8</target>
+          <encoding>UTF-8</encoding>
+        </configuration>
+      </plugin>
+    </plugins>
+    <pluginManagement>
+      <plugins>
+        <!-- 配置Tomcat插件 -->
+        <plugin>
+          <groupId>org.apache.tomcat.maven</groupId>
+          <artifactId>tomcat7-maven-plugin</artifactId>
+          <version>2.2</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+        <includes>
+          <include>**/*.properties</include>
+          <include>**/*.xml</include>
+          <include>**/*.tld</include>
+        </includes>
+        <filtering>false</filtering>
+      </resource>
+      <resource>
+        <directory>src/main/java</directory>
+        <includes>
+          <include>**/*.properties</include>
+          <include>**/*.xml</include>
+        </includes>
+        <filtering>false</filtering>
+      </resource>
+    </resources>
+
+  </build>
+
+</project>

+ 86 - 0
src/main/java/com/how2java/tmall/controller/CategoryController.java

@@ -0,0 +1,86 @@
+package com.how2java.tmall.controller;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.how2java.tmall.pojo.Category;
+import com.how2java.tmall.service.CategoryService;
+import com.how2java.tmall.util.ImageUtil;
+import com.how2java.tmall.util.Page;
+import com.how2java.tmall.util.UploadedImageFile;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.imageio.ImageIO;
+import javax.servlet.http.HttpSession;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+ 
+@Controller
+@RequestMapping("")
+public class CategoryController {
+    @Autowired
+    CategoryService categoryService;
+  
+    @RequestMapping("admin_category_list")
+    public String list(Model model,Page page){
+        PageHelper.offsetPage(page.getStart(),page.getCount());
+        List<Category> cs= categoryService.list();
+        int total = (int) new PageInfo<>(cs).getTotal();
+        page.setTotal(total);
+        model.addAttribute("cs", cs);
+        model.addAttribute("page", page);
+        return "admin/listCategory";
+    }
+
+    @RequestMapping("admin_category_add")
+    public String add(Category c, HttpSession session, UploadedImageFile uploadedImageFile) throws IOException {
+        categoryService.add(c);
+        File  imageFolder= new File(session.getServletContext().getRealPath("img/category"));
+        File file = new File(imageFolder,c.getId()+".jpg");
+        if(!file.getParentFile().exists())
+            file.getParentFile().mkdirs();
+        uploadedImageFile.getImage().transferTo(file);
+        BufferedImage img = ImageUtil.change2jpg(file);
+        ImageIO.write(img, "jpg", file);
+        return "redirect:/admin_category_list";
+    }
+
+    @RequestMapping("admin_category_delete")
+    public String delete(int id,HttpSession session) throws IOException {
+        categoryService.delete(id);
+
+        File  imageFolder= new File(session.getServletContext().getRealPath("img/category"));
+        File file = new File(imageFolder,id+".jpg");
+        file.delete();
+
+        return "redirect:/admin_category_list";
+    }
+
+    @RequestMapping("admin_category_edit")
+    public String edit(int id,Model model) throws IOException {
+        Category c= categoryService.get(id);
+        model.addAttribute("c", c);
+        return "admin/editCategory";
+    }
+
+    @RequestMapping("admin_category_update")
+    public String update(Category c, HttpSession session, UploadedImageFile uploadedImageFile) throws IOException {
+        categoryService.update(c);
+        MultipartFile image = uploadedImageFile.getImage();
+        if(null!=image &&!image.isEmpty()){
+            File  imageFolder= new File(session.getServletContext().getRealPath("img/category"));
+            File file = new File(imageFolder,c.getId()+".jpg");
+            image.transferTo(file);
+            BufferedImage img = ImageUtil.change2jpg(file);
+            ImageIO.write(img, "jpg", file);
+        }
+        return "redirect:/admin_category_list";
+    }
+
+}
+

+ 368 - 0
src/main/java/com/how2java/tmall/controller/ForeController.java

@@ -0,0 +1,368 @@
+package com.how2java.tmall.controller;
+
+import com.github.pagehelper.PageHelper;
+import com.how2java.tmall.pojo.*;
+import com.how2java.tmall.service.*;
+import comparator.*;
+import org.apache.commons.lang.math.RandomUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.util.HtmlUtils;
+
+import javax.servlet.http.HttpSession;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+@Controller
+@RequestMapping("")
+public class ForeController {
+    @Autowired
+    CategoryService categoryService;
+    @Autowired
+    ProductService productService;
+    @Autowired
+    UserService userService;
+    @Autowired
+    ProductImageService productImageService;
+    @Autowired
+    PropertyValueService propertyValueService;
+    @Autowired
+    OrderService orderService;
+    @Autowired
+    OrderItemService orderItemService;
+    @Autowired
+    ReviewService reviewService;
+    @RequestMapping("forehome")
+    public String home(Model model) {
+        List<Category> cs= categoryService.list();
+        productService.fill(cs);
+        productService.fillByRow(cs);
+         model.addAttribute("cs", cs);
+        return "fore/home";
+    }
+
+    @RequestMapping("foreregister")
+    public String register(Model model,User user) {
+        String name =  user.getName();
+        name = HtmlUtils.htmlEscape(name);
+        user.setName(name);
+        boolean exist = userService.isExist(name);
+        
+        if(exist){
+            String m ="用户名已经被使用,不能使用";
+            model.addAttribute("msg", m);
+
+
+            return "fore/register";
+        }
+        userService.add(user);
+
+        return "redirect:registerSuccessPage";
+    }
+    @RequestMapping("forelogin")
+    public String login(@RequestParam("name") String name, @RequestParam("password") String password, Model model, HttpSession session) {
+        name = HtmlUtils.htmlEscape(name);
+        User user = userService.get(name,password);
+
+        if(null==user){
+            model.addAttribute("msg", "账号密码错误");
+            return "fore/login";
+        }
+        session.setAttribute("user", user);
+        return "redirect:forehome";
+    }
+    @RequestMapping("forelogout")
+    public String logout( HttpSession session) {
+        session.removeAttribute("user");
+        return "redirect:forehome";
+    }
+
+    @RequestMapping("foreproduct")
+    public String product( int pid, Model model) {
+        Product p = productService.get(pid);
+
+        List<ProductImage> productSingleImages = productImageService.list(p.getId(), ProductImageService.type_single);
+        List<ProductImage> productDetailImages = productImageService.list(p.getId(), ProductImageService.type_detail);
+        p.setProductSingleImages(productSingleImages);
+        p.setProductDetailImages(productDetailImages);
+
+        List<PropertyValue> pvs = propertyValueService.list(p.getId());
+        List<Review> reviews = reviewService.list(p.getId());
+        productService.setSaleAndReviewNumber(p);
+
+        model.addAttribute("reviews", reviews);
+        model.addAttribute("p", p);
+        model.addAttribute("pvs", pvs);
+        return "fore/product";
+    }
+
+    @RequestMapping("forecheckLogin")
+    @ResponseBody
+    public String checkLogin( HttpSession session) {
+        User user =(User)  session.getAttribute("user");
+        if(null!=user)
+            return "success";
+        return "fail";
+    }
+    @RequestMapping("foreloginAjax")
+    @ResponseBody
+    public String loginAjax(@RequestParam("name") String name, @RequestParam("password") String password,HttpSession session) {
+        name = HtmlUtils.htmlEscape(name);
+        User user = userService.get(name,password);
+
+        if(null==user){
+            return "fail";
+        }
+        session.setAttribute("user", user);
+        return "success";
+    }
+    @RequestMapping("forecategory")
+    public String category(int cid,String sort, Model model) {
+        Category c = categoryService.get(cid);
+        productService.fill(c);
+        productService.setSaleAndReviewNumber(c.getProducts());
+
+        if(null!=sort){
+            switch(sort){
+                case "review":
+                    Collections.sort(c.getProducts(),new ProductReviewComparator());
+                    break;
+                case "date" :
+                    Collections.sort(c.getProducts(),new ProductDateComparator());
+                    break;
+
+                case "saleCount" :
+                    Collections.sort(c.getProducts(),new ProductSaleCountComparator());
+                    break;
+
+                case "price":
+                    Collections.sort(c.getProducts(),new ProductPriceComparator());
+                    break;
+
+                case "all":
+                    Collections.sort(c.getProducts(),new ProductAllComparator());
+                    break;
+            }
+        }
+
+        model.addAttribute("c", c);
+        return "fore/category";
+    }
+
+    @RequestMapping("foresearch")
+    public String search( String keyword,Model model){
+
+        PageHelper.offsetPage(0,20);
+        List<Product> ps= productService.search(keyword);
+        productService.setSaleAndReviewNumber(ps);
+        model.addAttribute("ps",ps);
+        return "fore/searchResult";
+    }
+    @RequestMapping("forebuyone")
+    public String buyone(int pid, int num, HttpSession session) {
+        Product p = productService.get(pid);
+        int oiid = 0;
+
+        User user =(User)  session.getAttribute("user");
+        boolean found = false;
+        List<OrderItem> ois = orderItemService.listByUser(user.getId());
+        for (OrderItem oi : ois) {
+            if(oi.getProduct().getId().intValue()==p.getId().intValue()){
+                oi.setNumber(oi.getNumber()+num);
+                orderItemService.update(oi);
+                found = true;
+                oiid = oi.getId();
+                break;
+            }
+        }
+
+        if(!found){
+            OrderItem oi = new OrderItem();
+            oi.setUid(user.getId());
+            oi.setNumber(num);
+            oi.setPid(pid);
+            orderItemService.add(oi);
+            oiid = oi.getId();
+        }
+        return "redirect:forebuy?oiid="+oiid;
+    }
+
+    @RequestMapping("forebuy")
+    public String buy( Model model,String[] oiid,HttpSession session){
+        List<OrderItem> ois = new ArrayList<>();
+        float total = 0;
+
+        for (String strid : oiid) {
+            int id = Integer.parseInt(strid);
+            OrderItem oi= orderItemService.get(id);
+            total +=oi.getProduct().getPromotePrice()*oi.getNumber();
+            ois.add(oi);
+        }
+
+        session.setAttribute("ois", ois);
+        model.addAttribute("total", total);
+        return "fore/buy";
+    }
+    @RequestMapping("foreaddCart")
+    @ResponseBody
+    public String addCart(int pid, int num, Model model,HttpSession session) {
+        Product p = productService.get(pid);
+        User user =(User)  session.getAttribute("user");
+        boolean found = false;
+
+        List<OrderItem> ois = orderItemService.listByUser(user.getId());
+        for (OrderItem oi : ois) {
+            if(oi.getProduct().getId().intValue()==p.getId().intValue()){
+                oi.setNumber(oi.getNumber()+num);
+                orderItemService.update(oi);
+                found = true;
+                break;
+            }
+        }
+
+
+        if(!found){
+            OrderItem oi = new OrderItem();
+            oi.setUid(user.getId());
+            oi.setNumber(num);
+            oi.setPid(pid);
+            orderItemService.add(oi);
+        }
+        return "success";
+    }
+    @RequestMapping("forecart")
+    public String cart( Model model,HttpSession session) {
+        User user =(User)  session.getAttribute("user");
+        List<OrderItem> ois = orderItemService.listByUser(user.getId());
+        model.addAttribute("ois", ois);
+        return "fore/cart";
+    }
+
+    @RequestMapping("forechangeOrderItem")
+    @ResponseBody
+    public String changeOrderItem( Model model,HttpSession session, int pid, int number) {
+        User user =(User)  session.getAttribute("user");
+        if(null==user)
+            return "fail";
+
+        List<OrderItem> ois = orderItemService.listByUser(user.getId());
+        for (OrderItem oi : ois) {
+            if(oi.getProduct().getId().intValue()==pid){
+                oi.setNumber(number);
+                orderItemService.update(oi);
+                break;
+            }
+
+        }
+        return "success";
+    }
+    @RequestMapping("foredeleteOrderItem")
+    @ResponseBody
+    public String deleteOrderItem( Model model,HttpSession session,int oiid){
+        User user =(User)  session.getAttribute("user");
+        if(null==user)
+            return "fail";
+        orderItemService.delete(oiid);
+        return "success";
+    }
+
+    @RequestMapping("forecreateOrder")
+    public String createOrder( Model model,Order order,HttpSession session){
+        User user =(User)  session.getAttribute("user");
+        String orderCode = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + RandomUtils.nextInt(10000);
+        order.setOrderCode(orderCode);
+        order.setCreateDate(new Date());
+        order.setUid(user.getId());
+        order.setStatus(OrderService.waitPay);
+        List<OrderItem> ois= (List<OrderItem>)  session.getAttribute("ois");
+
+        float total =orderService.add(order,ois);
+        return "redirect:forealipay?oid="+order.getId() +"&total="+total;
+    }
+
+
+    @RequestMapping("forepayed")
+    public String payed(int oid, float total, Model model) {
+        Order order = orderService.get(oid);
+        order.setStatus(OrderService.waitDelivery);
+        order.setPayDate(new Date());
+        orderService.update(order);
+        model.addAttribute("o", order);
+        return "fore/payed";
+    }
+
+    @RequestMapping("forebought")
+    public String bought( Model model,HttpSession session) {
+        User user =(User)  session.getAttribute("user");
+        List<Order> os= orderService.list(user.getId(),OrderService.delete);
+
+        orderItemService.fill(os);
+
+        model.addAttribute("os", os);
+
+        return "fore/bought";
+    }
+
+    @RequestMapping("foreconfirmPay")
+    public String confirmPay( Model model,int oid) {
+        Order o = orderService.get(oid);
+        orderItemService.fill(o);
+        model.addAttribute("o", o);
+        return "fore/confirmPay";
+    }
+    @RequestMapping("foreorderConfirmed")
+    public String orderConfirmed( Model model,int oid) {
+        Order o = orderService.get(oid);
+        o.setStatus(OrderService.waitReview);
+        o.setConfirmDate(new Date());
+        orderService.update(o);
+        return "fore/orderConfirmed";
+    }
+    @RequestMapping("foredeleteOrder")
+    @ResponseBody
+    public String deleteOrder( Model model,int oid){
+        Order o = orderService.get(oid);
+        o.setStatus(OrderService.delete);
+        orderService.update(o);
+        return "success";
+    }
+    @RequestMapping("forereview")
+    public String review( Model model,int oid) {
+        Order o = orderService.get(oid);
+        orderItemService.fill(o);
+        Product p = o.getOrderItems().get(0).getProduct();
+        List<Review> reviews = reviewService.list(p.getId());
+        productService.setSaleAndReviewNumber(p);
+        model.addAttribute("p", p);
+        model.addAttribute("o", o);
+        model.addAttribute("reviews", reviews);
+        return "fore/review";
+    }
+    @RequestMapping("foredoreview")
+    public String doreview( Model model,HttpSession session,@RequestParam("oid") int oid,@RequestParam("pid") int pid,String content) {
+        Order o = orderService.get(oid);
+        o.setStatus(OrderService.finish);
+        orderService.update(o);
+
+        Product p = productService.get(pid);
+        content = HtmlUtils.htmlEscape(content);
+
+        User user =(User)  session.getAttribute("user");
+        Review review = new Review();
+        review.setContent(content);
+        review.setPid(pid);
+        review.setCreateDate(new Date());
+        review.setUid(user.getId());
+        reviewService.add(review);
+
+        return "redirect:forereview?oid="+oid+"&showonly=true";
+    }
+
+}

+ 53 - 0
src/main/java/com/how2java/tmall/controller/OrderController.java

@@ -0,0 +1,53 @@
+package com.how2java.tmall.controller;
+
+import java.io.IOException;
+import java.util.Date;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.how2java.tmall.pojo.Order;
+import com.how2java.tmall.service.OrderItemService;
+import com.how2java.tmall.service.OrderService;
+import com.how2java.tmall.util.Page;
+
+
+@Controller
+@RequestMapping("")
+public class OrderController {
+    @Autowired
+    OrderService orderService;
+    @Autowired
+    OrderItemService orderItemService;
+
+    @RequestMapping("admin_order_list")
+    public String list(Model model, Page page){
+        PageHelper.offsetPage(page.getStart(),page.getCount());
+
+        List<Order> os= orderService.list();
+
+        int total = (int) new PageInfo<>(os).getTotal();
+        page.setTotal(total);
+
+        orderItemService.fill(os);
+
+        model.addAttribute("os", os);
+        model.addAttribute("page", page);
+
+        return "admin/listOrder";
+    }
+
+    @RequestMapping("admin_order_delivery")
+    public String delivery(Order o) throws IOException {
+        o.setDeliveryDate(new Date());
+        o.setStatus(OrderService.waitConfirm);
+        orderService.update(o);
+        return "redirect:admin_order_list";
+    }
+}
+

+ 27 - 0
src/main/java/com/how2java/tmall/controller/PageController.java

@@ -0,0 +1,27 @@
+package com.how2java.tmall.controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+@RequestMapping("")
+public class PageController {
+    @RequestMapping("registerPage")
+    public String registerPage() {
+        return "fore/register";
+    }
+    @RequestMapping("registerSuccessPage")
+    public String registerSuccessPage() {
+        return "fore/registerSuccess";
+    }
+    @RequestMapping("loginPage")
+    public String loginPage() {
+        return "fore/login";
+    }
+    @RequestMapping("forealipay")
+    public String alipay(){
+        return "fore/alipay";
+    }
+}
+
+

+ 74 - 0
src/main/java/com/how2java/tmall/controller/ProductController.java

@@ -0,0 +1,74 @@
+package com.how2java.tmall.controller;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.how2java.tmall.pojo.Category;
+import com.how2java.tmall.pojo.Product;
+import com.how2java.tmall.service.CategoryService;
+import com.how2java.tmall.service.ProductService;
+import com.how2java.tmall.util.Page;
+
+@Controller
+@RequestMapping("")
+public class ProductController {
+    @Autowired
+    CategoryService categoryService;
+    @Autowired
+    ProductService productService;
+
+    @RequestMapping("admin_product_add")
+    public String add(Model model, Product p) {
+        productService.add(p);
+        return "redirect:admin_product_list?cid="+p.getCid();
+    }
+
+    @RequestMapping("admin_product_delete")
+    public String delete(int id) {
+        Product p = productService.get(id);
+        productService.delete(id);
+        return "redirect:admin_product_list?cid="+p.getCid();
+    }
+
+    @RequestMapping("admin_product_edit")
+    public String edit(Model model, int id) {
+        Product p = productService.get(id);
+        Category c = categoryService.get(p.getCid());
+        p.setCategory(c);
+        model.addAttribute("p", p);
+        return "admin/editProduct";
+    }
+
+    @RequestMapping("admin_product_update")
+    public String update(Product p) {
+        productService.update(p);
+        return "redirect:admin_product_list?cid="+p.getCid();
+    }
+
+    @RequestMapping("admin_product_list")
+    public String list(int cid, Model model, Page page) {
+        Category c = categoryService.get(cid);
+
+        PageHelper.offsetPage(page.getStart(),page.getCount());
+        List<Product> ps = productService.list(cid);
+
+        int total = (int) new PageInfo<>(ps).getTotal();
+        page.setTotal(total);
+        page.setParam("&cid="+c.getId());
+
+        model.addAttribute("ps", ps);
+        model.addAttribute("c", c);
+        model.addAttribute("page", page);
+
+        return "admin/listProduct";
+    }
+}
+

+ 119 - 0
src/main/java/com/how2java/tmall/controller/ProductImageController.java

@@ -0,0 +1,119 @@
+package com.how2java.tmall.controller;
+
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.util.List;
+
+import javax.imageio.ImageIO;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.how2java.tmall.pojo.Product;
+import com.how2java.tmall.pojo.ProductImage;
+import com.how2java.tmall.service.ProductImageService;
+import com.how2java.tmall.service.ProductService;
+import com.how2java.tmall.util.ImageUtil;
+import com.how2java.tmall.util.Page;
+import com.how2java.tmall.util.UploadedImageFile;
+
+
+@Controller
+@RequestMapping("")
+public class ProductImageController {
+    @Autowired
+    ProductService productService;
+
+    @Autowired
+    ProductImageService productImageService;
+
+
+    @RequestMapping("admin_productImage_add")
+    public String add(ProductImage  pi, HttpSession session, UploadedImageFile uploadedImageFile) {
+        productImageService.add(pi);
+        String fileName = pi.getId()+ ".jpg";
+        String imageFolder;
+        String imageFolder_small=null;
+        String imageFolder_middle=null;
+        if(ProductImageService.type_single.equals(pi.getType())){
+            imageFolder= session.getServletContext().getRealPath("img/productSingle");
+            imageFolder_small= session.getServletContext().getRealPath("img/productSingle_small");
+            imageFolder_middle= session.getServletContext().getRealPath("img/productSingle_middle");
+        }
+        else{
+            imageFolder= session.getServletContext().getRealPath("img/productDetail");
+        }
+
+        File f = new File(imageFolder, fileName);
+        f.getParentFile().mkdirs();
+        try {
+            uploadedImageFile.getImage().transferTo(f);
+            BufferedImage img = ImageUtil.change2jpg(f);
+            ImageIO.write(img, "jpg", f);
+
+            if(ProductImageService.type_single.equals(pi.getType())) {
+                File f_small = new File(imageFolder_small, fileName);
+                File f_middle = new File(imageFolder_middle, fileName);
+
+                ImageUtil.resizeImage(f, 56, 56, f_small);
+                ImageUtil.resizeImage(f, 217, 190, f_middle);
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return "redirect:admin_productImage_list?pid="+pi.getPid();
+    }
+
+    @RequestMapping("admin_productImage_delete")
+    public String delete(int id,HttpSession session) {
+        ProductImage pi = productImageService.get(id);
+
+        String fileName = pi.getId()+ ".jpg";
+        String imageFolder;
+        String imageFolder_small=null;
+        String imageFolder_middle=null;
+
+        if(ProductImageService.type_single.equals(pi.getType())){
+            imageFolder= session.getServletContext().getRealPath("img/productSingle");
+            imageFolder_small= session.getServletContext().getRealPath("img/productSingle_small");
+            imageFolder_middle= session.getServletContext().getRealPath("img/productSingle_middle");
+            File imageFile = new File(imageFolder,fileName);
+            File f_small = new File(imageFolder_small,fileName);
+            File f_middle = new File(imageFolder_middle,fileName);
+            imageFile.delete();
+            f_small.delete();
+            f_middle.delete();
+
+        }
+        else{
+            imageFolder= session.getServletContext().getRealPath("img/productDetail");
+            File imageFile = new File(imageFolder,fileName);
+            imageFile.delete();
+        }
+
+
+        productImageService.delete(id);
+
+
+        return "redirect:admin_productImage_list?pid="+pi.getPid();
+    }
+
+    @RequestMapping("admin_productImage_list")
+    public String list(int pid, Model model) {
+        Product p =productService.get(pid);
+        List<ProductImage> pisSingle = productImageService.list(pid, ProductImageService.type_single);
+        List<ProductImage> pisDetail = productImageService.list(pid, ProductImageService.type_detail);
+
+
+        model.addAttribute("p", p);
+        model.addAttribute("pisSingle", pisSingle);
+        model.addAttribute("pisDetail", pisDetail);
+
+        return "admin/listProductImage";
+    }
+}

+ 72 - 0
src/main/java/com/how2java/tmall/controller/PropertyController.java

@@ -0,0 +1,72 @@
+package com.how2java.tmall.controller;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.how2java.tmall.pojo.Category;
+import com.how2java.tmall.pojo.Property;
+import com.how2java.tmall.service.CategoryService;
+import com.how2java.tmall.service.PropertyService;
+import com.how2java.tmall.util.Page;
+
+@Controller
+@RequestMapping("")
+public class PropertyController {
+    @Autowired
+    CategoryService categoryService;
+    @Autowired
+    PropertyService propertyService;
+
+    @RequestMapping("admin_property_add")
+    public String add(Model model, Property p) {
+        propertyService.add(p);
+        return "redirect:admin_property_list?cid="+p.getCid();
+    }
+
+    @RequestMapping("admin_property_delete")
+    public String delete(int id) {
+        Property p = propertyService.get(id);
+        propertyService.delete(id);
+        return "redirect:admin_property_list?cid="+p.getCid();
+    }
+
+    @RequestMapping("admin_property_edit")
+    public String edit(Model model, int id) {
+        Property p = propertyService.get(id);
+        Category c = categoryService.get(p.getCid());
+        p.setCategory(c);
+        model.addAttribute("p", p);
+        return "admin/editProperty";
+    }
+
+    @RequestMapping("admin_property_update")
+    public String update(Property p) {
+        propertyService.update(p);
+        return "redirect:admin_property_list?cid="+p.getCid();
+    }
+
+    @RequestMapping("admin_property_list")
+    public String list(int cid, Model model,  Page page) {
+        Category c = categoryService.get(cid);
+
+        PageHelper.offsetPage(page.getStart(),page.getCount());
+        List<Property> ps = propertyService.list(cid);
+
+        int total = (int) new PageInfo<>(ps).getTotal();
+        page.setTotal(total);
+        page.setParam("&cid="+c.getId());
+
+        model.addAttribute("ps", ps);
+        model.addAttribute("c", c);
+        model.addAttribute("page", page);
+
+        return "admin/listProperty";
+    }
+}
+

+ 40 - 0
src/main/java/com/how2java/tmall/controller/PropertyValueController.java

@@ -0,0 +1,40 @@
+package com.how2java.tmall.controller;
+
+import com.how2java.tmall.pojo.Product;
+import com.how2java.tmall.pojo.PropertyValue;
+import com.how2java.tmall.service.ProductService;
+import com.how2java.tmall.service.PropertyValueService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.List;
+
+@Controller
+@RequestMapping("")
+public class PropertyValueController {
+    @Autowired
+    PropertyValueService propertyValueService;
+    @Autowired
+    ProductService productService;
+
+    @RequestMapping("admin_propertyValue_edit")
+    public String edit(Model model,int pid) {
+        Product p = productService.get(pid);
+        propertyValueService.init(p);
+        List<PropertyValue> pvs = propertyValueService.list(p.getId());
+
+        model.addAttribute("p", p);
+        model.addAttribute("pvs", pvs);
+        return "admin/editPropertyValue";
+    }
+    @RequestMapping("admin_propertyValue_update")
+    @ResponseBody
+    public String update(PropertyValue pv) {
+        propertyValueService.update(pv);
+        return "success";
+    }
+}
+

+ 40 - 0
src/main/java/com/how2java/tmall/controller/UserController.java

@@ -0,0 +1,40 @@
+package com.how2java.tmall.controller;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.how2java.tmall.pojo.User;
+import com.how2java.tmall.service.UserService;
+import com.how2java.tmall.util.Page;
+
+
+@Controller
+@RequestMapping("")
+public class UserController {
+    @Autowired
+    UserService userService;
+ 
+    @RequestMapping("admin_user_list")
+    public String list(Model model, Page page){
+        PageHelper.offsetPage(page.getStart(),page.getCount());
+
+        List<User> us= userService.list();
+
+        int total = (int) new PageInfo<>(us).getTotal();
+        page.setTotal(total);
+
+        model.addAttribute("us", us);
+        model.addAttribute("page", page);
+
+        return "admin/listUser";
+    }
+
+
+
+}

+ 93 - 0
src/main/java/com/how2java/tmall/interceptor/LoginInterceptor.java

@@ -0,0 +1,93 @@
+package com.how2java.tmall.interceptor;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+import com.how2java.tmall.pojo.Category;
+import com.how2java.tmall.pojo.OrderItem;
+import com.how2java.tmall.pojo.User;
+import com.how2java.tmall.service.CategoryService;
+import com.how2java.tmall.service.OrderItemService;
+ 
+public class LoginInterceptor extends HandlerInterceptorAdapter {
+    @Autowired
+    CategoryService categoryService;
+    @Autowired
+    OrderItemService orderItemService;
+     /**
+     * 在业务处理器处理请求之前被调用
+     * 如果返回false
+     *     从当前的拦截器往回执行所有拦截器的afterCompletion(),再退出拦截器链
+     * 如果返回true
+     *    执行下一个拦截器,直到所有的拦截器都执行完毕
+     *    再执行被拦截的Controller
+     *    然后进入拦截器链,
+     *    从最后一个拦截器往回执行所有的postHandle()
+     *    接着再从最后一个拦截器往回执行所有的afterCompletion()
+     */
+    public boolean preHandle(HttpServletRequest request,
+                             HttpServletResponse response, Object handler) throws Exception {
+
+        HttpSession session = request.getSession();
+        String contextPath=session.getServletContext().getContextPath();
+        String[] noNeedAuthPage = new String[]{
+                "home",
+                "checkLogin",
+                "register",
+                "loginAjax",
+                "login",
+                "product",
+                "category",
+                "search"};
+
+        String uri = request.getRequestURI();
+        uri = StringUtils.remove(uri, contextPath);
+//        System.out.println(uri);
+        if(uri.startsWith("/fore")){
+            String method = StringUtils.substringAfterLast(uri,"/fore" );
+            if(!Arrays.asList(noNeedAuthPage).contains(method)){
+                User user =(User) session.getAttribute("user");
+                if(null==user){
+                    response.sendRedirect("loginPage");
+                    return false;
+                }
+            }
+        }
+
+        return true;
+
+    }
+ 
+    /**
+     * 在业务处理器处理请求执行完成后,生成视图之前执行的动作
+     * 可在modelAndView中加入数据,比如当前时间
+     */
+
+    public void postHandle(HttpServletRequest request,
+            HttpServletResponse response, Object handler,    
+            ModelAndView modelAndView) throws Exception {
+
+
+    }
+ 
+    /**  
+     * 在DispatcherServlet完全处理完请求后被调用,可用于清理资源等   
+     *   
+     * 当有拦截器抛出异常时,会从当前拦截器往回执行所有的拦截器的afterCompletion()  
+     */
+     
+    public void afterCompletion(HttpServletRequest request,    
+            HttpServletResponse response, Object handler, Exception ex)  
+    throws Exception {  
+           
+    }  
+       
+} 

+ 87 - 0
src/main/java/com/how2java/tmall/interceptor/OtherInterceptor.java

@@ -0,0 +1,87 @@
+package com.how2java.tmall.interceptor;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+import com.how2java.tmall.pojo.Category;
+import com.how2java.tmall.pojo.OrderItem;
+import com.how2java.tmall.pojo.User;
+import com.how2java.tmall.service.CategoryService;
+import com.how2java.tmall.service.OrderItemService;
+ 
+public class OtherInterceptor extends HandlerInterceptorAdapter {
+    @Autowired
+    CategoryService categoryService;
+    @Autowired
+    OrderItemService orderItemService;
+     /**
+     * 在业务处理器处理请求之前被调用
+     * 如果返回false
+     *     从当前的拦截器往回执行所有拦截器的afterCompletion(),再退出拦截器链
+     * 如果返回true
+     *    执行下一个拦截器,直到所有的拦截器都执行完毕
+     *    再执行被拦截的Controller
+     *    然后进入拦截器链,
+     *    从最后一个拦截器往回执行所有的postHandle()
+     *    接着再从最后一个拦截器往回执行所有的afterCompletion()
+     */
+    public boolean preHandle(HttpServletRequest request,
+                             HttpServletResponse response, Object handler) throws Exception {
+    	return true;
+
+    }
+ 
+    /**
+     * 在业务处理器处理请求执行完成后,生成视图之前执行的动作
+     * 可在modelAndView中加入数据,比如当前时间
+     */
+
+    public void postHandle(HttpServletRequest request,
+            HttpServletResponse response, Object handler,    
+            ModelAndView modelAndView) throws Exception {
+    	/*这里是获取分类集合信息,用于放在搜索栏下面*/
+        List<Category> cs = categoryService.list();
+        request.getSession().setAttribute("cs", cs);
+
+        /*这里是获取当前的contextPath:tmall_ssm,用与放在左上角那个变形金刚,点击之后才能够跳转到首页,否则点击之后也仅仅停留在当前页面*/
+        HttpSession session = request.getSession();
+        String contextPath=session.getServletContext().getContextPath();
+        request.getSession().setAttribute("contextPath", contextPath);
+
+        /*这里是获取购物车中一共有多少数量*/
+        User user =(User)  session.getAttribute("user");
+        int  cartTotalItemNumber = 0;
+        if(null!=user) {
+            List<OrderItem> ois = orderItemService.listByUser(user.getId());
+            for (OrderItem oi : ois) {
+            	cartTotalItemNumber+=oi.getNumber();
+            }
+       	
+        }
+        request.getSession().setAttribute("cartTotalItemNumber", cartTotalItemNumber);
+
+    }
+ 
+    /**  
+     * 在DispatcherServlet完全处理完请求后被调用,可用于清理资源等   
+     *   
+     * 当有拦截器抛出异常时,会从当前拦截器往回执行所有的拦截器的afterCompletion()  
+     */
+     
+    public void afterCompletion(HttpServletRequest request,    
+            HttpServletResponse response, Object handler, Exception ex)  
+    throws Exception {  
+           
+//        System.out.println("afterCompletion(), 在访问视图之后被调用");
+    }  
+       
+} 
+

+ 22 - 0
src/main/java/com/how2java/tmall/mapper/CategoryMapper.java

@@ -0,0 +1,22 @@
+package com.how2java.tmall.mapper;
+
+import com.how2java.tmall.pojo.Category;
+import com.how2java.tmall.pojo.CategoryExample;
+import java.util.List;
+
+public interface CategoryMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(Category record);
+
+    int insertSelective(Category record);
+
+    List<Category> selectByExample(CategoryExample example);
+
+    Category selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(Category record);
+
+    int updateByPrimaryKey(Category record);
+}
+

+ 22 - 0
src/main/java/com/how2java/tmall/mapper/OrderItemMapper.java

@@ -0,0 +1,22 @@
+package com.how2java.tmall.mapper;
+
+import com.how2java.tmall.pojo.OrderItem;
+import com.how2java.tmall.pojo.OrderItemExample;
+import java.util.List;
+
+public interface OrderItemMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(OrderItem record);
+
+    int insertSelective(OrderItem record);
+
+    List<OrderItem> selectByExample(OrderItemExample example);
+
+    OrderItem selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(OrderItem record);
+
+    int updateByPrimaryKey(OrderItem record);
+}
+

+ 21 - 0
src/main/java/com/how2java/tmall/mapper/OrderMapper.java

@@ -0,0 +1,21 @@
+package com.how2java.tmall.mapper;
+
+import com.how2java.tmall.pojo.Order;
+import com.how2java.tmall.pojo.OrderExample;
+import java.util.List;
+
+public interface OrderMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(Order record);
+
+    int insertSelective(Order record);
+
+    List<Order> selectByExample(OrderExample example);
+
+    Order selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(Order record);
+
+    int updateByPrimaryKey(Order record);
+}

+ 22 - 0
src/main/java/com/how2java/tmall/mapper/ProductImageMapper.java

@@ -0,0 +1,22 @@
+package com.how2java.tmall.mapper;
+
+import com.how2java.tmall.pojo.ProductImage;
+import com.how2java.tmall.pojo.ProductImageExample;
+import java.util.List;
+
+public interface ProductImageMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(ProductImage record);
+
+    int insertSelective(ProductImage record);
+
+    List<ProductImage> selectByExample(ProductImageExample example);
+
+    ProductImage selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(ProductImage record);
+
+    int updateByPrimaryKey(ProductImage record);
+}
+

+ 22 - 0
src/main/java/com/how2java/tmall/mapper/ProductMapper.java

@@ -0,0 +1,22 @@
+package com.how2java.tmall.mapper;
+
+import com.how2java.tmall.pojo.Product;
+import com.how2java.tmall.pojo.ProductExample;
+import java.util.List;
+
+public interface ProductMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(Product record);
+
+    int insertSelective(Product record);
+
+    List<Product> selectByExample(ProductExample example);
+
+    Product selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(Product record);
+
+    int updateByPrimaryKey(Product record);
+}
+

+ 22 - 0
src/main/java/com/how2java/tmall/mapper/PropertyMapper.java

@@ -0,0 +1,22 @@
+package com.how2java.tmall.mapper;
+
+import com.how2java.tmall.pojo.Property;
+import com.how2java.tmall.pojo.PropertyExample;
+import java.util.List;
+
+public interface PropertyMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(Property record);
+
+    int insertSelective(Property record);
+
+    List<Property> selectByExample(PropertyExample example);
+
+    Property selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(Property record);
+
+    int updateByPrimaryKey(Property record);
+}
+

+ 21 - 0
src/main/java/com/how2java/tmall/mapper/PropertyValueMapper.java

@@ -0,0 +1,21 @@
+package com.how2java.tmall.mapper;
+
+import com.how2java.tmall.pojo.PropertyValue;
+import com.how2java.tmall.pojo.PropertyValueExample;
+import java.util.List;
+
+public interface PropertyValueMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(PropertyValue record);
+
+    int insertSelective(PropertyValue record);
+
+    List<PropertyValue> selectByExample(PropertyValueExample example);
+
+    PropertyValue selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(PropertyValue record);
+
+    int updateByPrimaryKey(PropertyValue record);
+}

+ 21 - 0
src/main/java/com/how2java/tmall/mapper/ReviewMapper.java

@@ -0,0 +1,21 @@
+package com.how2java.tmall.mapper;
+
+import com.how2java.tmall.pojo.Review;
+import com.how2java.tmall.pojo.ReviewExample;
+import java.util.List;
+
+public interface ReviewMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(Review record);
+
+    int insertSelective(Review record);
+
+    List<Review> selectByExample(ReviewExample example);
+
+    Review selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(Review record);
+
+    int updateByPrimaryKey(Review record);
+}

+ 21 - 0
src/main/java/com/how2java/tmall/mapper/UserMapper.java

@@ -0,0 +1,21 @@
+package com.how2java.tmall.mapper;
+
+import com.how2java.tmall.pojo.User;
+import com.how2java.tmall.pojo.UserExample;
+import java.util.List;
+
+public interface UserMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(User record);
+
+    int insertSelective(User record);
+
+    List<User> selectByExample(UserExample example);
+
+    User selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(User record);
+
+    int updateByPrimaryKey(User record);
+}

+ 47 - 0
src/main/java/com/how2java/tmall/pojo/Category.java

@@ -0,0 +1,47 @@
+package com.how2java.tmall.pojo;
+
+import java.util.List;
+
+public class Category {
+    private Integer id;
+
+    private String name;
+
+    /*如下是非数据库字段*/
+    private List<Product> products;
+
+    private List<List<Product>> productsByRow;
+
+    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 List<Product> getProducts() {
+        return products;
+    }
+
+    public void setProducts(List<Product> products) {
+        this.products = products;
+    }
+
+    public List<List<Product>> getProductsByRow() {
+        return productsByRow;
+    }
+
+    public void setProductsByRow(List<List<Product>> productsByRow) {
+        this.productsByRow = productsByRow;
+    }
+}
+

+ 330 - 0
src/main/java/com/how2java/tmall/pojo/CategoryExample.java

@@ -0,0 +1,330 @@
+package com.how2java.tmall.pojo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class CategoryExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public CategoryExample() {
+        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 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);
+        }
+    }
+}

+ 215 - 0
src/main/java/com/how2java/tmall/pojo/Order.java

@@ -0,0 +1,215 @@
+package com.how2java.tmall.pojo;
+
+import com.how2java.tmall.service.OrderService;
+
+import java.util.Date;
+import java.util.List;
+
+
+public class Order {
+    private Integer id;
+
+    private String orderCode;
+
+    private String address;
+
+    private String post;
+
+    private String receiver;
+
+    private String mobile;
+
+    private String userMessage;
+
+    private Date createDate;
+
+    private Date payDate;
+
+    private Date deliveryDate;
+
+    private Date confirmDate;
+
+    private Integer uid;
+
+    private String status;
+
+
+    /*如下是非数据库字段*/
+    private List<OrderItem> orderItems;
+
+    private User user;
+
+    private float total;
+
+    private int totalNumber;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getOrderCode() {
+        return orderCode;
+    }
+
+    public void setOrderCode(String orderCode) {
+        this.orderCode = orderCode == null ? null : orderCode.trim();
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address == null ? null : address.trim();
+    }
+
+    public String getPost() {
+        return post;
+    }
+
+    public void setPost(String post) {
+        this.post = post == null ? null : post.trim();
+    }
+
+    public String getReceiver() {
+        return receiver;
+    }
+
+    public void setReceiver(String receiver) {
+        this.receiver = receiver == null ? null : receiver.trim();
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile == null ? null : mobile.trim();
+    }
+
+    public String getUserMessage() {
+        return userMessage;
+    }
+
+    public void setUserMessage(String userMessage) {
+        this.userMessage = userMessage == null ? null : userMessage.trim();
+    }
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    public Date getPayDate() {
+        return payDate;
+    }
+
+    public void setPayDate(Date payDate) {
+        this.payDate = payDate;
+    }
+
+    public Date getDeliveryDate() {
+        return deliveryDate;
+    }
+
+    public void setDeliveryDate(Date deliveryDate) {
+        this.deliveryDate = deliveryDate;
+    }
+
+    public Date getConfirmDate() {
+        return confirmDate;
+    }
+
+    public void setConfirmDate(Date confirmDate) {
+        this.confirmDate = confirmDate;
+    }
+
+    public Integer getUid() {
+        return uid;
+    }
+
+    public void setUid(Integer uid) {
+        this.uid = uid;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status == null ? null : status.trim();
+    }
+
+    public List<OrderItem> getOrderItems() {
+        return orderItems;
+    }
+
+    public void setOrderItems(List<OrderItem> orderItems) {
+        this.orderItems = orderItems;
+    }
+    
+    
+    public static void main(String args[]){
+        Order o  = new Order();
+        o.setStatus(OrderService.delete);
+        System.out.println(o.getStatusDesc());
+    }
+    public String getStatusDesc(){
+        String desc ="未知";
+        switch(status){
+            case OrderService.waitPay:
+                desc="待付款";
+                break;
+            case OrderService.waitDelivery:
+                desc="待发货";
+                break;
+            case OrderService.waitConfirm:
+                desc="待收货";
+                break;
+            case OrderService.waitReview:
+                desc="等评价";
+                break;
+            case OrderService.finish:
+                desc="完成";
+                break;
+            case OrderService.delete:
+                desc="刪除";
+                break;
+            default:
+                desc="未知";
+        }
+        return desc;
+    }
+
+
+    public float getTotal() {
+        return total;
+    }
+
+    public void setTotal(float total) {
+        this.total = total;
+    }
+
+    public int getTotalNumber() {
+        return totalNumber;
+    }
+
+    public void setTotalNumber(int totalNumber) {
+        this.totalNumber = totalNumber;
+    }
+
+    public User getUser() {
+        return user;
+    }
+
+    public void setUser(User user) {
+        this.user = user;
+    }
+}

+ 1051 - 0
src/main/java/com/how2java/tmall/pojo/OrderExample.java

@@ -0,0 +1,1051 @@
+package com.how2java.tmall.pojo;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class OrderExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public OrderExample() {
+        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 andOrderCodeIsNull() {
+            addCriterion("orderCode is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderCodeIsNotNull() {
+            addCriterion("orderCode is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderCodeEqualTo(String value) {
+            addCriterion("orderCode =", value, "orderCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderCodeNotEqualTo(String value) {
+            addCriterion("orderCode <>", value, "orderCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderCodeGreaterThan(String value) {
+            addCriterion("orderCode >", value, "orderCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderCodeGreaterThanOrEqualTo(String value) {
+            addCriterion("orderCode >=", value, "orderCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderCodeLessThan(String value) {
+            addCriterion("orderCode <", value, "orderCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderCodeLessThanOrEqualTo(String value) {
+            addCriterion("orderCode <=", value, "orderCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderCodeLike(String value) {
+            addCriterion("orderCode like", value, "orderCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderCodeNotLike(String value) {
+            addCriterion("orderCode not like", value, "orderCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderCodeIn(List<String> values) {
+            addCriterion("orderCode in", values, "orderCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderCodeNotIn(List<String> values) {
+            addCriterion("orderCode not in", values, "orderCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderCodeBetween(String value1, String value2) {
+            addCriterion("orderCode between", value1, value2, "orderCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderCodeNotBetween(String value1, String value2) {
+            addCriterion("orderCode not between", value1, value2, "orderCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddressIsNull() {
+            addCriterion("address is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddressIsNotNull() {
+            addCriterion("address is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddressEqualTo(String value) {
+            addCriterion("address =", value, "address");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddressNotEqualTo(String value) {
+            addCriterion("address <>", value, "address");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddressGreaterThan(String value) {
+            addCriterion("address >", value, "address");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddressGreaterThanOrEqualTo(String value) {
+            addCriterion("address >=", value, "address");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddressLessThan(String value) {
+            addCriterion("address <", value, "address");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddressLessThanOrEqualTo(String value) {
+            addCriterion("address <=", value, "address");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddressLike(String value) {
+            addCriterion("address like", value, "address");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddressNotLike(String value) {
+            addCriterion("address not like", value, "address");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddressIn(List<String> values) {
+            addCriterion("address in", values, "address");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddressNotIn(List<String> values) {
+            addCriterion("address not in", values, "address");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddressBetween(String value1, String value2) {
+            addCriterion("address between", value1, value2, "address");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddressNotBetween(String value1, String value2) {
+            addCriterion("address not between", value1, value2, "address");
+            return (Criteria) this;
+        }
+
+        public Criteria andPostIsNull() {
+            addCriterion("post is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPostIsNotNull() {
+            addCriterion("post is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPostEqualTo(String value) {
+            addCriterion("post =", value, "post");
+            return (Criteria) this;
+        }
+
+        public Criteria andPostNotEqualTo(String value) {
+            addCriterion("post <>", value, "post");
+            return (Criteria) this;
+        }
+
+        public Criteria andPostGreaterThan(String value) {
+            addCriterion("post >", value, "post");
+            return (Criteria) this;
+        }
+
+        public Criteria andPostGreaterThanOrEqualTo(String value) {
+            addCriterion("post >=", value, "post");
+            return (Criteria) this;
+        }
+
+        public Criteria andPostLessThan(String value) {
+            addCriterion("post <", value, "post");
+            return (Criteria) this;
+        }
+
+        public Criteria andPostLessThanOrEqualTo(String value) {
+            addCriterion("post <=", value, "post");
+            return (Criteria) this;
+        }
+
+        public Criteria andPostLike(String value) {
+            addCriterion("post like", value, "post");
+            return (Criteria) this;
+        }
+
+        public Criteria andPostNotLike(String value) {
+            addCriterion("post not like", value, "post");
+            return (Criteria) this;
+        }
+
+        public Criteria andPostIn(List<String> values) {
+            addCriterion("post in", values, "post");
+            return (Criteria) this;
+        }
+
+        public Criteria andPostNotIn(List<String> values) {
+            addCriterion("post not in", values, "post");
+            return (Criteria) this;
+        }
+
+        public Criteria andPostBetween(String value1, String value2) {
+            addCriterion("post between", value1, value2, "post");
+            return (Criteria) this;
+        }
+
+        public Criteria andPostNotBetween(String value1, String value2) {
+            addCriterion("post not between", value1, value2, "post");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiverIsNull() {
+            addCriterion("receiver is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiverIsNotNull() {
+            addCriterion("receiver is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiverEqualTo(String value) {
+            addCriterion("receiver =", value, "receiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiverNotEqualTo(String value) {
+            addCriterion("receiver <>", value, "receiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiverGreaterThan(String value) {
+            addCriterion("receiver >", value, "receiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiverGreaterThanOrEqualTo(String value) {
+            addCriterion("receiver >=", value, "receiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiverLessThan(String value) {
+            addCriterion("receiver <", value, "receiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiverLessThanOrEqualTo(String value) {
+            addCriterion("receiver <=", value, "receiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiverLike(String value) {
+            addCriterion("receiver like", value, "receiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiverNotLike(String value) {
+            addCriterion("receiver not like", value, "receiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiverIn(List<String> values) {
+            addCriterion("receiver in", values, "receiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiverNotIn(List<String> values) {
+            addCriterion("receiver not in", values, "receiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiverBetween(String value1, String value2) {
+            addCriterion("receiver between", value1, value2, "receiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andReceiverNotBetween(String value1, String value2) {
+            addCriterion("receiver not between", value1, value2, "receiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andMobileIsNull() {
+            addCriterion("mobile is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMobileIsNotNull() {
+            addCriterion("mobile is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMobileEqualTo(String value) {
+            addCriterion("mobile =", value, "mobile");
+            return (Criteria) this;
+        }
+
+        public Criteria andMobileNotEqualTo(String value) {
+            addCriterion("mobile <>", value, "mobile");
+            return (Criteria) this;
+        }
+
+        public Criteria andMobileGreaterThan(String value) {
+            addCriterion("mobile >", value, "mobile");
+            return (Criteria) this;
+        }
+
+        public Criteria andMobileGreaterThanOrEqualTo(String value) {
+            addCriterion("mobile >=", value, "mobile");
+            return (Criteria) this;
+        }
+
+        public Criteria andMobileLessThan(String value) {
+            addCriterion("mobile <", value, "mobile");
+            return (Criteria) this;
+        }
+
+        public Criteria andMobileLessThanOrEqualTo(String value) {
+            addCriterion("mobile <=", value, "mobile");
+            return (Criteria) this;
+        }
+
+        public Criteria andMobileLike(String value) {
+            addCriterion("mobile like", value, "mobile");
+            return (Criteria) this;
+        }
+
+        public Criteria andMobileNotLike(String value) {
+            addCriterion("mobile not like", value, "mobile");
+            return (Criteria) this;
+        }
+
+        public Criteria andMobileIn(List<String> values) {
+            addCriterion("mobile in", values, "mobile");
+            return (Criteria) this;
+        }
+
+        public Criteria andMobileNotIn(List<String> values) {
+            addCriterion("mobile not in", values, "mobile");
+            return (Criteria) this;
+        }
+
+        public Criteria andMobileBetween(String value1, String value2) {
+            addCriterion("mobile between", value1, value2, "mobile");
+            return (Criteria) this;
+        }
+
+        public Criteria andMobileNotBetween(String value1, String value2) {
+            addCriterion("mobile not between", value1, value2, "mobile");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserMessageIsNull() {
+            addCriterion("userMessage is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserMessageIsNotNull() {
+            addCriterion("userMessage is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserMessageEqualTo(String value) {
+            addCriterion("userMessage =", value, "userMessage");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserMessageNotEqualTo(String value) {
+            addCriterion("userMessage <>", value, "userMessage");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserMessageGreaterThan(String value) {
+            addCriterion("userMessage >", value, "userMessage");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserMessageGreaterThanOrEqualTo(String value) {
+            addCriterion("userMessage >=", value, "userMessage");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserMessageLessThan(String value) {
+            addCriterion("userMessage <", value, "userMessage");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserMessageLessThanOrEqualTo(String value) {
+            addCriterion("userMessage <=", value, "userMessage");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserMessageLike(String value) {
+            addCriterion("userMessage like", value, "userMessage");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserMessageNotLike(String value) {
+            addCriterion("userMessage not like", value, "userMessage");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserMessageIn(List<String> values) {
+            addCriterion("userMessage in", values, "userMessage");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserMessageNotIn(List<String> values) {
+            addCriterion("userMessage not in", values, "userMessage");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserMessageBetween(String value1, String value2) {
+            addCriterion("userMessage between", value1, value2, "userMessage");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserMessageNotBetween(String value1, String value2) {
+            addCriterion("userMessage not between", value1, value2, "userMessage");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateIsNull() {
+            addCriterion("createDate is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateIsNotNull() {
+            addCriterion("createDate is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateEqualTo(Date value) {
+            addCriterion("createDate =", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateNotEqualTo(Date value) {
+            addCriterion("createDate <>", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateGreaterThan(Date value) {
+            addCriterion("createDate >", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateGreaterThanOrEqualTo(Date value) {
+            addCriterion("createDate >=", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateLessThan(Date value) {
+            addCriterion("createDate <", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateLessThanOrEqualTo(Date value) {
+            addCriterion("createDate <=", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateIn(List<Date> values) {
+            addCriterion("createDate in", values, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateNotIn(List<Date> values) {
+            addCriterion("createDate not in", values, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateBetween(Date value1, Date value2) {
+            addCriterion("createDate between", value1, value2, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateNotBetween(Date value1, Date value2) {
+            addCriterion("createDate not between", value1, value2, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayDateIsNull() {
+            addCriterion("payDate is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayDateIsNotNull() {
+            addCriterion("payDate is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayDateEqualTo(Date value) {
+            addCriterion("payDate =", value, "payDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayDateNotEqualTo(Date value) {
+            addCriterion("payDate <>", value, "payDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayDateGreaterThan(Date value) {
+            addCriterion("payDate >", value, "payDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayDateGreaterThanOrEqualTo(Date value) {
+            addCriterion("payDate >=", value, "payDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayDateLessThan(Date value) {
+            addCriterion("payDate <", value, "payDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayDateLessThanOrEqualTo(Date value) {
+            addCriterion("payDate <=", value, "payDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayDateIn(List<Date> values) {
+            addCriterion("payDate in", values, "payDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayDateNotIn(List<Date> values) {
+            addCriterion("payDate not in", values, "payDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayDateBetween(Date value1, Date value2) {
+            addCriterion("payDate between", value1, value2, "payDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPayDateNotBetween(Date value1, Date value2) {
+            addCriterion("payDate not between", value1, value2, "payDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryDateIsNull() {
+            addCriterion("deliveryDate is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryDateIsNotNull() {
+            addCriterion("deliveryDate is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryDateEqualTo(Date value) {
+            addCriterion("deliveryDate =", value, "deliveryDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryDateNotEqualTo(Date value) {
+            addCriterion("deliveryDate <>", value, "deliveryDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryDateGreaterThan(Date value) {
+            addCriterion("deliveryDate >", value, "deliveryDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryDateGreaterThanOrEqualTo(Date value) {
+            addCriterion("deliveryDate >=", value, "deliveryDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryDateLessThan(Date value) {
+            addCriterion("deliveryDate <", value, "deliveryDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryDateLessThanOrEqualTo(Date value) {
+            addCriterion("deliveryDate <=", value, "deliveryDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryDateIn(List<Date> values) {
+            addCriterion("deliveryDate in", values, "deliveryDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryDateNotIn(List<Date> values) {
+            addCriterion("deliveryDate not in", values, "deliveryDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryDateBetween(Date value1, Date value2) {
+            addCriterion("deliveryDate between", value1, value2, "deliveryDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andDeliveryDateNotBetween(Date value1, Date value2) {
+            addCriterion("deliveryDate not between", value1, value2, "deliveryDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfirmDateIsNull() {
+            addCriterion("confirmDate is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfirmDateIsNotNull() {
+            addCriterion("confirmDate is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfirmDateEqualTo(Date value) {
+            addCriterion("confirmDate =", value, "confirmDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfirmDateNotEqualTo(Date value) {
+            addCriterion("confirmDate <>", value, "confirmDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfirmDateGreaterThan(Date value) {
+            addCriterion("confirmDate >", value, "confirmDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfirmDateGreaterThanOrEqualTo(Date value) {
+            addCriterion("confirmDate >=", value, "confirmDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfirmDateLessThan(Date value) {
+            addCriterion("confirmDate <", value, "confirmDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfirmDateLessThanOrEqualTo(Date value) {
+            addCriterion("confirmDate <=", value, "confirmDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfirmDateIn(List<Date> values) {
+            addCriterion("confirmDate in", values, "confirmDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfirmDateNotIn(List<Date> values) {
+            addCriterion("confirmDate not in", values, "confirmDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfirmDateBetween(Date value1, Date value2) {
+            addCriterion("confirmDate between", value1, value2, "confirmDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andConfirmDateNotBetween(Date value1, Date value2) {
+            addCriterion("confirmDate not between", value1, value2, "confirmDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidIsNull() {
+            addCriterion("uid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidIsNotNull() {
+            addCriterion("uid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidEqualTo(Integer value) {
+            addCriterion("uid =", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidNotEqualTo(Integer value) {
+            addCriterion("uid <>", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidGreaterThan(Integer value) {
+            addCriterion("uid >", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidGreaterThanOrEqualTo(Integer value) {
+            addCriterion("uid >=", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidLessThan(Integer value) {
+            addCriterion("uid <", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidLessThanOrEqualTo(Integer value) {
+            addCriterion("uid <=", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidIn(List<Integer> values) {
+            addCriterion("uid in", values, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidNotIn(List<Integer> values) {
+            addCriterion("uid not in", values, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidBetween(Integer value1, Integer value2) {
+            addCriterion("uid between", value1, value2, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidNotBetween(Integer value1, Integer value2) {
+            addCriterion("uid not between", value1, value2, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNull() {
+            addCriterion("status is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNotNull() {
+            addCriterion("status is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusEqualTo(String value) {
+            addCriterion("status =", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotEqualTo(String value) {
+            addCriterion("status <>", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThan(String value) {
+            addCriterion("status >", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThanOrEqualTo(String value) {
+            addCriterion("status >=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThan(String value) {
+            addCriterion("status <", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThanOrEqualTo(String value) {
+            addCriterion("status <=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLike(String value) {
+            addCriterion("status like", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotLike(String value) {
+            addCriterion("status not like", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIn(List<String> values) {
+            addCriterion("status in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotIn(List<String> values) {
+            addCriterion("status not in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusBetween(String value1, String value2) {
+            addCriterion("status between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotBetween(String value1, String value2) {
+            addCriterion("status not between", value1, value2, "status");
+            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);
+        }
+    }
+}

+ 65 - 0
src/main/java/com/how2java/tmall/pojo/OrderItem.java

@@ -0,0 +1,65 @@
+package com.how2java.tmall.pojo;
+
+public class OrderItem {
+    private Integer id;
+
+    private Integer pid;
+
+    private Integer oid;
+
+    private Integer uid;
+
+    private Integer number;
+
+    /*非数据库字段*/
+    private Product product;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getPid() {
+        return pid;
+    }
+
+    public void setPid(Integer pid) {
+        this.pid = pid;
+    }
+
+    public Integer getOid() {
+        return oid;
+    }
+
+    public void setOid(Integer oid) {
+        this.oid = oid;
+    }
+
+    public Integer getUid() {
+        return uid;
+    }
+
+    public void setUid(Integer uid) {
+        this.uid = uid;
+    }
+
+    public Integer getNumber() {
+        return number;
+    }
+
+    public void setNumber(Integer number) {
+        this.number = number;
+    }
+
+    public Product getProduct() {
+        return product;
+    }
+
+    public void setProduct(Product product) {
+        this.product = product;
+    }
+}
+

+ 500 - 0
src/main/java/com/how2java/tmall/pojo/OrderItemExample.java

@@ -0,0 +1,500 @@
+package com.how2java.tmall.pojo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class OrderItemExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public OrderItemExample() {
+        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 andPidIsNull() {
+            addCriterion("pid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidIsNotNull() {
+            addCriterion("pid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidEqualTo(Integer value) {
+            addCriterion("pid =", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidNotEqualTo(Integer value) {
+            addCriterion("pid <>", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidGreaterThan(Integer value) {
+            addCriterion("pid >", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidGreaterThanOrEqualTo(Integer value) {
+            addCriterion("pid >=", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidLessThan(Integer value) {
+            addCriterion("pid <", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidLessThanOrEqualTo(Integer value) {
+            addCriterion("pid <=", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidIn(List<Integer> values) {
+            addCriterion("pid in", values, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidNotIn(List<Integer> values) {
+            addCriterion("pid not in", values, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidBetween(Integer value1, Integer value2) {
+            addCriterion("pid between", value1, value2, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidNotBetween(Integer value1, Integer value2) {
+            addCriterion("pid not between", value1, value2, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andOidIsNull() {
+            addCriterion("oid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andOidIsNotNull() {
+            addCriterion("oid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andOidEqualTo(Integer value) {
+            addCriterion("oid =", value, "oid");
+            return (Criteria) this;
+        }
+
+        public Criteria andOidNotEqualTo(Integer value) {
+            addCriterion("oid <>", value, "oid");
+            return (Criteria) this;
+        }
+
+        public Criteria andOidGreaterThan(Integer value) {
+            addCriterion("oid >", value, "oid");
+            return (Criteria) this;
+        }
+
+        public Criteria andOidGreaterThanOrEqualTo(Integer value) {
+            addCriterion("oid >=", value, "oid");
+            return (Criteria) this;
+        }
+
+        public Criteria andOidLessThan(Integer value) {
+            addCriterion("oid <", value, "oid");
+            return (Criteria) this;
+        }
+
+        public Criteria andOidLessThanOrEqualTo(Integer value) {
+            addCriterion("oid <=", value, "oid");
+            return (Criteria) this;
+        }
+
+        public Criteria andOidIn(List<Integer> values) {
+            addCriterion("oid in", values, "oid");
+            return (Criteria) this;
+        }
+
+        public Criteria andOidNotIn(List<Integer> values) {
+            addCriterion("oid not in", values, "oid");
+            return (Criteria) this;
+        }
+
+        public Criteria andOidBetween(Integer value1, Integer value2) {
+            addCriterion("oid between", value1, value2, "oid");
+            return (Criteria) this;
+        }
+
+        public Criteria andOidNotBetween(Integer value1, Integer value2) {
+            addCriterion("oid not between", value1, value2, "oid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidIsNull() {
+            addCriterion("uid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidIsNotNull() {
+            addCriterion("uid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidEqualTo(Integer value) {
+            addCriterion("uid =", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidNotEqualTo(Integer value) {
+            addCriterion("uid <>", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidGreaterThan(Integer value) {
+            addCriterion("uid >", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidGreaterThanOrEqualTo(Integer value) {
+            addCriterion("uid >=", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidLessThan(Integer value) {
+            addCriterion("uid <", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidLessThanOrEqualTo(Integer value) {
+            addCriterion("uid <=", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidIn(List<Integer> values) {
+            addCriterion("uid in", values, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidNotIn(List<Integer> values) {
+            addCriterion("uid not in", values, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidBetween(Integer value1, Integer value2) {
+            addCriterion("uid between", value1, value2, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidNotBetween(Integer value1, Integer value2) {
+            addCriterion("uid not between", value1, value2, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andNumberIsNull() {
+            addCriterion("number is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNumberIsNotNull() {
+            addCriterion("number is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNumberEqualTo(Integer value) {
+            addCriterion("number =", value, "number");
+            return (Criteria) this;
+        }
+
+        public Criteria andNumberNotEqualTo(Integer value) {
+            addCriterion("number <>", value, "number");
+            return (Criteria) this;
+        }
+
+        public Criteria andNumberGreaterThan(Integer value) {
+            addCriterion("number >", value, "number");
+            return (Criteria) this;
+        }
+
+        public Criteria andNumberGreaterThanOrEqualTo(Integer value) {
+            addCriterion("number >=", value, "number");
+            return (Criteria) this;
+        }
+
+        public Criteria andNumberLessThan(Integer value) {
+            addCriterion("number <", value, "number");
+            return (Criteria) this;
+        }
+
+        public Criteria andNumberLessThanOrEqualTo(Integer value) {
+            addCriterion("number <=", value, "number");
+            return (Criteria) this;
+        }
+
+        public Criteria andNumberIn(List<Integer> values) {
+            addCriterion("number in", values, "number");
+            return (Criteria) this;
+        }
+
+        public Criteria andNumberNotIn(List<Integer> values) {
+            addCriterion("number not in", values, "number");
+            return (Criteria) this;
+        }
+
+        public Criteria andNumberBetween(Integer value1, Integer value2) {
+            addCriterion("number between", value1, value2, "number");
+            return (Criteria) this;
+        }
+
+        public Criteria andNumberNotBetween(Integer value1, Integer value2) {
+            addCriterion("number not between", value1, value2, "number");
+            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);
+        }
+    }
+}

+ 151 - 0
src/main/java/com/how2java/tmall/pojo/Product.java

@@ -0,0 +1,151 @@
+package com.how2java.tmall.pojo;
+
+import java.util.Date;
+import java.util.List;
+
+public class Product {
+    private Integer id;
+
+    private String name;
+
+    private String subTitle;
+
+    private Float originalPrice;
+
+    private Float promotePrice;
+
+    private Integer stock;
+
+    private Integer cid;
+
+    private Date createDate;
+
+
+    /*非数据库字段*/
+    private Category  category;
+
+    private ProductImage firstProductImage;
+
+    private List<ProductImage> productSingleImages;
+
+    private List<ProductImage> productDetailImages;
+
+    private int saleCount;
+
+    private int reviewCount;
+
+
+    public Category getCategory() {
+        return category;
+    }
+
+    public void setCategory(Category category) {
+        this.category = category;
+    }
+
+    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 getSubTitle() {
+        return subTitle;
+    }
+
+    public void setSubTitle(String subTitle) {
+        this.subTitle = subTitle == null ? null : subTitle.trim();
+    }
+
+    public Float getOriginalPrice() {
+        return originalPrice;
+    }
+
+    public void setOriginalPrice(Float originalPrice) {
+        this.originalPrice = originalPrice;
+    }
+
+    public Float getPromotePrice() {
+        return promotePrice;
+    }
+
+    public void setPromotePrice(Float promotePrice) {
+        this.promotePrice = promotePrice;
+    }
+
+    public Integer getStock() {
+        return stock;
+    }
+
+    public void setStock(Integer stock) {
+        this.stock = stock;
+    }
+
+    public Integer getCid() {
+        return cid;
+    }
+
+    public void setCid(Integer cid) {
+        this.cid = cid;
+    }
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    public ProductImage getFirstProductImage() {
+        return firstProductImage;
+    }
+
+
+    public void setFirstProductImage(ProductImage firstProductImage) {
+        this.firstProductImage = firstProductImage;
+    }
+
+    public List<ProductImage> getProductSingleImages() {
+        return productSingleImages;
+    }
+
+    public void setProductSingleImages(List<ProductImage> productSingleImages) {
+        this.productSingleImages = productSingleImages;
+    }
+
+    public List<ProductImage> getProductDetailImages() {
+        return productDetailImages;
+    }
+
+    public void setProductDetailImages(List<ProductImage> productDetailImages) {
+        this.productDetailImages = productDetailImages;
+    }
+
+    public int getSaleCount() {
+        return saleCount;
+    }
+
+    public void setSaleCount(int saleCount) {
+        this.saleCount = saleCount;
+    }
+
+    public int getReviewCount() {
+        return reviewCount;
+    }
+
+    public void setReviewCount(int reviewCount) {
+        this.reviewCount = reviewCount;
+    }
+}
+

+ 702 - 0
src/main/java/com/how2java/tmall/pojo/ProductExample.java

@@ -0,0 +1,702 @@
+package com.how2java.tmall.pojo;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class ProductExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public ProductExample() {
+        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 andSubTitleIsNull() {
+            addCriterion("subTitle is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubTitleIsNotNull() {
+            addCriterion("subTitle is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubTitleEqualTo(String value) {
+            addCriterion("subTitle =", value, "subTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubTitleNotEqualTo(String value) {
+            addCriterion("subTitle <>", value, "subTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubTitleGreaterThan(String value) {
+            addCriterion("subTitle >", value, "subTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubTitleGreaterThanOrEqualTo(String value) {
+            addCriterion("subTitle >=", value, "subTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubTitleLessThan(String value) {
+            addCriterion("subTitle <", value, "subTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubTitleLessThanOrEqualTo(String value) {
+            addCriterion("subTitle <=", value, "subTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubTitleLike(String value) {
+            addCriterion("subTitle like", value, "subTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubTitleNotLike(String value) {
+            addCriterion("subTitle not like", value, "subTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubTitleIn(List<String> values) {
+            addCriterion("subTitle in", values, "subTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubTitleNotIn(List<String> values) {
+            addCriterion("subTitle not in", values, "subTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubTitleBetween(String value1, String value2) {
+            addCriterion("subTitle between", value1, value2, "subTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andSubTitleNotBetween(String value1, String value2) {
+            addCriterion("subTitle not between", value1, value2, "subTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andOriginalPriceIsNull() {
+            addCriterion("originalPrice is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andOriginalPriceIsNotNull() {
+            addCriterion("originalPrice is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andOriginalPriceEqualTo(Float value) {
+            addCriterion("originalPrice =", value, "originalPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andOriginalPriceNotEqualTo(Float value) {
+            addCriterion("originalPrice <>", value, "originalPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andOriginalPriceGreaterThan(Float value) {
+            addCriterion("originalPrice >", value, "originalPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andOriginalPriceGreaterThanOrEqualTo(Float value) {
+            addCriterion("originalPrice >=", value, "originalPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andOriginalPriceLessThan(Float value) {
+            addCriterion("originalPrice <", value, "originalPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andOriginalPriceLessThanOrEqualTo(Float value) {
+            addCriterion("originalPrice <=", value, "originalPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andOriginalPriceIn(List<Float> values) {
+            addCriterion("originalPrice in", values, "originalPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andOriginalPriceNotIn(List<Float> values) {
+            addCriterion("originalPrice not in", values, "originalPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andOriginalPriceBetween(Float value1, Float value2) {
+            addCriterion("originalPrice between", value1, value2, "originalPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andOriginalPriceNotBetween(Float value1, Float value2) {
+            addCriterion("originalPrice not between", value1, value2, "originalPrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andPromotePriceIsNull() {
+            addCriterion("promotePrice is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPromotePriceIsNotNull() {
+            addCriterion("promotePrice is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPromotePriceEqualTo(Float value) {
+            addCriterion("promotePrice =", value, "promotePrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andPromotePriceNotEqualTo(Float value) {
+            addCriterion("promotePrice <>", value, "promotePrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andPromotePriceGreaterThan(Float value) {
+            addCriterion("promotePrice >", value, "promotePrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andPromotePriceGreaterThanOrEqualTo(Float value) {
+            addCriterion("promotePrice >=", value, "promotePrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andPromotePriceLessThan(Float value) {
+            addCriterion("promotePrice <", value, "promotePrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andPromotePriceLessThanOrEqualTo(Float value) {
+            addCriterion("promotePrice <=", value, "promotePrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andPromotePriceIn(List<Float> values) {
+            addCriterion("promotePrice in", values, "promotePrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andPromotePriceNotIn(List<Float> values) {
+            addCriterion("promotePrice not in", values, "promotePrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andPromotePriceBetween(Float value1, Float value2) {
+            addCriterion("promotePrice between", value1, value2, "promotePrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andPromotePriceNotBetween(Float value1, Float value2) {
+            addCriterion("promotePrice not between", value1, value2, "promotePrice");
+            return (Criteria) this;
+        }
+
+        public Criteria andStockIsNull() {
+            addCriterion("stock is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStockIsNotNull() {
+            addCriterion("stock is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStockEqualTo(Integer value) {
+            addCriterion("stock =", value, "stock");
+            return (Criteria) this;
+        }
+
+        public Criteria andStockNotEqualTo(Integer value) {
+            addCriterion("stock <>", value, "stock");
+            return (Criteria) this;
+        }
+
+        public Criteria andStockGreaterThan(Integer value) {
+            addCriterion("stock >", value, "stock");
+            return (Criteria) this;
+        }
+
+        public Criteria andStockGreaterThanOrEqualTo(Integer value) {
+            addCriterion("stock >=", value, "stock");
+            return (Criteria) this;
+        }
+
+        public Criteria andStockLessThan(Integer value) {
+            addCriterion("stock <", value, "stock");
+            return (Criteria) this;
+        }
+
+        public Criteria andStockLessThanOrEqualTo(Integer value) {
+            addCriterion("stock <=", value, "stock");
+            return (Criteria) this;
+        }
+
+        public Criteria andStockIn(List<Integer> values) {
+            addCriterion("stock in", values, "stock");
+            return (Criteria) this;
+        }
+
+        public Criteria andStockNotIn(List<Integer> values) {
+            addCriterion("stock not in", values, "stock");
+            return (Criteria) this;
+        }
+
+        public Criteria andStockBetween(Integer value1, Integer value2) {
+            addCriterion("stock between", value1, value2, "stock");
+            return (Criteria) this;
+        }
+
+        public Criteria andStockNotBetween(Integer value1, Integer value2) {
+            addCriterion("stock not between", value1, value2, "stock");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidIsNull() {
+            addCriterion("cid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidIsNotNull() {
+            addCriterion("cid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidEqualTo(Integer value) {
+            addCriterion("cid =", value, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidNotEqualTo(Integer value) {
+            addCriterion("cid <>", value, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidGreaterThan(Integer value) {
+            addCriterion("cid >", value, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidGreaterThanOrEqualTo(Integer value) {
+            addCriterion("cid >=", value, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidLessThan(Integer value) {
+            addCriterion("cid <", value, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidLessThanOrEqualTo(Integer value) {
+            addCriterion("cid <=", value, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidIn(List<Integer> values) {
+            addCriterion("cid in", values, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidNotIn(List<Integer> values) {
+            addCriterion("cid not in", values, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidBetween(Integer value1, Integer value2) {
+            addCriterion("cid between", value1, value2, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidNotBetween(Integer value1, Integer value2) {
+            addCriterion("cid not between", value1, value2, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateIsNull() {
+            addCriterion("createDate is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateIsNotNull() {
+            addCriterion("createDate is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateEqualTo(Date value) {
+            addCriterion("createDate =", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateNotEqualTo(Date value) {
+            addCriterion("createDate <>", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateGreaterThan(Date value) {
+            addCriterion("createDate >", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateGreaterThanOrEqualTo(Date value) {
+            addCriterion("createDate >=", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateLessThan(Date value) {
+            addCriterion("createDate <", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateLessThanOrEqualTo(Date value) {
+            addCriterion("createDate <=", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateIn(List<Date> values) {
+            addCriterion("createDate in", values, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateNotIn(List<Date> values) {
+            addCriterion("createDate not in", values, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateBetween(Date value1, Date value2) {
+            addCriterion("createDate between", value1, value2, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateNotBetween(Date value1, Date value2) {
+            addCriterion("createDate not between", value1, value2, "createDate");
+            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);
+        }
+    }
+}
+

+ 33 - 0
src/main/java/com/how2java/tmall/pojo/ProductImage.java

@@ -0,0 +1,33 @@
+package com.how2java.tmall.pojo;
+
+public class ProductImage {
+    private Integer id;
+
+    private Integer pid;
+
+    private String type;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getPid() {
+        return pid;
+    }
+
+    public void setPid(Integer pid) {
+        this.pid = pid;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type == null ? null : type.trim();
+    }
+}

+ 391 - 0
src/main/java/com/how2java/tmall/pojo/ProductImageExample.java

@@ -0,0 +1,391 @@
+package com.how2java.tmall.pojo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ProductImageExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public ProductImageExample() {
+        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 andPidIsNull() {
+            addCriterion("pid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidIsNotNull() {
+            addCriterion("pid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidEqualTo(Integer value) {
+            addCriterion("pid =", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidNotEqualTo(Integer value) {
+            addCriterion("pid <>", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidGreaterThan(Integer value) {
+            addCriterion("pid >", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidGreaterThanOrEqualTo(Integer value) {
+            addCriterion("pid >=", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidLessThan(Integer value) {
+            addCriterion("pid <", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidLessThanOrEqualTo(Integer value) {
+            addCriterion("pid <=", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidIn(List<Integer> values) {
+            addCriterion("pid in", values, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidNotIn(List<Integer> values) {
+            addCriterion("pid not in", values, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidBetween(Integer value1, Integer value2) {
+            addCriterion("pid between", value1, value2, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidNotBetween(Integer value1, Integer value2) {
+            addCriterion("pid not between", value1, value2, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIsNull() {
+            addCriterion("type is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIsNotNull() {
+            addCriterion("type is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeEqualTo(String value) {
+            addCriterion("type =", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotEqualTo(String value) {
+            addCriterion("type <>", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThan(String value) {
+            addCriterion("type >", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThanOrEqualTo(String value) {
+            addCriterion("type >=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThan(String value) {
+            addCriterion("type <", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThanOrEqualTo(String value) {
+            addCriterion("type <=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLike(String value) {
+            addCriterion("type like", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotLike(String value) {
+            addCriterion("type not like", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIn(List<String> values) {
+            addCriterion("type in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotIn(List<String> values) {
+            addCriterion("type not in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeBetween(String value1, String value2) {
+            addCriterion("type between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotBetween(String value1, String value2) {
+            addCriterion("type not between", value1, value2, "type");
+            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);
+        }
+    }
+}
+

+ 43 - 0
src/main/java/com/how2java/tmall/pojo/Property.java

@@ -0,0 +1,43 @@
+package com.how2java.tmall.pojo;
+
+public class Property {
+    private Integer id;
+
+    private Integer cid;
+
+    private String name;
+
+    /*非数据库字段*/
+    private Category  category;
+
+    public Category getCategory() {
+        return category;
+    }
+
+    public void setCategory(Category category) {
+        this.category = category;
+    }
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getCid() {
+        return cid;
+    }
+
+    public void setCid(Integer cid) {
+        this.cid = cid;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name == null ? null : name.trim();
+    }
+}

+ 391 - 0
src/main/java/com/how2java/tmall/pojo/PropertyExample.java

@@ -0,0 +1,391 @@
+package com.how2java.tmall.pojo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PropertyExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public PropertyExample() {
+        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 andCidIsNull() {
+            addCriterion("cid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidIsNotNull() {
+            addCriterion("cid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidEqualTo(Integer value) {
+            addCriterion("cid =", value, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidNotEqualTo(Integer value) {
+            addCriterion("cid <>", value, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidGreaterThan(Integer value) {
+            addCriterion("cid >", value, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidGreaterThanOrEqualTo(Integer value) {
+            addCriterion("cid >=", value, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidLessThan(Integer value) {
+            addCriterion("cid <", value, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidLessThanOrEqualTo(Integer value) {
+            addCriterion("cid <=", value, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidIn(List<Integer> values) {
+            addCriterion("cid in", values, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidNotIn(List<Integer> values) {
+            addCriterion("cid not in", values, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidBetween(Integer value1, Integer value2) {
+            addCriterion("cid between", value1, value2, "cid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCidNotBetween(Integer value1, Integer value2) {
+            addCriterion("cid not between", value1, value2, "cid");
+            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 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);
+        }
+    }
+}
+

+ 54 - 0
src/main/java/com/how2java/tmall/pojo/PropertyValue.java

@@ -0,0 +1,54 @@
+package com.how2java.tmall.pojo;
+
+public class PropertyValue {
+    private Integer id;
+
+    private Integer pid;
+
+    private Integer ptid;
+
+    private String value;
+
+    /*非数据库字段*/
+    private Property property;
+
+    public Property getProperty() {
+        return property;
+    }
+
+    public void setProperty(Property property) {
+        this.property = property;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getPid() {
+        return pid;
+    }
+
+    public void setPid(Integer pid) {
+        this.pid = pid;
+    }
+
+    public Integer getPtid() {
+        return ptid;
+    }
+
+    public void setPtid(Integer ptid) {
+        this.ptid = ptid;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value == null ? null : value.trim();
+    }
+}

+ 450 - 0
src/main/java/com/how2java/tmall/pojo/PropertyValueExample.java

@@ -0,0 +1,450 @@
+package com.how2java.tmall.pojo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PropertyValueExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public PropertyValueExample() {
+        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 andPidIsNull() {
+            addCriterion("pid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidIsNotNull() {
+            addCriterion("pid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidEqualTo(Integer value) {
+            addCriterion("pid =", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidNotEqualTo(Integer value) {
+            addCriterion("pid <>", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidGreaterThan(Integer value) {
+            addCriterion("pid >", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidGreaterThanOrEqualTo(Integer value) {
+            addCriterion("pid >=", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidLessThan(Integer value) {
+            addCriterion("pid <", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidLessThanOrEqualTo(Integer value) {
+            addCriterion("pid <=", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidIn(List<Integer> values) {
+            addCriterion("pid in", values, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidNotIn(List<Integer> values) {
+            addCriterion("pid not in", values, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidBetween(Integer value1, Integer value2) {
+            addCriterion("pid between", value1, value2, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidNotBetween(Integer value1, Integer value2) {
+            addCriterion("pid not between", value1, value2, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPtidIsNull() {
+            addCriterion("ptid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPtidIsNotNull() {
+            addCriterion("ptid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPtidEqualTo(Integer value) {
+            addCriterion("ptid =", value, "ptid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPtidNotEqualTo(Integer value) {
+            addCriterion("ptid <>", value, "ptid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPtidGreaterThan(Integer value) {
+            addCriterion("ptid >", value, "ptid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPtidGreaterThanOrEqualTo(Integer value) {
+            addCriterion("ptid >=", value, "ptid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPtidLessThan(Integer value) {
+            addCriterion("ptid <", value, "ptid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPtidLessThanOrEqualTo(Integer value) {
+            addCriterion("ptid <=", value, "ptid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPtidIn(List<Integer> values) {
+            addCriterion("ptid in", values, "ptid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPtidNotIn(List<Integer> values) {
+            addCriterion("ptid not in", values, "ptid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPtidBetween(Integer value1, Integer value2) {
+            addCriterion("ptid between", value1, value2, "ptid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPtidNotBetween(Integer value1, Integer value2) {
+            addCriterion("ptid not between", value1, value2, "ptid");
+            return (Criteria) this;
+        }
+
+        public Criteria andValueIsNull() {
+            addCriterion("value is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andValueIsNotNull() {
+            addCriterion("value is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andValueEqualTo(String value) {
+            addCriterion("value =", value, "value");
+            return (Criteria) this;
+        }
+
+        public Criteria andValueNotEqualTo(String value) {
+            addCriterion("value <>", value, "value");
+            return (Criteria) this;
+        }
+
+        public Criteria andValueGreaterThan(String value) {
+            addCriterion("value >", value, "value");
+            return (Criteria) this;
+        }
+
+        public Criteria andValueGreaterThanOrEqualTo(String value) {
+            addCriterion("value >=", value, "value");
+            return (Criteria) this;
+        }
+
+        public Criteria andValueLessThan(String value) {
+            addCriterion("value <", value, "value");
+            return (Criteria) this;
+        }
+
+        public Criteria andValueLessThanOrEqualTo(String value) {
+            addCriterion("value <=", value, "value");
+            return (Criteria) this;
+        }
+
+        public Criteria andValueLike(String value) {
+            addCriterion("value like", value, "value");
+            return (Criteria) this;
+        }
+
+        public Criteria andValueNotLike(String value) {
+            addCriterion("value not like", value, "value");
+            return (Criteria) this;
+        }
+
+        public Criteria andValueIn(List<String> values) {
+            addCriterion("value in", values, "value");
+            return (Criteria) this;
+        }
+
+        public Criteria andValueNotIn(List<String> values) {
+            addCriterion("value not in", values, "value");
+            return (Criteria) this;
+        }
+
+        public Criteria andValueBetween(String value1, String value2) {
+            addCriterion("value between", value1, value2, "value");
+            return (Criteria) this;
+        }
+
+        public Criteria andValueNotBetween(String value1, String value2) {
+            addCriterion("value not between", value1, value2, "value");
+            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);
+        }
+    }
+}

+ 66 - 0
src/main/java/com/how2java/tmall/pojo/Review.java

@@ -0,0 +1,66 @@
+package com.how2java.tmall.pojo;
+
+import java.util.Date;
+
+public class Review {
+    private Integer id;
+
+    private String content;
+
+    private Integer uid;
+
+    private Integer pid;
+
+    private Date createDate;
+    /*非数据库字段*/
+    private User user;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content == null ? null : content.trim();
+    }
+
+    public Integer getUid() {
+        return uid;
+    }
+
+    public void setUid(Integer uid) {
+        this.uid = uid;
+    }
+
+    public Integer getPid() {
+        return pid;
+    }
+
+    public void setPid(Integer pid) {
+        this.pid = pid;
+    }
+
+    public Date getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(Date createDate) {
+        this.createDate = createDate;
+    }
+
+    public User getUser() {
+        return user;
+    }
+
+    public void setUser(User user) {
+        this.user = user;
+    }
+}
+

+ 511 - 0
src/main/java/com/how2java/tmall/pojo/ReviewExample.java

@@ -0,0 +1,511 @@
+package com.how2java.tmall.pojo;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class ReviewExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public ReviewExample() {
+        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 andContentIsNull() {
+            addCriterion("content is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIsNotNull() {
+            addCriterion("content is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentEqualTo(String value) {
+            addCriterion("content =", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentNotEqualTo(String value) {
+            addCriterion("content <>", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentGreaterThan(String value) {
+            addCriterion("content >", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentGreaterThanOrEqualTo(String value) {
+            addCriterion("content >=", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentLessThan(String value) {
+            addCriterion("content <", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentLessThanOrEqualTo(String value) {
+            addCriterion("content <=", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentLike(String value) {
+            addCriterion("content like", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentNotLike(String value) {
+            addCriterion("content not like", value, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIn(List<String> values) {
+            addCriterion("content in", values, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentNotIn(List<String> values) {
+            addCriterion("content not in", values, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentBetween(String value1, String value2) {
+            addCriterion("content between", value1, value2, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentNotBetween(String value1, String value2) {
+            addCriterion("content not between", value1, value2, "content");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidIsNull() {
+            addCriterion("uid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidIsNotNull() {
+            addCriterion("uid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidEqualTo(Integer value) {
+            addCriterion("uid =", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidNotEqualTo(Integer value) {
+            addCriterion("uid <>", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidGreaterThan(Integer value) {
+            addCriterion("uid >", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidGreaterThanOrEqualTo(Integer value) {
+            addCriterion("uid >=", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidLessThan(Integer value) {
+            addCriterion("uid <", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidLessThanOrEqualTo(Integer value) {
+            addCriterion("uid <=", value, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidIn(List<Integer> values) {
+            addCriterion("uid in", values, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidNotIn(List<Integer> values) {
+            addCriterion("uid not in", values, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidBetween(Integer value1, Integer value2) {
+            addCriterion("uid between", value1, value2, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andUidNotBetween(Integer value1, Integer value2) {
+            addCriterion("uid not between", value1, value2, "uid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidIsNull() {
+            addCriterion("pid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidIsNotNull() {
+            addCriterion("pid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidEqualTo(Integer value) {
+            addCriterion("pid =", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidNotEqualTo(Integer value) {
+            addCriterion("pid <>", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidGreaterThan(Integer value) {
+            addCriterion("pid >", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidGreaterThanOrEqualTo(Integer value) {
+            addCriterion("pid >=", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidLessThan(Integer value) {
+            addCriterion("pid <", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidLessThanOrEqualTo(Integer value) {
+            addCriterion("pid <=", value, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidIn(List<Integer> values) {
+            addCriterion("pid in", values, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidNotIn(List<Integer> values) {
+            addCriterion("pid not in", values, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidBetween(Integer value1, Integer value2) {
+            addCriterion("pid between", value1, value2, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andPidNotBetween(Integer value1, Integer value2) {
+            addCriterion("pid not between", value1, value2, "pid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateIsNull() {
+            addCriterion("createDate is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateIsNotNull() {
+            addCriterion("createDate is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateEqualTo(Date value) {
+            addCriterion("createDate =", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateNotEqualTo(Date value) {
+            addCriterion("createDate <>", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateGreaterThan(Date value) {
+            addCriterion("createDate >", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateGreaterThanOrEqualTo(Date value) {
+            addCriterion("createDate >=", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateLessThan(Date value) {
+            addCriterion("createDate <", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateLessThanOrEqualTo(Date value) {
+            addCriterion("createDate <=", value, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateIn(List<Date> values) {
+            addCriterion("createDate in", values, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateNotIn(List<Date> values) {
+            addCriterion("createDate not in", values, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateBetween(Date value1, Date value2) {
+            addCriterion("createDate between", value1, value2, "createDate");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateDateNotBetween(Date value1, Date value2) {
+            addCriterion("createDate not between", value1, value2, "createDate");
+            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);
+        }
+    }
+}

+ 52 - 0
src/main/java/com/how2java/tmall/pojo/User.java

@@ -0,0 +1,52 @@
+package com.how2java.tmall.pojo;
+
+public class User {
+    private Integer id;
+
+    private String name;
+
+    private String password;
+
+    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 String getAnonymousName(){
+        if(null==name)
+            return null;
+
+        if(name.length()<=1)
+            return "*";
+
+        if(name.length()==2)
+            return name.substring(0,1) +"*";
+
+        char[] cs =name.toCharArray();
+        for (int i = 1; i < cs.length-1; i++) {
+            cs[i]='*';
+        }
+        return new String(cs);
+
+
+    }
+}

+ 400 - 0
src/main/java/com/how2java/tmall/pojo/UserExample.java

@@ -0,0 +1,400 @@
+package com.how2java.tmall.pojo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class UserExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public UserExample() {
+        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 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);
+        }
+    }
+}

+ 16 - 0
src/main/java/com/how2java/tmall/service/CategoryService.java

@@ -0,0 +1,16 @@
+package com.how2java.tmall.service;
+
+import com.how2java.tmall.pojo.Category;
+import java.util.List;
+
+public interface CategoryService{
+    List<Category> list();
+
+    void add(Category category);
+
+    void delete(int id);
+
+    Category get(int id);
+
+    void update(Category category);
+}

+ 26 - 0
src/main/java/com/how2java/tmall/service/OrderItemService.java

@@ -0,0 +1,26 @@
+package com.how2java.tmall.service;
+
+import java.util.List;
+
+import com.how2java.tmall.pojo.Order;
+import com.how2java.tmall.pojo.OrderItem;
+
+public interface OrderItemService {
+
+
+    void add(OrderItem c);
+
+    void delete(int id);
+    void update(OrderItem c);
+    OrderItem get(int id);
+    List list();
+
+    void fill(List<Order> os);
+
+    void fill(Order o);
+
+    int getSaleCount(int  pid);
+
+    List<OrderItem> listByUser(int uid);
+}
+

+ 24 - 0
src/main/java/com/how2java/tmall/service/OrderService.java

@@ -0,0 +1,24 @@
+package com.how2java.tmall.service;
+
+import java.util.List;
+
+import com.how2java.tmall.pojo.Order;
+import com.how2java.tmall.pojo.OrderItem;
+
+public interface OrderService {
+
+    String waitPay = "waitPay";
+    String waitDelivery = "waitDelivery";
+    String waitConfirm = "waitConfirm";
+    String waitReview = "waitReview";
+    String finish = "finish";
+    String delete = "delete";
+
+    void add(Order c);
+    float add(Order c,List<OrderItem> ois);
+    void delete(int id);
+    void update(Order c);
+    Order get(int id);
+    List list();
+    List list(int uid, String excludedStatus);
+}

+ 17 - 0
src/main/java/com/how2java/tmall/service/ProductImageService.java

@@ -0,0 +1,17 @@
+package com.how2java.tmall.service;
+ 
+import java.util.List;
+
+import com.how2java.tmall.pojo.ProductImage;
+
+public interface ProductImageService {
+
+    String type_single = "type_single";
+    String type_detail = "type_detail";
+
+    void add(ProductImage pi);
+    void delete(int id);
+    void update(ProductImage pi);
+    ProductImage get(int id);
+    List list(int pid, String type);
+}

+ 27 - 0
src/main/java/com/how2java/tmall/service/ProductService.java

@@ -0,0 +1,27 @@
+package com.how2java.tmall.service;
+
+import java.util.List;
+
+import com.how2java.tmall.pojo.Category;
+import com.how2java.tmall.pojo.Product;
+
+public interface ProductService {
+    void add(Product p);
+    void delete(int id);
+    void update(Product p);
+    Product get(int id);
+    List list(int cid);
+    void setFirstProductImage(Product p);
+
+    void fill(List<Category> cs);
+
+    void fill(Category c);
+
+    void fillByRow(List<Category> cs);
+
+    void setSaleAndReviewNumber(Product p);
+
+    void setSaleAndReviewNumber(List<Product> ps);
+
+    List<Product> search(String keyword);
+}

+ 14 - 0
src/main/java/com/how2java/tmall/service/PropertyService.java

@@ -0,0 +1,14 @@
+package com.how2java.tmall.service;
+ 
+import com.how2java.tmall.pojo.Property;
+
+import java.util.List;
+
+public interface PropertyService {
+    void add(Property c);
+    void delete(int id);
+    void update(Property c);
+    Property get(int id);
+    List list(int cid);
+}
+

+ 15 - 0
src/main/java/com/how2java/tmall/service/PropertyValueService.java

@@ -0,0 +1,15 @@
+package com.how2java.tmall.service;
+
+import com.how2java.tmall.pojo.Product;
+import com.how2java.tmall.pojo.PropertyValue;
+
+import java.util.List;
+
+public interface PropertyValueService {
+    void init(Product p);
+    void update(PropertyValue pv);
+
+    PropertyValue get(int ptid, int pid);
+    List<PropertyValue> list(int pid);
+}
+

+ 19 - 0
src/main/java/com/how2java/tmall/service/ReviewService.java

@@ -0,0 +1,19 @@
+package com.how2java.tmall.service;
+ 
+import java.util.List;
+
+import com.how2java.tmall.pojo.Review;
+
+public interface ReviewService {
+     
+
+    void add(Review c);
+
+    void delete(int id);
+    void update(Review c);
+    Review get(int id);
+    List list(int pid);
+
+    int getCount(int pid);
+}
+

+ 17 - 0
src/main/java/com/how2java/tmall/service/UserService.java

@@ -0,0 +1,17 @@
+package com.how2java.tmall.service;
+ 
+import java.util.List;
+
+import com.how2java.tmall.pojo.User;
+
+public interface UserService {
+    void add(User c);
+    void delete(int id);
+    void update(User c);
+    User get(int id);
+    List list();
+    boolean isExist(String name);
+
+    User get(String name, String password);
+}
+

+ 44 - 0
src/main/java/com/how2java/tmall/service/impl/CategoryServiceImpl.java

@@ -0,0 +1,44 @@
+package com.how2java.tmall.service.impl;
+
+import com.how2java.tmall.mapper.CategoryMapper;
+import com.how2java.tmall.pojo.Category;
+import com.how2java.tmall.pojo.CategoryExample;
+import com.how2java.tmall.service.CategoryService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CategoryServiceImpl implements CategoryService {
+    @Autowired
+    CategoryMapper categoryMapper;
+
+    @Override
+    public List<Category> list() {
+        CategoryExample example =new CategoryExample();
+        example.setOrderByClause("id desc");
+        return categoryMapper.selectByExample(example);
+    }
+
+    @Override
+    public void add(Category category) {
+        categoryMapper.insert(category);
+    }
+
+    @Override
+    public void delete(int id) {
+        categoryMapper.deleteByPrimaryKey(id);
+    }
+
+    @Override
+    public Category get(int id) {
+        return categoryMapper.selectByPrimaryKey(id);
+    }
+
+    @Override
+    public void update(Category category) {
+        categoryMapper.updateByPrimaryKeySelective(category);
+    }
+}
+

+ 116 - 0
src/main/java/com/how2java/tmall/service/impl/OrderItemServiceImpl.java

@@ -0,0 +1,116 @@
+package com.how2java.tmall.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.how2java.tmall.mapper.OrderItemMapper;
+import com.how2java.tmall.pojo.Order;
+import com.how2java.tmall.pojo.OrderItem;
+import com.how2java.tmall.pojo.OrderItemExample;
+import com.how2java.tmall.pojo.Product;
+import com.how2java.tmall.service.OrderItemService;
+import com.how2java.tmall.service.ProductService;
+
+
+@Service
+public class OrderItemServiceImpl implements OrderItemService {
+    @Autowired
+    OrderItemMapper orderItemMapper;
+    @Autowired
+    ProductService productService;
+
+    @Override
+    public void add(OrderItem c) {
+        orderItemMapper.insert(c);
+    }
+
+    @Override
+    public void delete(int id) {
+        orderItemMapper.deleteByPrimaryKey(id);
+    }
+
+    @Override
+    public void update(OrderItem c) {
+        orderItemMapper.updateByPrimaryKeySelective(c);
+    }
+
+    @Override
+    public OrderItem get(int id) {
+        OrderItem result = orderItemMapper.selectByPrimaryKey(id);
+        setProduct(result);
+        return result;
+    }
+
+    public List<OrderItem> list(){
+        OrderItemExample example =new OrderItemExample();
+        example.setOrderByClause("id desc");
+        return orderItemMapper.selectByExample(example);
+
+    }
+
+    @Override
+    public void fill(List<Order> os) {
+        for (Order o : os) {
+            fill(o);
+        }
+    }
+
+    @Override
+    public int getSaleCount(int pid) {
+        OrderItemExample example =new OrderItemExample();
+        example.createCriteria().andPidEqualTo(pid);
+        List<OrderItem> ois =orderItemMapper.selectByExample(example);
+        int result =0;
+        for (OrderItem oi : ois) {
+            result+=oi.getNumber();
+        }
+        return result;
+    }
+
+    @Override
+    public List<OrderItem> listByUser(int uid) {
+        OrderItemExample example =new OrderItemExample();
+        example.createCriteria().andUidEqualTo(uid).andOidIsNull();
+        List<OrderItem> result =orderItemMapper.selectByExample(example);
+        setProduct(result);
+        return result;
+    }
+
+    public void fill(Order o) {
+        OrderItemExample example =new OrderItemExample();
+        example.createCriteria().andOidEqualTo(o.getId());
+        example.setOrderByClause("id desc");
+        List<OrderItem> ois =orderItemMapper.selectByExample(example);
+        setProduct(ois);
+
+        float total = 0;
+        int totalNumber = 0;
+        for (OrderItem oi : ois) {
+            total+=oi.getNumber()*oi.getProduct().getPromotePrice();
+            totalNumber+=oi.getNumber();
+        }
+        o.setTotal(total);
+        o.setTotalNumber(totalNumber);
+        o.setOrderItems(ois);
+
+
+    }
+
+    public void setProduct(List<OrderItem> ois){
+        for (OrderItem oi: ois) {
+            setProduct(oi);
+        }
+    }
+
+    private void setProduct(OrderItem oi) {
+        Product p = productService.get(oi.getPid());
+        oi.setProduct(p);
+    }
+
+
+    ;
+
+}
+

+ 93 - 0
src/main/java/com/how2java/tmall/service/impl/OrderServiceImpl.java

@@ -0,0 +1,93 @@
+package com.how2java.tmall.service.impl;
+
+import com.how2java.tmall.mapper.OrderMapper;
+import com.how2java.tmall.pojo.Order;
+import com.how2java.tmall.pojo.OrderExample;
+import com.how2java.tmall.pojo.OrderItem;
+import com.how2java.tmall.pojo.User;
+import com.how2java.tmall.service.OrderItemService;
+import com.how2java.tmall.service.OrderService;
+import com.how2java.tmall.service.UserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+
+@Service
+public class OrderServiceImpl implements OrderService {
+    @Autowired
+    OrderMapper orderMapper;
+
+    @Autowired
+    UserService userService;
+    @Autowired
+    OrderItemService orderItemService;
+
+    @Override
+    public void add(Order c) {
+        orderMapper.insert(c);
+    }
+
+    @Override
+    public void delete(int id) {
+        orderMapper.deleteByPrimaryKey(id);
+    }
+
+    @Override
+    public void update(Order c) {
+        orderMapper.updateByPrimaryKeySelective(c);
+    }
+
+    @Override
+    public Order get(int id) {
+        return orderMapper.selectByPrimaryKey(id);
+    }
+
+    @Override
+    @Transactional(propagation= Propagation.REQUIRED,rollbackForClassName="Exception")
+    public float add(Order o, List<OrderItem> ois) {
+        float total = 0;
+        add(o);
+
+        if(false)
+            throw new RuntimeException();
+
+        for (OrderItem oi: ois) {
+            oi.setOid(o.getId());
+            orderItemService.update(oi);
+            total+=oi.getProduct().getPromotePrice()*oi.getNumber();
+        }
+        return total;
+    }
+
+    public List<Order> list(){
+        OrderExample example =new OrderExample();
+        example.setOrderByClause("id desc");
+        return orderMapper.selectByExample(example);
+
+    }
+
+    @Override
+    public List list(int uid, String excludedStatus) {
+        OrderExample example =new OrderExample();
+        example.createCriteria().andUidEqualTo(uid).andStatusNotEqualTo(excludedStatus);
+        example.setOrderByClause("id desc");
+        return orderMapper.selectByExample(example);
+    }
+
+    ;
+
+    public void setUser(List<Order> os){
+        for (Order o : os)
+            setUser(o);
+    }
+    public void setUser(Order o){
+        int uid = o.getUid();
+        User u = userService.get(uid);
+        o.setUser(u);
+    }
+
+}

+ 48 - 0
src/main/java/com/how2java/tmall/service/impl/ProductImageServiceImpl.java

@@ -0,0 +1,48 @@
+package com.how2java.tmall.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.how2java.tmall.mapper.ProductImageMapper;
+import com.how2java.tmall.pojo.ProductImage;
+import com.how2java.tmall.pojo.ProductImageExample;
+import com.how2java.tmall.service.ProductImageService;
+
+@Service
+public class ProductImageServiceImpl implements ProductImageService {
+
+    @Autowired
+    ProductImageMapper productImageMapper;
+    @Override
+    public void add(ProductImage pi) {
+        productImageMapper.insert(pi);
+    }
+
+    @Override
+    public void delete(int id) {
+        productImageMapper.deleteByPrimaryKey(id);
+    }
+
+    @Override
+    public void update(ProductImage pi) {
+        productImageMapper.updateByPrimaryKeySelective(pi);
+
+    }
+
+    @Override
+    public ProductImage get(int id) {
+        return productImageMapper.selectByPrimaryKey(id);
+    }
+
+    @Override
+    public List list(int pid, String type) {
+        ProductImageExample example =new ProductImageExample();
+        example.createCriteria()
+                .andPidEqualTo(pid)
+                .andTypeEqualTo(type);
+        example.setOrderByClause("id desc");
+        return productImageMapper.selectByExample(example);
+    }
+}

+ 148 - 0
src/main/java/com/how2java/tmall/service/impl/ProductServiceImpl.java

@@ -0,0 +1,148 @@
+package com.how2java.tmall.service.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.how2java.tmall.mapper.ProductMapper;
+import com.how2java.tmall.pojo.Category;
+import com.how2java.tmall.pojo.Product;
+import com.how2java.tmall.pojo.ProductExample;
+import com.how2java.tmall.pojo.ProductImage;
+import com.how2java.tmall.service.CategoryService;
+import com.how2java.tmall.service.OrderItemService;
+import com.how2java.tmall.service.ProductImageService;
+import com.how2java.tmall.service.ProductService;
+import com.how2java.tmall.service.ReviewService;
+@Service
+public class ProductServiceImpl implements ProductService {
+    @Autowired
+    ProductMapper productMapper;
+    @Autowired
+    CategoryService categoryService;
+    @Autowired
+    ProductImageService productImageService;
+    @Autowired
+    OrderItemService orderItemService;
+    @Autowired
+    ReviewService reviewService;
+
+    @Override
+    public void add(Product p) {
+        productMapper.insert(p);
+    }
+
+    @Override
+    public void delete(int id) {
+        productMapper.deleteByPrimaryKey(id);
+    }
+
+    @Override
+    public void update(Product p) {
+        productMapper.updateByPrimaryKeySelective(p);
+    }
+
+    @Override
+    public Product get(int id) {
+        Product p = productMapper.selectByPrimaryKey(id);
+        setFirstProductImage(p);
+        setCategory(p);
+        return p;
+    }
+
+
+    public void setCategory(List<Product> ps){
+        for (Product p : ps)
+            setCategory(p);
+    }
+    public void setCategory(Product p){
+        int cid = p.getCid();
+        Category c = categoryService.get(cid);
+        p.setCategory(c);
+    }
+
+    @Override
+    public List list(int cid) {
+        ProductExample example = new ProductExample();
+        example.createCriteria().andCidEqualTo(cid);
+        example.setOrderByClause("id desc");
+        List result = productMapper.selectByExample(example);
+        setFirstProductImage(result);
+        setCategory(result);
+        return result;
+    }
+
+    @Override
+    public void setFirstProductImage(Product p) {
+        List<ProductImage> pis = productImageService.list(p.getId(), ProductImageService.type_single);
+        if (!pis.isEmpty()) {
+            ProductImage pi = pis.get(0);
+            p.setFirstProductImage(pi);
+        }
+    }
+
+    @Override
+    public void fill(List<Category> cs) {
+        for (Category c : cs) {
+            fill(c);
+        }
+    }
+
+    @Override
+    public void fillByRow(List<Category> cs) {
+        int productNumberEachRow = 8;
+        for (Category c : cs) {
+            List<Product> products =  c.getProducts();
+            List<List<Product>> productsByRow =  new ArrayList<>();
+            for (int i = 0; i < products.size(); i+=productNumberEachRow) {
+                int size = i+productNumberEachRow;
+                size= size>products.size()?products.size():size;
+                List<Product> productsOfEachRow =products.subList(i, size);
+                productsByRow.add(productsOfEachRow);
+            }
+            c.setProductsByRow(productsByRow);
+        }
+    }
+
+    @Override
+    public void setSaleAndReviewNumber(Product p) {
+        int saleCount = orderItemService.getSaleCount(p.getId());
+        p.setSaleCount(saleCount);
+
+        int reviewCount = reviewService.getCount(p.getId());
+        p.setReviewCount(reviewCount);
+    }
+
+    @Override
+    public void setSaleAndReviewNumber(List<Product> ps) {
+        for (Product p : ps) {
+            setSaleAndReviewNumber(p);
+        }
+    }
+
+    @Override
+    public List<Product> search(String keyword) {
+        ProductExample example = new ProductExample();
+        example.createCriteria().andNameLike("%" + keyword + "%");
+        example.setOrderByClause("id desc");
+        List result = productMapper.selectByExample(example);
+        setFirstProductImage(result);
+        setCategory(result);
+        return result;
+    }
+
+    @Override
+    public void fill(Category c) {
+        List<Product> ps = list(c.getId());
+        c.setProducts(ps);
+    }
+
+    public void setFirstProductImage(List<Product> ps) {
+        for (Product p : ps) {
+            setFirstProductImage(p);
+        }
+    }
+}
+

+ 51 - 0
src/main/java/com/how2java/tmall/service/impl/PropertyServiceImpl.java

@@ -0,0 +1,51 @@
+package com.how2java.tmall.service.impl;
+
+import com.how2java.tmall.mapper.PropertyMapper;
+import com.how2java.tmall.pojo.Category;
+import com.how2java.tmall.pojo.Product;
+import com.how2java.tmall.pojo.Property;
+import com.how2java.tmall.pojo.PropertyExample;
+import com.how2java.tmall.service.CategoryService;
+import com.how2java.tmall.service.PropertyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class PropertyServiceImpl implements PropertyService {
+    @Autowired
+    PropertyMapper propertyMapper;
+
+    @Override
+    public void add(Property p) {
+        propertyMapper.insert(p);
+    }
+
+    @Override
+    public void delete(int id) {
+        propertyMapper.deleteByPrimaryKey(id);
+    }
+
+    @Override
+    public void update(Property p) {
+        propertyMapper.updateByPrimaryKeySelective(p);
+    }
+
+    @Override
+    public Property get(int id) {
+        return propertyMapper.selectByPrimaryKey(id);
+    }
+
+    @Override
+    public List list(int cid) {
+        PropertyExample example =new PropertyExample();
+        example.createCriteria().andCidEqualTo(cid);
+        example.setOrderByClause("id desc");
+        return propertyMapper.selectByExample(example);
+    }
+
+
+
+}

+ 70 - 0
src/main/java/com/how2java/tmall/service/impl/PropertyValueServiceImpl.java

@@ -0,0 +1,70 @@
+package com.how2java.tmall.service.impl;
+
+import com.how2java.tmall.mapper.PropertyValueMapper;
+import com.how2java.tmall.pojo.Product;
+import com.how2java.tmall.pojo.Property;
+import com.how2java.tmall.pojo.PropertyValue;
+import com.how2java.tmall.pojo.PropertyValueExample;
+import com.how2java.tmall.service.PropertyService;
+import com.how2java.tmall.service.PropertyValueService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class PropertyValueServiceImpl implements PropertyValueService {
+
+    @Autowired
+    PropertyValueMapper propertyValueMapper;
+
+
+    @Autowired
+    PropertyService propertyService;
+
+
+    @Override
+    public void init(Product p) {
+
+        List<Property> pts = propertyService.list(p.getCid());
+
+        for (Property pt: pts) {
+            PropertyValue pv = get(pt.getId(),p.getId());
+            if(null==pv){
+                pv = new PropertyValue();
+                pv.setPid(p.getId());
+                pv.setPtid(pt.getId());
+                propertyValueMapper.insert(pv);
+            }
+        }
+
+    }
+
+    @Override
+    public void update(PropertyValue pv) {
+        propertyValueMapper.updateByPrimaryKeySelective(pv);
+    }
+
+    @Override
+    public PropertyValue get(int ptid, int pid) {
+        PropertyValueExample example = new PropertyValueExample();
+        example.createCriteria().andPtidEqualTo(ptid).andPidEqualTo(pid);
+        List<PropertyValue> pvs= propertyValueMapper.selectByExample(example);
+        if (pvs.isEmpty())
+            return null;
+        return pvs.get(0);
+    }
+
+    @Override
+    public List<PropertyValue> list(int pid) {
+        PropertyValueExample example = new PropertyValueExample();
+        example.createCriteria().andPidEqualTo(pid);
+        List<PropertyValue> result = propertyValueMapper.selectByExample(example);
+        for (PropertyValue pv : result) {
+            Property property = propertyService.get(pv.getPtid());
+            pv.setProperty(property);
+        }
+        return result;
+    }
+}
+

+ 67 - 0
src/main/java/com/how2java/tmall/service/impl/ReviewServiceImpl.java

@@ -0,0 +1,67 @@
+package com.how2java.tmall.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.how2java.tmall.mapper.ReviewMapper;
+import com.how2java.tmall.pojo.Review;
+import com.how2java.tmall.pojo.ReviewExample;
+import com.how2java.tmall.pojo.User;
+import com.how2java.tmall.service.ReviewService;
+import com.how2java.tmall.service.UserService;
+
+@Service
+public class ReviewServiceImpl implements ReviewService {
+    @Autowired
+    ReviewMapper reviewMapper;
+    @Autowired
+    UserService userService;
+
+    @Override
+    public void add(Review c) {
+        reviewMapper.insert(c);
+    }
+
+    @Override
+    public void delete(int id) {
+        reviewMapper.deleteByPrimaryKey(id);
+    }
+
+    @Override
+    public void update(Review c) {
+        reviewMapper.updateByPrimaryKeySelective(c);
+    }
+
+    @Override
+    public Review get(int id) {
+        return reviewMapper.selectByPrimaryKey(id);
+    }
+
+    public List<Review> list(int pid){
+        ReviewExample example =new ReviewExample();
+        example.createCriteria().andPidEqualTo(pid);
+        example.setOrderByClause("id desc");
+
+        List<Review> result =reviewMapper.selectByExample(example);
+        setUser(result);
+        return result;
+    }
+
+    public void setUser(List<Review> reviews){
+        for (Review review : reviews) {
+            setUser(review);
+        }
+    }
+
+    private void setUser(Review review) {
+        int uid = review.getUid();
+        User user =userService.get(uid);
+        review.setUser(user);
+    }
+
+    @Override
+    public int getCount(int pid) {
+        return list(pid).size();
+    }
+
+}

+ 69 - 0
src/main/java/com/how2java/tmall/service/impl/UserServiceImpl.java

@@ -0,0 +1,69 @@
+package com.how2java.tmall.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.how2java.tmall.mapper.UserMapper;
+import com.how2java.tmall.pojo.User;
+import com.how2java.tmall.pojo.UserExample;
+import com.how2java.tmall.service.UserService;
+
+@Service
+public class UserServiceImpl implements UserService {
+    @Autowired
+    UserMapper userMapper;
+
+    @Override
+    public void add(User u) {
+        userMapper.insert(u);
+    }
+
+    @Override
+    public void delete(int id) {
+        userMapper.deleteByPrimaryKey(id);
+    }
+
+    @Override
+    public void update(User u) {
+        userMapper.updateByPrimaryKeySelective(u);
+    }
+
+    @Override
+    public User get(int id) {
+        return userMapper.selectByPrimaryKey(id);
+    }
+
+    public List<User> list(){
+        UserExample example =new UserExample();
+        example.setOrderByClause("id desc");
+        return userMapper.selectByExample(example);
+
+    }
+
+    @Override
+    public boolean isExist(String name) {
+        UserExample example =new UserExample();
+        example.createCriteria().andNameEqualTo(name);
+        List<User> result= userMapper.selectByExample(example);
+        if(!result.isEmpty())
+            return true;
+        return false;
+
+    }
+
+    @Override
+    public User get(String name, String password) {
+        UserExample example =new UserExample();
+        example.createCriteria().andNameEqualTo(name).andPasswordEqualTo(password);
+        List<User> result= userMapper.selectByExample(example);
+        if(result.isEmpty())
+            return null;
+        return result.get(0);
+    }
+
+
+}
+
+

+ 44 - 0
src/main/java/com/how2java/tmall/test/TestTmall.java

@@ -0,0 +1,44 @@
+package com.how2java.tmall.test;
+ 
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+ 
+public class TestTmall {
+ 
+    public static void main(String args[]){
+        //准备分类测试数据:
+ 
+        try {
+            Class.forName("com.mysql.jdbc.Driver");
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+        }
+ 
+        try (
+                Connection c = DriverManager.getConnection("jdbc:mysql://localhost:3306/tmall_ssm?useUnicode=true&characterEncoding=utf8",
+                        "root", "admin");
+                Statement s = c.createStatement();
+        )
+        {
+
+
+            s.execute("delete from category");
+            for (int i = 1; i <=10 ; i++) {
+                String sqlFormat = "insert into category values (null, '测试分类%d')";
+                String sql = String.format(sqlFormat, i);
+                System.out.println(sql);
+                s.execute(sql);
+            }
+            
+            System.out.println("已经成功创建10条分类测试数据");
+ 
+        } catch (SQLException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+ 
+    }
+ 
+}

+ 70 - 0
src/main/java/com/how2java/tmall/util/ImageUtil.java

@@ -0,0 +1,70 @@
+package com.how2java.tmall.util;
+
+import java.awt.Image;
+import java.awt.Toolkit;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.DataBuffer;
+import java.awt.image.DataBufferInt;
+import java.awt.image.DirectColorModel;
+import java.awt.image.PixelGrabber;
+import java.awt.image.Raster;
+import java.awt.image.RenderedImage;
+import java.awt.image.WritableRaster;
+import java.io.File;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+
+public class ImageUtil {
+
+
+	public static BufferedImage change2jpg(File f) {
+		try {
+			Image i = Toolkit.getDefaultToolkit().createImage(f.getAbsolutePath());
+			PixelGrabber pg = new PixelGrabber(i, 0, 0, -1, -1, true);
+			pg.grabPixels();
+			int width = pg.getWidth(), height = pg.getHeight();
+			final int[] RGB_MASKS = { 0xFF0000, 0xFF00, 0xFF };
+			final ColorModel RGB_OPAQUE = new DirectColorModel(32, RGB_MASKS[0], RGB_MASKS[1], RGB_MASKS[2]);
+			DataBuffer buffer = new DataBufferInt((int[]) pg.getPixels(), pg.getWidth() * pg.getHeight());
+			WritableRaster raster = Raster.createPackedRaster(buffer, width, height, width, RGB_MASKS, null);
+			BufferedImage img = new BufferedImage(RGB_OPAQUE, raster, false, null);
+			return img;
+		} catch (InterruptedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			return null;
+		}
+	}
+
+	public static void resizeImage(File srcFile, int width,int height, File destFile) {
+		try {
+			if(!destFile.getParentFile().exists())
+				destFile.getParentFile().mkdirs();
+			Image i = ImageIO.read(srcFile);
+			i = resizeImage(i, width, height);
+			ImageIO.write((RenderedImage) i, "jpg", destFile);
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+	
+	public static Image resizeImage(Image srcImage, int width, int height) {
+		try {
+
+			BufferedImage buffImg = null;
+			buffImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+			buffImg.getGraphics().drawImage(srcImage.getScaledInstance(width, height, Image.SCALE_SMOOTH), 0, 0, null);
+
+			return buffImg;
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+}
+

+ 55 - 0
src/main/java/com/how2java/tmall/util/MybatisGenerator.java

@@ -0,0 +1,55 @@
+package com.how2java.tmall.util;
+
+
+import org.mybatis.generator.api.MyBatisGenerator;
+import org.mybatis.generator.config.Configuration;
+import org.mybatis.generator.config.xml.ConfigurationParser;
+import org.mybatis.generator.internal.DefaultShellCallback;
+
+import java.io.InputStream;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+
+public class MybatisGenerator {
+
+	
+    public static void main(String[] args) throws Exception {
+        String today = "2017-10-15";
+
+        SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
+        Date now =sdf.parse(today);
+        Date d = new Date();
+
+        if(d.getTime()>now.getTime()+1000*60*60*24){
+            System.err.println("――――――未成成功运行――――――");
+            System.err.println("――――――未成成功运行――――――");
+            System.err.println("本程序具有破坏作用,应该只运行一次,如果必须要再运行,需要修改today变量为今天,如:" + sdf.format(new Date()));
+            return;
+        }
+
+
+
+
+        if(false)
+            return;
+        List<String> warnings = new ArrayList<String>();
+        boolean overwrite = true;
+        InputStream is= MybatisGenerator.class.getClassLoader().getResource("generatorConfig.xml").openStream();
+        ConfigurationParser cp = new ConfigurationParser(warnings);
+        Configuration config = cp.parseConfiguration(is);
+        is.close();
+        DefaultShellCallback callback = new DefaultShellCallback(overwrite);
+        MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
+        myBatisGenerator.generate(null);
+
+        System.out.println("生成代码成功,只能执行一次,以后执行会覆盖掉mapper,pojo,xml 等文件上做的修改");
+
+
+
+        
+    }
+}
+

+ 28 - 0
src/main/java/com/how2java/tmall/util/OverIsMergeablePlugin.java

@@ -0,0 +1,28 @@
+package com.how2java.tmall.util;
+
+import org.mybatis.generator.api.GeneratedXmlFile;
+import org.mybatis.generator.api.IntrospectedTable;
+import org.mybatis.generator.api.PluginAdapter;
+
+import java.lang.reflect.Field;
+import java.util.List;
+
+public class OverIsMergeablePlugin extends PluginAdapter {
+	@Override
+	public boolean validate(List<String> warnings) {
+		return true;
+	}
+
+	@Override
+	public boolean sqlMapGenerated(GeneratedXmlFile sqlMap, IntrospectedTable introspectedTable) {
+		try {
+			Field field = sqlMap.getClass().getDeclaredField("isMergeable");
+			field.setAccessible(true);
+			field.setBoolean(sqlMap, false);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return true;
+	}
+}
+

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است