在这里插入图片描述在这里插入图片描述在这里插入图片描述

MyBatis逆向工程

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfigurationPUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN""http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"><generatorConfiguration><context id="DB2Tables" targetRuntime="MyBatis3"><commentGenerator><property name="suppressAllComments" value="true" /></commentGenerator><!-- 配置数据库连接 --><jdbcConnection driverClass="com.mysql.jdbc.Driver"connectionURL="jdbc:mysql://localhost:3306/ssm_crud"userId="root"password="123"></jdbcConnection><javaTypeResolver ><property name="forceBigDecimals" value="false" /></javaTypeResolver><!-- 指定javaBean 的生成方式 --><javaModelGenerator targetPackage="it.bean"targetProject=".\src\main\java"><property name="enableSubPackages" value="true" /><property name="trimStrings" value="true" /></javaModelGenerator><!-- 指定sql映射文件的生成位置 --><sqlMapGenerator targetPackage="mapper"  targetProject=".\src\main\resources"><property name="enableSubPackages" value="true" /></sqlMapGenerator><!-- 指定dao接口生成的位置,mapper接口 --><javaClientGenerator type="XMLMAPPER" targetPackage="it.dao" targetProject=".\src\main\java"><property name="enableSubPackages" value="true" /></javaClientGenerator><table tableName="employees" domainObjectName="Employee"></table><table tableName="department" domainObjectName="Department"></table></context>
</generatorConfiguration>
package it.test;import java.io.File;
import java.util.ArrayList;
import java.util.List;import org.mybatis.generator.api.MyBatisGenerator;
import org.mybatis.generator.config.Configuration;
import org.mybatis.generator.config.xml.ConfigurationParser;
import org.mybatis.generator.internal.DefaultShellCallback;public class MBGTest {public static void main(String[] args) throws Exception {List<String> warnings = new ArrayList<String>();boolean overwrite = true;File configFile = new File("mbg.xml");ConfigurationParser cp = new ConfigurationParser(warnings);Configuration config = cp.parseConfiguration(configFile);DefaultShellCallback callback = new DefaultShellCallback(overwrite);MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);myBatisGenerator.generate(null);}
}

applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:c="http://www.springframework.org/schema/c"xmlns:cache="http://www.springframework.org/schema/cache"xmlns:context="http://www.springframework.org/schema/context"xmlns:jdbc="http://www.springframework.org/schema/jdbc"xmlns:jee="http://www.springframework.org/schema/jee"xmlns:lang="http://www.springframework.org/schema/lang"xmlns:mvc="http://www.springframework.org/schema/mvc"xmlns:mybatis-spring="http://mybatis.org/schema/mybatis-spring"xmlns:p="http://www.springframework.org/schema/p"xmlns:task="http://www.springframework.org/schema/task"xmlns:tx="http://www.springframework.org/schema/tx"xmlns:util="http://www.springframework.org/schema/util"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsdhttp://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsdhttp://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.3.xsdhttp://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsdhttp://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.1.xsdhttp://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsdhttp://mybatis.org/schema/mybatis-spring http://mybatis.org/schema/mybatis-spring-1.2.xsdhttp://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsdhttp://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd"><!-- 自动扫描,除了Controller 不扫描,其他都要扫描 --><context:component-scan base-package="it"><context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/></context:component-scan><!-- Spring的配置文件,这里主要配置和业务逻辑有关的 --><!-- 数据源,事务控制,xxx --><context:property-placeholder location="classpath:dbconfig.properties"/><bean id="pooledDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"><property name="jdbcUrl" value="${jdbc.jdbcUrl}"></property><property name="driverClass" value="${jdbc.driverClass}"></property><property name="user" value="${jdbc.user}"></property><property name="password" value="${jdbc.password}"></property></bean><!-- 配置MyBatis的整合 --><bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"><!-- 指定mybatis全局配置文件的位置 --><property name="configLocation" value="classpath:mybatis-config.xml"></property><property name="dataSource" ref="pooledDataSource"></property><!-- 指定mybatis,mapper文件的位置 --><property name="mapperLocations" value="classpath:mapper/*.xml"></property></bean><!-- 配置扫描器,将MyBatis接口的实现加入到IOC 容器中 --><bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"><!-- 扫描所有的dao接口的实现,加入到IOC 容器中 --><property name="basePackage" value="it"></property></bean><!-- 设置一个可以执行批量的SQLSession(MapperTest类中使用批量添加员工) --><bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate"> <constructor-arg name="sqlSessionFactory" ref="sqlSessionFactory"></constructor-arg><constructor-arg name="executorType" value="BATCH"></constructor-arg></bean><!-- 事务控制的配置 --><bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"><!-- 控制事务管理器 --><property name="dataSource" ref="pooledDataSource"></property></bean><!-- 开启基于注解的事务,或者使用xml配置形式的事务(必要和主要的事务都采取配置xml的形式) --><aop:config><!-- 配置切入点表达式 --><aop:pointcut expression="execution(* it.service..*(..))" id="txPoint"/><!-- 配置事务增强 --><aop:advisor advice-ref="txAdvice" pointcut-ref="txPoint"/></aop:config><!-- 配置事务增强,事务如何加入 --><tx:advice id="txAdvice"><tx:attributes><!-- 所有方法都是事务方法 --><tx:method name="*"/><!-- 所有的get开始的方法都是事务方法 --><tx:method name="get*" read-only="true"/></tx:attributes></tx:advice><!-- Spring配置文件的核心点: 数据源,与MyBatis的整合,事务控制 -->
</beans>

MyBatis-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configurationPUBLIC "-//mybatis.org//DTD Config 3.0//EN""http://mybatis.org/dtd/mybatis-3-config.dtd"><configuration><settings><setting name="mapUnderscoreToCamelCase" value="true"></setting></settings><!-- 给对应包下起别名 --><typeAliases><package name="it.bean"/></typeAliases><!-- 引入分页插件 --><plugins><plugin interceptor="com.github.pagehelper.PageInterceptor"><property name="reasonable" value="true"/></plugin></plugins></configuration>

controller层

