From 96d54564a2afb14c9c1f7c8f1ca0db371da3462f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=81=AA?= Date: Mon, 28 Mar 2022 16:03:20 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=90=AD=E5=BB=BAssm=E6=A1=86=E6=9E=B6=20?= =?UTF-8?q?=E5=B9=B6=E4=B8=94=E6=B5=8B=E8=AF=95mybatisplus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ssm_zc_test/pom.xml | 170 +++++++++++++++++- .../hxic/zc/controller/StudentController.java | 38 ++++ .../main/java/com/hxic/zc/domain/Student.java | 24 +++ .../com/hxic/zc/mapper/StudentMapper.java | 7 + .../com/hxic/zc/service/StudentService.java | 8 + .../zc/service/impl/StudentServiceImpl.java | 13 ++ .../resources/applicationContext-mybatis.xml | 57 ++++++ .../src/main/resources/database.properties | 11 ++ .../main/resources/mapper/StudentMapper.xml | 15 ++ .../src/main/resources/springmvc-servlet.xml | 19 ++ ssm_zc_test/src/main/webapp/WEB-INF/web.xml | 51 ++++++ 11 files changed, 410 insertions(+), 3 deletions(-) create mode 100644 ssm_zc_test/src/main/java/com/hxic/zc/controller/StudentController.java create mode 100644 ssm_zc_test/src/main/java/com/hxic/zc/domain/Student.java create mode 100644 ssm_zc_test/src/main/java/com/hxic/zc/mapper/StudentMapper.java create mode 100644 ssm_zc_test/src/main/java/com/hxic/zc/service/StudentService.java create mode 100644 ssm_zc_test/src/main/java/com/hxic/zc/service/impl/StudentServiceImpl.java create mode 100644 ssm_zc_test/src/main/resources/applicationContext-mybatis.xml create mode 100644 ssm_zc_test/src/main/resources/database.properties create mode 100644 ssm_zc_test/src/main/resources/mapper/StudentMapper.xml create mode 100644 ssm_zc_test/src/main/resources/springmvc-servlet.xml diff --git a/ssm_zc_test/pom.xml b/ssm_zc_test/pom.xml index 5ed0c73..601e4dc 100644 --- a/ssm_zc_test/pom.xml +++ b/ssm_zc_test/pom.xml @@ -18,17 +18,181 @@ UTF-8 - 1.7 - 1.7 + 4.3.14.RELEASE + 1.8 + 1.8 + + + org.springframework + spring-core + ${spring.version} + + + org.springframework + spring-beans + ${spring.version} + + + org.springframework + spring-context + ${spring.version} + + + org.springframework + spring-tx + ${spring.version} + + + org.springframework + spring-web + ${spring.version} + + + org.springframework + spring-webmvc + ${spring.version} + + + org.springframework + spring-aop + ${spring.version} + + + org.springframework + spring-expression + ${spring.version} + + + org.springframework + spring-jdbc + ${spring.version} + + + org.springframework + spring-test + ${spring.version} + test + + + + + + mysql + mysql-connector-java + 5.1.45 + + junit junit - 4.11 + 4.12 test + + + org.aspectj + aspectjweaver + 1.8.10 + + + org.aspectj + aspectjrt + 1.8.10 + + + + commons-fileupload + commons-fileupload + 1.3.3 + + + + + + commons-dbcp + commons-dbcp + 1.4 + + + commons-pool + commons-pool + 1.6 + + + + com.fasterxml.jackson.core + jackson-core + 2.9.0.pr3 + + + com.fasterxml.jackson.core + jackson-databind + 2.9.0.pr3 + + + com.fasterxml.jackson.core + jackson-annotations + 2.9.0.pr3 + + + + com.google.code.gson + gson + 2.8.2 + + + + com.alibaba + fastjson + 1.2.28 + + + + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + + javax.servlet + jstl + 1.2 + + + + + org.projectlombok + lombok + 1.16.10 + provided + + + com.baomidou + mybatis-plus + 3.3.2 + + + commons-codec + commons-codec + 1.15 + + diff --git a/ssm_zc_test/src/main/java/com/hxic/zc/controller/StudentController.java b/ssm_zc_test/src/main/java/com/hxic/zc/controller/StudentController.java new file mode 100644 index 0000000..96d974c --- /dev/null +++ b/ssm_zc_test/src/main/java/com/hxic/zc/controller/StudentController.java @@ -0,0 +1,38 @@ +package com.hxic.zc.controller; + + +import com.hxic.zc.domain.Student; +import com.hxic.zc.service.StudentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; + +@Controller +@RequestMapping("mp") +public class StudentController { + @Autowired + StudentService service; + + @RequestMapping("query") + @ResponseBody + public String query() { + + List list = service.list(); + System.out.println(list); + return null; + } + + @RequestMapping("add") + @ResponseBody + public String add() { + Student st = new Student(); + st.setName("ccc"); + st.setSno("1111"); + service.save(st); + + return null; + } +} \ No newline at end of file diff --git a/ssm_zc_test/src/main/java/com/hxic/zc/domain/Student.java b/ssm_zc_test/src/main/java/com/hxic/zc/domain/Student.java new file mode 100644 index 0000000..8c1190d --- /dev/null +++ b/ssm_zc_test/src/main/java/com/hxic/zc/domain/Student.java @@ -0,0 +1,24 @@ +package com.hxic.zc.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "student") +public class Student { + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @TableField(value = "name") + private String name; + + @TableField(value = "sno") + private String sno; +} \ No newline at end of file diff --git a/ssm_zc_test/src/main/java/com/hxic/zc/mapper/StudentMapper.java b/ssm_zc_test/src/main/java/com/hxic/zc/mapper/StudentMapper.java new file mode 100644 index 0000000..350c0fa --- /dev/null +++ b/ssm_zc_test/src/main/java/com/hxic/zc/mapper/StudentMapper.java @@ -0,0 +1,7 @@ +package com.hxic.zc.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hxic.zc.domain.Student; + +public interface StudentMapper extends BaseMapper { +} \ No newline at end of file diff --git a/ssm_zc_test/src/main/java/com/hxic/zc/service/StudentService.java b/ssm_zc_test/src/main/java/com/hxic/zc/service/StudentService.java new file mode 100644 index 0000000..5521aa4 --- /dev/null +++ b/ssm_zc_test/src/main/java/com/hxic/zc/service/StudentService.java @@ -0,0 +1,8 @@ +package com.hxic.zc.service; + +import com.hxic.zc.domain.Student; +import com.baomidou.mybatisplus.extension.service.IService; +public interface StudentService extends IService{ + + +} diff --git a/ssm_zc_test/src/main/java/com/hxic/zc/service/impl/StudentServiceImpl.java b/ssm_zc_test/src/main/java/com/hxic/zc/service/impl/StudentServiceImpl.java new file mode 100644 index 0000000..0a7f8bd --- /dev/null +++ b/ssm_zc_test/src/main/java/com/hxic/zc/service/impl/StudentServiceImpl.java @@ -0,0 +1,13 @@ +package com.hxic.zc.service.impl; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hxic.zc.mapper.StudentMapper; +import com.hxic.zc.domain.Student; +import com.hxic.zc.service.StudentService; +@Service +public class StudentServiceImpl extends ServiceImpl implements StudentService{ + +} diff --git a/ssm_zc_test/src/main/resources/applicationContext-mybatis.xml b/ssm_zc_test/src/main/resources/applicationContext-mybatis.xml new file mode 100644 index 0000000..ab9bfc7 --- /dev/null +++ b/ssm_zc_test/src/main/resources/applicationContext-mybatis.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ssm_zc_test/src/main/resources/database.properties b/ssm_zc_test/src/main/resources/database.properties new file mode 100644 index 0000000..5c94d29 --- /dev/null +++ b/ssm_zc_test/src/main/resources/database.properties @@ -0,0 +1,11 @@ +driver=com.mysql.jdbc.Driver +url=jdbc:mysql://127.0.0.1:3306/mybatis?useUnicode=true&characterEncoding=utf-8 +user=root +password=x5 +minIdle=45 +maxIdle=50 +initialSize=5 +maxActive=100 +maxWait=100 +removeAbandonedTimeout=180 +removeAbandoned=true diff --git a/ssm_zc_test/src/main/resources/mapper/StudentMapper.xml b/ssm_zc_test/src/main/resources/mapper/StudentMapper.xml new file mode 100644 index 0000000..6c0f661 --- /dev/null +++ b/ssm_zc_test/src/main/resources/mapper/StudentMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + id, `name`, sno + + \ No newline at end of file diff --git a/ssm_zc_test/src/main/resources/springmvc-servlet.xml b/ssm_zc_test/src/main/resources/springmvc-servlet.xml new file mode 100644 index 0000000..698f370 --- /dev/null +++ b/ssm_zc_test/src/main/resources/springmvc-servlet.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/ssm_zc_test/src/main/webapp/WEB-INF/web.xml b/ssm_zc_test/src/main/webapp/WEB-INF/web.xml index 9f88c1f..154a0e3 100644 --- a/ssm_zc_test/src/main/webapp/WEB-INF/web.xml +++ b/ssm_zc_test/src/main/webapp/WEB-INF/web.xml @@ -4,4 +4,55 @@ Archetype Created Web Application + + + + + contextConfigLocation + classpath:applicationContext-mybatis.xml + + + + + encodingFilter + org.springframework.web.filter.CharacterEncodingFilter + + encoding + UTF-8 + + + forceEncoding + true + + + + encodingFilter + /* + + + + + + org.springframework.web.context.ContextLoaderListener + + + + + + + springDispatcherServlet + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + classpath:springmvc-servlet.xml + + 1 + + + springDispatcherServlet + / + + + + -- Gitee From 4290439d6baf00b2db17ab148e3b8ab299011343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=81=AA?= Date: Tue, 29 Mar 2022 09:42:25 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=90=AD=E5=BB=BAssm=E6=A1=86=E6=9E=B6=20?= =?UTF-8?q?=E5=B9=B6=E4=B8=94=E6=B5=8B=E8=AF=95mybatisplus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ssm_zc_34/pom.xml | 233 ++++++++++++++++++ .../hxci/zc/controller/StudentController.java | 33 +++ .../resources/applicationContext-mybatis.xml | 57 +++++ .../src/main/resources/database.properties | 11 + .../src/main/resources/springmvc-servlet.xml | 19 ++ ssm_zc_34/src/main/webapp/WEB-INF/web.xml | 58 +++++ 6 files changed, 411 insertions(+) create mode 100644 ssm_zc_34/pom.xml create mode 100644 ssm_zc_34/src/main/java/com/hxci/zc/controller/StudentController.java create mode 100644 ssm_zc_34/src/main/resources/applicationContext-mybatis.xml create mode 100644 ssm_zc_34/src/main/resources/database.properties create mode 100644 ssm_zc_34/src/main/resources/springmvc-servlet.xml create mode 100644 ssm_zc_34/src/main/webapp/WEB-INF/web.xml diff --git a/ssm_zc_34/pom.xml b/ssm_zc_34/pom.xml new file mode 100644 index 0000000..3f7437c --- /dev/null +++ b/ssm_zc_34/pom.xml @@ -0,0 +1,233 @@ + + + + + ssm_demo + org.example + 1.0-SNAPSHOT + + 4.0.0 + + ssm_zc_34 + war + + ssm_zc_34 Maven Webapp + + http://www.example.com + + + UTF-8 + 4.3.14.RELEASE + 1.8 + 1.8 + + + + + + org.springframework + spring-core + ${spring.version} + + + org.springframework + spring-beans + ${spring.version} + + + org.springframework + spring-context + ${spring.version} + + + org.springframework + spring-tx + ${spring.version} + + + org.springframework + spring-web + ${spring.version} + + + org.springframework + spring-webmvc + ${spring.version} + + + org.springframework + spring-aop + ${spring.version} + + + org.springframework + spring-expression + ${spring.version} + + + org.springframework + spring-jdbc + ${spring.version} + + + org.springframework + spring-test + ${spring.version} + test + + + + + + mysql + mysql-connector-java + 5.1.45 + + + + junit + junit + 4.12 + test + + + + org.aspectj + aspectjweaver + 1.8.10 + + + org.aspectj + aspectjrt + 1.8.10 + + + + commons-fileupload + commons-fileupload + 1.3.3 + + + + + + commons-dbcp + commons-dbcp + 1.4 + + + commons-pool + commons-pool + 1.6 + + + + com.fasterxml.jackson.core + jackson-core + 2.9.0.pr3 + + + com.fasterxml.jackson.core + jackson-databind + 2.9.0.pr3 + + + com.fasterxml.jackson.core + jackson-annotations + 2.9.0.pr3 + + + + com.google.code.gson + gson + 2.8.2 + + + + com.alibaba + fastjson + 1.2.28 + + + + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + + javax.servlet + jstl + 1.2 + + + + + org.projectlombok + lombok + 1.16.10 + provided + + + com.baomidou + mybatis-plus + 3.3.2 + + + commons-codec + commons-codec + 1.15 + + + + + ssm_zc_34 + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-war-plugin + 3.2.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + + diff --git a/ssm_zc_34/src/main/java/com/hxci/zc/controller/StudentController.java b/ssm_zc_34/src/main/java/com/hxci/zc/controller/StudentController.java new file mode 100644 index 0000000..e59a5df --- /dev/null +++ b/ssm_zc_34/src/main/java/com/hxci/zc/controller/StudentController.java @@ -0,0 +1,33 @@ +package com.hxci.zc.controller; + +import com.hxci.zc.domain.Student; +import com.hxci.zc.service.StudentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +import java.util.List; + +@Controller +@RequestMapping("stu") +public class StudentController { + @Autowired + StudentService service; + + @RequestMapping("query") + public String query(){ + List list= service.list(); + System.out.println(list); + return null; + } + + + @RequestMapping("add") + public String add(){ + Student stu = new Student(); + stu.setName("李四"); + stu.setSno("666"); + service.save(stu); + return null; + } +} diff --git a/ssm_zc_34/src/main/resources/applicationContext-mybatis.xml b/ssm_zc_34/src/main/resources/applicationContext-mybatis.xml new file mode 100644 index 0000000..6fc38ae --- /dev/null +++ b/ssm_zc_34/src/main/resources/applicationContext-mybatis.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ssm_zc_34/src/main/resources/database.properties b/ssm_zc_34/src/main/resources/database.properties new file mode 100644 index 0000000..5c94d29 --- /dev/null +++ b/ssm_zc_34/src/main/resources/database.properties @@ -0,0 +1,11 @@ +driver=com.mysql.jdbc.Driver +url=jdbc:mysql://127.0.0.1:3306/mybatis?useUnicode=true&characterEncoding=utf-8 +user=root +password=x5 +minIdle=45 +maxIdle=50 +initialSize=5 +maxActive=100 +maxWait=100 +removeAbandonedTimeout=180 +removeAbandoned=true diff --git a/ssm_zc_34/src/main/resources/springmvc-servlet.xml b/ssm_zc_34/src/main/resources/springmvc-servlet.xml new file mode 100644 index 0000000..0b33a50 --- /dev/null +++ b/ssm_zc_34/src/main/resources/springmvc-servlet.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/ssm_zc_34/src/main/webapp/WEB-INF/web.xml b/ssm_zc_34/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..7632e3c --- /dev/null +++ b/ssm_zc_34/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,58 @@ + + + + Archetype Created Web Application + + + + + contextConfigLocation + + classpath:applicationContext-mybatis.xml + + + + + encodingFilter + org.springframework.web.filter.CharacterEncodingFilter + + encoding + UTF-8 + + + forceEncoding + true + + + + encodingFilter + /* + + + + + + org.springframework.web.context.ContextLoaderListener + + + + + + springDispatcherServlet + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + classpath:springmvc-servlet.xml + + 1 + + + springDispatcherServlet + / + + + + + -- Gitee From 2aaeb2fe6e6eca09054be1db421611385da15bd1 Mon Sep 17 00:00:00 2001 From: wangyunlong Date: Tue, 29 Mar 2022 11:56:19 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E7=8E=8B=E4=BA=91=E9=BE=99=E6=90=AD?= =?UTF-8?q?=E5=BB=BA=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ssm_wyl/pom.xml | 217 ++++++++++++++++++ .../wang/controller/StudentController.java | 37 +++ .../main/java/com/wang/domain/Student.java | 24 ++ .../java/com/wang/mapper/StudentMapper.java | 7 + .../java/com/wang/service/StudentService.java | 7 + .../wang/service/impl/StudentServiceImpl.java | 11 + .../resources/applicationContext-mybatis.xml | 57 +++++ .../src/main/resources/database.properties | 11 + .../main/resources/mapper/StudentMapper.xml | 15 ++ .../src/main/resources/springmvc-servlet.xml | 19 ++ ssm_wyl/src/main/webapp/WEB-INF/web.xml | 54 +++++ ssm_wyl/src/main/webapp/index.jsp | 5 + 12 files changed, 464 insertions(+) create mode 100644 ssm_wyl/pom.xml create mode 100644 ssm_wyl/src/main/java/com/wang/controller/StudentController.java create mode 100644 ssm_wyl/src/main/java/com/wang/domain/Student.java create mode 100644 ssm_wyl/src/main/java/com/wang/mapper/StudentMapper.java create mode 100644 ssm_wyl/src/main/java/com/wang/service/StudentService.java create mode 100644 ssm_wyl/src/main/java/com/wang/service/impl/StudentServiceImpl.java create mode 100644 ssm_wyl/src/main/resources/applicationContext-mybatis.xml create mode 100644 ssm_wyl/src/main/resources/database.properties create mode 100644 ssm_wyl/src/main/resources/mapper/StudentMapper.xml create mode 100644 ssm_wyl/src/main/resources/springmvc-servlet.xml create mode 100644 ssm_wyl/src/main/webapp/WEB-INF/web.xml create mode 100644 ssm_wyl/src/main/webapp/index.jsp diff --git a/ssm_wyl/pom.xml b/ssm_wyl/pom.xml new file mode 100644 index 0000000..478fea5 --- /dev/null +++ b/ssm_wyl/pom.xml @@ -0,0 +1,217 @@ + + + + 4.0.0 + + org.example + ssm_wyl + 1.0-SNAPSHOT + war + + ssm_wyl Maven Webapp + + http://www.example.com + + + UTF-8 + 4.3.14.RELEASE + 1.7 + 1.7 + + + + + junit + junit + 4.11 + test + + + + org.springframework + spring-core + ${spring.version} + + + org.springframework + spring-beans + ${spring.version} + + + org.springframework + spring-context + ${spring.version} + + + org.springframework + spring-tx + ${spring.version} + + + org.springframework + spring-web + ${spring.version} + + + org.springframework + spring-webmvc + ${spring.version} + + + org.springframework + spring-aop + ${spring.version} + + + org.springframework + spring-expression + ${spring.version} + + + org.springframework + spring-jdbc + ${spring.version} + + + org.springframework + spring-test + ${spring.version} + test + + + + + + mysql + mysql-connector-java + 5.1.45 + + + + org.aspectj + aspectjweaver + 1.8.10 + + + org.aspectj + aspectjrt + 1.8.10 + + + + commons-fileupload + commons-fileupload + 1.3.3 + + + + commons-dbcp + commons-dbcp + 1.4 + + + commons-pool + commons-pool + 1.6 + + + + com.fasterxml.jackson.core + jackson-core + 2.9.0.pr3 + + + com.fasterxml.jackson.core + jackson-databind + 2.9.0.pr3 + + + com.fasterxml.jackson.core + jackson-annotations + 2.9.0.pr3 + + + + com.google.code.gson + gson + 2.8.2 + + + + com.alibaba + fastjson + 1.2.28 + + + + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + + javax.servlet + jstl + 1.2 + + + + + org.projectlombok + lombok + 1.16.10 + provided + + + com.baomidou + mybatis-plus + 3.3.2 + + + commons-codec + commons-codec + 1.15 + + + + + ssm_wyl + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-war-plugin + 3.2.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + + diff --git a/ssm_wyl/src/main/java/com/wang/controller/StudentController.java b/ssm_wyl/src/main/java/com/wang/controller/StudentController.java new file mode 100644 index 0000000..0c41372 --- /dev/null +++ b/ssm_wyl/src/main/java/com/wang/controller/StudentController.java @@ -0,0 +1,37 @@ +package com.wang.controller; + +import com.wang.domain.Student; +import com.wang.service.StudentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; + +@Controller +@RequestMapping("mp") +public class StudentController { + @Autowired + StudentService service; + + @RequestMapping("query") + @ResponseBody + public String query() { + + List list = service.list(); + System.out.println(list); + return null; + } + + @RequestMapping("add") + @ResponseBody + public String add() { + Student st = new Student(); + st.setName("ccc"); + st.setSno("1111"); + service.save(st); + + return null; + } +} diff --git a/ssm_wyl/src/main/java/com/wang/domain/Student.java b/ssm_wyl/src/main/java/com/wang/domain/Student.java new file mode 100644 index 0000000..15a77b1 --- /dev/null +++ b/ssm_wyl/src/main/java/com/wang/domain/Student.java @@ -0,0 +1,24 @@ +package com.wang.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "student") +public class Student { + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @TableField(value = "name") + private String name; + + @TableField(value = "sno") + private String sno; +} diff --git a/ssm_wyl/src/main/java/com/wang/mapper/StudentMapper.java b/ssm_wyl/src/main/java/com/wang/mapper/StudentMapper.java new file mode 100644 index 0000000..620b9d8 --- /dev/null +++ b/ssm_wyl/src/main/java/com/wang/mapper/StudentMapper.java @@ -0,0 +1,7 @@ +package com.wang.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wang.domain.Student; + +public interface StudentMapper extends BaseMapper { +} diff --git a/ssm_wyl/src/main/java/com/wang/service/StudentService.java b/ssm_wyl/src/main/java/com/wang/service/StudentService.java new file mode 100644 index 0000000..e4865c9 --- /dev/null +++ b/ssm_wyl/src/main/java/com/wang/service/StudentService.java @@ -0,0 +1,7 @@ +package com.wang.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.wang.domain.Student; + +public interface StudentService extends IService { +} diff --git a/ssm_wyl/src/main/java/com/wang/service/impl/StudentServiceImpl.java b/ssm_wyl/src/main/java/com/wang/service/impl/StudentServiceImpl.java new file mode 100644 index 0000000..dcc95a7 --- /dev/null +++ b/ssm_wyl/src/main/java/com/wang/service/impl/StudentServiceImpl.java @@ -0,0 +1,11 @@ +package com.wang.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.wang.domain.Student; +import com.wang.mapper.StudentMapper; +import com.wang.service.StudentService; +import org.springframework.stereotype.Service; + +@Service +public class StudentServiceImpl extends ServiceImpl implements StudentService { +} diff --git a/ssm_wyl/src/main/resources/applicationContext-mybatis.xml b/ssm_wyl/src/main/resources/applicationContext-mybatis.xml new file mode 100644 index 0000000..627cce5 --- /dev/null +++ b/ssm_wyl/src/main/resources/applicationContext-mybatis.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ssm_wyl/src/main/resources/database.properties b/ssm_wyl/src/main/resources/database.properties new file mode 100644 index 0000000..fcc4173 --- /dev/null +++ b/ssm_wyl/src/main/resources/database.properties @@ -0,0 +1,11 @@ +driver=com.mysql.jdbc.Driver +url=jdbc:mysql://127.0.0.1:3306/mybatis?useUnicode=true&characterEncoding=utf-8 +user=root +password=root +minIdle=45 +maxIdle=50 +initialSize=5 +maxActive=100 +maxWait=100 +removeAbandonedTimeout=180 +removeAbandoned=true diff --git a/ssm_wyl/src/main/resources/mapper/StudentMapper.xml b/ssm_wyl/src/main/resources/mapper/StudentMapper.xml new file mode 100644 index 0000000..bf25a0c --- /dev/null +++ b/ssm_wyl/src/main/resources/mapper/StudentMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + id, `name`, sno + + \ No newline at end of file diff --git a/ssm_wyl/src/main/resources/springmvc-servlet.xml b/ssm_wyl/src/main/resources/springmvc-servlet.xml new file mode 100644 index 0000000..86b706c --- /dev/null +++ b/ssm_wyl/src/main/resources/springmvc-servlet.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/ssm_wyl/src/main/webapp/WEB-INF/web.xml b/ssm_wyl/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..fd9ff6a --- /dev/null +++ b/ssm_wyl/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,54 @@ + + + + Archetype Created Web Application + + + contextConfigLocation + classpath:applicationContext-mybatis.xml + + + + + encodingFilter + org.springframework.web.filter.CharacterEncodingFilter + + encoding + UTF-8 + + + forceEncoding + true + + + + encodingFilter + /* + + + + + + org.springframework.web.context.ContextLoaderListener + + + + + + + springDispatcherServlet + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + classpath:springmvc-servlet.xml + + 1 + + + springDispatcherServlet + / + + + diff --git a/ssm_wyl/src/main/webapp/index.jsp b/ssm_wyl/src/main/webapp/index.jsp new file mode 100644 index 0000000..c38169b --- /dev/null +++ b/ssm_wyl/src/main/webapp/index.jsp @@ -0,0 +1,5 @@ + + +

