/** * 查询处理 * * @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); } }
/** * 补交告知查询处理 * * @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 { QueryForm aWebForm = (QueryForm) pQueryForm; String[] sql_select; // 需要查询的字段 String sql_where; // 最终的查询条件 String[] sql_from; // 查询表 String sql_order; // 排序 String sql_selectCol = "a.DQCLZT,a.DEPARTID,a.BLZT,a.bljg,a.YXTYWBH,a.XMMC,to_char(a.shoulisj,'yyyy-mm-dd') shoulisj,to_char(a.bujiaogaozhisj,'yyyy-mm-dd') bujiaogaozhisj, to_char(a.bujiaoshoulisj, 'yyyy-mm-dd') bujiaoshoulisj,a.ssgzr,a.YWLSH,a.XKSXBH,a.XKSXXXBH,b.ITEMNAME bname,decode(a.banjie,'N',trunc(sysdate, 'dd') - trunc(a.bujiaogaozhisj, 'dd'),trunc(a.bujiaoshoulisj, 'dd') - trunc(a.bujiaogaozhisj, 'dd')) bjtimes "; sql_where = "a.XKSXBH=b.ID and a.xksxxxbh=b.items and a.version = b.version and a.DSRWCLZT='1' and a.BUJIAOGAOZHI='Y' and a.SFBLSJ='N'"; if (pQueryForm.getSptype() == null) { sql_where = sql_where + " AND B.spare4 IN (1,2,3)"; } else { sql_where = sql_where + " AND B.spare4 IN (" + pQueryForm.getSptype() + ")"; } // 查询数据SQL语句 // String msSql = "select // a.DQCLZT,a.BLZT,a.bljg,a.YXTYWBH,a.XMMC,to_char(a.shoulisj,'yyyy-mm-dd') // shoulisj,a.ssgzr,a.YWLSH,a.XKSXBH,a.XKSXXXBH,b.ITEMNAME bname,b.department DEPARTID from // t_JC_XZXK_busiindex a,t_JC_XZXK_permissionitemsys b where 1=1 "; // 主查询语句 sql_order = "order by SHOULISJ desc,bujiaogaozhisj desc"; // 排序语句 // 查询子条件 String msTemp = pQueryForm.getYXTYWBH(); // 原业务流水号 if (msTemp != null && msTemp.length() > 0) { sql_where += " and a.YXTYWBH = '" + msTemp + "'"; } msTemp = pQueryForm.getXMMC(); // 申请单位 if (msTemp != null && msTemp.length() > 0) { sql_where += " and a.XMMC like '%" + msTemp + "%'"; } msTemp = pQueryForm.getDepartment(); // 许可实施机关 if (msTemp != null && msTemp.length() > 0) { sql_where += " and a.departid = '" + msTemp + "'"; } msTemp = pQueryForm.getBJGZZT(); // 补交告知状态 if (msTemp != null && msTemp.length() > 0) { if (msTemp.equals("1")) { sql_where += " and a.SFBJGZCS is not null and a.SFBJGZCS ='N' and ((a.banjie = 'N' and trunc(sysdate, 'dd') -trunc(a.bujiaogaozhisj, 'dd')>=60) or (a.bujiaoshouli = 'Y' and trunc(a.bujiaoshoulisj, 'dd') -trunc(a.bujiaogaozhisj, 'dd')>=60)) "; } else { sql_where += " and a.SFBJGZCS is not null and a.SFBJGZCS ='" + msTemp + "'"; } } msTemp = pQueryForm.getPermission(); // 许可事项 if (msTemp != null && msTemp.length() > 0) { sql_where += " and (b.id||b.items) = '" + msTemp + "'"; } msTemp = pQueryForm.getBusi_area(); // 业务范围 if (msTemp == null || msTemp.equals("0")) { // 查询当前业务 sql_select = new String[] {sql_selectCol}; sql_from = new String[] {"t_JC_XZXK_busiindex a,t_JC_XZXK_permissionitemsys b"}; } else { sql_select = new String[] {sql_selectCol, sql_selectCol}; sql_from = new String[] { "t_JC_XZXK_busiindex a,t_JC_XZXK_permissionitemsys b", "h_JC_XZXK_busiindex a,t_JC_XZXK_permissionitemsys b" }; if (!msTemp.equals("9")) { // 不是查询所有业务,则用该时间段对 TJSJ 做查询 String[] sql_timeArea = Common.getDataArea(pQueryForm.getBusi_area()); sql_where = sql_where + " AND a.tjsj >= to_date(" + sql_timeArea[0] + ",'YYYYMM')"; sql_where = sql_where + " AND a.tjsj <= to_date(" + sql_timeArea[1] + ",'YYYYMM')"; } } msTemp = pQueryForm.getSetTime1(); // 办结日期,起 if (msTemp != null && !msTemp.equals("")) { sql_where += " and a.BUJIAOGAOZHISJ>=TO_DATE('" + msTemp + "','YYYY-MM-DD') "; } msTemp = pQueryForm.getSetTime2(); // 办结日期,止 if (msTemp != null && !msTemp.equals("")) { sql_where += " and a.BUJIAOGAOZHISJ<TO_DATE('" + msTemp + "','YYYY-MM-DD')+1 "; } msTemp = pQueryForm.getYc(); // 是否已查看标志 if (msTemp != null && msTemp.equals("N")) { sql_where += " and (a.YCCHECK is null or a.YCCHECK='N') "; } CDataPage dataPage = new CDataPage(); dataPage.setSql_select(sql_select); // 设置查询语句 dataPage.setSql_from(sql_from); dataPage.setSql_where(sql_where); dataPage.setSql_order(sql_order); // 设置排序语句 dataPage.setFormName("forms[0]"); dataPage.setPageRowCount(CConstants.PAGE_ROW_COUNT); dataPage.makeSqlWithSqlPart(); dataPage.init(request); request.setAttribute(CConstants.DATA_PAGE_OBJECT, dataPage); TreeMap tmDepartName0 = new TreeMap(); // 添加许可办理状态表到对应的FORM tmDepartName0 = CCodeMap.getMapByType("监察补交告知状态"); aWebForm.setLxStatusList(tmDepartName0); } catch (Exception e) { throw new CDealException("根据输入条件进行查询时失败。", e); } }
/** * 查询处理 * * @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); } }