使用SSM整合实现增删改查

男娘i 2024-03-23 14:21 130阅读 0赞

SSM整合准备工作;
1、创建web模块,引入依赖;
2、创建数据表;
3、创建web.xml;
4、创建SpringMVC配置文件。

5、创建Spring的配置文件,配置扫描组件、配置数据源、配置事务管理器、配置开启事务注解;
6、创建service层,包括service接口和实现类;
7、搭建MyBatis环境,创建MyBatis核心配置文件,创建mapper接口,创建映射文件;
8、Spring整合MyBatis,在Spring的配置文件中,配置SqlSessionFactoryBean。

Spring整合MyBatis
1、搭建MyBatis环境,创建核心配置文件,创建mapper,映射文件;
2、在Spring配置文件中,添加两个配置,配置SqlSessionFactoryBean,配置扫描mapper接口MapperScannerConfigurer。

配置SqlSessionFactoryBean,可以从Spring IOC容器获取SqlSessionFactory对象
配置扫描mapper接口,将指定路径下所有接口,通过SqlSession对象创建对应的代理实现类对象,并交给Spring IOC容器管理。
就可以在service层,直接对依赖的mapper接口类型的对象进行自动装配。

引入依赖

  1. <properties>
  2. <!--spring版本-->
  3. <spring.version>5.3.1</spring.version>
  4. </properties>
  5. <dependencies>
  6. <dependency>
  7. <groupId>org.springframework</groupId>
  8. <artifactId>spring-context</artifactId>
  9. <version>${spring.version}</version>
  10. </dependency>
  11. <dependency>
  12. <groupId>org.springframework</groupId>
  13. <artifactId>spring-beans</artifactId>
  14. <version>${spring.version}</version>
  15. </dependency>
  16. <!--springmvc-->
  17. <dependency>
  18. <groupId>org.springframework</groupId>
  19. <artifactId>spring-web</artifactId>
  20. <version>${spring.version}</version>
  21. </dependency>
  22. <dependency>
  23. <groupId>org.springframework</groupId>
  24. <artifactId>spring-webmvc</artifactId>
  25. <version>${spring.version}</version>
  26. </dependency>
  27. <!--事务管理依赖的jar-->
  28. <dependency>
  29. <groupId>org.springframework</groupId>
  30. <artifactId>spring-jdbc</artifactId>
  31. <version>${spring.version}</version>
  32. </dependency>
  33. <dependency>
  34. <groupId>org.springframework</groupId>
  35. <artifactId>spring-aspects</artifactId>
  36. <version>${spring.version}</version>
  37. </dependency>
  38. <dependency>
  39. <groupId>org.springframework</groupId>
  40. <artifactId>spring-test</artifactId>
  41. <version>${spring.version}</version>
  42. </dependency>
  43. <!-- Mybatis核心 -->
  44. <dependency>
  45. <groupId>org.mybatis</groupId>
  46. <artifactId>mybatis</artifactId>
  47. <version>3.5.7</version>
  48. </dependency>
  49. <!--mybatis和spring的整合包-->
  50. <dependency>
  51. <groupId>org.mybatis</groupId>
  52. <artifactId>mybatis-spring</artifactId>
  53. <version>2.0.6</version>
  54. </dependency>
  55. <!-- 连接池 -->
  56. <dependency>
  57. <groupId>com.alibaba</groupId>
  58. <artifactId>druid</artifactId>
  59. <version>1.0.9</version>
  60. </dependency>
  61. <!-- junit测试 -->
  62. <dependency>
  63. <groupId>junit</groupId>
  64. <artifactId>junit</artifactId>
  65. <version>4.12</version>
  66. <scope>test</scope>
  67. </dependency>
  68. <!-- MySQL驱动 -->
  69. <dependency>
  70. <groupId>mysql</groupId>
  71. <artifactId>mysql-connector-java</artifactId>
  72. <version>8.0.16</version>
  73. </dependency>
  74. <!-- log4j日志 -->
  75. <dependency>
  76. <groupId>log4j</groupId>
  77. <artifactId>log4j</artifactId>
  78. <version>1.2.17</version>
  79. </dependency>
  80. <!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper -->
  81. <!--分页插件-->
  82. <dependency>
  83. <groupId>com.github.pagehelper</groupId>
  84. <artifactId>pagehelper</artifactId>
  85. <version>5.2.0</version>
  86. </dependency>
  87. <!-- 日志 Thymeleaf依赖slf4j日志,slf4j日志的具体实现logback依赖的jar -->
  88. <dependency>
  89. <groupId>ch.qos.logback</groupId>
  90. <artifactId>logback-classic</artifactId>
  91. <version>1.2.3</version>
  92. </dependency>
  93. <!-- ServletAPI -->
  94. <!--前端控制器DispatcherServlet间接实现了HttpServlet所依赖的jar-->
  95. <dependency>
  96. <groupId>javax.servlet</groupId>
  97. <artifactId>javax.servlet-api</artifactId>
  98. <version>3.1.0</version>
  99. <scope>provided</scope>
  100. </dependency>
  101. <!--json依赖的jar-->
  102. <dependency>
  103. <groupId>com.fasterxml.jackson.core</groupId>
  104. <artifactId>jackson-databind</artifactId>
  105. <version>2.12.1</version>
  106. </dependency>
  107. <!--文件上传-->
  108. <dependency>
  109. <groupId>commons-fileupload</groupId>
  110. <artifactId>commons-fileupload</artifactId>
  111. <version>1.3.1</version>
  112. </dependency>
  113. <!-- Spring5和Thymeleaf整合包 -->
  114. <dependency>
  115. <groupId>org.thymeleaf</groupId>
  116. <artifactId>thymeleaf-spring5</artifactId>
  117. <version>3.0.12.RELEASE</version>
  118. </dependency>
  119. </dependencies>