package it.controller;import it.bean.Employee;
import it.bean.Msg;
import it.dao.EmployeeMapper;
import it.servlet.EmployeeService;import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;import javax.validation.Valid;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;import com.github.pagehelper.PageInfo;
import com.github.pagehelper.page.PageMethod;/*** 处理员工的CRUD 请求* * @author lenovo* */
@Controller
public class EmployeeController {@AutowiredEmployeeService employeeService;@RequestMapping("/success")public String test() {return "success";}/** 单个,批量* */@RequestMapping(value="/emp/{ids}",method=RequestMethod.DELETE)@ResponseBodypublic Msg deleteEmp(@PathVariable("ids")String ids) {//区分一下, 批量删除, 和单个删除if(ids.contains("-")) {String[] strings = ids.split("-");List<Integer> list = new ArrayList<Integer>();for (String str : strings) {list.add(Integer.parseInt(str));}employeeService.deleteEmps(list);}else {Integer id = Integer.parseInt(ids);employeeService.deleteEmployee(id);}return Msg.success();}/*** 1,如果直接发送ajax = PUT形式的请求* 封装数据* Employee 除empId,其他值全是NULL* 问题: 请求有数据,但是Employee对象封装不上,SQL语句出错* * 原因: Tomcat * 			1,将请求体的数据封装成一个map* 			2,request.getParameter("empName")就会从这个Map中获取对象;* 			3,SpringMVC 封装成POJO对象的时候,* 				会把POJO对象的每一个属性的值,会把request.getParamter("empName");* * AJAX 发送PUT请求引发的血案:* 		PUT请求:请求体中的数据:request.getParameter("empName")拿不到* 		是因为 Tomcat 一看是PUT 不会封装请求体为map,只有POST请求才封装请求体为map* 解决方案:* 我们要能支持直接发送PUT请求之类的请求还要封装请求体中的数据,* 1,配置上HttpPUTFormContentFilter,* 2,他的作用,将请求体中的数据解析包装成一个map* 3,request被重新包装,request.getParameter() 被重写,就会从自己封装的map中获取,* @param employee* @return*/@RequestMapping(value="/emp/{empId}",method=RequestMethod.PUT)@ResponseBodypublic Msg updateEmployee(Employee employee) {System.out.println("将要更新的员工: "+employee);employeeService.updateEmployee(employee);return Msg.success();}//根据id,查询员工 ,@PathVariable 表示从地址中获取参数@RequestMapping(value="/emp/{id}",method=RequestMethod.GET)@ResponseBodypublic Msg getEmpId(@PathVariable("id")Integer id) {Employee employee = employeeService.getEmpId(id);return Msg.success().addAttribute("employee", employee);}//检查员工名是否重复@RequestMapping("/chuckUserName")@ResponseBodypublic Msg chuckUserName(@RequestParam("empName") String empName) {//首先判断用户名是否合法String reg = "(^[a-zA-Z0-9_-]{6,16}$)|(^[\u2E80-\u9FFF]{2,5})";if(!empName.matches(reg)) {return Msg.fail().addAttribute("error", "用户名英文字母个数6-16,汉字2-5个");}//查询数据库, 首先先进行验证boolean b = employeeService.chuckUserName(empName);if(b) {return Msg.success();			}else {return Msg.fail().addAttribute("error", "用户名不可用");}}/*** 员工保存* @Valid 表示封装以后的数据要进行校验* BuindingResult 表示校验成功或者失败* @param employee* @return*/@RequestMapping(value="/emp",method=RequestMethod.POST)@ResponseBodypublic Msg saveEmp(@Valid Employee employee,BindingResult result) {//result.hasErros 表示校验成功或者失败Map<String,Object> map = new HashMap<String, Object>();if(result.hasErrors()) {//校验失败,应该返回失败,在模态框中显示校验失败的错误消息List<FieldError> list =	result.getFieldErrors();for (FieldError fieldError : list) {map.put(fieldError.getField(), fieldError.getDefaultMessage());}return Msg.fail().addAttribute("errorFields", map);}else {employeeService.saveEmp(employee);return Msg.success();			}}/*** 需要导入jackson 包* @param pn* @return*///该注解的作用是将返回值,自动分装成json 串 :@ResponseBody@RequestMapping("/emps")@ResponseBody	public Msg getEemployeesWithJSON(@RequestParam(value = "pn", defaultValue = "1") Integer pn) {// 引入PageHelper 分页插件// 在查询之前只需调用,.插入页面,以及每页的记录数PageMethod.startPage(pn, 3);// startPage 后面紧跟的这个查询就是一个分页查询List<Employee> list = employeeService.getEmployees();// 使用pageInfo包装查询的结果.只需要将pageInfo交给页面就行了// 封装详细的分页信息,包括我们查询出来的数据,5: 表示连续显示的5页PageInfo page = new PageInfo(list, 5);Msg msg = Msg.success();msg.addAttribute("pageInto", page);return msg;}/** 查询员工数据,(分页查询)* * @RequestParam(value="pn",defaultValue="1") Integer pn :pn* 表示分页查询,不传入值,默认值为1*///@RequestMapping("/emps")public String getEemployees(@RequestParam(value = "pn", defaultValue = "1") Integer pn,Model model) {// 引入PageHelper 分页插件// 在查询之前只需调用,.插入页面,以及每页的记录数PageMethod.startPage(pn, 3);System.out.println("a");// startPage 后面紧跟的这个查询就是一个分页查询List<Employee> list = employeeService.getEmployees();// 使用pageInfo包装查询的结果.只需要将pageInfo交给页面就行了// 封装详细的分页信息,包括我们查询出来的数据,5: 表示连续显示的5页PageInfo page = new PageInfo(list, 5);model.addAttribute("pageInfo", page);return "list";}
}
package it.controller;import it.bean.Department;
import it.bean.Msg;
import it.servlet.DepartmentService;import java.util.List;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;/*** 处理有关部门的操作* */
@Controller
public class DepartmentController {@Autowiredprivate DepartmentService departmentService;@RequestMapping("/depts")@ResponseBodypublic Msg getDepts() {List<Department> list =  departmentService.getDepartments();return Msg.success().addAttribute("depts",list);	}}

service层

package it.servlet;import it.bean.Employee;
import it.bean.EmployeeExample;
import it.bean.EmployeeExample.Criteria;
import it.dao.EmployeeMapper;import java.util.List;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;@Service
public class EmployeeService {@AutowiredEmployeeMapper employeeMapper;//查询所有员工没有条件public List<Employee> getEmployees() {return employeeMapper.selectByExampleDepartment(null);}public void saveEmp(Employee employee) {employeeMapper.insertSelective(employee);}/** 检查用户 名是否可用* count 表示记录数为零时,记录数可用*/public boolean chuckUserName(String empName) {//根据条件查询EmployeeExample example = new EmployeeExample();Criteria criteria = example.createCriteria();criteria.andEmpNameEqualTo(empName);long count = employeeMapper.countByExample(example);return count == 0;}public Employee getEmpId(Integer id) {Employee employee = employeeMapper.selectByPrimaryKey(id);return employee;}public void updateEmployee(Employee employee) {employeeMapper.updateByPrimaryKeySelective(employee);}public void deleteEmployee(Integer id) {employeeMapper.deleteByPrimaryKey(id);}public void deleteEmps(List<Integer> strings) {EmployeeExample example = new EmployeeExample();Criteria criteria = example.createCriteria();//sql 语句就变成 delete from xxx where emp_id in(...)criteria.andEmpIdIn(strings);employeeMapper.deleteByExample(example);}
}
package it.servlet;import it.bean.Department;
import it.dao.DepartmentMapper;import java.util.List;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;@Service
public class DepartmentService {@Autowiredprivate DepartmentMapper departmentMapper;public List<Department> getDepartments() {return departmentMapper.selectByExample(null);}}

DAO层

package it.dao;import it.bean.Employee;
import it.bean.EmployeeExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;@Service
public interface EmployeeMapper {long countByExample(EmployeeExample example);int deleteByExample(EmployeeExample example);int deleteByPrimaryKey(Integer empId);int insert(Employee record);int insertSelective(Employee record);List<Employee> selectByExample(EmployeeExample example);Employee selectByPrimaryKey(Integer empId);List<Employee> selectByExampleDepartment(EmployeeExample example);Employee selectByPrimaryKeyDepartment(Integer empId);int updateByExampleSelective(@Param("record") Employee record, @Param("example") EmployeeExample example);int updateByExample(@Param("record") Employee record, @Param("example") EmployeeExample example);int updateByPrimaryKeySelective(Employee record);int updateByPrimaryKey(Employee record);}
package it.dao;import it.bean.Department;
import it.bean.DepartmentExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;@Service
public interface DepartmentMapper {long countByExample(DepartmentExample example);int deleteByExample(DepartmentExample example);int deleteByPrimaryKey(Integer depId);int insert(Department record);int insertSelective(Department record);List<Department> selectByExample(DepartmentExample example);Department selectByPrimaryKey(Integer depId);int updateByExampleSelective(@Param("record") Department record, @Param("example") DepartmentExample example);int updateByExample(@Param("record") Department record, @Param("example") DepartmentExample example);int updateByPrimaryKeySelective(Department record);int updateByPrimaryKey(Department record);
}

EmployeeMapper.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="it.dao.EmployeeMapper"><resultMap id="BaseResultMap" type="it.bean.Employee"><id column="emp_id" jdbcType="INTEGER" property="empId" /><result column="emp_name" jdbcType="VARCHAR" property="empName" /><result column="emp_gender" jdbcType="VARCHAR" property="empGender" /><result column="emp_email" jdbcType="VARCHAR" property="empEmail" /><result column="dep_id" jdbcType="INTEGER" property="depId" /></resultMap><sql id="Example_Where_Clause"><where><foreach collection="oredCriteria" item="criteria" separator="or"><if test="criteria.valid"><trim prefix="(" prefixOverrides="and" suffix=")"><foreach collection="criteria.criteria" item="criterion"><choose><when test="criterion.noValue">and ${criterion.condition}</when><when test="criterion.singleValue">and ${criterion.condition} #{criterion.value}</when><when test="criterion.betweenValue">and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}</when><when test="criterion.listValue">and ${criterion.condition}<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">#{listItem}</foreach></when></choose></foreach></trim></if></foreach></where></sql><sql id="Update_By_Example_Where_Clause"><where><foreach collection="example.oredCriteria" item="criteria" separator="or"><if test="criteria.valid"><trim prefix="(" prefixOverrides="and" suffix=")"><foreach collection="criteria.criteria" item="criterion"><choose><when test="criterion.noValue">and ${criterion.condition}</when><when test="criterion.singleValue">and ${criterion.condition} #{criterion.value}</when><when test="criterion.betweenValue">and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}</when><when test="criterion.listValue">and ${criterion.condition}<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">#{listItem}</foreach></when></choose></foreach></trim></if></foreach></where></sql><sql id="Base_Column_List">emp_id, emp_name, emp_gender, emp_email, dep_id</sql><!-- 添加员工加部门的查询 --><!--  List<Employee> selectByExampleDepartment(EmployeeExample example); --><select id="selectByExampleDepartment" parameterType="it.bean.EmployeeExample" resultMap="WithDepartmentResultMap">select<if test="distinct">distinct</if><include refid="WithDepartment_Column_List" />from employees eleft join department d on e.dep_id = d.dep_id<if test="_parameter != null"><include refid="Example_Where_Clause" /></if><if test="orderByClause != null">order by ${orderByClause}</if></select><sql id="WithDepartment_Column_List">e.emp_id,e.emp_name,emp_gender,emp_email,e.dep_id,d.dep_id,d.dep_name</sql><resultMap type="it.bean.Employee" id="WithDepartmentResultMap"><id column="emp_id" jdbcType="INTEGER" property="empId" /><result column="emp_name" jdbcType="VARCHAR" property="empName" /><result column="emp_gender" jdbcType="VARCHAR" property="empGender" /><result column="emp_email" jdbcType="VARCHAR" property="empEmail" /><result column="dep_id" jdbcType="INTEGER" property="depId" /><!-- 查询员工的部门信息 --><association property="department" javaType="it.bean.Department"><id column="dep_id" property="depId"/><result column="dep_name" property="depName"/></association></resultMap><!-- Employee selectByPrimaryKeyDepartment(Integer empId); --><select id="selectByPrimaryKeyDepartment" parameterType="java.lang.Integer" resultMap="WithDepartmentResultMap">select <include refid="WithDepartment_Column_List" />from employees eleft join department d on e.dep_id = d.dep_idwhere emp_id = #{empId,jdbcType=INTEGER}</select><select id="selectByExample" parameterType="it.bean.EmployeeExample" resultMap="BaseResultMap">select<if test="distinct">distinct</if><include refid="Base_Column_List" />from employees<if test="_parameter != null"><include refid="Example_Where_Clause" /></if><if test="orderByClause != null">order by ${orderByClause}</if></select><select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">select <include refid="Base_Column_List" />from employeeswhere emp_id = #{empId,jdbcType=INTEGER}</select><delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">delete from employeeswhere emp_id = #{empId,jdbcType=INTEGER}</delete><delete id="deleteByExample" parameterType="it.bean.EmployeeExample">delete from employees<if test="_parameter != null"><include refid="Example_Where_Clause" /></if></delete><insert id="insert" parameterType="it.bean.Employee">insert into employees (emp_id, emp_name, emp_gender, emp_email, dep_id)values (#{empId,jdbcType=INTEGER}, #{empName,jdbcType=VARCHAR}, #{empGender,jdbcType=VARCHAR}, #{empEmail,jdbcType=VARCHAR}, #{depId,jdbcType=INTEGER})</insert><insert id="insertSelective" parameterType="it.bean.Employee">insert into employees<trim prefix="(" suffix=")" suffixOverrides=","><if test="empId != null">emp_id,</if><if test="empName != null">emp_name,</if><if test="empGender != null">emp_gender,</if><if test="empEmail != null">emp_email,</if><if test="depId != null">dep_id,</if></trim><trim prefix="values (" suffix=")" suffixOverrides=","><if test="empId != null">#{empId,jdbcType=INTEGER},</if><if test="empName != null">#{empName,jdbcType=VARCHAR},</if><if test="empGender != null">#{empGender,jdbcType=VARCHAR},</if><if test="empEmail != null">#{empEmail,jdbcType=VARCHAR},</if><if test="depId != null">#{depId,jdbcType=INTEGER},</if></trim></insert><select id="countByExample" parameterType="it.bean.EmployeeExample" resultType="java.lang.Long">select count(*) from employees<if test="_parameter != null"><include refid="Example_Where_Clause" /></if></select><update id="updateByExampleSelective" parameterType="map">update employees<set><if test="record.empId != null">emp_id = #{record.empId,jdbcType=INTEGER},</if><if test="record.empName != null">emp_name = #{record.empName,jdbcType=VARCHAR},</if><if test="record.empGender != null">emp_gender = #{record.empGender,jdbcType=VARCHAR},</if><if test="record.empEmail != null">emp_email = #{record.empEmail,jdbcType=VARCHAR},</if><if test="record.depId != null">dep_id = #{record.depId,jdbcType=INTEGER},</if></set><if test="_parameter != null"><include refid="Update_By_Example_Where_Clause" /></if></update><update id="updateByExample" parameterType="map">update employeesset emp_id = #{record.empId,jdbcType=INTEGER},emp_name = #{record.empName,jdbcType=VARCHAR},emp_gender = #{record.empGender,jdbcType=VARCHAR},emp_email = #{record.empEmail,jdbcType=VARCHAR},dep_id = #{record.depId,jdbcType=INTEGER}<if test="_parameter != null"><include refid="Update_By_Example_Where_Clause" /></if></update><update id="updateByPrimaryKeySelective" parameterType="it.bean.Employee">update employees<set><if test="empName != null">emp_name = #{empName,jdbcType=VARCHAR},</if><if test="empGender != null">emp_gender = #{empGender,jdbcType=VARCHAR},</if><if test="empEmail != null">emp_email = #{empEmail,jdbcType=VARCHAR},</if><if test="depId != null">dep_id = #{depId,jdbcType=INTEGER},</if></set>where emp_id = #{empId,jdbcType=INTEGER}</update><update id="updateByPrimaryKey" parameterType="it.bean.Employee">update employeesset emp_name = #{empName,jdbcType=VARCHAR},emp_gender = #{empGender,jdbcType=VARCHAR},emp_email = #{empEmail,jdbcType=VARCHAR},dep_id = #{depId,jdbcType=INTEGER}where emp_id = #{empId,jdbcType=INTEGER}</update>
</mapper>

DepartmentMapper.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="it.dao.DepartmentMapper"><resultMap id="BaseResultMap" type="it.bean.Department"><id column="dep_id" jdbcType="INTEGER" property="depId" /><result column="dep_name" jdbcType="VARCHAR" property="depName" /></resultMap><sql id="Example_Where_Clause"><where><foreach collection="oredCriteria" item="criteria" separator="or"><if test="criteria.valid"><trim prefix="(" prefixOverrides="and" suffix=")"><foreach collection="criteria.criteria" item="criterion"><choose><when test="criterion.noValue">and ${criterion.condition}</when><when test="criterion.singleValue">and ${criterion.condition} #{criterion.value}</when><when test="criterion.betweenValue">and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}</when><when test="criterion.listValue">and ${criterion.condition}<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">#{listItem}</foreach></when></choose></foreach></trim></if></foreach></where></sql><sql id="Update_By_Example_Where_Clause"><where><foreach collection="example.oredCriteria" item="criteria" separator="or"><if test="criteria.valid"><trim prefix="(" prefixOverrides="and" suffix=")"><foreach collection="criteria.criteria" item="criterion"><choose><when test="criterion.noValue">and ${criterion.condition}</when><when test="criterion.singleValue">and ${criterion.condition} #{criterion.value}</when><when test="criterion.betweenValue">and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}</when><when test="criterion.listValue">and ${criterion.condition}<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">#{listItem}</foreach></when></choose></foreach></trim></if></foreach></where></sql><sql id="Base_Column_List">dep_id, dep_name</sql><select id="selectByExample" parameterType="it.bean.DepartmentExample" resultMap="BaseResultMap">select<if test="distinct">distinct</if><include refid="Base_Column_List" />from department<if test="_parameter != null"><include refid="Example_Where_Clause" /></if><if test="orderByClause != null">order by ${orderByClause}</if></select><select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">select <include refid="Base_Column_List" />from departmentwhere dep_id = #{depId,jdbcType=INTEGER}</select><delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">delete from departmentwhere dep_id = #{depId,jdbcType=INTEGER}</delete><delete id="deleteByExample" parameterType="it.bean.DepartmentExample">delete from department<if test="_parameter != null"><include refid="Example_Where_Clause" /></if></delete><insert id="insert" parameterType="it.bean.Department">insert into department (dep_id, dep_name)values (#{depId,jdbcType=INTEGER}, #{depName,jdbcType=VARCHAR})</insert><insert id="insertSelective" parameterType="it.bean.Department">insert into department<trim prefix="(" suffix=")" suffixOverrides=","><if test="depId != null">dep_id,</if><if test="depName != null">dep_name,</if></trim><trim prefix="values (" suffix=")" suffixOverrides=","><if test="depId != null">#{depId,jdbcType=INTEGER},</if><if test="depName != null">#{depName,jdbcType=VARCHAR},</if></trim></insert><select id="countByExample" parameterType="it.bean.DepartmentExample" resultType="java.lang.Long">select count(*) from department<if test="_parameter != null"><include refid="Example_Where_Clause" /></if></select><update id="updateByExampleSelective" parameterType="map">update department<set><if test="record.depId != null">dep_id = #{record.depId,jdbcType=INTEGER},</if><if test="record.depName != null">dep_name = #{record.depName,jdbcType=VARCHAR},</if></set><if test="_parameter != null"><include refid="Update_By_Example_Where_Clause" /></if></update><update id="updateByExample" parameterType="map">update departmentset dep_id = #{record.depId,jdbcType=INTEGER},dep_name = #{record.depName,jdbcType=VARCHAR}<if test="_parameter != null"><include refid="Update_By_Example_Where_Clause" /></if></update><update id="updateByPrimaryKeySelective" parameterType="it.bean.Department">update department<set><if test="depName != null">dep_name = #{depName,jdbcType=VARCHAR},</if></set>where dep_id = #{depId,jdbcType=INTEGER}</update><update id="updateByPrimaryKey" parameterType="it.bean.Department">update departmentset dep_name = #{depName,jdbcType=VARCHAR}where dep_id = #{depId,jdbcType=INTEGER}</update>
</mapper>

SpringMVC

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xmlns:mvc="http://www.springframework.org/schema/mvc"xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsdhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd"><!--SpringMVC的配置文件,包含网站跳转逻辑的控制,配置  --><context:component-scan base-package="it" use-default-filters="false"><!--只扫描控制器。  --><context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/></context:component-scan><!--配置视图解析器,方便页面返回  --><bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"><property name="prefix" value="/WEB-INF/views/"></property><property name="suffix" value=".jsp"></property></bean><!--两个标准配置  --><!-- 将springmvc不能处理的请求交给tomcat --><mvc:default-servlet-handler/><mvc:view-controller path="/list" view-name="list"/><!-- 能支持springmvc更高级的一些功能,JSR303校验,快捷的ajax...映射动态请求 --><mvc:annotation-driven/></beans>

index.jsp

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
pageContext.setAttribute("Path",request.getContextPath());
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><base href="<%=basePath%>"><title>员工列表</title><meta http-equiv="pragma" content="no-cache"><meta http-equiv="cache-control" content="no-cache"><meta http-equiv="expires" content="0">    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"><meta http-equiv="description" content="This is my page"><!-- 引入样式 --><script type="text/javascript" src="${Path }/static/js/jquery-1.12.4.min.js"></script><!-- 引入样式 --><link href="${Path }/static/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet"><script src="${Path }/static/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script></head><body><!-- 员工修改的模态框 --><div class="modal fade" id="empUpdateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title" id="myModalLabel">员工修改</h4></div><div class="modal-body"><form class="form-horizontal"><div class="form-group"><label class="col-sm-2 control-label">empName</label><div class="col-sm-10"><!-- 静态输入框 --><p class="form-control-static" id="empNameUpdateStatic"></p></div></div><div class="form-group"><label class="col-sm-2 control-label">email</label><div class="col-sm-10"><input type="text" name="empEmail" class="form-control" id="empEmail_update_input" placeholder="email@atguigu.com"><span class="help-block"></span></div></div><div class="form-group"><label class="col-sm-2 control-label">gender</label><div class="col-sm-10"><label class="radio-inline"><input type="radio" name="empGender" id="gender1_update_input" value="1" checked="checked"></label><label class="radio-inline"><input type="radio" name="empGender" id="gender2_update_input" value="0"></label></div></div><div class="form-group"><label class="col-sm-2 control-label">deptName</label><div class="col-sm-4"><!-- 部门提交部门id即可 --><select class="form-control" name="depId" ></select></div></div></form></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">关闭</button><button type="button" class="btn btn-primary" id="emp_update_btn">修改</button></div></div></div></div><!-- 员工添加的模态框 --><div class="modal fade" id="empAddModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title" id="myModalLabel">员工添加</h4></div><div class="modal-body"><form class="form-horizontal"><div class="form-group"><label class="col-sm-2 control-label">empName</label><div class="col-sm-10"><input type="text" name="empName" class="form-control" id="empName_add_input" placeholder="empName"><span class="help-block"></span></div></div><div class="form-group"><label class="col-sm-2 control-label">email</label><div class="col-sm-10"><input type="text" name="empEmail" class="form-control" id="empEmail_add_input" placeholder="email@qq.com"><span class="help-block"></span></div></div><div class="form-group"><label class="col-sm-2 control-label">gender</label><div class="col-sm-10"><label class="radio-inline"><input type="radio" name="empGender" id="gender1_add_input" value="0" checked="checked"></label><label class="radio-inline"><input type="radio" name="empGender" id="gender2_add_input" value="1"></label></div></div><div class="form-group"><label class="col-sm-2 control-label">deptName</label><div class="col-sm-4"><!-- 部门提交部门id即可 --><select class="form-control" name="depId" ></select></div></div></form></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">关闭</button><button type="button" class="btn btn-primary" id="emp_save_btn">保存</button></div></div></div></div><!-- 搭建显示页面 --><div class="container"><!-- 第一行: 标题 --><div class="row"><div class="col-md-12"><h1>员工表(SSM-CRUD)</h1></div> <!-- 表示标题占12--></div><!-- 第二行: 按钮 --><div class="row"><div class="col-md-4 col-md-offset-8"><button class="btn btn-primary" id="emp_add_model">新增</button><button class="btn btn-danger" id="emp_delete_all_btn">删除</button> 				</div></div><!-- 第三行: 员工表格 --><div class="row"><div class="col-md-12"><table class="table table-hover" id="emps_table"><thead><tr><th><input type="checkbox" id="check_all"/></th><th>#</th><th>姓名</th><th>性别</th><th>邮箱</th><th>部门</th><th>操作</th></tr></thead><tbody></tbody></table></div></div><!-- 显示分页信息 --><div class="row"><!-- 分页文字信息 --><div class="col-md-6" id="page_info_area"></div><!-- 分页条信息 --><div class="col-md-6" id="page_nav_area"></div></div></div><script type="text/javascript">var totalRecord; //用于添加用户时,获取总页面数,进行跳转到最后一页var currentPage; //表示当前页面//1,页面加载完成后,直接去发送一个ajax请求,要到分页数据$(function(){//去首页to_page(1);});function to_page(pn) {$.ajax({url:"${Path }/emps",data:"pn=" + pn,type:"GET",success:function(result) {//console.log(result);//1,解析并显示员工信息build_emps_table(result);//2,显示页码信息build_page_info(result);//2,解析并显示分页信息build_page_nav(result);}});}function build_emps_table(result) {//清空table表格$("#emps_table tbody").empty();var emps = result.ma.pageInto.list;//遍历员工$.each(emps,function(index,item) {var checkBoxTd = $("<td><input type='checkbox' class='check_item'/></td>");var empIdTd = $("<td></td>").append(item.empId);var empNameTd = $("<td></td>").append(item.empName);var genderTd = $("<td></td>").append(item.empGender == "1" ? "男" : "女");var deptNameTd = $("<td></td>").append(item.department.depName);var emailTd = $("<td></td>").append(item.empEmail);/*<button class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>编辑</button><button class="btn btn-danger btn-sm"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span>删除</button>*/var editBtn = $("<button></button>").addClass("btn btn-primary btn-sm edit_btn").append($("<span></span>").addClass("glyphicon glyphicon-pencil")).append("修改");//添加一个自定义的属性,用于员工修改操作时,根据id,获取员工editBtn.attr("emp_edit_id",item.empId);var delBtn = $("<button></button>").addClass("btn btn-danger btn-sm delete_btn").append($("<span></span>").addClass("glyphicon glyphicon-trash")).append("删除");//当删除按钮添加一个自定义的属性表示当前删除的员工的iddelBtn.attr("del-id",item.empId);var btnTd = $("<tb></tb>").append(editBtn).append(delBtn);//append 方法执行完成以后,还是返回原来的元素$("<tr></tr>").append(checkBoxTd).append(empIdTd).append(empNameTd).append(genderTd).append(emailTd).append(deptNameTd).append(btnTd).appendTo("#emps_table tbody");});}//解析显示分页信息function build_page_info(result) {$("#page_info_area").empty();$("#page_info_area").append("当前" + result.ma.pageInto.pageNum + "页,总共"+ result.ma.pageInto.pages+"页,总共"+result.ma.pageInto.total+"条记录");totalRecord = result.ma.pageInto.total;currentPage = result.ma.pageInto.pageNum;}//解析显示分页条function build_page_nav(result) {//page_nav_area$("#page_nav_area").empty();var ul = $("<ur></ur>").addClass("pagination"); var firstPageLi = $("<li></li>").append($("<a></a>").append("首页").attr("href","#")); //设置首页var prePageLi = $("<li></li>").append($("<a></a>").append("&laquo;")); //设置前一页if(result.ma.pageInto.hasPreviousPage == false) {	//当没有前一页,赋值一个disabledfirstPageLi.addClass("disabled");prePageLi.addClass("disabled");}else {//为元素添加点击翻页事件firstPageLi.click(function() {to_page(1);});prePageLi.click(function() {to_page(result.ma.pageInto.pageNum-1);});}//添加首页,上一页提示ul.append(firstPageLi).append(prePageLi);var nextPageLi = $("<li></li>").append($("<a></a>").append("&raquo;")); //设置后一页		var lastPageLi = $("<li></li>").append($("<a></a>").append("末页").attr("href","#"));	  //设置末页if(result.ma.pageInto.hasNextPage == false) {nextPageLi.addClass("disabled");lastPageLi.addClass("disabled");}else {//为下一页,末页绑定点击事件nextPageLi.click(function() {to_page(result.ma.pageInto.pageNum+1);});lastPageLi.click(function() {to_page(result.ma.pageInto.pages);});//添加首页和前一页的提示ul.append(firstPageLi).append(prePageLi);}$.each(result.ma.pageInto.navigatepageNums,function(index,item) {var numLi =  $("<li></li>").append($("<a></a>").append(item));//添加标识符if(result.ma.pageInto.pageNum == item) {numLi.addClass("active");}//绑定一个点击事件numLi.click(function() {to_page(item);});//添加页码ul.append(numLi);});//添加下一页和末页ul.append(nextPageLi).append(lastPageLi);var navEle = $("<nav></nav>").append(ul);navEle.appendTo("#page_nav_area");}//完整的清空表单样式,以及内容function reset_form(ele) {$(ele)[0].reset();//清空表单样式$(ele).find("*").removeClass("has-error has-success");$(ele).find(".help-block").text("");}//点击新增按钮, 弹出模态框$("#emp_add_model").click(function() {//清除表单数据(表单完整重置)reset_form("#empAddModal form");$("#empAddModal form")[0].reset();//发送ajax请求,查询部门信息显示在下拉列表中getDepts("#empAddModal select");//模态框弹出$("#empAddModal").modal({//向modal设置一些属性backdrop:"static"});});//查询所有的部门信息, 并显示在下拉列表中function getDepts(ele) {//清空下拉列表中的元素$(ele).empty();$.ajax({url:"${Path}/depts",type:"GET",success:function(result) {//console.log(result);//$("#empAddModal select")$.each(result.ma.depts,function() {var optionEle = $("<option></option>").append(this.depName).attr("value",this.depId);optionEle.appendTo(ele);});}});}//点击保存的方法$("#emp_save_btn").click(function() {//将模态框中填写的表单数据交给服务器进行保存//1,先对要提交给服务器的数据 进行校验(前端校验)if(!validate_add_form()) {return false;}//判断之前的ajax用户名校验是否成功if($(this).attr("ajax-va") == "error") {return false;}//2,发送ajax请求保存员工$.ajax({url:"${Path}/emp",type:"POST",data:$("#empAddModal form").serialize(),success: function(result) {//alert(result.str);if(result.state == 100) {//员工保存成功//1,关闭模态框$("#empAddModal").modal("hide");//2,来到最后一页,显示刚才保存的数据//发送ajax请求,显示最后一页数据即可to_page(totalRecord);}else {//显示失败信息//console.log(result);//后端校验if(underfined == result.ma.errorField.email) {//显示邮箱的错误信息show_validate_msg("#empEmail_add_input","error",result.ma.errorField.email);}if(underfined == result.ma.error.empName) {//显示邮箱的错误信息show_validate_msg("#empName_add_input","error",result.ma.error.empName);} }}});});//该方法用于数据提交表单数据校验function validate_add_form() {//1,拿到要校验的数据,使用正则表达式//校验用户名var empName = $("#empName_add_input").val();var regName = /(^[a-zA-Z0-9_-]{6,16}$)|(^[\u2E80-\u9FFF]{2,5})/;// /(^[a-zA-Z0-9_-]{6,16}$)|(^[\u2E80-\u9FFF]{2,5})////(^[a_zA_Z0_9_-]{6,16}$)|(^[\u2E80-\u9FFF]{2,6})/if(!regName.test(empName)) {//alert("用户名可以是2-6位的中文或者6-16位的英文和数字组合");show_validate_msg("#empName_add_input","error","用户名可以是2-6位的中文或者6-16位的英文和数字组合");return false;}else {show_validate_msg("#empName_add_input","success","");}	//校验邮箱var empEmail = $("#empEmail_add_input").val();var regEmail = /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/;if(!regEmail.test(empEmail)) {//应该清空这个元素之前的格式show_validate_msg("#empEmail_add_input","error","邮箱格式错误");return false;}else {show_validate_msg("#empEmail_add_input","success","");}return true;}//function show_validate_msg(ele,status,msg) {//清除元素的状态,元素之间的格式$(ele).parent().removeClass("has-success has-error");$(ele).next("span").text("");if("success" == status) {$(ele).parent().addClass("has-success");$(ele).next("span").text("");}else if("error" == status) {$(ele).parent().addClass("has-error");$(ele).next("span").text(msg);}}//校验用户名是否可用$("#empName_add_input").change(function() {//发送ajax请求校验用户名是否可用var empName = this.value;$.ajax({url:"${Path}/chuckUserName",data:"empName="+empName,type:"POST",success: function(result) {if(result.state == 100) {show_validate_msg("#empName_add_input","success","");$("#emp_save_btn").attr("ajax-va","success");}else {show_validate_msg("#empName_add_input","error",result.ma.error);$("#emp_save_btn").attr("ajax-va","error");}}});});//1,我们是按钮创建之前绑定了click, 所以绑定不上,//处理办法//1),可以在创建按钮的时候绑定(耦合性太高). 2),绑定点击.live(推荐,但新的版本已删除了此方法,用on方法所代替)$(document).on("click",".edit_btn",function() {//alert("你好");//1,查询出所有的部门getDepts("#empUpdateModal select");//2,查询出员工,回显到模态框中getEmp($(this).attr("emp_edit_id"));//3,把员工的id传递给模态框的更新按钮$("#emp_update_btn").attr("emp_edit_id",$(this).attr("emp_edit_id"));//弹出模态框$("#empUpdateModal").modal({//向modal设置一些属性backdrop:"static"});});//ajax请求,根据id获取employeefunction getEmp(id) {$.ajax({url:"${Path}/emp/" + id,type:"GET",success: function(result) {var emp = result.ma.employee;//回显$("#empNameUpdateStatic").text(emp.empName);$("#empEmail_update_input").val(emp.empEmail);$("#empUpdateModal input[name=empGender]").val([emp.empGender]);$("#empUpdateModal select").val(emp.depId);}});}//点击更新按钮,更新员工信息$("#emp_update_btn").click(function() {//验证员工邮箱是否有效,//1,校验员工邮箱var empEmail = $("#empEmail_update_input").val();var regEmail = /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/;if(!regEmail.test(empEmail)) {show_validate_msg("#empEmail_update_input","error","邮箱格式错误");	return false;}else {show_validate_msg("#empEmail_update_input","success","");}//2.发送ajax请求保存更新员工数据    data:$("#empUpdateModal form").serialize()+"&_method=PUT"$.ajax({url:"${Path}/emp/"+$(this).attr("emp_edit_id"),type:"PUT",data:$("#empUpdateModal form").serialize(),success: function(result) {//alert(result.state);//1,关闭对话框$("#empUpdateModal").modal("hide");//2,回到本页面to_page(currentPage);}});});$(document).on("click",".delete_btn",function() {//1,弹出是否确认删除对话框   获取员工姓名var empName = $(this).parents("tr").find("td:eq(2)").text();//从删除按钮上获取idvar empId = $(this).attr("del-id");if(confirm("确认删除[ " + empName + " ]吗?")) {//确认删除.发送ajax请求删除即可$.ajax({url: "${Path}/emp/" + empId,type: "DELETE",success: function (result) {//alert(result.str);//回到本页to_page(currentPage);}});}});//完成全选/全不选$("#check_all").click(function() {//attr获取checked 是undefined//我们这些dom原生的属性使用prop.attr获取自定义属性的值//使用prop修改和读取原生的dom原生属性的值//$(this).prop("checked");$(".check_item").prop("checked",$(this).prop("checked"));});//给单个check_item 绑定点击事件$(document).on("click",".check_item",function() {//判断当前元素选中的元素是否5个var flag = $(".check_item:checked").length == $(".check_item").length;$("#check_all").prop("checked",flag);});//点击全部删除按钮,将会批量删除$("#emp_delete_all_btn").click(function() {//遍历所有的,.check.item:checkedvar empName = "";var ids = "";$.each($(".check_item:checked"),function() {empName += $(this).parents("tr").find("td:eq(2)").text() + ",";ids += $(this).parents("tr").find("td:eq(1)").text() + "-";});//去除empNames多余的,号empName = empName.substring(0,empName.length - 1);//去除ids 多余的- 号ids = ids.substring(0,ids.length - 1);if(confirm("确认删除: " + empName + "?")) {// 确认,发送ajax请求$.ajax({url:"${Path}/emp/"+ ids,type:"DELETE",success: function(result) {alert(result.str);//回到当前页面to_page(currentPage);}});}});</script></body>
</html>

Msg类

package it.bean;import java.util.HashMap;
import java.util.Map;import com.fasterxml.jackson.annotation.JsonInclude;@JsonInclude
public class Msg {// 状态码private Integer state;// 信息private String str;private Map<String, Object> ma = new HashMap<String, Object>();public Msg(Integer state, String str) {super();this.state = state;this.str = str;}public Msg(Integer state, String str, Map<String, Object> ma) {super();this.state = state;this.str = str;this.ma = ma;}public Msg() {super();// TODO Auto-generated constructor stub}public static Msg success() {Msg msg = new Msg();msg.setState(100);msg.setStr("成功");return msg;}public static Msg fail() {Msg msg = new Msg();msg.setState(200);msg.setStr("失败");return msg;}public Integer getState() {return state;}public Msg addAttribute(String str, Object object) {this.ma.put(str, object);return this;}public Map<String, Object> getMa() {return ma;}public void setMa(Map<String, Object> ma) {this.ma = ma;}public void setState(Integer state) {this.state = state;}public String getStr() {return str;}public void setStr(String str) {this.str = str;}}

Department.java , Employee.java,…等都是 使用MyBatis逆向工程的.
所遇到的问题:(1)无法给客户端返回JSON.(2)日常手残,敲错id,变量名…
项目是跟着尚硅谷视频学的

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. linux设置登陆n次失败锁定账号

