1 数据库
数据库使用mysql 数据库。
1、创建crm数据库
2、将参考资料中的sql脚本导入到数据库中
2 工程搭建
工程使用Springmvc、spring、mybatis框架整合完成。
2.1 SqlMapConfig.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">;
<configuration>
</configuration>
2.2 applicationContext-dao.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:task="http://www.springframework.org/schema/task" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-4.0.xsd
http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd">;
Jdbc.propertiesjdbc.driver=com.mysql.jdbc.Driverjdbc.url=jdbc:mysql://localhost:3306/crm?characterEncoding=utf-8jdbc.username=rootjdbc.password=root2.3 applicationContext-service.xml2.4 applicationContext-trans.xml2.5 Springmvc.xml2.6 Web.xmlcustomer.actioncontextConfigLocationclasspath:applicationContext-*.xmlorg.springframework.web.context.ContextLoaderListenerencodingorg.springframework.web.filter.CharacterEncodingFilterencodingUTF-8encoding*.actioncrmorg.springframework.web.servlet.DispatcherServletcontextConfigLocationclasspath:springmvc.xml1crm*.action2.7 加入jsp及分页标签 3 查询条件初始化3.1 需求 初始化查询条件下拉列表。4 客户列表展示4.1 需求 展示商品列表,并且可以根据查询条件过滤查询结果,并且实现分页处理。5 修改客户信息5.1 需求 1、点击客户列表中的“修改”按钮弹出客户信息修改对话框,并初始化客户信息2、点击“保存修改”按钮将修改后的结果保存到数据库中6 删除客户6.1 需求 点击客户列表中的删除按钮,提示“警告信息” 点击确定后删除用户信息,并刷新页面。