关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 更新日志 - 技术支持 - 招聘英才

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务QQ: 69893005、3102411850 商务热线(5*8小时): 010-64808099 官方邮箱: jeecgos@163.com

查看: 7979|回复: 2

模糊搜索、模糊查询的简化 cq.like

[复制链接]
发表于 2014-4-18 14:38:17 | 显示全部楼层 |阅读模式
本帖最后由 沈焕杰 于 2014-4-18 14:41 编辑

/**
         * easyui AJAX请求表格数据
         *
         * @param notice
         * @param request
         * @param response
         * @param dataGrid
         */
        @SuppressWarnings("unchecked")
        @RequestMapping(params = "datagrid")
        public void datagrid(NoticeEntity notice, HttpServletRequest request,
                        HttpServletResponse response, DataGrid dataGrid) {

//------            既然可以实现"*",那就直接判断非空后,默认添加"*"咯  - -!

                String searchStr= request.getParameter("title");              
                if (searchStr!= null) {                                                       
                        notice.setTitle("*" + notice.getTitle() + "*");           
                }                                                                                      
-//-----------------------------------------------------------------------------------

                CriteriaQuery cq = new CriteriaQuery(NoticeEntity.class, dataGrid);
                // 查询条件组装器
                org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq,
                                notice, request.getParameterMap());


                this.systemService.getDataGridReturn(cq, true);


                TagUtil.datagrid(response, dataGrid);
        }

发表于 2014-4-28 10:07:16 | 显示全部楼层
保留很好
发表于 2014-4-28 14:36:59 | 显示全部楼层
可以在online生成的画面条件查询的地方添加一个选项模糊查询
然后再修改模板,这样就可以实现在动生成了。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表