Package org.jeecgframework.core.common.hibernate.qbc

Examples of org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery


   * 地域列表
   */
  @RequestMapping(params = "territoryGrid")
  @ResponseBody
  public List<TreeGrid> territoryGrid(HttpServletRequest request, TreeGrid treegrid) {
    CriteriaQuery cq = new CriteriaQuery(TSTerritory.class);
      if (treegrid.getId() != null) {
        cq.eq("TSTerritory.id", treegrid.getId());
      }
      if (treegrid.getId() == null) {
        cq.eq("TSTerritory.id","1");//这个是全国最高级
      }
   
    cq.addOrder("territorySort", SortDirection.asc);
    cq.add();
    List<TSTerritory> territoryList = systemService.getListByCriteriaQuery(cq, false);
    List<TreeGrid> treeGrids = new ArrayList<TreeGrid>();
    TreeGridModel treeGridModel = new TreeGridModel();
    treeGridModel.setIcon("");
    treeGridModel.setTextField("territoryName");
View Full Code Here


   * 地域父级下拉菜单
   */
  @RequestMapping(params = "setPTerritory")
  @ResponseBody
  public List<ComboTree> setPTerritory(HttpServletRequest request, ComboTree comboTree) {
    CriteriaQuery cq = new CriteriaQuery(TSTerritory.class);
    if (comboTree.getId() != null) {
      cq.eq("TSTerritory.id", comboTree.getId());
    }
    if (comboTree.getId() == null) {
      cq.isNull("TSTerritory");
    }
    cq.add();
    List<TSTerritory> territoryList = systemService.getListByCriteriaQuery(cq, false);
    List<ComboTree> comboTrees = new ArrayList<ComboTree>();
    ComboTreeModel comboTreeModel = new ComboTreeModel("id", "territoryName", "TSTerritorys");
    comboTrees = systemService.ComboTree(territoryList, comboTreeModel, null);
    return comboTrees;
View Full Code Here

   * @param response
   * @param dataGrid
   */
  @RequestMapping(params = "datagrid")
  public void datagrid(TSUser user,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
    CriteriaQuery cq = new CriteriaQuery(TSUser.class, dataGrid);
    //查询条件组装器
    org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, user);
   
    Short[] userstate = new Short[] { Globals.User_Normal, Globals.User_ADMIN };
    cq.in("status", userstate);
    cq.add();
    this.systemService.getDataGridReturn(cq, true);
    TagUtil.datagrid(response, dataGrid);
  }
View Full Code Here

   * @param response
   * @param dataGrid
   */
  @RequestMapping(params = "datagridRole")
  public void datagridRole(HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
    CriteriaQuery cq = new CriteriaQuery(TSRole.class, dataGrid);
    this.systemService.getDataGridReturn(cq, true);
    TagUtil.datagrid(response, dataGrid);
  }
View Full Code Here

   */
  @RequestMapping(params = "datagridUser")
  public void datagridUser(HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
    String departid = request.getParameter("departid");
    String roleid = request.getParameter("roleid");
    CriteriaQuery cq = new CriteriaQuery(TSUser.class, dataGrid);
    if (departid.length() > 0) {
      cq.eq("TDepart.departid", oConvertUtils.getInt(departid, 0));
      cq.add();
    }
    String userid = "";
    if (roleid.length() > 0) {
      List<TSRoleUser> roleUsers = systemService.findByProperty(TSRoleUser.class, "TRole.roleid", oConvertUtils.getInt(roleid, 0));
      if (roleUsers.size() > 0) {
        for (TSRoleUser tRoleUser : roleUsers) {
          userid += tRoleUser.getTSUser().getId() + ",";
        }
      }
      cq.in("userid", oConvertUtils.getInts(userid.split(",")));
      cq.add();
    }
    this.systemService.getDataGridReturn(cq, true);
    TagUtil.datagrid(response, dataGrid);
  }
View Full Code Here

   * @param response
   * @param dataGrid
   */
  @RequestMapping(params = "datagridDepart")
  public void datagridDepart(HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
    CriteriaQuery cq = new CriteriaQuery(TSDepart.class, dataGrid);
    systemService.getDataGridReturn(cq, true);
    TagUtil.datagrid(response, dataGrid);
  }
View Full Code Here

   */
  @RequestMapping(params = "test")
  public void test(HttpServletRequest request, HttpServletResponse response) {
    String jString = request.getParameter("_dt_json");
    DataTables dataTables = new DataTables(request);
    CriteriaQuery cq = new CriteriaQuery(TSUser.class, dataTables);
    String username = request.getParameter("userName");
    if (username != null) {
      cq.like("userName", username);
      cq.add();
    }
    DataTableReturn dataTableReturn = systemService.getDataTableReturn(cq, true);
    TagUtil.datatable(response, dataTableReturn, "id,userName,mobilePhone,TSDepart_departname");
  }
View Full Code Here

   * @param response
   * @param dataGrid
   */
  @RequestMapping(params = "testSearch")
  public void testSearch(TSUser user, HttpServletRequest request,HttpServletResponse response,DataGrid dataGrid) {
    CriteriaQuery cq = new CriteriaQuery(TSUser.class, dataGrid);
    if(user.getUserName()!=null){
      cq.like("userName", user.getUserName());
    }
    if(user.getRealName()!=null){
      cq.like("realName", user.getRealName());
    }
    cq.add();
    this.systemService.getDataGridReturn(cq, true);
    TagUtil.datagrid(response, dataGrid);
  }
View Full Code Here

   */

  @RequestMapping(params = "datagrid")
  public void datagrid(HttpServletRequest request,
      HttpServletResponse response, DataGrid dataGrid) {
    CriteriaQuery cq = new CriteriaQuery(TSFunction.class, dataGrid);
    this.systemService.getDataGridReturn(cq, true);
    TagUtil.datagrid(response, dataGrid);
  }
View Full Code Here

   */

  @RequestMapping(params = "opdategrid")
  public void opdategrid(HttpServletRequest request,
      HttpServletResponse response, DataGrid dataGrid) {
    CriteriaQuery cq = new CriteriaQuery(TSOperation.class, dataGrid);
    // ----------------------------------------------------------------
    // ----------------------------------------------------------------
    String functionId = oConvertUtils.getString(request
        .getParameter("functionId"));
    cq.eq("TSFunction.id", functionId);
    cq.add();
    // ----------------------------------------------------------------
    // ----------------------------------------------------------------
    this.systemService.getDataGridReturn(cq, true);
    TagUtil.datagrid(response, dataGrid);
  }
View Full Code Here

TOP

Related Classes of org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.