diff --git a/ssm_zgy_34/pom.xml b/ssm_zgy_34/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..7cc68f8e5ef568df5beb6a2b2f44d9c266669d81 --- /dev/null +++ b/ssm_zgy_34/pom.xml @@ -0,0 +1,236 @@ + + + + 4.0.0 + + org.example + ssm_zgy_34 + 1.0-SNAPSHOT + war + + ssm_zgy_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_zgy_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_zgy_34/src/main/java/com/hxci/zgy/controller/StudentController.java b/ssm_zgy_34/src/main/java/com/hxci/zgy/controller/StudentController.java new file mode 100644 index 0000000000000000000000000000000000000000..bb9a0f1a5335d41492bbb8440813f3bbcb26a392 --- /dev/null +++ b/ssm_zgy_34/src/main/java/com/hxci/zgy/controller/StudentController.java @@ -0,0 +1,33 @@ +package com.hxci.zgy.controller; + +import com.hxci.zgy.domain.Student; +import com.hxci.zgy.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.setUsername("吴彦祖"); + stu.setPhone("12344"); + service.save(stu); + return null; + } + + +} diff --git a/ssm_zgy_34/src/main/java/com/hxci/zgy/domain/Student.java b/ssm_zgy_34/src/main/java/com/hxci/zgy/domain/Student.java new file mode 100644 index 0000000000000000000000000000000000000000..950c59b6934932fdf27d13c68feacc6a04450c21 --- /dev/null +++ b/ssm_zgy_34/src/main/java/com/hxci/zgy/domain/Student.java @@ -0,0 +1,27 @@ +package com.hxci.zgy.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.INPUT) + private Integer id; + + @TableField(value = "username") + private String username; + + @TableField(value = "school") + private String school; + + @TableField(value = "phone") + private String phone; +} \ No newline at end of file diff --git a/ssm_zgy_34/src/main/java/com/hxci/zgy/mapper/StudentMapper.java b/ssm_zgy_34/src/main/java/com/hxci/zgy/mapper/StudentMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..1a2225c6db87c9014b4af6c0ab35ddc5531af075 --- /dev/null +++ b/ssm_zgy_34/src/main/java/com/hxci/zgy/mapper/StudentMapper.java @@ -0,0 +1,7 @@ +package com.hxci.zgy.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hxci.zgy.domain.Student; + +public interface StudentMapper extends BaseMapper { +} \ No newline at end of file diff --git a/ssm_zgy_34/src/main/java/com/hxci/zgy/service/StudentService.java b/ssm_zgy_34/src/main/java/com/hxci/zgy/service/StudentService.java new file mode 100644 index 0000000000000000000000000000000000000000..4be293ae10b41600cd8c9550191a74078f3e1c86 --- /dev/null +++ b/ssm_zgy_34/src/main/java/com/hxci/zgy/service/StudentService.java @@ -0,0 +1,8 @@ +package com.hxci.zgy.service; + +import com.hxci.zgy.domain.Student; +import com.baomidou.mybatisplus.extension.service.IService; +public interface StudentService extends IService{ + + +} diff --git a/ssm_zgy_34/src/main/java/com/hxci/zgy/service/impl/StudentServiceImpl.java b/ssm_zgy_34/src/main/java/com/hxci/zgy/service/impl/StudentServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..ed2e85a7cb9c9707ce1340eac09be0ec613f07c2 --- /dev/null +++ b/ssm_zgy_34/src/main/java/com/hxci/zgy/service/impl/StudentServiceImpl.java @@ -0,0 +1,13 @@ +package com.hxci.zgy.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.zgy.mapper.StudentMapper; +import com.hxci.zgy.domain.Student; +import com.hxci.zgy.service.StudentService; +@Service +public class StudentServiceImpl extends ServiceImpl implements StudentService{ + +} diff --git a/ssm_zgy_34/src/main/resources/applicationContext-mybatis.xml b/ssm_zgy_34/src/main/resources/applicationContext-mybatis.xml new file mode 100644 index 0000000000000000000000000000000000000000..85bc319ffcced8df45ea103f3074dbee09165efd --- /dev/null +++ b/ssm_zgy_34/src/main/resources/applicationContext-mybatis.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ssm_zgy_34/src/main/resources/database.properties b/ssm_zgy_34/src/main/resources/database.properties new file mode 100644 index 0000000000000000000000000000000000000000..5c94d29cecdfd5ee6c5e667a7771299e3f8ca801 --- /dev/null +++ b/ssm_zgy_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_zgy_34/src/main/resources/mapper/StudentMapper.xml b/ssm_zgy_34/src/main/resources/mapper/StudentMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..85ae3b54cbb5201d6bb7fcd7f6064afb54f7814d --- /dev/null +++ b/ssm_zgy_34/src/main/resources/mapper/StudentMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + id, username, school, phone + + \ No newline at end of file diff --git a/ssm_zgy_34/src/main/resources/springmvc-servlet.xml b/ssm_zgy_34/src/main/resources/springmvc-servlet.xml new file mode 100644 index 0000000000000000000000000000000000000000..0b33a5083e880fb89b7a1c80ef82b7ad7ab59386 --- /dev/null +++ b/ssm_zgy_34/src/main/resources/springmvc-servlet.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/ssm_zgy_34/src/main/webapp/WEB-INF/web.xml b/ssm_zgy_34/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000000000000000000000000000000000..c5feac52807cde07fa05a2043a27688a15509b6c --- /dev/null +++ b/ssm_zgy_34/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,62 @@ + + + + Archetype Created Web Application + + + + + contextConfigLocation + + classpath:applicationContext-*.xml + + + + log4jConfigLocation + classpath:log4j2.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_zgy_34/src/main/webapp/index.jsp b/ssm_zgy_34/src/main/webapp/index.jsp new file mode 100644 index 0000000000000000000000000000000000000000..c38169bb958579c635a5c09ee2f379cc5956c0c2 --- /dev/null +++ b/ssm_zgy_34/src/main/webapp/index.jsp @@ -0,0 +1,5 @@ + + +

Hello World!

+ +