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

How to implement ssm pagination

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly introduces how to achieve ssm paging, the article introduces in great detail, has a certain reference value, interested friends must read it!

The page is implemented in bootstrapTable (just configure the parameters of the query), and the css,js of bootstrapTable must be introduced.

Function load () {var typeid = $("# typeid") .val () $('# exampleTable') .bootstrapTable ({method: 'get', / / request method for server data get or post url: "xxx/base/supSupt/list", / / loading address for server data iconSize:' outline', toolbar:'# exampleToolbar' Striped: true, / / set to true will have interlaced discoloration effect dataType: "json", / / the data type returned by the server is pagination: true, / / set to true will display the page bar singleSelect: false at the bottom / / setting to true forbids multiple selection of pageSize: 10, / / if paging is set Number of data items per page pageNumber: 1, / / if distribution is set, the home page number search: true, / / whether the search box is displayed Give the parameter to search for showColumns: false, / / whether to display the content drop-down box (select the displayed column) clickToSelect:true, sortOrder: "desc", sidePagination: "server", / / set where to paging Optional values are "client" or queryParams: function (params) {/ / there is a Query class in the backend. As long as a key-value pair is added and there is something in the table, he will automatically get return {/ / description: the parameters passed to the backend include offset start index, limit step size, and sort sorting. Order:desc or, and the key-value pairs of all columns limit: params.limit, offset: params.offset,sort: "createdat", according to the creation time (corresponding to the conditions of the mapping file) order: "desc" Sort type:typeid} }, columns: [{checkbox: true}, {field: 'code' Title: 'coding'}, {field: 'comp' Title: 'company name'}, {field: 'busilicence', title:' credit code'} {field: 'law', title:' legal representative'}, {field: 'tel' Title: 'contact number'}]})}

two。 Controller

@ ResponseBody @ GetMapping ("/ list") @ RequiresPermissions ("base:supSupt:add") public PageUtils list (@ RequestParam Map params) {/ / query list data Query query = new Query (params); List supSuptList = supSuptService.getSupListExcludeSuptpyeId (query); int total = supSuptService.getSupListCountExcludeSuptpyeId (query); PageUtils pageUtils = new PageUtils (supSuptList, total); return pageUtils;} utility class

Paged utility class mybatis mapping file select * from bid_sup where id not in (select ss.supid from bid_sup_supt as ss inner join bid_sup as s on ss.supid = s.id and ss.typeid = # {typeid}) order by ${sort} ${order} order by ls desc limit # {offset} # {limit} select count (*) from bid_sup where id not in (select ss.supid from bid_sup_supt as ss inner join bid_sup as s on ss.supid = s.id and ss.typeid = # {typeid}) these are all the contents of the article "how to achieve ssm pagination" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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

Database

Wechat

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

12
Report