Ver código fonte

吉林省云同步数据

tchao 3 anos atrás
commit
23dc23e825
46 arquivos alterados com 5544 adições e 0 exclusões
  1. 14 0
      .gitignore
  2. 170 0
      pom.xml
  3. 43 0
      src/main/java/tk/mybatis/springboot/Application.java
  4. 13 0
      src/main/java/tk/mybatis/springboot/SpringBootStartApplication.java
  5. 42 0
      src/main/java/tk/mybatis/springboot/conf/WebMvcConfig.java
  6. 65 0
      src/main/java/tk/mybatis/springboot/controller/ApiController.java
  7. 59 0
      src/main/java/tk/mybatis/springboot/controller/CityController.java
  8. 94 0
      src/main/java/tk/mybatis/springboot/controller/CountryController.java
  9. 86 0
      src/main/java/tk/mybatis/springboot/controller/UserInfoController.java
  10. 42 0
      src/main/java/tk/mybatis/springboot/mapper/CityMapper.java
  11. 35 0
      src/main/java/tk/mybatis/springboot/mapper/CountryMapper.java
  12. 35 0
      src/main/java/tk/mybatis/springboot/mapper/UserInfoMapper.java
  13. 42 0
      src/main/java/tk/mybatis/springboot/mapper/Wcmivtable57Mapper.java
  14. 70 0
      src/main/java/tk/mybatis/springboot/model/BaseEntity.java
  15. 34 0
      src/main/java/tk/mybatis/springboot/model/Bmfw.java
  16. 64 0
      src/main/java/tk/mybatis/springboot/model/City.java
  17. 74 0
      src/main/java/tk/mybatis/springboot/model/Country.java
  18. 31 0
      src/main/java/tk/mybatis/springboot/model/Document.java
  19. 28 0
      src/main/java/tk/mybatis/springboot/model/Page.java
  20. 61 0
      src/main/java/tk/mybatis/springboot/model/Szxxcs.java
  21. 97 0
      src/main/java/tk/mybatis/springboot/model/UserInfo.java
  22. 258 0
      src/main/java/tk/mybatis/springboot/model/Wcmivtable57.java
  23. 89 0
      src/main/java/tk/mybatis/springboot/service/ApiService.java
  24. 69 0
      src/main/java/tk/mybatis/springboot/service/CityService.java
  25. 93 0
      src/main/java/tk/mybatis/springboot/service/CountryService.java
  26. 67 0
      src/main/java/tk/mybatis/springboot/service/UserInfoService.java
  27. 39 0
      src/main/java/tk/mybatis/springboot/util/MyMapper.java
  28. 14 0
      src/main/resources/application-dev.properties
  29. 42 0
      src/main/resources/application-old.yml
  30. 11 0
      src/main/resources/application-production.properties
  31. 20 0
      src/main/resources/application.properties
  32. 9 0
      src/main/resources/banner.txt
  33. 37 0
      src/main/resources/generator/generatorConfig.xml
  34. 34 0
      src/main/resources/mapper/CityMapper.xml
  35. 29 0
      src/main/resources/mapper/CountryMapper.xml
  36. 57 0
      src/main/resources/mapper/Wcmivtable57Mapper.xml
  37. 88 0
      src/main/resources/static/css/style.css
  38. 2653 0
      src/main/resources/static/js/jquery-1.11.1.min.js
  39. 178 0
      src/main/resources/templates/index.ftl
  40. 30 0
      src/main/resources/templates/view.ftl
  41. 226 0
      src/main/resources/test.sql
  42. 77 0
      src/test/java/tk/mybatis/springboot/mapper/MyBatis331Mapper.java
  43. 92 0
      src/test/java/tk/mybatis/springboot/mapper/MyBatis331Test.java
  44. 18 0
      src/test/java/tk/mybatis/springboot/mapper/city.sql
  45. 80 0
      src/test/java/tk/mybatis/springboot/model/City2.java
  46. 35 0
      src/test/java/tk/mybatis/springboot/test/CountryServiceTest.java

+ 14 - 0
.gitignore

@@ -0,0 +1,14 @@
+# Maven #
+target/
+
+# IDEA #
+.idea/
+*.iml
+
+# Eclipse #
+.settings/
+.classpath
+.project
+
+# jrebel #
+src/main/resources/rebel.xml

+ 170 - 0
pom.xml

@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         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>tk.mybatis</groupId>
+    <artifactId>mybatis-spring-boot</artifactId>
+    <packaging>war</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.3.0.RELEASE</version>
+    </parent>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <mybatis.spring.version>1.2.4</mybatis.spring.version>
+        <mapper.starter.version>2.0.3-beta1</mapper.starter.version>
+        <pagehelper.starter.version>1.2.5</pagehelper.starter.version>
+    </properties>
+
+    <dependencies>
+
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-jdbc</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-freemarker</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>commons-collections</groupId>
+            <artifactId>commons-collections</artifactId>
+            <version>3.2.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.oracle</groupId>
+            <artifactId>ojdbc6</artifactId>
+            <version>11.2.0.3</version>
+        </dependency>
+        <!--<dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>-->
+
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.datatype</groupId>
+            <artifactId>jackson-datatype-joda</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.module</groupId>
+            <artifactId>jackson-module-parameter-names</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>1.3.1</version>
+        </dependency>
+
+        <!--mapper-->
+        <dependency>
+            <groupId>tk.mybatis</groupId>
+            <artifactId>mapper-spring-boot-starter</artifactId>
+            <version>${mapper.starter.version}</version>
+        </dependency>
+        <!--pagehelper-->
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+            <version>${pagehelper.starter.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.mybatis.spring.boot</groupId>
+                    <artifactId>mybatis-spring-boot-starter</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.1.9</version>
+        </dependency>
+        <!--<dependency>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-validator</artifactId>
+            <version>5.3.5.Final</version>
+        </dependency>-->
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.springframework</groupId>
+                        <artifactId>springloaded</artifactId>
+                        <version>1.2.5.RELEASE</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+            <plugin>
+                <groupId>org.mybatis.generator</groupId>
+                <artifactId>mybatis-generator-maven-plugin</artifactId>
+                <version>1.3.2</version>
+                <configuration>
+                    <configurationFile>${basedir}/src/main/resources/generator/generatorConfig.xml</configurationFile>
+                    <overwrite>true</overwrite>
+                    <verbose>true</verbose>
+                </configuration>
+                <dependencies>
+                    <!--<dependency>
+                        <groupId>mysql</groupId>
+                        <artifactId>mysql-connector-java</artifactId>
+                        <version>${mysql.version}</version>
+                    </dependency>-->
+                    <dependency>
+                        <groupId>tk.mybatis</groupId>
+                        <artifactId>mapper-generator</artifactId>
+                        <version>1.0.0</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 43 - 0
src/main/java/tk/mybatis/springboot/Application.java

@@ -0,0 +1,43 @@
+package tk.mybatis.springboot;
+
+//特别注意,下面的是 tk.MapperScan
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+import tk.mybatis.spring.annotation.MapperScan;
+
+/**
+ * @author liuzh
+ * @since 2015-12-12 18:22
+ */
+@Controller
+@EnableWebMvc
+@SpringBootApplication
+@MapperScan(basePackages = "tk.mybatis.springboot.mapper")
+/*@ComponentScan(basePackages = "tk.mybatis.springboot.mapper")*/
+public class Application extends WebMvcConfigurerAdapter implements CommandLineRunner {
+    private Logger logger = LoggerFactory.getLogger(Application.class);
+
+    public static void main(String[] args) {
+        SpringApplication.run(Application.class, args);
+    }
+
+    @Override
+    public void run(String... args) throws Exception {
+        logger.info("服务启动完成!");
+    }
+
+    @RequestMapping("/")
+    String home() {
+        return "redirect:countries";
+    }
+}

+ 13 - 0
src/main/java/tk/mybatis/springboot/SpringBootStartApplication.java

@@ -0,0 +1,13 @@
+package tk.mybatis.springboot;
+
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+
+public class SpringBootStartApplication  extends SpringBootServletInitializer {
+
+    @Override
+    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
+        // 注意这里要指向原先用main方法执行的Application启动类
+        return builder.sources(Application.class);
+    }
+}

+ 42 - 0
src/main/java/tk/mybatis/springboot/conf/WebMvcConfig.java

@@ -0,0 +1,42 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.conf;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+
+/**
+ * @author liuzh
+ * @since 2015-12-19 16:16
+ */
+@Configuration
+public class WebMvcConfig extends WebMvcConfigurerAdapter {
+
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
+    }
+}

+ 65 - 0
src/main/java/tk/mybatis/springboot/controller/ApiController.java

@@ -0,0 +1,65 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.controller;
+
+import tk.mybatis.springboot.model.Bmfw;
+import  tk.mybatis.springboot.model.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.*;
+import tk.mybatis.springboot.model.Szxxcs;
+import tk.mybatis.springboot.service.ApiService;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author liuzh
+ * @since 2015-12-19 11:10
+ */
+@RestController
+@RequestMapping("/api")
+public class ApiController {
+
+    @Autowired
+    private ApiService apiService;
+    @RequestMapping(value = "/interactive")
+    public Page<Szxxcs> interactive(@RequestBody Map<String, String> params) {
+        String userId = (String)params.get("userId");
+        if(!StringUtils.isEmpty(userId)) {
+            Integer pageNo = this.getValue(params, "pageNo", 1);
+            Integer pageSize = this.getValue(params, "pageSize", 10);
+            Page<Szxxcs> result = apiService.interactive(userId, pageNo, pageSize);
+            return result;
+        }else{
+            return null;
+        }
+    }
+    private Integer getValue(Map<String, String> params, String key, Integer defaultValue) {
+        String val = (String)params.get(key);
+        return StringUtils.isEmpty(val) ? defaultValue : Integer.parseInt(val);
+    }
+
+}

+ 59 - 0
src/main/java/tk/mybatis/springboot/controller/CityController.java

