Exemplo n.º 1
0
  /**
   * 查询处理
   *
   * @param actionForm ActionForm 表单From
   * @param request HttpServletRequest Web请求
   * @param response HttpServletResponse Web结果
   * @throws CDealException 处理异常
   */
  public static void doQuery(
      QueryForm pQueryForm, HttpServletRequest request, HttpServletResponse response)
      throws CDealException {
    try {

      // 查询数据SQL语句
      String msSql =
          "select CHENGPIID,COMPLAINEDPERSON,COMPLAINPERSON,COMPLAINVERSION,to_char(a.CREATEDATE,'yyyy-mm-dd')CREATEDATE,COMPLAINUNIT,COMPLAINEDUNIT,SPARE1,SPARE2,SPARE3,SPARE4,t.abbrname,a.XZGCXYFL,a.SUBXZGCXYFL from T_YW_ZDSX_JCJ_TSCHENGPIBIAO a,t_Sys_Department t  WHERE a.STATUS = 1 and SUBMITSTATUS = 1 and t.id=COMPLAINEDUNIT "; // 主查询语句
      String msOrder = "ORDER BY CREATEDATE desc"; // 排序语句

      // 查询子条件
      String msSqlWhere = "";
      String msTemp = pQueryForm.getCHENGPIID(); // 呈批表编号
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and CHENGPIID like '%" + msTemp + "%'";
      }
      msTemp = pQueryForm.getCOMPLAINEDPERSON(); // 呈批表被投诉人姓名
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and COMPLAINEDPERSON like '%" + msTemp + "%'";
      }
      msTemp = pQueryForm.getCOMPLAINUNIT(); // 呈批表问题性质
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and COMPLAINUNIT like '%" + msTemp + "%'";
      }
      msTemp = pQueryForm.getCOMPLAINEDUNIT(); // 呈批表被投诉人单位
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and COMPLAINEDUNIT = '" + msTemp + "'";
      }
      msTemp = pQueryForm.getCOMPLAINPERSON(); // 呈批表投诉人姓名
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and COMPLAINPERSON like '%" + msTemp + "%'";
      }
      msTemp = pQueryForm.getCOMPLAINVERSION(); // 呈批表投诉形式
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and COMPLAINVERSION =" + msTemp;
      }
      msTemp = pQueryForm.getCREATEDATE1(); // 呈批表创建时间,起
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and CREATEDATE >= to_date('" + msTemp + "','yyyy-mm-dd')";
      }
      msTemp = pQueryForm.getCREATEDATE2(); // 呈批表创建时间,止
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and CREATEDATE <= to_date('" + msTemp + "','yyyy-mm-dd')";
      }

      msSql = msSql + msSqlWhere; // 主查询语句 加上 查询子条件

      CDataPage dataPage = new CDataPage(); // 翻页实现类
      dataPage.setQuerySql(msSql); // 设置查询语句
      dataPage.setOrderStr(msOrder); // 设置排序语句
      dataPage.setPageRowCount(CConstants.PAGE_ROW_COUNT); // 每页行数
      dataPage.init(request);
      request.setAttribute(CConstants.DATA_PAGE_OBJECT, dataPage);

      // 初始化页面,初始化投诉形式下拉菜单
      TreeMap COMPLAINVERSIONListName = new TreeMap(); // 取出aWebForm
      COMPLAINVERSIONListName = CCodeMap.getMapByType("行政效能投诉形式");
      pQueryForm.setCOMPLAINVERSIONList(COMPLAINVERSIONListName);
      TreeMap COMPLAINVERSIONListName1 = new TreeMap(); // 取出aWebForm
      COMPLAINVERSIONListName1 = CCodeMap.getMapByType("部门名称列表");
      pQueryForm.setDepartList(COMPLAINVERSIONListName1);

    } catch (Exception e) {
      throw new CDealException("根据输入条件进行查询时失败。", e);
    }
  }
