資源簡(jiǎn)介
使用idea整合的ssm框架,功能有查詢,修改,刪除,分頁(yè)
1、創(chuàng)建數(shù)據(jù)庫(kù)名為:crm
將本工程提供的crm數(shù)據(jù)導(dǎo)入到crm中
2、工程數(shù)據(jù)庫(kù)管理在:jdbc.properties
3、工程采用:maven創(chuàng)建
代碼片段和文件信息
package?com.itheima.crm.controller;
import?com.fasterxml.jackson.annotation.JsonTypeInfo;
import?com.itheima.crm.pojo.baseDict;
import?com.itheima.crm.pojo.Customer;
import?com.itheima.crm.pojo.QueryVo;
import?com.itheima.crm.service.baseDictService;
import?com.itheima.crm.service.CustomerService;
import?com.itheima.crm.utils.Page;
import?org.springframework.beans.factory.annotation.Autowired;
import?org.springframework.beans.factory.annotation.Qualifier;
import?org.springframework.beans.factory.annotation.Value;
import?org.springframework.stereotype.Controller;
import?org.springframework.ui.Model;
import?org.springframework.web.bind.annotation.RequestMapping;
import?org.springframework.web.bind.annotation.ResponseBody;
import?java.util.List;
/**
?*?@version?V1.0
?*?@ClassName:CustomerController
?*?@Description:客戶請(qǐng)求處理
?*?@author:cxg
?*?@Date:${time}
?*/
@Controller
@RequestMapping(“customer“)
public?class?CustomerController?{
????@Autowired
????public?baseDictService?baseDictService;
????@Autowired
????public?CustomerService?customerService;
????@Value(“${customer_from_type}“)
????private?String?customer_from_type;
????@Value(“${customer_industry_type}“)
????private?String?customer_industry_type;
????@Value(“${customer_level_type}“)
????private?String?customer_level_type;
????@RequestMapping(“l(fā)ist“)
????public?String?list(Model?modelQueryVo?vo)?{
????????//查詢來(lái)源
????????ListseDict>?fromType=baseDictService.getbaseDictByCode(customer_from_type);
????????//所屬行業(yè)
????????ListseDict>?industryType=baseDictService.getbaseDictByCode(customer_industry_type);
????????//客戶級(jí)別
????????ListseDict>?levelType=baseDictService.getbaseDictByCode(customer_level_type);
????????model.addAttribute(“fromType“fromType);
????????model.addAttribute(“industryType“industryType);
????????model.addAttribute(“l(fā)evelType“l(fā)evelType);
????????//根據(jù)查詢條件分頁(yè)查詢用戶列表
????????Page?page=?customerService.getCustomerByQueryVo(vo);
????????//設(shè)置分頁(yè)數(shù)據(jù)返回
????????model.addAttribute(“page“page);
????????//返回查詢條件
????????model.addAttribute(“vo“?vo);
????????return?“customer“;
????}
????@RequestMapping(“edit“)
????@ResponseBody
????public?Customer?edit(Integer?id){
????????Customer?customer=?customerService.getCustomerById(id);
????????return??customer;
????}
????@RequestMapping(“update“)
????@ResponseBody
????public?String?update(Customer?customer){
????????String?msg?=?“1“;
????????try?{
????????????customerService.updateCustomer(customer);
????????????msg?=?“0“;
????????}?catch?(Exception?e)?{
????????????e.printStackTrace();
????????}
????????return?msg;
????}
????@RequestMapping(“delete“)
????@ResponseBody
????public?String?deleteCustomer(Integer?id)?{
????????customerService.deleteCustomer(id);
????????return?“ok“;
????}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????300??2018-08-30?10:41??crm_cxg\.idea\artifacts\crm_cxg_war.xm
?????文件???????4004??2018-08-30?19:12??crm_cxg\.idea\artifacts\crm_cxg_war_exploded.xm
?????文件????????626??2018-08-30?18:22??crm_cxg\.idea\compiler.xm
?????文件????????172??2018-08-29?13:56??crm_cxg\.idea\encodings.xm
?????文件???????1562??2018-08-30?18:01??crm_cxg\.idea\inspectionProfiles\Project_Default.xm
?????文件????????558??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__commons_logging_commons_logging_1_2.xm
?????文件????????486??2018-08-30?19:12??crm_cxg\.idea\libraries\Maven__com_alibaba_druid_1_1_9.xm
?????文件????????522??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__com_fasterxm
?????文件????????644??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__com_fasterxm
?????文件????????595??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__com_fasterxm
?????文件????????623??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__com_fasterxm
?????文件????????561??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__com_github_jsqlparser_jsqlparser_0_9_5.xm
?????文件????????561??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__com_github_pagehelper_pagehelper_5_0_0.xm
?????文件????????578??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__javax_servlet_javax_servlet_api_3_0_1.xm
?????文件????????494??2018-08-30?20:38??crm_cxg\.idea\libraries\Maven__javax_servlet_jsp_api_2_0.xm
?????文件????????522??2018-08-30?20:38??crm_cxg\.idea\libraries\Maven__javax_servlet_servlet_api_2_4.xm
?????文件????????611??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__javax_validation_validation_api_1_1_0_Final.xm
?????文件????????437??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__jstl_jstl_1_2.xm
?????文件????????455??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__junit_junit_4_12.xm
?????文件????????469??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__log4j_log4j_1_2_17.xm
?????文件????????574??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__mysql_mysql_connector_java_5_1_41.xm
?????文件????????542??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__org_aspectj_aspectjweaver_1_8_9.xm
?????文件????????532??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__org_hamcrest_hamcrest_core_1_3.xm
?????文件????????634??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__org_hibernate_hibernate_validator_5_4_1_Final.xm
?????文件????????608??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__org_jboss_logging_jboss_logging_3_3_0_Final.xm
?????文件????????645??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__org_mybatis_generator_mybatis_generator_core_1_3_5.xm
?????文件????????500??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__org_mybatis_mybatis_3_4_2.xm
?????文件????????549??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__org_mybatis_mybatis_spring_1_3_1.xm
?????文件????????609??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__org_springfr
?????文件????????637??2018-08-30?19:11??crm_cxg\.idea\libraries\Maven__org_springfr
............此處省略243個(gè)文件信息
評(píng)論
共有 條評(píng)論