@@ -0,0 +1,59 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.controller;
+
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+import tk.mybatis.springboot.model.Bmfw;
+import tk.mybatis.springboot.model.City;
+import tk.mybatis.springboot.service.CityService;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author liuzh
+ * @since 2015-12-19 11:10
+ */
+@RestController
+@RequestMapping("/cities")
+public class CityController {
+
+    @Autowired
+    private CityService cityService;
+
+
+    @RequestMapping(value = "/queryConvenienceServices")
+    public List<Bmfw> queryConvenienceServices(@RequestBody Map<String, String> params) {
+        List<Bmfw> result = cityService.interactive();
+        return result;
+
+    }
+}

+ 94 - 0
src/main/java/tk/mybatis/springboot/controller/CountryController.java

@@ -0,0 +1,94 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.controller;
+
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+import tk.mybatis.springboot.model.Country;
+import tk.mybatis.springboot.service.CountryService;
+
+import java.util.List;
+
+/**
+ * @author liuzh
+ * @since 2015-12-19 11:10
+ */
+@Controller
+@RequestMapping("/countries")
+public class CountryController {
+
+    @Autowired
+    private CountryService countryService;
+
+    @RequestMapping
+    public ModelAndView getAll(Country country) {
+        ModelAndView result = new ModelAndView("index");
+        List<Country> countryList = countryService.getAllByWeekend(country);
+        result.addObject("pageInfo", new PageInfo<Country>(countryList));
+        result.addObject("queryParam", country);
+        result.addObject("page", country.getPage());
+        result.addObject("rows", country.getRows());
+        return result;
+    }
+
+    @RequestMapping(value = "/add")
+    public ModelAndView add() {
+        ModelAndView result = new ModelAndView("view");
+        result.addObject("country", new Country());
+        return result;
+    }
+
+    @RequestMapping(value = "/view/{id}")
+    public ModelAndView view(@PathVariable Integer id) {
+        ModelAndView result = new ModelAndView("view");
+        Country country = countryService.getById(id);
+        result.addObject("country", country);
+        return result;
+    }
+
+    @RequestMapping(value = "/delete/{id}")
+    public ModelAndView delete(@PathVariable Integer id, RedirectAttributes ra) {
+        ModelAndView result = new ModelAndView("redirect:/countries");
+        countryService.deleteById(id);
+        ra.addFlashAttribute("msg", "删除成功!");
+        return result;
+    }
+
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public ModelAndView save(Country country) {
+        ModelAndView result = new ModelAndView("view");
+        String msg = country.getId() == null ? "新增成功!" : "更新成功!";
+        countryService.save(country);
+        result.addObject("country", country);
+        result.addObject("msg", msg);
+        return result;
+    }
+}

+ 86 - 0
src/main/java/tk/mybatis/springboot/controller/UserInfoController.java

@@ -0,0 +1,86 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.controller;
+
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.servlet.ModelAndView;
+import tk.mybatis.springboot.model.UserInfo;
+import tk.mybatis.springboot.service.UserInfoService;
+
+import java.util.List;
+
+/**
+ * @author liuzh
+ * @since 2015-12-19 11:10
+ */
+@RestController
+@RequestMapping("/users")
+public class UserInfoController {
+
+    @Autowired
+    private UserInfoService userInfoService;
+
+    @RequestMapping
+    public PageInfo<UserInfo> getAll(UserInfo userInfo) {
+        List<UserInfo> userInfoList = userInfoService.getAll(userInfo);
+        return new PageInfo<UserInfo>(userInfoList);
+    }
+
+    @RequestMapping(value = "/add")
+    public UserInfo add() {
+        return new UserInfo();
+    }
+
+    @RequestMapping(value = "/view/{id}")
+    public UserInfo view(@PathVariable Integer id) {
+        ModelAndView result = new ModelAndView();
+        UserInfo userInfo = userInfoService.getById(id);
+        return userInfo;
+    }
+
+    @RequestMapping(value = "/delete/{id}")
+    public ModelMap delete(@PathVariable Integer id) {
+        ModelMap result = new ModelMap();
+        userInfoService.deleteById(id);
+        result.put("msg", "删除成功!");
+        return result;
+    }
+
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public ModelMap save(UserInfo userInfo) {
+        ModelMap result = new ModelMap();
+        String msg = userInfo.getId() == null ? "新增成功!" : "更新成功!";
+        userInfoService.save(userInfo);
+        result.put("userInfo", userInfo);
+        result.put("msg", msg);
+        return result;
+    }
+}

+ 42 - 0
src/main/java/tk/mybatis/springboot/mapper/CityMapper.java

@@ -0,0 +1,42 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.mapper;
+
+import org.apache.ibatis.annotations.ResultMap;
+import org.apache.ibatis.annotations.Select;
+import tk.mybatis.springboot.model.City;
+import tk.mybatis.springboot.util.MyMapper;
+
+import java.util.List;
+
+/**
+ * @author liuzh_3nofxnp
+ * @since 2016-01-22 22:17
+ */
+public interface CityMapper extends MyMapper<City> {
+    @Select("select * from wcmbmfw")
+    @ResultMap("BaseResultMap")
+    List<City> selectAllrides();
+}

+ 35 - 0
src/main/java/tk/mybatis/springboot/mapper/CountryMapper.java

@@ -0,0 +1,35 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.mapper;
+
+import org.apache.ibatis.annotations.Select;
+import tk.mybatis.springboot.model.Country;
+import tk.mybatis.springboot.util.MyMapper;
+
+public interface CountryMapper extends MyMapper<Country> {
+
+    @Select("select * from country limit 1")
+    Country findOne();
+}

+ 35 - 0
src/main/java/tk/mybatis/springboot/mapper/UserInfoMapper.java

@@ -0,0 +1,35 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.mapper;
+
+import tk.mybatis.springboot.model.UserInfo;
+import tk.mybatis.springboot.util.MyMapper;
+
+/**
+ * @author liuzh_3nofxnp
+ * @since 2016-01-22 22:17
+ */
+public interface UserInfoMapper extends MyMapper<UserInfo> {
+}

+ 42 - 0
src/main/java/tk/mybatis/springboot/mapper/Wcmivtable57Mapper.java

@@ -0,0 +1,42 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.mapper;
+
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.ResultMap;
+import org.apache.ibatis.annotations.Select;
+import tk.mybatis.springboot.model.Wcmivtable57;
+import tk.mybatis.springboot.util.MyMapper;
+
+import java.util.List;
+import java.util.Map;
+
+public interface Wcmivtable57Mapper extends MyMapper<Wcmivtable57> {
+    @Select("select * from (select rownum r, b.biao_ti ,b.nei_rong ,b.crtime,b.group1__hui_fu_nei_rong ,b.group1__hui_fu_ri_qi ,a.docpuburl  from wcmdocument a,wcmivtable57 b where a.docid=b.documentid and a.docstatus='10' and b.ZU1_USERID=#{UserId} and rownum<=#{pageSize} order by b.wcmivtable57id) where r>=#{pageNo}")
+    @ResultMap("BaseResultMap")
+    List<Wcmivtable57> selectAllrides(@Param("UserId")String UserId,@Param("pageNo")Integer pageNo, @Param("pageSize") Integer pageSize);
+
+    List<Map> selectAllmax(@Param("UserId")String UserId);
+}

+ 70 - 0
src/main/java/tk/mybatis/springboot/model/BaseEntity.java

@@ -0,0 +1,70 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.model;
+
+import javax.persistence.*;
+
+/**
+ * 基础信息
+ *
+ * @author liuzh
+ * @since 2016-01-31 21:42
+ */
+public class BaseEntity {
+    @Id
+    @Column(name = "Id")
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    @Transient
+    private Integer page = 1;
+
+    @Transient
+    private Integer rows = 10;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getPage() {
+        return page;
+    }
+
+    public void setPage(Integer page) {
+        this.page = page;
+    }
+
+    public Integer getRows() {
+        return rows;
+    }
+
+    public void setRows(Integer rows) {
+        this.rows = rows;
+    }
+}

+ 34 - 0
src/main/java/tk/mybatis/springboot/model/Bmfw.java