Exemplo n.º 2
0
  /**
   * 查询处理
   *
   * @param actionForm ActionForm 表单From
   * @param request HttpServletRequest Web请求
   * @param response HttpServletResponse Web结果
   * @throws CDealException 处理异常
   */
  public static void doQuery(
      QueryForm pQueryForm, HttpServletRequest request, HttpServletResponse response)
      throws CDealException {
    try {

      // 查询数据SQL语句
      //      String msSql = "select
      // t.BUSIINDEXID,t.ITEMID,t.ITEMTITLE,t.FROMCOMPANY,t.ITEMTYPE,t.DEPARTMENT, " +
      //                     "t.LIMITFOREWARN,t.LIMITYELLOW,t.LIMITRED,c.abbrname from
      // T_JC_ZDSX_DCK_BUSIINDEX t" +
      //                     ",t_Yw_Dck_Jcj_Taskbreak b,t_sys_department c where t.itemid = b.itemid
      // and b.firstflag = 1 and b.transactdepartment = c.id ";
      String msSql =
          "select t.BUSIINDEXID,t.ITEMID,t.ITEMTITLE,t.FROMCOMPANY,t.ITEMTYPE,t.DEPARTMENT, "
              + "t.LIMITFOREWARN,t.LIMITYELLOW,t.LIMITRED from T_JC_ZDSX_DCK_BUSIINDEX t,t_yw_dck_jcj_resister p where t.itemid = p.itemid and (t.spare1=0 or t.spare1 is null)  ";
      String msOrder =
          "order by t.LIMITRED desc,T.LIMITYELLOW desc,T.LIMITFOREWARN desc, BUSIINDEXID desc"; // 排序语句

      // 查询子条件
      String msSqlWhere = "";
      String msTemp = pQueryForm.getItemid(); // 编号
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and t.itemid like '%" + msTemp + "%'";
      }
      msTemp = pQueryForm.getFromcompany(); // 来文单位
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and t.fromcompany like '%" + msTemp + "%'";
      }
      msTemp = pQueryForm.getItemtitle(); // 督办标题
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and t.itemtitle like '%" + msTemp + "%'";
      }
      msTemp = pQueryForm.getItemtype(); // 类别
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and t.itemtype =" + msTemp;
      }
      msTemp = pQueryForm.getItemstatus(); // 重大事项状态类别
      if (msTemp != null && msTemp.length() > 0 && msTemp.equals("1")) {
        msSqlWhere += " and p.ITEMSTATUS =1";
      }
      if (msTemp != null && msTemp.length() > 0 && msTemp.equals("2")) {
        msSqlWhere += " and p.ITEMSTATUS =2";
      }
      if (msTemp != null && msTemp.length() > 0 && msTemp.equals("3")) {
        msSqlWhere += " and p.ITEMSTATUS =3";
      }
      if (msTemp != null
          && msTemp.length() > 0
          && (msTemp.equals("4")
              || msTemp.equals("5")
              || msTemp.equals("6")
              || msTemp.equals("7"))) {
        msSqlWhere += " and p.ITEMSTATUS =4";
      }
      if (msTemp != null && msTemp.length() > 0 && msTemp.equals("8")) {
        msSqlWhere += " and p.ITEMSTATUS =7";
      }
      msTemp = pQueryForm.getDepartment(); // 来源分类
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and t.department =" + msTemp;
      }
      msTemp = pQueryForm.getFromdate1(); // 收文日期,起
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and t.INITIALDATE >= to_date('" + msTemp + "','yyyy-mm-dd')";
      }
      msTemp = pQueryForm.getFromdate2(); // 收文日期,止
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and t.INITIALDATE <= to_date('" + msTemp + "','yyyy-mm-dd')";
      }

      msSql = msSql + msSqlWhere; // 主查询语句 加上 查询子条件

      CDataPage dataPage = new CDataPage(); // 翻页实现类
      dataPage.setQuerySql(msSql); // 设置查询语句
      dataPage.setOrderStr(msOrder); // 设置排序语句
      dataPage.setQueryFormOrderColumn(pQueryForm.getQueryFormOrderColumn()); // 查询页面排序的字段
      dataPage.setPageRowCount(CConstants.PAGE_ROW_COUNT); // 每页行数
      dataPage.setFormName("forms[0]");
      dataPage.init(request);
      request.setAttribute(CConstants.DATA_PAGE_OBJECT, dataPage);
    } catch (Exception e) {
      throw new CDealException("根据输入条件进行查询时失败。", e);
    }
  }
