MyBatis生成的实体条件,并在页面根据一些字段进行模糊查询
程序员文章站
2022-05-22 21:05:47
...
首先是页面的查询框
要根据案由名称和设计场所类型,进行搜,
页面代码
<form id="searchFrom" action="" style="margin-bottom: 10px;">
<input type="text" name="map['andNameLike']" class="easyui-validatebox" data-options="width:150,prompt: '案由名称'"/>
涉及场所类型:<select id="select_list" class="easyui-validatebox" data-options="width:150,prompt: '全部'"
name="map['andServiceTypeEqualTo']">
</select>
<span class="toolbar-item dialog-tool-separator"></span>
<a href="javascript(0)" class="easyui-linkbutton" plain="true" iconCls="icon-search" onclick="cx()">查询</a>
<a href="javascript(0)" class="easyui-linkbutton" plain="true" iconCls="icon-standard-application-go"
onclick="importAction()">导入</a>
<a href="javascript(0)" class="easyui-linkbutton" plain="true" iconCls="icon-print" onclick="prin()">导出</a>
</form>
页面查询条件采用表单提交,
后台Controller层
@SuppressWarnings({ "unchecked", "rawtypes" })
@RequestMapping("queryPage")
@ResponseBody
public Page<CisCaseAction> queryPage(Page page) {
CisCaseActionExample example = new CisCaseActionExample();
example.setPage(page);
popQeuryExample(page.getMap(), example.createCriteria());
cisCaseActionService.queryPage(example);
return page;
}