Get the App
SLTechnology News&Howtos  ›  Database  › 

How to implement ssm pagination

Shulou Source: shulou.com Published: 2022-06-01 01:52:04 11月13日 Update

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!

Tags: Data content parameters server service background tools files articles sorting search query code representative value credit company interest premise address Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Linux Docker vpn OPPO Reno