示例#1
0
  public List qryGrpPg(Map condMap, PageUtil pageInfo) throws Exception {

    StringBuffer sql =
        new StringBuffer(
            "select a.*,b.GROUP_NAME,c.POINT_NAME from panel_group a left join cust_group b on a.GROUP_ID=b.GROUP_ID left join cust_point c on c.POINT_ID=a.POINT_ID where 1=1 ");
    Map param = new HashMap();
    int index = 1;
    String panelId = (String) condMap.get("panelId");
    if (!StringUtil.isEmpty(panelId)) {
      param.put(String.valueOf(index++), panelId);
      sql.append(" and a.PANEL_ID=? ");
    }
    String resType = (String) condMap.get("resType");
    if (!StringUtil.isEmpty(resType)) {
      param.put(String.valueOf(index++), resType);
      sql.append(" and a.RES_TYPE=? ");
    }
    String title = (String) condMap.get("title");
    if (!StringUtil.isEmpty(title)) {
      param.put(String.valueOf(index++), "%" + title + "%");
      sql.append(" and a.PANELS_NAME like ? ");
    }
    String panelsName = (String) condMap.get("panelsName");
    if (!StringUtil.isEmpty(panelsName)) {
      param.put(String.valueOf(index++), "%" + panelsName + "%");
      sql.append(" and a.PANELS_NAME like ? ");
    }

    String screenId = (String) condMap.get("screenId");
    if (!StringUtil.isEmpty(screenId)) {
      param.put(String.valueOf(index++), screenId);
      sql.append(" and a.SCREEN_ID=? ");
    }
    String groupId = (String) condMap.get("groupId");
    if (!StringUtil.isEmpty(groupId)) {
      param.put(String.valueOf(index++), groupId);
      sql.append(" and a.GROUP_ID=? ");
    }
    String pointId = (String) condMap.get("pointId");
    if (!StringUtil.isEmpty(pointId)) {
      param.put(String.valueOf(index++), pointId);
      sql.append(" and a.POINT_ID=? ");
    }
    sql.append(UserUtil.custFilter2("a"));
    if (pageInfo != null) {
      pageInfo.setRowTotal(DbFactory.getSqlDdlDao().queryCount(sql.toString(), param));
      return DbFactory.getSqlDdlDao().query(sql.toString(), param, PanelGroup.class, pageInfo);
    } else {
      return DbFactory.getSqlDdlDao().query(sql.toString(), param, PanelGroup.class);
    }
  }
示例#2
0
  public List<SystemParameters> qryList(PageUtil pageInfo, Map<String, Object> qryParams)
      throws Exception {
    StringBuffer strSql = new StringBuffer("select * from system_parameters where 1=1 ");
    Map param = new HashMap();
    getQryMap(qryParams, param, strSql);
    strSql.append("  order by  create_date desc");

    List beanList = null;
    if (pageInfo != null) {
      pageInfo.setRowTotal(DbFactory.getSqlDdlDao().queryCount(strSql.toString(), param));
      beanList =
          DbFactory.getSqlDdlDao()
              .query(strSql.toString(), param, SystemParameters.class, pageInfo);
      return beanList;
    }
    beanList = DbFactory.getSqlDdlDao().query(strSql.toString(), param, SystemParameters.class);
    return beanList;
  }