Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the crm project module of Saas mode

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

What is the crm project module of Saas mode? for this question, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

Recently do Saas mode crm project staff module function summary: the project uses maven management, divided into multi-module development mode, so as to facilitate the separation and development of the project, to avoid all the functions are mixed together, which is also a more common development mode in the company.

Creation of basic components

Construction of maven multi-module project structure

Use the code generator to generate the corresponding mapper, domain and Velocity to generate the corresponding js and jsp controller query service serviceimpl files

two。 Advanced query paging

Paging query, referring to the previous project found that paging data requires a request to get a total of how many pieces of data, and the current page of the page and the current page of the data. A paged service method queryPageDataByQuery; should be encapsulated and then the mapper layer query should be sent two sql completion. And the query results are encapsulated as a paging object to return. Create a PageList encapsulated paging object. A lot of data has query requirements, encapsulating a BaseQuery object as a base class for query conditions.

PageList object

Public class PageList {

Private long total = 0

Private List rows = new ArrayList ()

Public long getTotal () {

Return total

}

Public void setTotal (long total) {

This.total = total

}

Public List getRows () {

Return rows

}

Public void setRows (List rows) {

This.rows = rows

}

}

Public PageList getByQuery (BaseQuery query) {

/ / create a PageList object that encapsulates data

PageList pageList = new PageList ()

/ / set paging conditions

Page page = PageHelper.startPage (query.getPage (), query.getRows ())

/ / query the data of the current page

List rows = getMapper () .selectByQuery (query)

/ / get the total number of entries

Long total = page.getTotal ()

/ / encapsulate the data in a PageList object and return

PageList.setRows (rows)

PageList.setTotal (total)

Return pageList

}

In the corresponding xml

Select e.poweryard d.name as dname

From t_employee e

Left join t_department d on e.department_id = d.id

3. And crud.

@ Controller@RequestMapping ("/ employee") public class EmployeeController {@ Autowired private IEmployeeService employeeService; @ RequestMapping ("/ index") public String index () {return "employee/employee";} @ RequestMapping ("/ getByid") @ ResponseBody public Employee getById (Long id) {return employeeService.selectByPrimaryKey (id);} @ RequestMapping ("/ list") @ ResponseBody//json public PageResult list (EmployeeQuery employeeQuery) {return employeeService.selectForList (employeeQuery) } @ RequestMapping ("/ page") @ ResponseBody public PageResult page (@ RequestBody String qu) {EmployeeQuery query = JSONObject.parseObject (qu, EmployeeQuery.class); return employeeService.selectForList (query);} @ RequestMapping ("remove") @ ResponseBody public AjaxResult remove (Long id) {System.out.println (id); try {employeeService.deleteByPrimaryKey (id); return AjaxResult.success () } catch (Exception e) {e.printStackTrace (); return AjaxResult.error ("wrong");} @ RequestMapping (value = "/ saveUpdate", method = RequestMethod.POST) @ ResponseBody public AjaxResult saveUpdate (@ RequestBody String product) {Employee produ = JSONObject.parseObject (product, Employee.class); / * System.out.println (">"); System.out.println (produ.getAge ()) * / try {if (produ.getId () = = null) {Date date = new Date (); produ.setAddtime (date); employeeService.insert (produ);} else {System.out.println ("djeksdwdweferferferge"); System.out.println (produ.getInitiationtime ()) System.out.println (produ.getAddtime ()); employeeService.updateByPrimaryKey (produ);} return AjaxResult.success ();} catch (Exception e) {e.printStackTrace (); return AjaxResult.error ("wrong");}}

Mapper

Delete from employee where id = # {id,jdbcType=BIGINT} insert into employee (username, password, age, post_id, iphone, pay, shop_id, Initiationtime, addtime) values (# {username,jdbcType=VARCHAR}, # {password,jdbcType=VARCHAR}, # {age,jdbcType=INTEGER}, # {postId,jdbcType=VARCHAR}, # {iphone,jdbcType=INTEGER}, # {pay,jdbcType=INTEGER}, # {shopId,jdbcType=VARCHAR}, # {initiationtime,jdbcType=DATE}, # {addtime JdbcType=DATE}) update employee set username = # {username,jdbcType=VARCHAR}, password = # {password,jdbcType=VARCHAR}, age = # {age,jdbcType=INTEGER}, post_id = # {postId,jdbcType=VARCHAR}, iphone = # {iphone,jdbcType=INTEGER}, pay = # {pay,jdbcType=INTEGER}, shop_id = # {shopId,jdbcType=VARCHAR}, Initiationtime = # {initiationtime,jdbcType=DATE}, addtime = # {addtime,jdbcType=DATE} where id = # {id JdbcType=BIGINT} select id, username, password, age, post_id, iphone, pay, shop_id, Initiationtime, addtime from employee where id = # {id,jdbcType=BIGINT} select id, username, password, age, post_id, iphone, pay, shop_id, Initiationtime, addtime from employee select id, username, password, age, post_id, iphone, pay, shop, Initiationtime, addtime from employee where username=# {username}

Summary of experience

Gains in the project

Starting to think about the code independently has improved your understanding of the code.

Problems encountered in the project

Because the project uses elementui, because it took a lot of time to use the el-date-picker date component to echo the date in editing, Baidu found that it was missing value-format= "yyyy-MM-dd" to change the format of the value on v-model. After adding it, the echo was successful.

The answer to the question about the crm project module of Saas mode is shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report