strSql=sql_top+" from WG_PLFSSJTEMP_CLONE S,WG_PLFSSJFJTEMP_CLONE F,XT_SJQYDY D,YW_QYXX Q"; }else{ strSql=sql_top+" from WG_PLFSSJTEMP S,WG_PLFSSJFJTEMP F,XT_SJQYDY D,YW_QYXX Q"; } strSql=strSql + " where S.ID = F.SJ_ID and F.MSJH = D.SJH and D.NSRSBH=Q.NSRSBH " +" and (S.CZYBM in (select CZYDM from YW_CZYXX where SWJGDM = '" + strSwjgdm + "') or S.CZYBM like '%自动发送程序%')"; if (!(strfssjQ == null) && !strfssjQ.equals("")) { strSql = "select * from (" +strSql+ ") as A where A.FSSJ >= '"+strfssjQ+"'"; } if (!(strfssjZ == null) && !strfssjZ.equals("")) { strSql = strSql+" and A.FSSJ <= '" + strfssjZ + "'"; } if (!(strNSRSBH == null) && !strNSRSBH.equals("")) { strSql = strSql+" and A.NSRSBH like '%" + strNSRSBH + "%'"; } if (!(strNSRMC == null) && !strNSRMC.equals("")) { strSql = strSql+" and A.MC like '%" + strNSRMC + "%'"; } if (!(strSJH == null) && !strSJH.equals("")) { strSql = strSql+" and A.MSJH like'%" + strSJH + "%'"; } if (!(strNR == null) && !strNR.equals("")) { strSql = strSql + " and A.CONTENT like '%" + strNR + "%'"; } if (!(strYWDM == null) && !strYWDM.equals("")) { strSql = strSql + " and A.YWDM='" + strYWDM + "'"; } if (!(strClbz == null) && !strClbz.equals("")) { strSql = strSql + " and A.CLBZ='" + strClbz + "'"; } if (!(strFsr == null) && !strFsr.equals("")) { String strFsrdm=getFsrxx(null,strFsr); if(!(strFsrdm == null) && !"".equals(strFsrdm)){ strSql=strSql + " and A.CZYBM = '"+strFsrdm+"' "; } }else{ if(!"1".equals(strQx)){ String strFsrdm=getFsrxx(null,strFsr); if(!(strFsrdm == null) && !"".equals(strFsrdm)){ strSql=strSql + " and A.CZYBM = '"+strFsrdm+"' "; } } } strSql = strSql + " order by A.ID"; 哪位大虾给看看啊!! |