Hello World!

+ + -- Gitee From ac2d5b3d54256b74921878e56170287a6e6e8133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=81=AA?= Date: Tue, 29 Mar 2022 12:04:33 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=90=AD=E5=BB=BAssm=E6=A1=86=E6=9E=B6=20?= =?UTF-8?q?=E5=B9=B6=E4=B8=94=E6=B5=8B=E8=AF=95mybatisplus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hxci/zc/domain/Student.java | 24 +++++++++++++++++++ .../com/hxci/zc/mapper/StudentMapper.java | 7 ++++++ .../com/hxci/zc/service/StudentService.java | 8 +++++++ .../zc/service/impl/StudentServiceImpl.java | 13 ++++++++++ .../main/resources/mapper/StudentMapper.xml | 15 ++++++++++++ ssm_zc_34/src/main/webapp/index.jsp | 5 ++++ 6 files changed, 72 insertions(+) create mode 100644 ssm_zc_34/src/main/java/com/hxci/zc/domain/Student.java create mode 100644 ssm_zc_34/src/main/java/com/hxci/zc/mapper/StudentMapper.java create mode 100644 ssm_zc_34/src/main/java/com/hxci/zc/service/StudentService.java create mode 100644 ssm_zc_34/src/main/java/com/hxci/zc/service/impl/StudentServiceImpl.java create mode 100644 ssm_zc_34/src/main/resources/mapper/StudentMapper.xml create mode 100644 ssm_zc_34/src/main/webapp/index.jsp diff --git a/ssm_zc_34/src/main/java/com/hxci/zc/domain/Student.java b/ssm_zc_34/src/main/java/com/hxci/zc/domain/Student.java new file mode 100644 index 0000000..e63e1a5 --- /dev/null +++ b/ssm_zc_34/src/main/java/com/hxci/zc/domain/Student.java @@ -0,0 +1,24 @@ +package com.hxci.zc.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "student") +public class Student { + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + @TableField(value = "name") + private String name; + + @TableField(value = "sno") + private String sno; +} \ No newline at end of file diff --git a/ssm_zc_34/src/main/java/com/hxci/zc/mapper/StudentMapper.java b/ssm_zc_34/src/main/java/com/hxci/zc/mapper/StudentMapper.java new file mode 100644 index 0000000..9c24384 --- /dev/null +++ b/ssm_zc_34/src/main/java/com/hxci/zc/mapper/StudentMapper.java @@ -0,0 +1,7 @@ +package com.hxci.zc.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hxci.zc.domain.Student; + +public interface StudentMapper extends BaseMapper { +} \ No newline at end of file diff --git a/ssm_zc_34/src/main/java/com/hxci/zc/service/StudentService.java b/ssm_zc_34/src/main/java/com/hxci/zc/service/StudentService.java new file mode 100644 index 0000000..0c52cc1 --- /dev/null +++ b/ssm_zc_34/src/main/java/com/hxci/zc/service/StudentService.java @@ -0,0 +1,8 @@ +package com.hxci.zc.service; + +import com.hxci.zc.domain.Student; +import com.baomidou.mybatisplus.extension.service.IService; +public interface StudentService extends IService{ + + +} diff --git a/ssm_zc_34/src/main/java/com/hxci/zc/service/impl/StudentServiceImpl.java b/ssm_zc_34/src/main/java/com/hxci/zc/service/impl/StudentServiceImpl.java new file mode 100644 index 0000000..4643c4f --- /dev/null +++ b/ssm_zc_34/src/main/java/com/hxci/zc/service/impl/StudentServiceImpl.java @@ -0,0 +1,13 @@ +package com.hxci.zc.service.impl; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hxci.zc.domain.Student; +import com.hxci.zc.mapper.StudentMapper; +import com.hxci.zc.service.StudentService; +@Service +public class StudentServiceImpl extends ServiceImpl implements StudentService{ + +} diff --git a/ssm_zc_34/src/main/resources/mapper/StudentMapper.xml b/ssm_zc_34/src/main/resources/mapper/StudentMapper.xml new file mode 100644 index 0000000..3d82ace --- /dev/null +++ b/ssm_zc_34/src/main/resources/mapper/StudentMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + id, `name`, sno + + \ No newline at end of file diff --git a/ssm_zc_34/src/main/webapp/index.jsp b/ssm_zc_34/src/main/webapp/index.jsp new file mode 100644 index 0000000..c38169b --- /dev/null +++ b/ssm_zc_34/src/main/webapp/index.jsp @@ -0,0 +1,5 @@ + + +

Hello World!

+ + -- Gitee From 545ccd8b79436f6c9fbfe47daa8d0a67449f7470 Mon Sep 17 00:00:00 2001 From: wangyunlong Date: Tue, 29 Mar 2022 12:19:12 +0800 Subject: [PATCH 5/5] test --- .../src/main/java/com/wang/controller/StudentController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssm_wyl/src/main/java/com/wang/controller/StudentController.java b/ssm_wyl/src/main/java/com/wang/controller/StudentController.java index 0c41372..d01cb57 100644 --- a/ssm_wyl/src/main/java/com/wang/controller/StudentController.java +++ b/ssm_wyl/src/main/java/com/wang/controller/StudentController.java @@ -14,7 +14,7 @@ import java.util.List; public class StudentController { @Autowired StudentService service; - +//111 @RequestMapping("query") @ResponseBody public String query() { -- Gitee