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及分页标签 ![](http://i2.51cto.com/images/blog/201804/14/9a04bf005fa429ba9bb8808c547a5eee.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)3 查询条件初始化3.1 需求 ![](http://i2.51cto.com/images/blog/201804/14/1a848cc209f6d1f767c31094f1357314.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)初始化查询条件下拉列表。4 客户列表展示4.1 需求 ![](http://i2.51cto.com/images/blog/201804/14/ea5f26965a9bb3ba7e36c2d41bb57612.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)展示商品列表,并且可以根据查询条件过滤查询结果,并且实现分页处理。5 修改客户信息5.1 需求 ![](http://i2.51cto.com/images/blog/201804/14/655fe95a36709ed32282d34804c4cd91.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)1、点击客户列表中的“修改”按钮弹出客户信息修改对话框,并初始化客户信息2、点击“保存修改”按钮将修改后的结果保存到数据库中6 删除客户6.1 需求 ![](http://i2.51cto.com/images/blog/201804/14/d4762f8fed0e185c9cf98309f26d82c6.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)点击客户列表中的删除按钮,提示“警告信息” ![](http://i2.51cto.com/images/blog/201804/14/de16be478129cd2fec47e630dc8f433d.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)点击确定后删除用户信息,并刷新页面。