    前言 为了防止黑客恶意尝试破解你的服务器密码,需要进行一定的防护措施 声明 此设置在centos7系统上操作配置 远程登陆限制配置 编辑/etc/pam.d/sshd,务必在字符"#%PAM-1.0"行内容下(换行)插入auth required pam_tally2.so onerr=fail deny=5 unlock_…...

    2024/4/24 11:18:28
  2. linux线程互斥锁的小实战和互斥锁死锁

    linux线程互斥锁的小实战 互斥锁的使用 在多个线程里,如何让一个线程里的代码运行完,在轮到另外一个线程执行,而不是多个线程互相竞争的关系。我们就可以使用到互斥锁的概念,这样的话,在一个线程执行上锁操作的时候,其他线程就会在等待,等待钥匙,等拿到钥匙以后,继续上…...

    2024/4/24 11:18:27
  3. 【Python】【难度:简单】Leetcode 938. 二叉搜索树的范围和

    给定二叉搜索树的根结点 root,返回 L 和 R(含)之间的所有结点的值的和。二叉搜索树保证具有唯一的值。示例 1:输入:root = [10,5,15,3,7,null,18], L = 7, R = 15 输出:32 示例 2:输入:root = [10,5,15,3,7,13,18,1,null,6], L = 6, R = 10 输出:23提示:树中的结点数…...

