<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="config.jsp"%> <%@page import="java.util.Calendar"%> <%@page import="java.text.SimpleDateFormat"%> <%@page import="jcms.blf.module.zcfgk.ZCFGK"%> <%@page import="com.hanweb.common.util.Convert"%> <%@page import="jcms.blf.module.zcfgk.ZCFGKBLF"%> <%@page import="jcms.entity.module.zcfgk.ZCFGKEntity"%> <%@page import="jcms.blf.module.zcfgk.TreeBLF"%> <%@page import="jcms.entity.module.zcfgk.TreeEntity"%> 政策法规库树形菜单查询 <% String classPath=application.getRealPath("")+"/jcms_files/jcms1/web"+strWebID+"/site/module/zcfgk/config/classify.xml"; String classStyle=xmlfile.getContent("classlist",classPath).replaceAll("<","<").replaceAll(">",">"); int perpage=Convert.getStringValueInt(xmlfile.getContent("classify_perpage",classPath)); int titleNO=Convert.getStringValueInt(xmlfile.getContent("classify_titleno",classPath)); int pages = Convert.getParameterInt(request,"currpage",1); if(pages <= 0){ pages = 1; } int i_id =Convert.getParameterInt(request,"i_id",0); int i_year =Convert.getParameterInt(request,"i_year",0); ZCFGKBLF zcfgkBLF=new ZCFGKBLF(); ZCFGKEntity zcfgkEn=zcfgkBLF.getEntity(Convert.getStringValueInt(strWebID)); String condition=" AND b_delete=0 AND b_published=1 "; ZCFGK zcfgk=new ZCFGK(); if(i_year!=0){ if(i_year!=2000){ condition +=" AND "+zcfgkEn.getVc_year()+"='"+i_year+"'"; }else{ condition +=" AND "+zcfgkEn.getVc_year()+"<='"+i_year+"'"; } }else{ TreeBLF treeBLF=new TreeBLF(); TreeEntity treeEn=treeBLF.getEntityById(i_id); if(treeEn!=null){ switch(treeEn.getI_cond_no()){ case 1: SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Calendar cal=Calendar.getInstance(); cal.add(Calendar.MONTH, -6); //得到前6个月 String current = format.format(cal.getTime()); condition +=" AND " + zcfgkEn.getVc_publishtime() + " >= '" + current + "' ORDER BY "+zcfgkEn.getVc_publishtime()+" DESC,i_type DESC,i_id"; break; case 2: condition +=" ORDER BY i_hits DESC,i_type DESC,i_id"; break; case 3: if("其他".equals(treeEn.getVc_condition())){ String other=zcfgk.getOtherSql(strWebID,treeEn.getI_parentid(),zcfgkEn.getVc_filetype()); condition +=" AND "+other+" ORDER BY i_orderid,i_type DESC,i_id"; }else{ condition +=" AND "+zcfgkEn.getVc_filetype()+" like '%"+treeEn.getVc_condition()+"%' ORDER BY "+zcfgkEn.getVc_publishtime()+" DESC,i_type DESC,i_id"; } break; case 4: if("其他".equals(treeEn.getVc_condition())){ String other=zcfgk.getOtherSql(strWebID,treeEn.getI_parentid(),zcfgkEn.getVc_taxttype()); condition +=" AND "+other+" ORDER BY " + zcfgkEn.getVc_publishtime() + " DESC,i_type DESC,i_id"; }else{ condition +=" AND "+zcfgkEn.getVc_taxttype()+" like '%"+treeEn.getVc_condition()+"%' ORDER BY "+zcfgkEn.getVc_publishtime()+" DESC,i_type DESC,i_id"; } break; case 5: String[] validValue = treeEn.getVc_condition().split(","); if(validValue != null && validValue.length > 1){ condition +=" AND "+zcfgkEn.getVc_valid()+" like '%" + validValue[0]+ "%' OR " +zcfgkEn.getVc_valid()+" like '%"+validValue[1]+"%' ORDER BY " + zcfgkEn.getVc_publishtime() + " DESC,i_type DESC,i_id"; }else{ condition +=" AND " + zcfgkEn.getVc_valid() + " like '%" + treeEn.getVc_condition()+"%' ORDER BY " + zcfgkEn.getVc_publishtime() + " DESC,i_type DESC,i_id"; } break; case 6: condition +=" AND "+zcfgkEn.getVc_publishtime()+" like '%"+treeEn.getVc_condition()+"%' ORDER BY "+zcfgkEn.getVc_publishtime()+" DESC,i_type DESC,i_id"; break; case 7: condition +=" AND "+zcfgkEn.getVc_company()+" like '%"+treeEn.getVc_condition()+"%' ORDER BY "+zcfgkEn.getVc_publishtime()+" DESC,i_type DESC,i_id"; break; case 8: condition +=" AND "+zcfgkEn.getVc_topic()+" like '%"+treeEn.getVc_condition()+"%' ORDER BY "+zcfgkEn.getVc_publishtime()+" DESC,i_type DESC,i_id"; break; case 9: out.println(Convert.getAlterScript("location.href='"+treeEn.getVc_condition()+"'")); return; case 10: condition +=" AND "+zcfgkEn.getVc_policies()+" like '%"+treeEn.getVc_condition()+"%' ORDER BY "+zcfgkEn.getVc_publishtime()+" DESC, i_type DESC,i_id"; break; case 11: condition +=" AND "+zcfgkEn.getVc_affmanagement()+" like '%"+treeEn.getVc_condition()+"%' ORDER BY "+zcfgkEn.getVc_publishtime()+" DESC,i_type DESC,i_id"; break; } } } String html=zcfgk.getClassifyList(condition,classStyle,strWebID, pages,perpage,titleNO); out.println(html); %> <%! public String getOtherSql(int id){ String sql="NOT EXISTS("; return ""; } %>