jquery代码: function test(){ var selectOption=$('#下拉框的id').val(); if(selectOption){ selectOption=selectOption.substring(0,selectOption.length-1) } }
控制器方法代码: @ResponseBody @RequestMapping(value = "/getBacktrackUU", method = {RequestMethod.POST, RequestMethod.GET}) public Object getBacktrackUU(HttpServletRequest request) { //从request中获取含属性前缀名的参数,构造去除前缀名后的参数Map. Map<String, Object> query = WebUtils.getParametersStartingWith(request, ""); QueryCriteria param = new QueryCriteria(); initParameters(param, query); String[] a=query.get('前端页面定义的字段').toString().split(","); param.put('字段名称',Arrays.aList(a)); param.put("intmmeueid",query.get("intmmeueid")); List<Map> result = lteGtManager.getBacktrackUU(param); return result; }
- mybatis中xml文件的用法:
- select * from 表名 where 字段名称 in
- <foreach collection="condition.控制器字段名称" index="index" item="item" open="("
- separator="," close=")">
- '${item}'
- </foreach>