    2024/4/24 11:18:29
  4. Android Studio APP实用小技巧

    APP实用小技巧 本篇介绍三个App的使用小技巧,(1)App启动动画(2)隐藏APP标题栏(3)隐藏系统通知状态栏。 文章目录APP实用小技巧APP启动动画隐藏标题栏隐藏系统状态栏 APP启动动画 微信、QQ已经融入我们的生活,细心的小伙伴会发现,每次启动这些APP的时候,都会有一个开场…...

    2024/4/24 11:18:28
  5. LeetCode155题:最小栈

    题目:设计一个支持 push ,pop ,top 操作,并能在常数时间内检索到最小元素的栈。push(x) —— 将元素 x 推入栈中。 pop() —— 删除栈顶的元素。 top() —— 获取栈顶元素。 getMin() —— 检索栈中的最小元素。示例:输入: ["MinStack","push","…...

    2024/4/24 11:18:24
  6. 学习记录—— java 字符串排序

    题目输入一个字符串数组,按照字母表的降序对这些字符串进行排序。应该输入字符串数组吗?? 没理解……就按照输入字符串,然后转成字符数组来操作了…… 然后用BubbleSort来降序排序 然后用到了一个方法,只匹配字符串内的字母部分,其他都替换成空白。str.replaceAll(regex,…...

    2024/4/28 0:47:52
  7. 常用网线类别介绍(超五类、六类)

    一、网线分类类别传输速率支持组网工作频率标识屏蔽层五类线100Mbps百兆150MHzCAT5非屏蔽/屏蔽超五类线250Mbps百/千兆150MHzCAT5E非屏蔽/屏蔽六类线1Gbps千兆250MHzCAT6非屏蔽/屏蔽超六类线10Gbps千/万兆500MHzCAT6E非屏蔽/屏蔽七类线10Gbps万兆600MHzCAT7屏蔽二、屏蔽与非屏蔽…...

    2024/4/28 1:51:37
  8. Vue跨域问题的解决方法(前后端)

    在刚接触Vue时,经常会遇到跨域的问题,本文提供两种解决方法。 问题背景 跨域是什么: 跨域资源共享(CORS) 是一种机制,它使用额外的HTTP头来告诉浏览器 让运行在一个 origin (domain) 上的Web应用被准许访问来自不同源服务器上的指定的资源。当一个资源从与该资源本身所在的…...

    2024/4/24 11:18:21
  9. 83、静态导入

    了解即可...

    2024/4/24 11:18:20
  10. springboot的常用注解

    springboot的常用注解上一篇我们简单介绍了Spring Boot的基本信息,以及动手搭建了第一个Spring Boot应用,也发现了Spring Boot惊人的配置简化,下面我们通过学习Spring Boot的核心注解以及配置,来了解Spring Boot为什么能做到如此精简。 一、入口类和@SpringBootApplication…...

    2024/4/24 11:18:20
  11. String的常用方法

    String a1int .a.length()---长度2.char a.charAt(值)---指定位置 的字符3.char c[]=a.toCharArray()--字符串变成字符数组4.int a.indexOf("字符")返回指定字符串的位置,不存在就返回-15.String a.toUpperCase();a.toLowerCase()--变成大小写6.String[] a.split(&q…...

    2024/4/20 7:07:50
  12. 5分钟玩转Axure之热区

    基础元件-热区认识热区使用热区总结 认识热区 热区是一个透明的元件(在预览时完全看不见),在原型制作的过程中使用其并不会对美观程度产生影响。 热区在基础元件中,可以看到有一个矩形和一个鼠标箭头组成。右边则是在画板里显示的热区。使用热区批量增加交互 很常见的一种使…...

    2024/4/15 5:12:50
  13. SQLZOO

    joinselect matchid, player from goal where teamid=‘GER’ select id, stadium, team1, team2 from game where id=‘1012’ select player, teamid, stadium, mdate from game join goal on (id=matchid) where teamid=‘GER’ select team1, team2, player from game joi…...

    2024/4/17 2:11:56
  14. PAT笔记 1059 C语言竞赛 (20分)

    题目思路分别用三个数组记录id的排名、是否存在、是否被查询过,后续根据条件进行判断、输出即可#include <stdio.h> #include <cmath> using namespace std;bool isPrime(int n){bool flag=true; //表示是素数if(n<=1){flag=false;}else{int sqr=sqrt(n*1.0);f…...

    2024/4/19 7:47:22
  15. Linux 入门指南(四)定时任务 Crontab 安装使用详细说明

    一、安装yum -y install vixie-cron yum -y install crontabs说明: vixie-cron 软件包是 cron 的主程序; crontabs 软件包是用来安装、卸装、或列举用来驱动 cron 守护进程的表格的程序。二、配置cron 是 linux 的内置服务,但它不自动起来,可以用以下的方法启动、关闭这个服…...

    2024/4/24 11:18:18
  16. vue.js入门demo

    <!DOCTYPE html> <html lang="en"> <head><meta charset="UTF-8"><title>Vue的第一个入门案例</title> </head> <body> <div id="app"></span><!-- 作用范围以内都能使用 {{变…...

    2024/4/24 11:18:18
  17. bootstrap轮播图去掉左右箭头的阴影

    加上如下css样式即可 .carousel-control.left {background-image:none !important;background-repeat: repeat-x;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#80000000, endColorstr=#00000000, GradientType=1); } .carousel-control.right {left: au…...

    2024/4/24 11:18:17
  18. 2018.6.53

    2018.6.53 判断以下公式的可满足性: F:i1=j∧i1≠i2∧a[j]=v1∧a⟨i1◃v1⟩⟨i2◃v2⟩[j]≠a[j] F:i_1 = j\wedge i_1\ne i_2 \wedge a[j]=v_1 \wedge a\langle i_1 \triangleleft v_1 \rangle \langle i_2 \triangleleft v_2 \rangle [j]\ne a[j]F:i1​=j∧i1​​=i2​∧a[…...

    2024/4/24 11:18:18
  19. 关于java中的常用的几个正则表达式

    几个正则表达式类 Pattern反斜线、转义和引用字符字符类预定义字符类边界匹配器Greedy 数量词 类 Pattern 正则表达式的编译表示形式。 正则表达式(regular expression)描述了一种字符串匹配的模式(pattern),可以用来检查一个串是否含有某种子串、将匹配的子串替换或者从某个…...

    2024/4/24 11:18:18
  20. 接口测试之结果为王---导出测试报告

    添加链接描述 本章内容是基于上篇文章,后续阶段。做以补充。 将项目四.json复制,粘贴到与前两个json文档放一起。(环境变量json,数据文件接送,业务流程json)新建一个文本,复制粘贴运行命令。cmd命令提示符,进入保存json路径。将新建文本内容改为一行,再视图自动换行。 回…...

    2024/4/24 11:18:16

最新文章

  1. RabbitMQ消息是如何分发的,消息是怎么路由的, RabbitMQ中的交换机类型有哪些

    目录 面试官:讲一下RabbitMQ消息如何分发和消息怎么路由的?消息分发消息路由RabbitMQ中的交换机类型示例Spring Boot代码示例1. 直接路由(Direct Exchange)2. 扇出路由(Fanout Exchange)3. 主题路由(Topic Exchange)4. 头路由(Headers Exchange)该文章专注于面试,面…...

    2024/4/28 5:19:26
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/3/20 10:50:27
  3. el-upload上传图片给SpringBoot后端

    需求 我的需求是&#xff0c;将上传文件的el-upload放到一个el-form里面&#xff0c;点击保存才提交&#xff0c;所以不能直接用action的方式&#xff0c;下面采用自定义上传的方式来完成Vue前端 主要是使用editForm.imgList来保存图片的信息&#xff0c;注意这里是一个对象&am…...

    2024/4/26 16:15:13
  4. 在虚拟机ubuntu中端里输入vim filename.不显示vim界面,而是vim可以在以下的 package 找到

    1。打开终端 2.输入以下命令来更新软件包列表&#xff1a; sudo apt update 3&#xff0c;输入以下命令来安装vim编辑器&#xff1a; sudo apt install vim 4等待安装完成后&#xff0c;再次输入"vim filename"命令&#xff0c;应该就能正常显示vim界面了。...

    2024/4/26 9:20:11
  5. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/4/26 18:09:39
  6. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/4/28 3:28:32
  7. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/4/26 23:05:52
  8. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/4/27 4:00:35
  9. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/4/27 17:58:04
  10. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/4/27 14:22:49
  11. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/4/28 1:28:33
  12. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/4/27 9:01:45
  13. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/4/27 17:59:30
  14. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/4/25 18:39:16
  15. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/4/28 1:34:08
  16. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/4/26 19:03:37
  17. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/4/28 1:22:35
  18. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/4/25 18:39:14
  19. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/4/26 23:04:58
  20. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/4/27 23:24:42
  21. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/4/25 18:39:00
  22. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/4/26 19:46:12
  23. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/4/27 11:43:08
  24. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/4/27 8:32:30
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57