添加页面employee_add

  1. <form th:action="@{/emp}" method="post">
  2. <table>
  3. <tr>
  4. <th colspan="2">添加员工信息</th>
  5. </tr>
  6. <tr>
  7. <td>员工姓名</td>
  8. <td><input type="text" name="empName"/></td>
  9. </tr>
  10. <tr>
  11. <td>年龄</td>
  12. <td><input type="text" name="age"/></td>
  13. </tr>
  14. <tr>
  15. <td>性别</td>
  16. <td><input type="radio" name="sex" value="男"/>
  17. <input type="radio" name="sex" value="女"/>
  18. </td>
  19. </tr>
  20. <tr>
  21. <td>邮箱</td>
  22. <td><input type="text" name="email"></td>
  23. </tr>
  24. <tr>
  25. <td colspan="2">
  26. <input type="submit" value="添加">
  27. </td>
  28. </tr>
  29. </table>
  30. </form>
  31. </body>
  32. </html>

查询页面employee_list

  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>员工列表页面</title>
  6. <link rel="stylesheet" th:href="@{/static/css/index_work.css}">
  7. </head>
  8. <body>
  9. <h1>enployee.html</h1>
  10. <div id="app">
  11. <table>
  12. <tr>
  13. <th colspan="6">员工列表</th>
  14. </tr>
  15. <tr>
  16. <th>id</th>
  17. <th>姓名</th>
  18. <th>性别</th>
  19. <th>年龄</th>
  20. <th>邮箱</th>
  21. <th>操作<a th:href="@{/to/add}">(添加)</a> </th>
  22. </tr>
  23. <tr th:each="employee : ${employeeList}">
  24. <td th:text="${employee.empId}"></td>
  25. <td th:text="${employee.empName}"></td>
  26. <td th:text="${employee.sex}"></td>
  27. <td th:text="${employee.age}"></td>
  28. <td th:text="${employee.email}"></td>
  29. <td>
  30. <a @click="deleteEmployee()" th:href="@{'/emp/'+${employee.empId}}">删除</a>
  31. <a th:href="@{'/emp/'+${employee.empId}}">更新</a>
  32. </td>
  33. </tr>
  34. </table>
  35. <form method="post">
  36. <input type="hidden" name="_method" value="delete">
  37. </form>
  38. </div>
  39. <script type="text/javascript" th:src="@{/static/js/vue.js}"></script>
  40. <script type="text/javascript">
  41. var vue=new Vue({
  42. el:"#app",
  43. methods:{
  44. deleteEmployee(){
  45. //获取form表单
  46. var form = document.getElementsByTagName("form")[0];
  47. //将超链接的href的值赋值给表单的action属性
  48. form.action=event.target.href;
  49. //提交表单
  50. form.submit();
  51. //阻止超链接默认行为
  52. event.preventDefault();
  53. }
  54. }
  55. });
  56. </script>
  57. </body>
  58. </html>