Exemplo n.º 3
0
  /**
   * 查询处理
   *
   * @param actionForm ActionForm 表单From
   * @param request HttpServletRequest Web请求
   * @param response HttpServletResponse Web结果
   * @throws CDealException 处理异常
   */
  public static void doQuery(
      QueryForm pQueryForm, HttpServletRequest request, HttpServletResponse response)
      throws CDealException {
    try {
      // 初始化页面,初始化法律类别下拉菜单
      TreeMap classificationList = new TreeMap();
      classificationList = CCodeMap.getMapByType("法律类别");
      pQueryForm.setClassificationList(classificationList);

      TreeMap businesstypeList = new TreeMap();
      businesstypeList = CCodeMap.getMapByType("法律法规业务类别");
      pQueryForm.setBusinesstypeList(businesstypeList);
      // 查询数据SQL语句
      String msSql =
          "select id,title,orderno,content,issuedate,to_char(createtime,'yyyy-mm-dd') createtime,businesstype,CLASSIFICATION,spare1,spare2,spare3,spare4 FROM t_pub_law WHERE 1=1 "; // 主查询语句
      String msOrder = "ORDER BY orderno"; // 排序语句

      // 查询子条件
      String msSqlWhere = "";
      String msTemp = pQueryForm.getTitle(); // 标题
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and title like '%" + msTemp + "%'";
      }
      msTemp = pQueryForm.getContent(); // 内容
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and content like '%" + msTemp + "%'";
      }
      msTemp = pQueryForm.getOrderno(); // 排序号
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and orderno like '%" + msTemp + "%'";
      }
      msTemp = pQueryForm.getClassification(); // 类别
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and classification ='" + msTemp + "'";
      }
      msTemp = pQueryForm.getBusinesstype(); // 业务类别
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and businesstype ='" + msTemp + "'";
      }
      msTemp = pQueryForm.getIssueTime1(); // 颁布日期,起
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and issuedate >= to_date('" + msTemp + "','yyyy-mm-dd')";
      }
      msTemp = pQueryForm.getIssueTime2(); // 颁布日期,止
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and issuedate <= to_date('" + msTemp + "','yyyy-mm-dd')";
      }
      msTemp = pQueryForm.getInputTime1(); // 录入时间,起
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and createtime >= to_date('" + msTemp + "','yyyy-mm-dd')";
      }
      msTemp = pQueryForm.getInputTime2(); // 录入时间,止
      if (msTemp != null && msTemp.length() > 0) {
        msSqlWhere += " and createtime <= to_date('" + msTemp + "','yyyy-mm-dd')";
      }

      msSql = msSql + msSqlWhere; // 主查询语句 加上 查询子条件

      CDataPage dataPage = new CDataPage(); // 翻页实现类
      dataPage.setQuerySql(msSql); // 设置查询语句
      dataPage.setOrderStr(msOrder); // 设置排序语句
      dataPage.setPageRowCount(CConstants.PAGE_ROW_COUNT); // 每页行数
      dataPage.setFormName("forms[0]");
      dataPage.init(request);
      request.setAttribute(CConstants.DATA_PAGE_OBJECT, dataPage);
    } catch (Exception e) {
      throw new CDealException("根据输入条件进行查询时失败。", e);
    }
  }