博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mybatis3 前台传数组 的处理
阅读量:6407 次
发布时间:2019-06-23

本文共 3785 字,大约阅读时间需要 12 分钟。

/**     * 分页按条件查询权限列表     * @param keywords     * @return     */    @RequestMapping(value = "/getByCondition2", method = { RequestMethod.GET,            RequestMethod.POST })    public @ResponseBody String getByCondition2(String beginTime,            String endTime,String privilegePersonsList,int startRow,int pageSize) {        List
privilegePersonLongs= new ArrayList
(); String[] split = privilegePersonsList.split(","); List
privilegePersons= Arrays.asList(split); if (privilegePersonLongs!=null) { List
list =service.selectByCondition(beginTime,endTime, ListUtil.fromStringToLongList(privilegePersons),startRow,pageSize); Page
page = new Page
(service.countByConditions()); if (list.size() != 0) { ResultVO
result = new ResultVO
(); result.setLists(list); result.setPage(page); return result.toString(); } } return ""; } /** * 分页按条件查询权限列表 * @param keywords * @return */ @RequestMapping(value = "/getByCondition3", method = { RequestMethod.GET, RequestMethod.POST }) public @ResponseBody String getByCondition3(String beginTime, String endTime,Integer[] privIds,int startRow,int pageSize) { List
privilegePersonLongs= new ArrayList
(); if (privilegePersonLongs!=null) { List
list =service.selectByCondition(beginTime,endTime, Arrays.asList(privIds),startRow,pageSize); Page
page = new Page
(service.countByConditions()); if (list.size() != 0) { ResultVO
result = new ResultVO
(); result.setLists(list); result.setPage(page); return result.toString(); } } return ""; } @RequestMapping(value="/getByCondition7", method={RequestMethod.GET,RequestMethod.POST}) public @ResponseBody String getByCondition7(String beginTime,String endTime, @RequestParam(value="privilegePersons[]",required=false)List
privilegePersons,int startRow,int pageSize) { List
list =service.selectByCondition(beginTime,endTime,privilegePersons,startRow,pageSize); Page
page = new Page
(service.countByConditions()); if (list.size() != 0) { ResultVO
result = new ResultVO
(); result.setLists(list); result.setPage(page); return result.toString(); } return ""; } --------------------------------------------------------------------------------------------------------------------------------------------------------------- http://localhost:8080/rolems/dataPrivilege/getByCondition2?&beginTime=2017-04-14 07:01:30&endTime=2017-04-18 17:01:30&startRow=0&pageSize=5&privilegePersonsList=0,1,2 http://localhost:8080/rolems/dataPrivilege/getByCondition7?&beginTime=2017-04-14 07:01:30&endTime=2017-04-18 17:01:30&startRow=0&pageSize=5&privilegePersons[]=0,1,2 http://localhost:8080/rolems/dataPrivilege/getByCondition3?&beginTime=2017-04-14 07:01:30&endTime=2017-04-18 17:01:30&startRow=0&pageSize=5&privIds=0,1,2 {     "result": "0",     "responseInfo": {         "page": {             "totalNum": 9,             "pageNum": 1,             "pageSize": 5,             "startRow": 0,             "pages": 2,             "orderField": "",             "direct": "DESC"         },         "lists": [             {                 "createTime": "2017-04-14 10:01:30",                 "privilegePerson": 0,                 "personOrRole": 1,                 "isCreator": 0,                 "dataId": "100020170414100000001130000000"             },             {                 "createTime": "2017-04-14 10:01:30",                 "privilegePerson": 1,                 "personOrRole": 1,                 "isCreator": 0,                 "dataId": "100020170414100000001230000000"             },             {                 "createTime": "2017-04-14 10:01:30",                 "privilegePerson": 2,                 "personOrRole": 1,                 "isCreator": 0,                 "dataId": "100020170414100000001330000000"             },             {                 "createTime": "2017-04-15 09:49:46",                 "privilegePerson": 0,                 "personOrRole": 1,                 "isCreator": 0,                 "dataId": "100020170414100000001030000000"             },             {                 "createTime": "2017-04-15 09:49:46",                 "privilegePerson": 1,                 "personOrRole": 1,                 "isCreator": 0,                 "dataId": "100020170414100000001430000000"             }         ]     } }

 

转载于:https://www.cnblogs.com/alamps/p/6735282.html

你可能感兴趣的文章
redis zset转set 反序列化失败_掌握好Redis的数据类型,面试心里有底了
查看>>
p图软件pⅰc_娱乐圈最塑料的夫妻,P图永远只P自己,太精彩了吧!
查看>>
jenkins 手动执行_Jenkins 入门
查看>>
怎么判断冠词用a还是an_葡语干货 | 葡萄牙语冠词用法整理大全
查看>>
js传参不是数字_JS的Reflect学习和应用
查看>>
三个不等_数学一轮复习05,从函数观点看方程与不等式,记住口诀与联系
查看>>
卡尺测量的最小范围_汽车维修工具-测量用具
查看>>
网优5g前景_5G网络优化师前景怎么样?
查看>>
竞态条件的赋值_[译] part25: golang Mutex互斥锁
查看>>
delmatch oracle_完美完全卸载(清除)oracle数据库的方式(方法)
查看>>
pyqt 滚动条 美化_Pyqt5 关于流式布局和滚动条的综合使用示例代码
查看>>
51单机片 编译hex_单片机爬坑记-05-编译环境(完)
查看>>
java 正则表达式 img_Java正则表达式获得html字符串里的<img src=""/> 中的url列表
查看>>
java 文件crc校验_一个获取文件crc32校验码的简洁的java类 | 学步园
查看>>
java flatmapfunction_Java8 Stream flatmap中间操作用法解析
查看>>
java rmi spring 4.0_Java Spring RMI一些尝试
查看>>
JAVA怎么连接华为的HDFS系统_JAVA-API操作HDFS文件系统(HDFS核心类FileSystem的使用)...
查看>>
java牛客网四则运算_数据库刷题—牛客网(51-61)
查看>>
Java get set6_JDK6的新特性(转)
查看>>
java发送邮件 不登陆_Java邮件到Exchange Server“不支持登录方法”
查看>>