更新页面employee_update

  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>更新员工信息</title>
  6. <link rel="stylesheet" th:href="@{/static/css/index_work.css}">
  7. </head>
  8. <body>
  9. <h1>employee_update.html</h1>
  10. </body>
  11. <form th:action="@{/emp}" method="post">
  12. <input type="hidden" name="_method" value="put">
  13. <!--要修改的员工id-->
  14. <input type="hidden" name="empId" th:value="${employee.empId}">
  15. <table>
  16. <tr>
  17. <th colspan="2">更新员工信息</th>
  18. </tr>
  19. <tr>
  20. <td>员工姓名</td>
  21. <td><input type="text" name="empName" th:value="${employee.empName}"/></td>
  22. </tr>
  23. <tr>
  24. <td>年龄</td>
  25. <td><input type="text" name="age" th:value="${employee.age}"/></td>
  26. </tr>
  27. <tr>
  28. <td>性别</td>
  29. <td><input type="radio" name="sex" value="男" th:field="${employee.sex}"/>
  30. <input type="radio" name="sex" value="女" th:field="${employee.sex}"/>
  31. </td>
  32. </tr>
  33. <tr>
  34. <td>邮箱</td>
  35. <td><input type="text" name="email" th:value="${employee.email}"></td>
  36. </tr>
  37. <tr>
  38. <td colspan="2">
  39. <input type="submit" value="更新">
  40. </td>
  41. </tr>
  42. </table>
  43. </form>
  44. </html>

在添加一个static包

index.html

  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>首页</title>
  6. </head>
  7. <body>
  8. <h1>index.xml</h1>
  9. <a th:href="@{/emp}">查看所有员工信息</a>
  10. </body>
  11. </html>