@@ -0,0 +1,34 @@
+package tk.mybatis.springboot.model;
+
+import javax.persistence.Table;
+import java.util.Date;
+
+public class Bmfw {
+    private String imgUrl;
+    private String title;
+    private String serviceUrl;
+
+    public String getImgUrl() {
+        return this.imgUrl;
+    }
+
+    public void setImgUrl(String imgUrl) {
+        this.imgUrl = imgUrl;
+    }
+
+    public String getTitle() {
+        return this.title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getServiceUrl() {
+        return this.serviceUrl;
+    }
+
+    public void setServiceUrl(String serviceUrl) {
+        this.serviceUrl = serviceUrl;
+    }
+}

+ 64 - 0
src/main/java/tk/mybatis/springboot/model/City.java

@@ -0,0 +1,64 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.model;
+
+import javax.persistence.Table;
+
+/**
+ * @author liuzh_3nofxnp
+ * @since 2016-01-22 22:16
+ */
+@Table(name = "wcmbmfw")
+public class City extends BaseEntity {
+
+    private String imgurl;
+    private String title;
+    private String serviceurl;
+
+
+    public String getImgurl() {
+        return imgurl;
+    }
+
+    public void setImgurl(String imgurl) {
+        this.imgurl = imgurl;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getServiceurl() {
+        return serviceurl;
+    }
+
+    public void setServiceurl(String serviceurl) {
+        this.serviceurl = serviceurl;
+    }
+}

+ 74 - 0
src/main/java/tk/mybatis/springboot/model/Country.java

@@ -0,0 +1,74 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.model;
+
+public class Country extends BaseEntity {
+    /**
+     * 名称
+     */
+    private String countryname;
+
+    /**
+     * 代码
+     */
+    private String countrycode;
+
+    /**
+     * 获取名称
+     *
+     * @return countryname - 名称
+     */
+    public String getCountryname() {
+        return countryname;
+    }
+
+    /**
+     * 设置名称
+     *
+     * @param countryname 名称
+     */
+    public void setCountryname(String countryname) {
+        this.countryname = countryname;
+    }
+
+    /**
+     * 获取代码
+     *
+     * @return countrycode - 代码
+     */
+    public String getCountrycode() {
+        return countrycode;
+    }
+
+    /**
+     * 设置代码
+     *
+     * @param countrycode 代码
+     */
+    public void setCountrycode(String countrycode) {
+        this.countrycode = countrycode;
+    }
+
+}

+ 31 - 0
src/main/java/tk/mybatis/springboot/model/Document.java

@@ -0,0 +1,31 @@
+package tk.mybatis.springboot.model;
+
+public class Document {
+    private String doctitle;
+    private String docpuburl;
+    private String title;
+
+    public String getDoctitle() {
+        return doctitle;
+    }
+
+    public void setDoctitle(String doctitle) {
+        this.doctitle = doctitle;
+    }
+
+    public String getDocpuburl() {
+        return docpuburl;
+    }
+
+    public void setDocpuburl(String docpuburl) {
+        this.docpuburl = docpuburl;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+}

+ 28 - 0
src/main/java/tk/mybatis/springboot/model/Page.java

@@ -0,0 +1,28 @@
+package tk.mybatis.springboot.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public final class Page<T> {
+    private Long count;
+    private List<T> content = new ArrayList();
+
+    public Page(List<T> list) {
+    }
+
+    public Long getCount() {
+        return this.count;
+    }
+
+    public void setCount(Long count) {
+        this.count = count;
+    }
+
+    public List<T> getContent() {
+        return this.content;
+    }
+
+    public void setContent(List<T> content) {
+        this.content = content;
+    }
+}

+ 61 - 0
src/main/java/tk/mybatis/springboot/model/Szxxcs.java

@@ -0,0 +1,61 @@
+package tk.mybatis.springboot.model;
+
+import java.util.Date;
+
+public class Szxxcs {
+
+    private String title;
+    private String questionContent;
+    private Date questionTime;
+    private String replyContent;
+    private Date replyTime;
+    private String url;
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getQuestionContent() {
+        return questionContent;
+    }
+
+    public void setQuestionContent(String questionContent) {
+        this.questionContent = questionContent;
+    }
+
+    public Date getQuestionTime() {
+        return questionTime;
+    }
+
+    public void setQuestionTime(Date questionTime) {
+        this.questionTime = questionTime;
+    }
+
+    public String getReplyContent() {
+        return replyContent;
+    }
+
+    public void setReplyContent(String replyContent) {
+        this.replyContent = replyContent;
+    }
+
+    public Date getReplyTime() {
+        return replyTime;
+    }
+
+    public void setReplyTime(Date replyTime) {
+        this.replyTime = replyTime;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+}

+ 97 - 0
src/main/java/tk/mybatis/springboot/model/UserInfo.java

@@ -0,0 +1,97 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.model;
+
+/**
+ * 用户信息
+ *
+ * @author liuzh
+ * @since 2016-01-31 21:39
+ */
+public class UserInfo extends BaseEntity {
+    private String username;
+    private String password;
+    private String usertype;
+    private Integer enabled;
+    private String qq;
+    private String email;
+    private String tel;
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getUsertype() {
+        return usertype;
+    }
+
+    public void setUsertype(String usertype) {
+        this.usertype = usertype;
+    }
+
+    public Integer getEnabled() {
+        return enabled;
+    }
+
+    public void setEnabled(Integer enabled) {
+        this.enabled = enabled;
+    }
+
+    public String getQq() {
+        return qq;
+    }
+
+    public void setQq(String qq) {
+        this.qq = qq;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getTel() {
+        return tel;
+    }
+
+    public void setTel(String tel) {
+        this.tel = tel;
+    }
+}

+ 258 - 0
src/main/java/tk/mybatis/springboot/model/Wcmivtable57.java

@@ -0,0 +1,258 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.model;
+
+import javax.persistence.Column;
+import javax.persistence.Table;
+import java.util.Date;
+
+/**
+ *
+ * @since 2016-01-22 22:16
+ */
+@Table(name = "wcmivtable57")
+public class Wcmivtable57 extends BaseEntity {
+
+
+
+
+    private int wcmivtable57id;
+    private int documentid;
+    private int channelid;
+    private int infoviewid;
+    private String cruser;
+    private Date crtime;
+    private String postuser;
+    private String docno;
+    private String randomserial;
+    private String rootelement;
+    private String doctitle;
+    @Column(name = "xing_ming")
+    private String xingming;
+    @Column(name = "zheng_jian_lei_xing")
+    private String zhengjianleixing;
+    @Column(name = "zheng_jian_hao")
+    private String zhengjianhao;
+    @Column(name = "dian_zi_you_xiang")
+    private String dianziyouxiang;
+    @Column(name = "lian_xi_di_zhi")
+    private String lianxidizhi;
+    @Column(name = "dian_hua")
+    private String dianhua;
+    @Column(name = "biao_ti")
+    private String biaoti;
+    @Column(name = "nei_rong")
+    private String neirong;
+    @Column(name = "group1__hui_fu_ren")
+    private String group1huifuren;
+    @Column(name = "group1__hui_fu_ri_qi")
+    private Date group1huifuriqi;
+    @Column(name = "group1__hui_fu_nei_rong")
+    private String group1huifuneirong;
+    private String docpuburl;
+
+    public String getDocpuburl() {
+        return docpuburl;
+    }
+
+    public void setDocpuburl(String docpuburl) {
+        this.docpuburl = docpuburl;
+    }
+
+    public int getWcmivtable57id() {
+        return wcmivtable57id;
+    }
+
+    public void setWcmivtable57id(int wcmivtable57id) {
+        this.wcmivtable57id = wcmivtable57id;
+    }
+    public int getDocumentid() {
+        return documentid;
+    }
+
+    public void setDocumentid(int documentid) {
+        this.documentid = documentid;
+    }
+
+    public int getChannelid() {
+        return channelid;
+    }
+
+    public void setChannelid(int channelid) {
+        this.channelid = channelid;
+    }
+
+    public int getInfoviewid() {
+        return infoviewid;
+    }
+
+    public void setInfoviewid(int infoviewid) {
+        this.infoviewid = infoviewid;
+    }
+
+    public String getCruser() {
+        return cruser;
+    }
+
+    public void setCruser(String cruser) {
+        this.cruser = cruser;
+    }
+
+    public Date getCrtime() {
+        return crtime;
+    }
+
+    public void setCrtime(Date crtime) {
+        this.crtime = crtime;
+    }
+
+    public String getPostuser() {
+        return postuser;
+    }
+
+    public void setPostuser(String postuser) {
+        this.postuser = postuser;
+    }
+
+    public String getDocno() {
+        return docno;
+    }
+
+    public void setDocno(String docno) {
+        this.docno = docno;
+    }
+
+    public String getRandomserial() {
+        return randomserial;
+    }
+
+    public void setRandomserial(String randomserial) {
+        this.randomserial = randomserial;
+    }
+
+    public String getRootelement() {
+        return rootelement;
+    }
+
+    public void setRootelement(String rootelement) {
+        this.rootelement = rootelement;
+    }
+
+    public String getDoctitle() {
+        return doctitle;
+    }
+
+    public void setDoctitle(String doctitle) {
+        this.doctitle = doctitle;
+    }
+
+    public String getXingming() {
+        return xingming;
+    }
+
+    public void setXingming(String xingming) {
+        this.xingming = xingming;
+    }
+
+    public String getZhengjianleixing() {
+        return zhengjianleixing;
+    }
+
+    public void setZhengjianleixing(String zhengjianleixing) {
+        this.zhengjianleixing = zhengjianleixing;
+    }
+
+    public String getZhengjianhao() {
+        return zhengjianhao;
+    }
+
+    public void setZhengjianhao(String zhengjianhao) {
+        this.zhengjianhao = zhengjianhao;
+    }
+
+    public String getDianziyouxiang() {
+        return dianziyouxiang;
+    }
+
+    public void setDianziyouxiang(String dianziyouxiang) {
+        this.dianziyouxiang = dianziyouxiang;
+    }
+
+    public String getLianxidizhi() {
+        return lianxidizhi;
+    }
+
+    public void setLianxidizhi(String lianxidizhi) {
+        this.lianxidizhi = lianxidizhi;
+    }
+
+    public String getDianhua() {
+        return dianhua;
+    }
+
+    public void setDianhua(String dianhua) {
+        this.dianhua = dianhua;
+    }
+
+    public String getBiaoti() {
+        return biaoti;
+    }
+
+    public void setBiaoti(String biaoti) {
+        this.biaoti = biaoti;
+    }
+
+    public String getNeirong() {
+        return neirong;
+    }
+
+    public void setNeirong(String neirong) {
+        this.neirong = neirong;
+    }
+
+    public String getGroup1huifuren() {
+        return group1huifuren;
+    }
+
+    public void setGroup1huifuren(String group1huifuren) {
+        this.group1huifuren = group1huifuren;
+    }
+
+    public Date getGroup1huifuriqi() {
+        return group1huifuriqi;
+    }
+
+    public void setGroup1huifuriqi(Date group1huifuriqi) {
+        this.group1huifuriqi = group1huifuriqi;
+    }
+
+    public String getGroup1huifuneirong() {
+        return group1huifuneirong;
+    }
+
+    public void setGroup1huifuneirong(String group1huifuneirong) {
+        this.group1huifuneirong = group1huifuneirong;
+    }
+}

+ 89 - 0
src/main/java/tk/mybatis/springboot/service/ApiService.java

@@ -0,0 +1,89 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.service;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.apache.commons.collections.MapUtils;
+import org.junit.platform.commons.util.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import tk.mybatis.springboot.mapper.Wcmivtable57Mapper;
+import tk.mybatis.springboot.model.Country;
+import tk.mybatis.springboot.model.Page;
+import tk.mybatis.springboot.model.Szxxcs;
+import tk.mybatis.springboot.model.Wcmivtable57;
+
+import java.util.*;
+
+/**
+ * @author liuzh
+ * @since 2015-12-19 11:09
+ */
+@Service
+public class ApiService {
+
+    @Autowired
+    private Wcmivtable57Mapper wcmivtable57yMapper;
+
+    public Page<Szxxcs> interactive(String UserId, Integer pageNo, Integer pageSize) {
+        List<Map> countList=wcmivtable57yMapper.selectAllmax(UserId);
+        Long count =null;
+        for(int i=0;i<countList.size();i++){
+            Map map1 = (Map)countList.get(i);
+            //int s= MapUtils.getIntValue(map1,"count",0);
+            int  s= MapUtils.getIntValue(map1,"COUNT",0);
+            if(s>0)
+                count= (long)s;
+        }
+        List<Wcmivtable57> wcmlist=wcmivtable57yMapper.selectAllrides(UserId,pageNo,pageSize);
+        List<Szxxcs> szxxcsList=new ArrayList();
+        for(Wcmivtable57 wcm57 : wcmlist){
+
+            String title=wcm57.getBiaoti();
+            String questionContent= wcm57.getNeirong();
+            Date questionTime=wcm57.getCrtime();
+            String replyContent=wcm57.getGroup1huifuneirong();
+            Date replyTime=wcm57.getGroup1huifuriqi();
+            String url=wcm57.getDocpuburl();
+            Szxxcs szxxcs=new Szxxcs();
+            szxxcs.setTitle(title);
+            szxxcs.setQuestionContent(questionContent);
+            szxxcs.setQuestionTime(questionTime);
+            szxxcs.setReplyContent(replyContent);
+            szxxcs.setReplyTime(replyTime);
+            szxxcs.setUrl(url);
+            szxxcsList.add(szxxcs);
+        }
+        Page<Szxxcs> result=new Page<>(szxxcsList);
+        result.setCount(count);
+        result.setContent(szxxcsList);
+        return result;
+    }
+
+
+
+
+}

+ 69 - 0
src/main/java/tk/mybatis/springboot/service/CityService.java

@@ -0,0 +1,69 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.service;
+
+import com.github.pagehelper.PageHelper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import tk.mybatis.springboot.mapper.CityMapper;
+import tk.mybatis.springboot.model.Bmfw;
+import tk.mybatis.springboot.model.City;
+import tk.mybatis.springboot.model.Szxxcs;
+import tk.mybatis.springboot.model.Wcmivtable57;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author liuzh
+ * @since 2015-12-19 11:09
+ */
+@Service
+public class CityService {
+
+    @Autowired
+    private CityMapper cityMapper;
+
+    public List<Bmfw> interactive() {
+        List<City> wcmlist=cityMapper.selectAllrides();
+        List<Bmfw> bmfwList=new ArrayList();
+        for(City wcm : wcmlist){
+
+            String title=wcm.getTitle();
+            String Imgurl= wcm.getImgurl();
+            String Serviceurl= wcm.getServiceurl();
+
+            Bmfw bmfw=new Bmfw();
+            bmfw.setTitle(title);
+            bmfw.setImgUrl(Imgurl);
+            bmfw.setServiceUrl(Serviceurl);
+
+            bmfwList.add(bmfw);
+        }
+        return bmfwList;
+    }
+
+}

+ 93 - 0
src/main/java/tk/mybatis/springboot/service/CountryService.java

@@ -0,0 +1,93 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.service;
+
+import com.github.pagehelper.PageHelper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import tk.mybatis.mapper.entity.Example;
+import tk.mybatis.mapper.weekend.Weekend;
+import tk.mybatis.mapper.weekend.WeekendCriteria;
+import tk.mybatis.springboot.mapper.CountryMapper;
+import tk.mybatis.springboot.model.Country;
+
+import java.util.List;
+
+/**
+ * @author liuzh
+ * @since 2015-12-19 11:09
+ */
+@Service
+public class CountryService {
+
+    @Autowired
+    private CountryMapper countryMapper;
+
+    public List<Country> getAll(Country country) {
+        if (country.getPage() != null && country.getRows() != null) {
+            PageHelper.startPage(country.getPage(), country.getRows());
+        }
+        Example example = new Example(Country.class);
+        Example.Criteria criteria = example.createCriteria();
+        if (country.getCountryname() != null && country.getCountryname().length() > 0) {
+            criteria.andLike("countryname", "%" + country.getCountryname() + "%");
+        }
+        if (country.getCountrycode() != null && country.getCountrycode().length() > 0) {
+            criteria.andLike("countrycode", "%" + country.getCountrycode() + "%");
+        }
+        return countryMapper.selectByExample(example);
+    }
+
+    public List<Country> getAllByWeekend(Country country) {
+        if (country.getPage() != null && country.getRows() != null) {
+            PageHelper.startPage(country.getPage(), country.getRows());
+        }
+        Weekend<Country> weekend = Weekend.of(Country.class);
+        WeekendCriteria<Country, Object> criteria = weekend.weekendCriteria();
+        if (country.getCountryname() != null && country.getCountryname().length() > 0) {
+            criteria.andLike(Country::getCountryname, "%" + country.getCountryname() + "%");
+        }
+        if (country.getCountrycode() != null && country.getCountrycode().length() > 0) {
+            criteria.andLike(Country::getCountrycode, "%" + country.getCountrycode() + "%");
+        }
+        return countryMapper.selectByExample(weekend);
+    }
+
+    public Country getById(Integer id) {
+        return countryMapper.selectByPrimaryKey(id);
+    }
+
+    public void deleteById(Integer id) {
+        countryMapper.deleteByPrimaryKey(id);
+    }
+
+    public void save(Country country) {
+        if (country.getId() != null) {
+            countryMapper.updateByPrimaryKey(country);
+        } else {
+            countryMapper.insert(country);
+        }
+    }
+}

+ 67 - 0
src/main/java/tk/mybatis/springboot/service/UserInfoService.java

@@ -0,0 +1,67 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.service;
+
+import com.github.pagehelper.PageHelper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import tk.mybatis.springboot.mapper.UserInfoMapper;
+import tk.mybatis.springboot.model.UserInfo;
+
+import java.util.List;
+
+/**
+ * @author liuzh
+ * @since 2016-01-31 21:42
+ */
+@Service
+public class UserInfoService {
+
+    @Autowired
+    private UserInfoMapper userInfoMapper;
+
+    public List<UserInfo> getAll(UserInfo UserInfo) {
+        if (UserInfo.getPage() != null && UserInfo.getRows() != null) {
+            PageHelper.startPage(UserInfo.getPage(), UserInfo.getRows());
+        }
+        return userInfoMapper.selectAll();
+    }
+
+    public UserInfo getById(Integer id) {
+        return userInfoMapper.selectByPrimaryKey(id);
+    }
+
+    public void deleteById(Integer id) {
+        userInfoMapper.deleteByPrimaryKey(id);
+    }
+
+    public void save(UserInfo country) {
+        if (country.getId() != null) {
+            userInfoMapper.updateByPrimaryKey(country);
+        } else {
+            userInfoMapper.insert(country);
+        }
+    }
+}

+ 39 - 0
src/main/java/tk/mybatis/springboot/util/MyMapper.java

@@ -0,0 +1,39 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.util;
+
+import tk.mybatis.mapper.common.Mapper;
+import tk.mybatis.mapper.common.MySqlMapper;
+
+/**
+ * 继承自己的MyMapper
+ *
+ * @author liuzh
+ * @since 2015-09-06 21:53
+ */
+public interface MyMapper<T> extends Mapper<T> {
+    //TODO
+    //FIXME 特别注意,该接口不能被扫描到,否则会出错
+}

+ 14 - 0
src/main/resources/application-dev.properties

@@ -0,0 +1,14 @@
+server.port=9092
+debug=true
+logging.level.root=warn
+logging.level.tk.mybatis.springboot.mapper=trace
+spring.datasource.url=jdbc:oracle:thin:@10.7.41.10:1521:orcl
+spring.datasource.username=trswcm
+spring.datasource.password=trsadmin
+
+spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
+spring.datasource.druid.initial-size=1
+spring.datasource.druid.min-idle=1
+spring.datasource.druid.max-active=20
+spring.datasource.druid.test-on-borrow=true
+spring.datasource.druid.stat-view-servlet.allow=true

+ 42 - 0
src/main/resources/application-old.yml

@@ -0,0 +1,42 @@
+server:
+    port: 9090
+    context-path: #/liuzh/
+
+logging:
+    level:
+        tk.mybatis: TRACE
+
+druid:
+    url: jdbc:mysql://localhost:3306/test
+    username: root
+    password: 123456
+    initial-size: 1
+    min-idle: 1
+    max-active: 20
+    test-on-borrow: true
+
+spring:
+    mvc:
+        view:
+            prefix: /templates/
+            suffix: .ftl
+    freemarker:
+        cache: false
+        request-context-attribute: request
+
+
+mybatis:
+    type-aliases-package: tk.mybatis.springboot.model
+    mapper-locations: classpath:mapper/*.xml
+
+mapper:
+    mappers:
+        - tk.mybatis.springboot.util.MyMapper
+    not-empty: false
+    identity: MYSQL
+
+pagehelper:
+    helperDialect: mysql
+    reasonable: true
+    supportMethodsArguments: true
+    params: count=countSql

+ 11 - 0
src/main/resources/application-production.properties

@@ -0,0 +1,11 @@
+server.port=8080
+logging.level.root=info
+spring.datasource.url=jdbc:mysql://localhost:3306/test
+spring.datasource.username=root
+spring.datasource.password=
+spring.datasource.driver-class-name=com.mysql.jdbc.Driver
+spring.datasource.druid.initial-size=1
+spring.datasource.druid.min-idle=1
+spring.datasource.druid.max-active=20
+spring.datasource.druid.test-on-borrow=true
+spring.datasource.druid.stat-view-servlet.allow=true

+ 20 - 0
src/main/resources/application.properties

@@ -0,0 +1,20 @@
+# \u8BBE\u7F6E\u6FC0\u6D3B\u7684\u73AF\u5883
+spring.profiles.active=dev
+# \u89C6\u56FE\u76F8\u5173
+spring.mvc.view.prefix=/templates/
+spring.mvc.view.suffix=.ftl
+
+spring.freemarker.cache=false
+spring.freemarker.request-context-attribute=request
+# mybatis \u914D\u7F6E
+mybatis.type-aliases-package=tk.mybatis.springboot.model
+mybatis.mapper-locations=classpath:mapper/*.xml
+# \u901A\u7528 Mapper \u914D\u7F6E
+mapper.mappers=tk.mybatis.springboot.util.MyMapper
+mapper.not-empty=false
+mapper.identity=oracle
+# \u5206\u9875\u63D2\u4EF6\u914D\u7F6E
+pagehelper.helperDialect=oracle
+pagehelper.reasonable=true
+pagehelper.supportMethodsArguments=true
+pagehelper.params=count=countSql

+ 9 - 0
src/main/resources/banner.txt

@@ -0,0 +1,9 @@
+${AnsiColor.BLUE}
+  __  __       ____        _   _                _____                 _    _      _                            __  __
+ |  \/  |     |  _ \      | | (_)       ___    |  __ \               | |  | |    | |                   ___    |  \/  |
+ | \  / |_   _| |_) | __ _| |_ _ ___   ( _ )   | |__) |_ _  __ _  ___| |__| | ___| |_ __   ___ _ __   ( _ )   | \  / | __ _ _ __  _ __   ___ _ __
+ | |\/| | | | |  _ < / _` | __| / __|  / _ \/\ |  ___/ _` |/ _` |/ _ \  __  |/ _ \ | '_ \ / _ \ '__|  / _ \/\ | |\/| |/ _` | '_ \| '_ \ / _ \ '__|
+ | |  | | |_| | |_) | (_| | |_| \__ \ | (_>  < | |  | (_| | (_| |  __/ |  | |  __/ | |_) |  __/ |    | (_>  < | |  | | (_| | |_) | |_) |  __/ |
+ |_|  |_|\__, |____/ \__,_|\__|_|___/  \___/\/ |_|   \__,_|\__, |\___|_|  |_|\___|_| .__/ \___|_|     \___/\/ |_|  |_|\__,_| .__/| .__/ \___|_|
+          __/ |                                             __/ |                  | |                                     | |   | |
+         |___/                                             |___/                   |_|                                     |_|   |_|

+ 37 - 0
src/main/resources/generator/generatorConfig.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE generatorConfiguration
+        PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
+        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
+
+<generatorConfiguration>
+    <properties resource="application-dev.properties"/>
+
+    <context id="oracle" targetRuntime="MyBatis3Simple" defaultModelType="flat">
+        <property name="beginningDelimiter" value="`"/>
+        <property name="endingDelimiter" value="`"/>
+
+       <!-- <plugin type="tk.mybatis.mapper.generator.MapperPlugin">
+            <property name="mappers" value="tk.mybatis.springboot.util.MyMapper"/>
+        </plugin>-->
+
+        <jdbcConnection driverClass="${spring.datasource.driver-class-name}"
+                        connectionURL="${spring.datasource.url}"
+                        userId="${spring.datasource.username}"
+                        password="${spring.datasource.password}">
+        </jdbcConnection>
+
+        <javaModelGenerator targetPackage="tk.mybatis.springboot.model" targetProject="src/main/java"/>
+
+        <sqlMapGenerator targetPackage="mapper" targetProject="src/main/resources"/>
+
+        <javaClientGenerator targetPackage="tk.mybatis.springboot.mapper" targetProject="src/main/java"
+                             type="XMLMAPPER"/>
+
+        <table tableName="country">
+            <!--mysql 配置
+            <generatedKey column="id" sqlStatement="Mysql" identity="true"/>-->
+            <!--oracle 配置-->
+            <!--<generatedKey column="id" sqlStatement="select SEQ_{1}.nextval from dual" identity="false" type="pre"/>-->
+        </table>
+    </context>
+</generatorConfiguration>

+ 34 - 0
src/main/resources/mapper/CityMapper.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  ~ The MIT License (MIT)
+  ~
+  ~ Copyright (c) 2014-2016 abel533@gmail.com
+  ~
+  ~ Permission is hereby granted, free of charge, to any person obtaining a copy
+  ~ of this software and associated documentation files (the "Software"), to deal
+  ~ in the Software without restriction, including without limitation the rights
+  ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+  ~ copies of the Software, and to permit persons to whom the Software is
+  ~ furnished to do so, subject to the following conditions:
+  ~
+  ~ The above copyright notice and this permission notice shall be included in
+  ~ all copies or substantial portions of the Software.
+  ~
+  ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+  ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+  ~ THE SOFTWARE.
+  -->
+
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="tk.mybatis.springboot.mapper.CityMapper">
+    <resultMap id="BaseResultMap" type="tk.mybatis.springboot.model.City">
+        <result column="TITLE" jdbcType="VARCHAR" property="title" />
+        <result column="IMGURL" jdbcType="VARCHAR" property="imgurl" />
+        <result column="SERVICEURL" jdbcType="VARCHAR" property="serviceurl" />
+    </resultMap>
+
+</mapper>

+ 29 - 0
src/main/resources/mapper/CountryMapper.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  ~ The MIT License (MIT)
+  ~
+  ~ Copyright (c) 2014-2016 abel533@gmail.com
+  ~
+  ~ Permission is hereby granted, free of charge, to any person obtaining a copy
+  ~ of this software and associated documentation files (the "Software"), to deal
+  ~ in the Software without restriction, including without limitation the rights
+  ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+  ~ copies of the Software, and to permit persons to whom the Software is
+  ~ furnished to do so, subject to the following conditions:
+  ~
+  ~ The above copyright notice and this permission notice shall be included in
+  ~ all copies or substantial portions of the Software.
+  ~
+  ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+  ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+  ~ THE SOFTWARE.
+  -->
+
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="tk.mybatis.springboot.mapper.CountryMapper">
+
+</mapper>

+ 57 - 0
src/main/resources/mapper/Wcmivtable57Mapper.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  ~ The MIT License (MIT)
+  ~
+  ~ Copyright (c) 2014-2016 abel533@gmail.com
+  ~
+  ~ Permission is hereby granted, free of charge, to any person obtaining a copy
+  ~ of this software and associated documentation files (the "Software"), to deal
+  ~ in the Software without restriction, including without limitation the rights
+  ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+  ~ copies of the Software, and to permit persons to whom the Software is
+  ~ furnished to do so, subject to the following conditions:
+  ~
+  ~ The above copyright notice and this permission notice shall be included in
+  ~ all copies or substantial portions of the Software.
+  ~
+  ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+  ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+  ~ THE SOFTWARE.
+  -->
+
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="tk.mybatis.springboot.mapper.Wcmivtable57Mapper">
+    <resultMap id="BaseResultMap" type="tk.mybatis.springboot.model.Wcmivtable57">
+        <id column="WCMIVTABLE57ID" jdbcType="INTEGER" property="wcmivtable57id" />
+        <result column="DOCUMENTID" jdbcType="INTEGER" property="documentid" />
+        <result column="CHANNELID" jdbcType="INTEGER" property="channelid" />
+        <result column="INFOVIEWID" jdbcType="INTEGER" property="infoviewid" />
+        <result column="CRUSER" jdbcType="VARCHAR" property="cruser" />
+        <result column="CRTIME" jdbcType="TIMESTAMP" property="crtime" />
+        <result column="POSTUSER" jdbcType="VARCHAR" property="postuser" />
+        <result column="DOCNO" jdbcType="VARCHAR" property="docno" />
+        <result column="RANDOMSERIAL" jdbcType="VARCHAR" property="randomserial" />
+        <result column="ROOTELEMENT" jdbcType="VARCHAR" property="rootelement" />
+        <result column="DOCTITLE" jdbcType="VARCHAR" property="doctitle" />
+        <result column="XING_MING" jdbcType="VARCHAR" property="xingming" />
+        <result column="ZHENG_JIAN_LEI_XING" jdbcType="VARCHAR" property="zhengjianleixing" />
+        <result column="ZHENG_JIAN_HAO" jdbcType="VARCHAR" property="zhengjianhao" />
+        <result column="DIAN_ZI_YOU_XIANG" jdbcType="VARCHAR" property="dianziyouxiang" />
+        <result column="LIAN_XI_DI_ZHI" jdbcType="VARCHAR" property="lianxidizhi" />
+        <result column="DIAN_HUA" jdbcType="VARCHAR" property="dianhua" />
+        <result column="BIAO_TI" jdbcType="VARCHAR" property="biaoti" />
+        <result column="NEI_RONG" jdbcType="VARCHAR" property="neirong" />
+        <result column="GROUP1__HUI_FU_REN" jdbcType="VARCHAR" property="group1huifuren" />
+        <result column="GROUP1__HUI_FU_RI_QI" jdbcType="TIMESTAMP" property="group1huifuriqi" />
+        <result column="GROUP1__HUI_FU_NEI_RONG" jdbcType="VARCHAR" property="group1huifuneirong" />
+        <result column="docpuburl" jdbcType="VARCHAR" property="docpuburl" />
+    </resultMap>
+    <select id="selectAllmax" parameterType="tk.mybatis.springboot.model.Wcmivtable57" resultType="java.util.Map">
+    select count(*) count from wcmdocument a,wcmivtable57 b where a.docid=b.documentid and a.docstatus='10'  and b.ZU1_USERID=#{UserId}
+  </select>
+
+</mapper>

+ 88 - 0
src/main/resources/static/css/style.css

@@ -0,0 +1,88 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+* {
+    margin: 0;
+}
+
+html, body {
+    height: 100%;
+}
+
+.wrapper {
+    min-height: 100%;
+    height: auto !important;
+    height: 100%;
+    margin: 0 auto -155px;
+}
+
+.footer, .push {
+    height: 155px;
+}
+
+table.gridtable {
+    font-family: verdana, arial, sans-serif;
+    font-size: 11px;
+    color: #333333;
+    border-width: 1px;
+    border-color: #666666;
+    border-collapse: collapse;
+    margin: 5px auto;
+}
+
+table.gridtable th {
+    border-width: 1px;
+    padding: 8px;
+    border-style: solid;
+    border-color: #666666;
+    background-color: #dedede;
+}
+
+table.gridtable td {
+    border-width: 1px;
+    padding: 8px;
+    border-style: solid;
+    border-color: #666666;
+    background-color: #ffffff;
+}
+
+.middle {
+    text-align: center;
+    margin: 0 auto;
+    width: 800px;
+    height: auto;
+}
+
+.info {
+    font-size: 12px;
+    text-align: center;
+    line-height: 20px;
+    padding: 40px;
+}
+
+.info a {
+    margin: 0 10px;
+    text-decoration: none;
+    color: green;
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 2653 - 0
src/main/resources/static/js/jquery-1.11.1.min.js


+ 178 - 0
src/main/resources/templates/index.ftl

@@ -0,0 +1,178 @@
+<html>
+<head>
+    <title>Mybatis分页插件 - 测试页面</title>
+    <script src="${request.contextPath}/static/js/jquery-1.11.1.min.js"></script>
+    <link href="${request.contextPath}/static/css/style.css" rel="stylesheet" type="text/css"/>
+    <style type="text/css">
+        .pageDetail {
+            display: none;
+        }
+
+        .show {
+            display: table-row;
+        }
+    </style>
+    <script>
+        $(function () {
+            $('#list').click(function () {
+                $('.pageDetail').toggleClass('show');
+            });
+        });
+
+    </script>
+</head>
+<body>
+<div class="wrapper">
+    <div class="middle">
+        <h1 style="padding: 50px 0 20px;">国家(地区)列表</h1>
+
+        <form action="${request.contextPath}/countries" method="post">
+            <table class="gridtable" style="width:100%;">
+                <tr>
+                    <th>国家(地区)名称:</th>
+                    <td><input type="text" name="countryname"
+                               value="<#if queryParam.countryname??>${queryParam.countryname}</#if>"/></td>
+                    <th>国家(地区)代码:</th>
+                    <td><input type="text" name="countrycode"
+                               value="<#if queryParam.countrycode??>${queryParam.countrycode}</#if>"/></td>
+                    <td rowspan="2"><input type="submit" value="查询"/></td>
+                </tr>
+                <tr>
+                    <th>页码:</th>
+                    <td><input type="text" name="page" value="${page!0}"/></td>
+                    <th>页面大小:</th>
+                    <td><input type="text" name="rows" value="${rows!10}"/></td>
+                </tr>
+            </table>
+        </form>
+    <#if pageInfo??>
+        <table class="gridtable" style="width:100%;">
+            <tr>
+                <th colspan="2">分页信息 - [<a href="javascript:;" id="list">展开/收缩</a>]</th>
+            </tr>
+            <tr class="pageDetail">
+                <th style="width: 300px;">当前页号</th>
+                <td>${pageInfo.pageNum}</td>
+            </tr>
+            <tr class="pageDetail">
+                <th>页面大小</th>
+                <td>${pageInfo.pageSize}</td>
+            </tr>
+            <tr class="pageDetail">
+                <th>起始行号(>=)</th>
+                <td>${pageInfo.startRow}</td>
+            </tr>
+            <tr class="pageDetail">
+                <th>终止行号(<=)</th>
+                <td>${pageInfo.endRow}</td>
+            </tr>
+            <tr class="pageDetail">
+                <th>总结果数</th>
+                <td>${pageInfo.total}</td>
+            </tr>
+            <tr class="pageDetail">
+                <th>总页数</th>
+                <td>${pageInfo.pages}</td>
+            </tr>
+            <tr class="pageDetail">
+                <th>第一页</th>
+                <td>${pageInfo.firstPage}</td>
+            </tr>
+            <tr class="pageDetail">
+                <th>前一页</th>
+                <td>${pageInfo.prePage}</td>
+            </tr>
+            <tr class="pageDetail">
+                <th>下一页</th>
+                <td>${pageInfo.nextPage}</td>
+            </tr>
+            <tr class="pageDetail">
+                <th>最后一页</th>
+                <td>${pageInfo.lastPage}</td>
+            </tr>
+            <tr class="pageDetail">
+                <th>是否为第一页</th>
+                <td>${pageInfo.isFirstPage?c}</td>
+            </tr>
+            <tr class="pageDetail">
+                <th>是否为最后一页</th>
+                <td>${pageInfo.isLastPage?c}</td>
+            </tr>
+            <tr class="pageDetail">
+                <th>是否有前一页</th>
+                <td>${pageInfo.hasPreviousPage?c}</td>
+            </tr>
+            <tr class="pageDetail">
+                <th>是否有下一页</th>
+                <td>${pageInfo.hasNextPage?c}</td>
+            </tr>
+        </table>
+        <table class="gridtable" style="width:100%;">
+            <#if msg??>
+                <tr style="color:red;">
+                    <th colspan="5">${msg}</th>
+                </tr>
+            </#if>
+        </table>
+        <table class="gridtable" style="width:100%;">
+            <thead>
+            <tr>
+                <th colspan="4">查询结果 - [<a href="${request.contextPath}/countries/add">新增国家(地区)</a>]</th>
+            </tr>
+            <tr>
+                <th>ID</th>
+                <th>国家(地区)名</th>
+                <th>国家(地区)代码</th>
+                <th>操作</th>
+            </tr>
+            </thead>
+            <tbody>
+                <#list pageInfo.list as country>
+                <tr>
+                    <td>${country.id?c}</td>
+                    <td>${country.countryname}</td>
+                    <td>${country.countrycode}</td>
+                    <td style="text-align:center;">[<a
+                            href="${request.contextPath}/countries/view/${country.id?c}">修改</a>] -
+                        [<a href="${request.contextPath}/countries/delete/${country.id?c}">删除</a>]
+                    </td>
+                </tr>
+                </#list>
+            </tbody>
+        </table>
+        <table class="gridtable" style="width:100%;text-align: center;">
+            <tr>
+                <#if pageInfo.hasPreviousPage>
+                    <td>
+                        <a href="${request.contextPath}/countries?page=1&rows=${pageInfo.pageSize}&countryname=${queryParam.countryname}&countrycode=${queryParam.countrycode}">首页</a>
+                    </td>
+                    <td>
+                        <a href="${request.contextPath}/countries?page=${pageInfo.prePage}&rows=${pageInfo.pageSize}&countryname=${queryParam.countryname}&countrycode=${queryParam.countrycode}">前一页</a>
+                    </td>
+                </#if>
+                <#list pageInfo.navigatepageNums as nav>
+                    <#if nav == pageInfo.pageNum>
+                        <td style="font-weight: bold;">${nav}</td>
+                    </#if>
+                    <#if nav != pageInfo.pageNum>
+                        <td>
+                            <a href="${request.contextPath}/countries?page=${nav}&rows=${pageInfo.pageSize}&countryname=<#if queryParam.countryname??>${queryParam.countryname}</#if>&countrycode=<#if queryParam.countrycode??>${queryParam.countrycode}</#if>">${nav}</a>
+                        </td>
+                    </#if>
+                </#list>
+                <#if pageInfo.hasNextPage>
+                    <td>
+                        <a href="${request.contextPath}/countries?page=${pageInfo.nextPage}&rows=${pageInfo.pageSize}&countryname=<#if queryParam.countryname??>${queryParam.countryname}</#if>&countrycode=<#if queryParam.countrycode??>${queryParam.countrycode}</#if>">下一页</a>
+                    </td>
+                    <td>
+                        <a href="${request.contextPath}/countries?page=${pageInfo.pages}&rows=${pageInfo.pageSize}&countryname=<#if queryParam.countryname??>${queryParam.countryname}</#if>&countrycode=<#if queryParam.countrycode??>${queryParam.countrycode}</#if>">尾页</a>
+                    </td>
+                </#if>
+            </tr>
+        </table>
+    </#if>
+    </div>
+    <div class="push"></div>
+</div>
+</body>
+</html>

+ 30 - 0
src/main/resources/templates/view.ftl

@@ -0,0 +1,30 @@
+<html>
+<head>
+    <title>国家(地区)信息</title>
+    <link href="${request.contextPath}/static/css/style.css" rel="stylesheet" type="text/css"/>
+</head>
+<body style="margin-top:50px;overflow: hidden;">
+<form action="${request.contextPath}/countries/save" method="post">
+    <input type="hidden" name="id" value="<#if country.id??>${country.id?c}</#if>"/>
+    <table class="gridtable" style="width:800px;">
+        <tr>
+            <th colspan="5">国家(地区)信息 - [<a href="${request.contextPath}/countries">返回</a>]</th>
+        </tr>
+        <tr>
+            <th>国家(地区)名称:</th>
+            <td><input type="text" name="countryname" value="<#if country.countryname??>${country.countryname}</#if>"/>
+            </td>
+            <th>国家(地区)代码:</th>
+            <td><input type="text" name="countrycode" value="<#if country.countrycode??>${country.countrycode}</#if>"/>
+            </td>
+            <td><input type="submit" value="保存"/></td>
+        </tr>
+    <#if msg??>
+        <tr style="color:#00ba00;">
+            <th colspan="5">${msg}</th>
+        </tr>
+    </#if>
+    </table>
+</form>
+</body>
+</html>

+ 226 - 0
src/main/resources/test.sql

@@ -0,0 +1,226 @@
+USE `test`;
+
+DROP TABLE IF EXISTS `country`;
+CREATE TABLE `country` (
+  `Id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `countryname` varchar(255) DEFAULT NULL COMMENT '名称',
+  `countrycode` varchar(255) DEFAULT NULL COMMENT '代码',
+  PRIMARY KEY (`Id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='国家信息';
+
+DROP TABLE IF EXISTS `city`;
+CREATE TABLE `city` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `name` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
+  `state` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='市级信息';
+
+CREATE TABLE `user_info` (
+  `Id` int(11) NOT NULL AUTO_INCREMENT,
+  `username` varchar(32) NOT NULL DEFAULT '' COMMENT '用户名',
+  `password` varchar(32) DEFAULT NULL COMMENT '密码',
+  `usertype` varchar(2) DEFAULT NULL COMMENT '用户类型',
+  `enabled` int(2) DEFAULT NULL COMMENT '是否可用',
+  `realname` varchar(32) DEFAULT NULL COMMENT '真实姓名',
+  `qq` varchar(14) DEFAULT NULL COMMENT 'QQ',
+  `email` varchar(100) DEFAULT NULL,
+  `tel` varchar(255) DEFAULT NULL COMMENT '联系电话',
+  PRIMARY KEY (`Id`)
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='用户信息表';
+
+-- 用户信息
+INSERT INTO `user_info` VALUES ('1', 'test1', '12345678', '1', null, null, null, null, null);
+INSERT INTO `user_info` VALUES ('2', 'test2', 'aaaa', '2', null, null, null, null, null);
+INSERT INTO `user_info` VALUES ('3', 'test3', 'bbbb', '1', null, null, null, null, null);
+INSERT INTO `user_info` VALUES ('4', 'test4', 'cccc', '2', null, null, null, null, null);
+INSERT INTO `user_info` VALUES ('5', 'test5', 'dddd', '1', null, null, null, null, null);
+
+-- 国家信息
+INSERT INTO `country` VALUES (1,'Angola','AO');
+INSERT INTO `country` VALUES (2,'Afghanistan','AF');
+INSERT INTO `country` VALUES (3,'Albania','AL');
+INSERT INTO `country` VALUES (4,'Algeria','DZ');
+INSERT INTO `country` VALUES (5,'Andorra','AD');
+INSERT INTO `country` VALUES (6,'Anguilla','AI');
+INSERT INTO `country` VALUES (7,'Antigua and Barbuda','AG');
+INSERT INTO `country` VALUES (8,'Argentina','AR');
+INSERT INTO `country` VALUES (9,'Armenia','AM');
+INSERT INTO `country` VALUES (10,'Australia','AU');
+INSERT INTO `country` VALUES (11,'Austria','AT');
+INSERT INTO `country` VALUES (12,'Azerbaijan','AZ');
+INSERT INTO `country` VALUES (13,'Bahamas','BS');
+INSERT INTO `country` VALUES (14,'Bahrain','BH');
+INSERT INTO `country` VALUES (15,'Bangladesh','BD');
+INSERT INTO `country` VALUES (16,'Barbados','BB');
+INSERT INTO `country` VALUES (17,'Belarus','BY');
+INSERT INTO `country` VALUES (18,'Belgium','BE');
+INSERT INTO `country` VALUES (19,'Belize','BZ');
+INSERT INTO `country` VALUES (20,'Benin','BJ');
+INSERT INTO `country` VALUES (21,'Bermuda Is.','BM');
+INSERT INTO `country` VALUES (22,'Bolivia','BO');
+INSERT INTO `country` VALUES (23,'Botswana','BW');
+INSERT INTO `country` VALUES (24,'Brazil','BR');
+INSERT INTO `country` VALUES (25,'Brunei','BN');
+INSERT INTO `country` VALUES (26,'Bulgaria','BG');
+INSERT INTO `country` VALUES (27,'Burkina-faso','BF');
+INSERT INTO `country` VALUES (28,'Burma','MM');
+INSERT INTO `country` VALUES (29,'Burundi','BI');
+INSERT INTO `country` VALUES (30,'Cameroon','CM');
+INSERT INTO `country` VALUES (31,'Canada','CA');
+INSERT INTO `country` VALUES (32,'Central African Republic','CF');
+INSERT INTO `country` VALUES (33,'Chad','TD');
+INSERT INTO `country` VALUES (34,'Chile','CL');
+INSERT INTO `country` VALUES (35,'China','CN');
+INSERT INTO `country` VALUES (36,'Colombia','CO');
+INSERT INTO `country` VALUES (37,'Congo','CG');
+INSERT INTO `country` VALUES (38,'Cook Is.','CK');
+INSERT INTO `country` VALUES (39,'Costa Rica','CR');
+INSERT INTO `country` VALUES (40,'Cuba','CU');
+INSERT INTO `country` VALUES (41,'Cyprus','CY');
+INSERT INTO `country` VALUES (42,'Czech Republic','CZ');
+INSERT INTO `country` VALUES (43,'Denmark','DK');
+INSERT INTO `country` VALUES (44,'Djibouti','DJ');
+INSERT INTO `country` VALUES (45,'Dominica Rep.','DO');
+INSERT INTO `country` VALUES (46,'Ecuador','EC');
+INSERT INTO `country` VALUES (47,'Egypt','EG');
+INSERT INTO `country` VALUES (48,'EI Salvador','SV');
+INSERT INTO `country` VALUES (49,'Estonia','EE');
+INSERT INTO `country` VALUES (50,'Ethiopia','ET');
+INSERT INTO `country` VALUES (51,'Fiji','FJ');
+INSERT INTO `country` VALUES (52,'Finland','FI');
+INSERT INTO `country` VALUES (53,'France','FR');
+INSERT INTO `country` VALUES (54,'French Guiana','GF');
+INSERT INTO `country` VALUES (55,'Gabon','GA');
+INSERT INTO `country` VALUES (56,'Gambia','GM');
+INSERT INTO `country` VALUES (57,'Georgia','GE');
+INSERT INTO `country` VALUES (58,'Germany','DE');
+INSERT INTO `country` VALUES (59,'Ghana','GH');
+INSERT INTO `country` VALUES (60,'Gibraltar','GI');
+INSERT INTO `country` VALUES (61,'Greece','GR');
+INSERT INTO `country` VALUES (62,'Grenada','GD');
+INSERT INTO `country` VALUES (63,'Guam','GU');
+INSERT INTO `country` VALUES (64,'Guatemala','GT');
+INSERT INTO `country` VALUES (65,'Guinea','GN');
+INSERT INTO `country` VALUES (66,'Guyana','GY');
+INSERT INTO `country` VALUES (67,'Haiti','HT');
+INSERT INTO `country` VALUES (68,'Honduras','HN');
+INSERT INTO `country` VALUES (69,'Hongkong','HK');
+INSERT INTO `country` VALUES (70,'Hungary','HU');
+INSERT INTO `country` VALUES (71,'Iceland','IS');
+INSERT INTO `country` VALUES (72,'India','IN');
+INSERT INTO `country` VALUES (73,'Indonesia','ID');
+INSERT INTO `country` VALUES (74,'Iran','IR');
+INSERT INTO `country` VALUES (75,'Iraq','IQ');
+INSERT INTO `country` VALUES (76,'Ireland','IE');
+INSERT INTO `country` VALUES (77,'Israel','IL');
+INSERT INTO `country` VALUES (78,'Italy','IT');
+INSERT INTO `country` VALUES (79,'Jamaica','JM');
+INSERT INTO `country` VALUES (80,'Japan','JP');
+INSERT INTO `country` VALUES (81,'Jordan','JO');
+INSERT INTO `country` VALUES (82,'Kampuchea (Cambodia )','KH');
+INSERT INTO `country` VALUES (83,'Kazakstan','KZ');
+INSERT INTO `country` VALUES (84,'Kenya','KE');
+INSERT INTO `country` VALUES (85,'Korea','KR');
+INSERT INTO `country` VALUES (86,'Kuwait','KW');
+INSERT INTO `country` VALUES (87,'Kyrgyzstan','KG');
+INSERT INTO `country` VALUES (88,'Laos','LA');
+INSERT INTO `country` VALUES (89,'Latvia','LV');
+INSERT INTO `country` VALUES (90,'Lebanon','LB');
+INSERT INTO `country` VALUES (91,'Lesotho','LS');
+INSERT INTO `country` VALUES (92,'Liberia','LR');
+INSERT INTO `country` VALUES (93,'Libya','LY');
+INSERT INTO `country` VALUES (94,'Liechtenstein','LI');
+INSERT INTO `country` VALUES (95,'Lithuania','LT');
+INSERT INTO `country` VALUES (96,'Luxembourg','LU');
+INSERT INTO `country` VALUES (97,'Macao','MO');
+INSERT INTO `country` VALUES (98,'Madagascar','MG');
+INSERT INTO `country` VALUES (99,'Malawi','MW');
+INSERT INTO `country` VALUES (100,'Malaysia','MY');
+INSERT INTO `country` VALUES (101,'Maldives','MV');
+INSERT INTO `country` VALUES (102,'Mali','ML');
+INSERT INTO `country` VALUES (103,'Malta','MT');
+INSERT INTO `country` VALUES (104,'Mauritius','MU');
+INSERT INTO `country` VALUES (105,'Mexico','MX');
+INSERT INTO `country` VALUES (106,'Moldova, Republic of','MD');
+INSERT INTO `country` VALUES (107,'Monaco','MC');
+INSERT INTO `country` VALUES (108,'Mongolia','MN');
+INSERT INTO `country` VALUES (109,'Montserrat Is','MS');
+INSERT INTO `country` VALUES (110,'Morocco','MA');
+INSERT INTO `country` VALUES (111,'Mozambique','MZ');
+INSERT INTO `country` VALUES (112,'Namibia','NA');
+INSERT INTO `country` VALUES (113,'Nauru','NR');
+INSERT INTO `country` VALUES (114,'Nepal','NP');
+INSERT INTO `country` VALUES (115,'Netherlands','NL');
+INSERT INTO `country` VALUES (116,'New Zealand','NZ');
+INSERT INTO `country` VALUES (117,'Nicaragua','NI');
+INSERT INTO `country` VALUES (118,'Niger','NE');
+INSERT INTO `country` VALUES (119,'Nigeria','NG');
+INSERT INTO `country` VALUES (120,'North Korea','KP');
+INSERT INTO `country` VALUES (121,'Norway','NO');
+INSERT INTO `country` VALUES (122,'Oman','OM');
+INSERT INTO `country` VALUES (123,'Pakistan','PK');
+INSERT INTO `country` VALUES (124,'Panama','PA');
+INSERT INTO `country` VALUES (125,'Papua New Cuinea','PG');
+INSERT INTO `country` VALUES (126,'Paraguay','PY');
+INSERT INTO `country` VALUES (127,'Peru','PE');
+INSERT INTO `country` VALUES (128,'Philippines','PH');
+INSERT INTO `country` VALUES (129,'Poland','PL');
+INSERT INTO `country` VALUES (130,'French Polynesia','PF');
+INSERT INTO `country` VALUES (131,'Portugal','PT');
+INSERT INTO `country` VALUES (132,'Puerto Rico','PR');
+INSERT INTO `country` VALUES (133,'Qatar','QA');
+INSERT INTO `country` VALUES (134,'Romania','RO');
+INSERT INTO `country` VALUES (135,'Russia','RU');
+INSERT INTO `country` VALUES (136,'Saint Lueia','LC');
+INSERT INTO `country` VALUES (137,'Saint Vincent','VC');
+INSERT INTO `country` VALUES (138,'San Marino','SM');
+INSERT INTO `country` VALUES (139,'Sao Tome and Principe','ST');
+INSERT INTO `country` VALUES (140,'Saudi Arabia','SA');
+INSERT INTO `country` VALUES (141,'Senegal','SN');
+INSERT INTO `country` VALUES (142,'Seychelles','SC');
+INSERT INTO `country` VALUES (143,'Sierra Leone','SL');
+INSERT INTO `country` VALUES (144,'Singapore','SG');
+INSERT INTO `country` VALUES (145,'Slovakia','SK');
+INSERT INTO `country` VALUES (146,'Slovenia','SI');
+INSERT INTO `country` VALUES (147,'Solomon Is','SB');
+INSERT INTO `country` VALUES (148,'Somali','SO');
+INSERT INTO `country` VALUES (149,'South Africa','ZA');
+INSERT INTO `country` VALUES (150,'Spain','ES');
+INSERT INTO `country` VALUES (151,'Sri Lanka','LK');
+INSERT INTO `country` VALUES (152,'St.Lucia','LC');
+INSERT INTO `country` VALUES (153,'St.Vincent','VC');
+INSERT INTO `country` VALUES (154,'Sudan','SD');
+INSERT INTO `country` VALUES (155,'Suriname','SR');
+INSERT INTO `country` VALUES (156,'Swaziland','SZ');
+INSERT INTO `country` VALUES (157,'Sweden','SE');
+INSERT INTO `country` VALUES (158,'Switzerland','CH');
+INSERT INTO `country` VALUES (159,'Syria','SY');
+INSERT INTO `country` VALUES (160,'Taiwan','TW');
+INSERT INTO `country` VALUES (161,'Tajikstan','TJ');
+INSERT INTO `country` VALUES (162,'Tanzania','TZ');
+INSERT INTO `country` VALUES (163,'Thailand','TH');
+INSERT INTO `country` VALUES (164,'Togo','TG');
+INSERT INTO `country` VALUES (165,'Tonga','TO');
+INSERT INTO `country` VALUES (166,'Trinidad and Tobago','TT');
+INSERT INTO `country` VALUES (167,'Tunisia','TN');
+INSERT INTO `country` VALUES (168,'Turkey','TR');
+INSERT INTO `country` VALUES (169,'Turkmenistan','TM');
+INSERT INTO `country` VALUES (170,'Uganda','UG');
+INSERT INTO `country` VALUES (171,'Ukraine','UA');
+INSERT INTO `country` VALUES (172,'United Arab Emirates','AE');
+INSERT INTO `country` VALUES (173,'United Kiongdom','GB');
+INSERT INTO `country` VALUES (174,'United States of America','US');
+INSERT INTO `country` VALUES (175,'Uruguay','UY');
+INSERT INTO `country` VALUES (176,'Uzbekistan','UZ');
+INSERT INTO `country` VALUES (177,'Venezuela','VE');
+INSERT INTO `country` VALUES (178,'Vietnam','VN');
+INSERT INTO `country` VALUES (179,'Yemen','YE');
+INSERT INTO `country` VALUES (180,'Yugoslavia','YU');
+INSERT INTO `country` VALUES (181,'Zimbabwe','ZW');
+INSERT INTO `country` VALUES (182,'Zaire','ZR');
+INSERT INTO `country` VALUES (183,'Zambia','ZM');
+
+-- 城市信息
+INSERT INTO `city` VALUES ('1', '石家庄', '河北');
+INSERT INTO `city` VALUES ('2', '邯郸', '河北');

+ 77 - 0
src/test/java/tk/mybatis/springboot/mapper/MyBatis331Mapper.java

@@ -0,0 +1,77 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.mapper;
+
+import org.apache.ibatis.annotations.*;
+import tk.mybatis.springboot.model.City2;
+
+import java.util.List;
+
+/**
+ * mybatis3.3.1版本新增功能测试
+ *
+ * @author liuzh
+ * @since 2016-03-06 17:22
+ */
+public interface MyBatis331Mapper {
+
+    /**
+     * 批量插入
+     *
+     * @param cities
+     * @return
+     */
+    @Insert("<script>" +
+            "insert into city (id, name, state) values " +
+            "<foreach collection=\"list\" item=\"city\" separator=\",\" >" +
+                "(#{city.id}, #{city.cityName}, #{city.cityState})" +
+            "</foreach>" +
+            "</script>")
+    @Options(useGeneratedKeys = true, keyProperty = "id")
+    int insertCities(List<City2> cities);
+
+    /**
+     * 根据主键查询一个
+     *
+     * @param id
+     * @return
+     */
+    @Results(id = "cityResult", value = {
+        @Result(property = "id", column = "id", id = true),
+        @Result(property = "cityName", column = "name", id = true),
+        @Result(property = "cityState", column = "state", id = true)
+    })
+    @Select("select id, name, state from city where id = #{id}")
+    City2 selectByCityId(Integer id);
+
+    /**
+     * 查询全部,引用上面的Results
+     *
+     * @return
+     */
+    @ResultMap("cityResult")
+    @Select("select id, name, state from city")
+    List<City2> selectAll();
+}

+ 92 - 0
src/test/java/tk/mybatis/springboot/mapper/MyBatis331Test.java

@@ -0,0 +1,92 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.mapper;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.annotation.Rollback;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.web.WebAppConfiguration;
+import org.springframework.transaction.annotation.Transactional;
+import tk.mybatis.springboot.Application;
+import tk.mybatis.springboot.model.City2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author liuzh
+ * @since 2016-03-06 17:42
+ */
+/*@RunWith(SpringJUnit4ClassRunner.class)
+@WebAppConfiguration
+@Transactional
+@SpringBootTest(classes = Application.class)*/
+public class MyBatis331Test {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+   /* @Autowired
+    private MyBatis331Mapper mapper;
+
+    @Test
+    @Rollback
+    public void testInsertList() {
+        List<City2> city2List = new ArrayList<City2>();
+        city2List.add(new City2("石家庄", "河北"));
+        city2List.add(new City2("邯郸", "河北"));
+        city2List.add(new City2("秦皇岛", "河北"));
+        Assert.assertEquals(3, mapper.insertCities(city2List));
+        for (City2 c2 : city2List) {
+            logger.info(c2.toString());
+            Assert.assertNotNull(c2.getId());
+        }
+    }
+
+    @Test
+    public void testSelectById() {
+        City2 city2 = mapper.selectByCityId(1);
+        logger.info(city2.toString());
+        Assert.assertNotNull(city2);
+        Assert.assertNotNull(city2.getCityName());
+        Assert.assertNotNull(city2.getCityState());
+    }
+
+    @Test
+    public void testSelectAll() {
+        List<City2> city2List = mapper.selectAll();
+        for (City2 c2 : city2List) {
+            logger.info(c2.toString());
+            Assert.assertNotNull(c2);
+            Assert.assertNotNull(c2.getCityName());
+            Assert.assertNotNull(c2.getCityState());
+        }
+    }*/
+
+}

+ 18 - 0
src/test/java/tk/mybatis/springboot/mapper/city.sql

@@ -0,0 +1,18 @@
+SET FOREIGN_KEY_CHECKS=0;
+
+-- ----------------------------
+-- Table structure for city
+-- ----------------------------
+DROP TABLE IF EXISTS `city`;
+CREATE TABLE `city` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `name` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
+  `state` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
+
+-- ----------------------------
+-- Records of city
+-- ----------------------------
+INSERT INTO `city` VALUES ('1', '石家庄', '河北');
+INSERT INTO `city` VALUES ('2', '邯郸', '河北');

+ 80 - 0
src/test/java/tk/mybatis/springboot/model/City2.java

@@ -0,0 +1,80 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2014-2016 abel533@gmail.com
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+package tk.mybatis.springboot.model;
+
+/**
+ * mybatis 3.3.1新功能测试使用
+ *
+ * @author liuzh
+ * @since 2016-01-22 22:16
+ */
+public class City2 {
+    private Integer id;
+
+    private String cityName;
+
+    private String cityState;
+
+    public City2() {
+    }
+
+    public City2(String cityName, String cityState) {
+        this.cityName = cityName;
+        this.cityState = cityState;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getCityName() {
+        return cityName;
+    }
+
+    public void setCityName(String cityName) {
+        this.cityName = cityName;
+    }
+
+    public String getCityState() {
+        return cityState;
+    }
+
+    public void setCityState(String cityState) {
+        this.cityState = cityState;
+    }
+
+    @Override
+    public String toString() {
+        return "City2{" +
+                "id=" + id +
+                ", cityName='" + cityName + '\'' +
+                ", cityState='" + cityState + '\'' +
+                '}';
+    }
+}

+ 35 - 0
src/test/java/tk/mybatis/springboot/test/CountryServiceTest.java

@@ -0,0 +1,35 @@
+package tk.mybatis.springboot.test;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.Import;
+import org.springframework.test.context.junit4.SpringRunner;
+import tk.mybatis.springboot.Application;
+import tk.mybatis.springboot.model.Country;
+import tk.mybatis.springboot.service.CountryService;
+
+import java.util.List;
+
+/**
+ * @author liuzh
+ * @since 2017/9/2.
+ */
+/*@RunWith(SpringRunner.class)
+@SpringBootTest
+@Import(Application.class)*/
+public class CountryServiceTest {
+
+   /* @Autowired
+    private CountryService countryService;
+
+    @Test
+    public void test() {
+        Country country = new Country();
+        List<Country> all = countryService.getAll(country);
+        for (Country c : all) {
+            System.out.println(c.getCountryname());
+        }
+    }*/
+}