web.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
  5. version="4.0">
  6. <!--配置SpringMVC编码过滤器-->
  7. <filter>
  8. <filter-name>CharacterEncodingFilter</filter-name>
  9. <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  10. <init-param>
  11. <!--设置请求对象的编码-->
  12. <param-name>encoding</param-name>
  13. <param-value>UTF-8</param-value>
  14. </init-param>
  15. <init-param>
  16. <!--设置响应对象的编码-->
  17. <param-name>forceEncoding</param-name>
  18. <param-value>true</param-value>
  19. </init-param>
  20. </filter>
  21. <filter-mapping>
  22. <filter-name>CharacterEncodingFilter</filter-name>
  23. <url-pattern>/*</url-pattern>
  24. </filter-mapping>
  25. <!--配置处理请求方式的过滤器-->
  26. <filter>
  27. <filter-name>HiddenHttpMethodFilter</filter-name>
  28. <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
  29. </filter>
  30. <filter-mapping>
  31. <filter-name>HiddenHttpMethodFilter</filter-name>
  32. <url-pattern>/*</url-pattern>
  33. </filter-mapping>
  34. <display-name>Archetype Created Web Application</display-name>
  35. <!--配置前端控制器 DispatcherServlet-->
  36. <servlet>
  37. <servlet-name>SpringMVC</servlet-name>
  38. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  39. <!--在加载DispatcherServlet时,读取SpringMVC配置文件
  40. 默认在webapp/WEB-INF下读取配置文件,
  41. 指定SpringMVC配置文件位置
  42. -->
  43. <init-param>
  44. <param-name>contextConfigLocation</param-name>
  45. <param-value>classpath:springmvc.xml</param-value>
  46. </init-param>
  47. <!--设置加载DispatcherServlet的时机:在服务器启动时-->
  48. <load-on-startup>1</load-on-startup>
  49. </servlet>
  50. <!--配置servlet的映射关系-->
  51. <servlet-mapping>
  52. <servlet-name>SpringMVC</servlet-name>
  53. <!--设置请求的路径
  54. / 表示处理所有的请求路径,处理.jsp -> tomcat提供JSPServlet处理jsp资源
  55. -->
  56. <url-pattern>/</url-pattern>
  57. </servlet-mapping>
  58. <!--配置监听器
  59. 在读取spring配置文件的默认路径和名称:/WEB-INF,
  60. -->
  61. <listener>
  62. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  63. </listener>
  64. <!--设置上下文参数自定义spring配置文件的路径和名称-->
  65. <context-param>
  66. <param-name>contextConfigLocation</param-name>
  67. <param-value>classpath:spring.xml</param-value>
  68. </context-param>
  69. <context-param>
  70. <param-name/>
  71. <param-value/>
  72. </context-param>
  73. </web-app>
  74. 映射文件EmloyeeMapper.xml
  75. <?xml version="1.0" encoding="UTF-8" ?>
  76. <!DOCTYPE mapper
  77. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  78. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  79. <!--MyBatis的映射文件 编写sql-->
  80. <!--一个数据表对应一个实体类,一个实体类对应一个mapper映射文件-->
  81. <mapper namespace="com.dzqc.ssm.mapper.EmployeeMapper">
  82. <!--List<Employee> getAllEmployees();-->
  83. <select id="getAllEmployees" resultType="Employee">
  84. select * from t_emp
  85. </select>
  86. <!--Integer insertEmployee(Employee employee);-->
  87. <insert id="insertEmployee">
  88. insert into t_emp values (null,#{empName},#{age},#{sex},#{email})
  89. </insert>
  90. <!--Integer updateEmployee(Employee employee);-->
  91. <update id="updateEmployee">
  92. update t_emp set emp_name=#{empName},age=#{age},sex=#{sex},email=#{email} where emp_id=#{empId}
  93. </update>
  94. <!--Employee queryEmployee(@Param("empId") Integer id);-->
  95. <select id="queryEmployee" resultType="Employee">
  96. select*from t_emp where emp_id=#{empId}
  97. </select>
  98. <!--Integer deleteEmployee(@Param("empId") Integer id);-->
  99. <delete id="deleteEmployee">
  100. delete from t_emp where emp_id=#{empId}
  101. </delete>
  102. </mapper>

69763ae307bd4eb2a0377a8057dfa636.png

jdbc.properties

  1. jdbc.driver=com.mysql.cj.jdbc.Driver
  2. jdbc.url=jdbc:mysql://localhost:3306/ssm212?serverTimezone=UTC&characterEncoding=utf-8
  3. jdbc.username=root
  4. jdbc.password=123456

mybatis-config

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE configuration
  3. PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-config.dtd">
  5. <!--根标签-->
  6. <configuration>
  7. <!--读取配置文件-->
  8. <properties resource="jdbc.properties"></properties>
  9. <!--全局设置-->
  10. <settings>
  11. <!--开启驼峰命名自动映射 即下划线自动映射成驼峰命名-->
  12. <setting name="mapUnderscoreToCamelCase" value="true"/>
  13. </settings>
  14. <!--引入映射文件-->
  15. <mappers>
  16. <!--<mapper resource="com\dzqc\mapper\EmpMapper.xml"/>-->
  17. <package name="com.dzqc.ssm.mapper"/>
  18. </mappers>
  19. </configuration>

spring.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
  6. <!--扫描组件(除)-->
  7. <context:component-scan base-package="com.dzqc.ssm">
  8. <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
  9. </context:component-scan>
  10. <!--引入属性文件,可以使用${}获取key对应的值-->
  11. <context:property-placeholder location="classpath:jdbc.properties"></context:property-placeholder>
  12. <!--配置数据源-->
  13. <bean id="druidDataSource" class="com.alibaba.druid.pool.DruidDataSource">
  14. <property name="driverClassName" value="${jdbc.driver}"></property>
  15. <property name="url" value="${jdbc.url}"></property>
  16. <property name="username" value="${jdbc.username}"></property>
  17. <property name="password" value="${jdbc.password}"></property>
  18. </bean>
  19. <!--配置事务管理器-->
  20. <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  21. <property name="dataSource" ref="druidDataSource"></property>
  22. </bean>
  23. <!--配置开启事务管理,可以对注解 标识的方法或类中所有方法进行事务管理-->
  24. <tx:annotation-driven transaction-manager="transactionManager"></tx:annotation-driven>
  25. <!--配置SqlSessionFactoryBean,可以获取SpringIOC容器中的SessionFactory对象-->
  26. <bean class="org.mybatis.spring.SqlSessionFactoryBean">
  27. <!--设置MyBatis核心配置文件的位置-->
  28. <property name="configLocation" value="classpath:mybatis-config.xml"></property>
  29. <!--配置数据源-->
  30. <property name="dataSource" ref="druidDataSource"></property>
  31. <!--设置类型别名-->
  32. <property name="typeAliasesPackage" value="com.dzqc.ssm.pojo"></property>
  33. <!--设置映射文件位置,当映射文件和接口不在同一-->
  34. <!-- <property name="mapperLocations" value="classpath:mapper/*.xml"></property>-->
  35. </bean>
  36. <!--配置扫描mapper接口,可以将指定包下所有接口,
  37. 通过SqlSession对象创建mapper接口的代理实现类对象,并将对象交给IOC容器处理-->
  38. <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  39. <property name="basePackage" value="com.dzqc.ssm.mapper"></property>
  40. </bean>
  41. </beans>

springmvc.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
  6. <!--扫描组件(除)-->
  7. <context:component-scan base-package="com.dzqc.ssm">
  8. <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
  9. </context:component-scan>
  10. <!--引入属性文件,可以使用${}获取key对应的值-->
  11. <context:property-placeholder location="classpath:jdbc.properties"></context:property-placeholder>
  12. <!--配置数据源-->
  13. <bean id="druidDataSource" class="com.alibaba.druid.pool.DruidDataSource">
  14. <property name="driverClassName" value="${jdbc.driver}"></property>
  15. <property name="url" value="${jdbc.url}"></property>
  16. <property name="username" value="${jdbc.username}"></property>
  17. <property name="password" value="${jdbc.password}"></property>
  18. </bean>
  19. <!--配置事务管理器-->
  20. <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  21. <property name="dataSource" ref="druidDataSource"></property>
  22. </bean>
  23. <!--配置开启事务管理,可以对注解 标识的方法或类中所有方法进行事务管理-->
  24. <tx:annotation-driven transaction-manager="transactionManager"></tx:annotation-driven>
  25. <!--配置SqlSessionFactoryBean,可以获取SpringIOC容器中的SessionFactory对象-->
  26. <bean class="org.mybatis.spring.SqlSessionFactoryBean">
  27. <!--设置MyBatis核心配置文件的位置-->
  28. <property name="configLocation" value="classpath:mybatis-config.xml"></property>
  29. <!--配置数据源-->
  30. <property name="dataSource" ref="druidDataSource"></property>
  31. <!--设置类型别名-->
  32. <property name="typeAliasesPackage" value="com.dzqc.ssm.pojo"></property>
  33. <!--设置映射文件位置,当映射文件和接口不在同一-->
  34. <!-- <property name="mapperLocations" value="classpath:mapper/*.xml"></property>-->
  35. </bean>
  36. <!--配置扫描mapper接口,可以将指定包下所有接口,
  37. 通过SqlSession对象创建mapper接口的代理实现类对象,并将对象交给IOC容器处理-->
  38. <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  39. <property name="basePackage" value="com.dzqc.ssm.mapper"></property>
  40. </bean>
  41. </beans>

控制层EmployeeController

0fda61607024471f969066d6be3bfd94.png

数据访问层EmployeeMapper

be6eb0698ae34481b580fbe24e255f62.png

实体类Employee

8f715548525d4ce9a62a3267731a2e1f.png

业务逻辑层

41a50707880f4573bef56ec8af927749.png

项目结构

50feeab745cb4f70bc65917d4d0ef43c.png

查询页面

324754ce1b92443bbbfc614d31dfdd55.png

更新页面

30e1caab107748fb8e08da995357d314.png

删除页面

90c870ef19fd41a98e23dde99aba7442.png

添加页面

490cd08855a9427eba5a0da52ec3ce03.png

数据库

  1. /*
  2. Navicat MySQL Data Transfer
  3. Source Server : db
  4. Source Server Version : 50735
  5. Source Host : localhost:3306
  6. Source Database : ssm
  7. Target Server Type : MYSQL
  8. Target Server Version : 50735
  9. File Encoding : 65001
  10. Date: 2022-12-13 11:20:11
  11. */
  12. SET FOREIGN_KEY_CHECKS=0;
  13. -- ----------------------------
  14. -- Table structure for t_emp
  15. -- ----------------------------
  16. DROP TABLE IF EXISTS `t_emp`;
  17. CREATE TABLE `t_emp` (
  18. `emp_id` int(11) NOT NULL AUTO_INCREMENT,
  19. `emp_name` varchar(20) DEFAULT NULL,
  20. `age` int(11) DEFAULT NULL,
  21. `sex` char(1) DEFAULT NULL,
  22. `email` varchar(50) DEFAULT NULL,
  23. PRIMARY KEY (`emp_id`)
  24. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  25. -- ----------------------------
  26. -- Records of t_emp
  27. -- ----------------------------

发表评论

表情:
评论列表 (有 0 条评论,130人围观)

还没有评论,来说两句吧...

相关阅读

    相关 ssm整合增删

    总体的ssm整合增删改查的思想: > 1、一般我们做增删改查的项目的时候,我们可以先从数据层开始写,在数据层把增删改查的功能方法写好,然后再写业务逻辑层的逻辑,业务逻辑层接口