+ |
+
+
+
+
+ <%
+ int pagenum = Util.getIntValue(request.getParameter("pagenum"), 1);
+ int perpage = Util.getPerpageLog();
+ if (perpage <= 1) perpage = 10;
+ String id = Util.fromScreen(request.getParameter("id"), user.getLanguage());//id
+ String isMainSell = Util.fromScreen(request.getParameter("isMainSell"), user.getLanguage());//是否主营销售类
+ String contractType = Util.fromScreen(request.getParameter("contractType"), user.getLanguage());//合同类型
+ String contractName = Util.fromScreen(request.getParameter("contractName"), user.getLanguage());//合同名称
+ String contractCode = Util.fromScreen(request.getParameter("contractCode"), user.getLanguage());//合同编号
+ String proposer = Util.fromScreen(request.getParameter("proposer"), user.getLanguage());//申请人
+ String propDeptId = Util.fromScreen(request.getParameter("propDeptId"), user.getLanguage());//申请部门ID
+ String clientCode1 = Util.fromScreen(request.getParameter("clientCode1"), user.getLanguage());//客户编号
+ String clientCode = Util.fromScreen(request.getParameter("clientCode"), user.getLanguage());//客户编号
+ String clientName = Util.fromScreen(request.getParameter("clientName"), user.getLanguage());//客户名称
+ String industryINOut = Util.fromScreen(request.getParameter("industryINOut"), user.getLanguage());//业内/业外
+ String operationDeptId = Util.fromScreen(request.getParameter("operationDeptId"), user.getLanguage());//运作部门ID
+ String contractNewOld = Util.fromScreen(request.getParameter("contractNewOld"), user.getLanguage());//新/老合同
+ String CLandFM = Util.fromScreen(request.getParameter("CLandFM"), user.getLanguage());//CL/FM
+ String serviceType = Util.fromScreen(request.getParameter("serviceType"), user.getLanguage());//服务种类
+ String contractStartTimeFirst = Util.fromScreen(request.getParameter("contractStartTimeFirst"), user.getLanguage());//合同起始日期(开始)
+ String contractStartTimeEnd = Util.fromScreen(request.getParameter("contractStartTimeEnd"), user.getLanguage());//合同起始日期(结束)
+ String contractEndTimeFirst = Util.fromScreen(request.getParameter("contractEndTimeFirst"), user.getLanguage());//合同结束日期(开始)
+ String contractEndTimeEnd = Util.fromScreen(request.getParameter("contractEndTimeEnd"), user.getLanguage());//合同结束日期(结束)
+ String estimateStartTmeFirst = Util.fromScreen(request.getParameter("estimateStartTmeFirst"), user.getLanguage());//预估运作起始日期(开始)
+ String estimateStartTmeEnd = Util.fromScreen(request.getParameter("estimateStartTmeEnd"), user.getLanguage());//预估运作起始日期(结束)
+ String estimateEndTimeFirst = Util.fromScreen(request.getParameter("estimateEndTimeFirst"), user.getLanguage());//预估运作结束日期(开始)
+ String estimateEndTimeEnd = Util.fromScreen(request.getParameter("estimateEndTimeEnd"), user.getLanguage());//预估运作结束日期(结束)
+ String contractTotalMoney = Util.fromScreen(request.getParameter("contractTotalMoney"), user.getLanguage());//合同总金额
+ String yearContractrTotMon = Util.fromScreen(request.getParameter("yearContractrTotMon"), user.getLanguage());//年合同总金额
+ String yearAchieveIncome = Util.fromScreen(request.getParameter("yearAchieveIncome"), user.getLanguage());//当年可实现收入金额
+ String creditPaymentDays = Util.fromScreen(request.getParameter("creditPaymentDays"), user.getLanguage());//信用账期(天)
+ String creditLimit = Util.fromScreen(request.getParameter("creditLimit"), user.getLanguage());//信用额度
+ String settleAccountsUnit = Util.fromScreen(request.getParameter("settleAccountsUnit"), user.getLanguage());//结算单位
+ String status = Util.fromScreen(request.getParameter("status"), user.getLanguage());//合同状态
+ String contractBackFileTimeFirst = Util.fromScreen(request.getParameter("contractBackFileTimeFirst"), user.getLanguage());//合同流程归档日期(开始)
+ String contractBackFileTimeEnd = Util.fromScreen(request.getParameter("contractBackFileTimeEnd"), user.getLanguage());//合同流程归档日期(结束)
+ String contractTotalMoneys = Util.null2String(request.getParameter("contractTotalMoneys"));
+ String yearContractrTotMons = Util.null2String(request.getParameter("yearContractrTotMons"));
+ String yearAchieveIncomes = Util.null2String(request.getParameter("yearAchieveIncomes"));
+ String creditPaymentDayss = Util.null2String(request.getParameter("creditPaymentDayss"));
+ String creditLimits = Util.null2String(request.getParameter("creditLimits"));
+ // ADD BY LIST 20141106
+ String subCompanyId = Util.fromScreen(request.getParameter("subCompanyId"), user.getLanguage());
+ // ADD BY LIST 20141106
+ //查询分部名称
+ String subcompanyname = "";
+ if(!"".equals(subCompanyId)){
+ RecordSet.executeQuery("select subcompanyname from HrmSubCompany where id in ("+subCompanyId+")");
+ while (RecordSet.next()){
+ String subcompanyname_temp = Util.null2String(RecordSet.getString(1));
+ if(!"".equals(subcompanyname_temp)){
+ if("".equals(subcompanyname)){
+ subcompanyname = subcompanyname_temp;
+ }else{
+ subcompanyname += "," + subcompanyname_temp;
+ }
+ }
+ }
+ }
+
+
+ //ADD BY ZWL 20191122
+ int opentype = Util.getIntValue(request.getParameter("opentype"),-1);//开闭口类型 0-闭口 1-开口 2-周期性
+
+ //sqlwhere = " 1=1 ";
+ //out.print("clientName="+clientName);
+ if(!"".equals(isMainSell)) sqlwhere += " and isMainSell = '"+isMainSell+"'";
+ if (!contractType.equals("")) sqlwhere += " and contractType='" + contractType + "'";
+ if (!contractName.equals("")) sqlwhere += " and contractName like '%" + contractName + "%'";
+ if (!contractCode.equals("")) sqlwhere += " and contractCode like '%" + contractCode + "%'";
+ if (!proposer.equals("")) sqlwhere += " and proposer='" + proposer + "'";
+ if (!propDeptId.equals("")) sqlwhere += " and propDeptId='" + propDeptId + "'";
+ if(!"".equals(clientName)){
+ if(clientName.indexOf(",")!=-1){
+ String arr[] = clientName.split(",");
+ sqlwhere += " and (clientName = '"+arr[0]+"'";
+ for(int i = 1;i='" + contractStartTimeFirst + "'";
+ if (!contractStartTimeEnd.equals("")) sqlwhere += " and CONVERT(varchar(100), contractStartTime, 23)<='" + contractStartTimeEnd + "'";
+ if (!contractEndTimeFirst.equals("")) sqlwhere += " and CONVERT(varchar(100), contractEndTime, 23)>='" + contractEndTimeFirst + "'";
+ if (!contractEndTimeEnd.equals("")) sqlwhere += " and CONVERT(varchar(100), contractEndTime, 23)<='" + contractEndTimeEnd + "'";
+ if (!estimateStartTmeFirst.equals("")) sqlwhere += " and CONVERT(varchar(100), estimateStartTme, 23)>='" + estimateStartTmeFirst + "'";
+ if (!estimateStartTmeEnd.equals("")) sqlwhere += " and CONVERT(varchar(100), estimateStartTme, 23)<='" + estimateStartTmeEnd + "'";
+ if (!estimateEndTimeFirst.equals("")) sqlwhere += " and CONVERT(varchar(100), estimateEndTime, 23)>='" + estimateEndTimeFirst + "'";
+ if (!estimateEndTimeEnd.equals("")) sqlwhere += " and CONVERT(varchar(100), estimateEndTime, 23)<='" + estimateEndTimeEnd + "'";
+
+ if (!contractTotalMoney.equals("")) {
+ if("0".equals(contractTotalMoneys)){
+ sqlwhere += " and (cast (isnull(nullif(contractTotalMoney,''),0) as decimal(19,2)))>" + contractTotalMoney ;
+ }
+ if("1".equals(contractTotalMoneys)){
+ sqlwhere += " and (cast (isnull(nullif(contractTotalMoney,''),0) as decimal(19,2)))=" + contractTotalMoney ;
+ }
+ if("2".equals(contractTotalMoneys)){
+ sqlwhere += " and (cast (isnull(nullif(contractTotalMoney,''),0) as decimal(19,2)))<" + contractTotalMoney ;
+ }
+ }
+ if (!yearContractrTotMon.equals("")) {
+ if("0".equals(yearContractrTotMons)){
+ sqlwhere += " and (cast (isnull(nullif(yearContractrTotMon,''),0) as decimal(19,2)))>" + yearContractrTotMon ;
+ }
+ if("1".equals(yearContractrTotMons)){
+ sqlwhere += " and (cast (isnull(nullif(yearContractrTotMon,''),0) as decimal(19,2)))=" + yearContractrTotMon ;
+ }
+ if("2".equals(yearContractrTotMons)){
+ sqlwhere += " and (cast (isnull(nullif(yearContractrTotMon,''),0) as decimal(19,2)))<" + yearContractrTotMon ;
+ }
+ }
+ if (!yearAchieveIncome.equals("")) {
+ if("0".equals(yearAchieveIncomes)){
+ sqlwhere += " and ISNUMERIC(yearAchieveIncome)=1 and (cast (isnull(nullif(yearAchieveIncome,''),0) as decimal(19,2)))>" + yearAchieveIncome ;
+ }
+ if("1".equals(yearAchieveIncomes)){
+ sqlwhere += " and ISNUMERIC(yearAchieveIncome)=1 and (cast (isnull(nullif(yearAchieveIncome,''),0) as decimal(19,2)))=" + yearAchieveIncome ;
+ }
+ if("2".equals(yearAchieveIncomes)){
+ sqlwhere += " and ISNUMERIC(yearAchieveIncome)=1 and (cast (isnull(nullif(yearAchieveIncome,''),0) as decimal(19,2)))<" + yearAchieveIncome ;
+ }
+ }
+
+ new BaseBean().writeLog(">>creditPaymentDays====== :"+creditPaymentDays);
+ if(!"".equals(creditPaymentDays)) {
+ new BaseBean().writeLog(">>creditPaymentDayss====222== :"+creditPaymentDayss);
+ if("0".equals(creditPaymentDayss)){
+ sqlwhere += " and ISNUMERIC(creditPaymentDays)=1 and (cast (isnull(nullif(creditPaymentDays,''),0) as decimal(19,2)))>=" + creditPaymentDays ;
+ }
+ if("1".equals(creditPaymentDayss)){
+ sqlwhere += " and ISNUMERIC(creditPaymentDays)=1 and (cast (isnull(nullif(creditPaymentDays,''),0) as decimal(19,2)))=" + creditPaymentDays ;
+ }
+ if("2".equals(creditPaymentDayss)){
+ sqlwhere += " and ISNUMERIC(creditPaymentDays)=1 and (cast (isnull(nullif(creditPaymentDays,''),0) as decimal(19,2)))<" + creditPaymentDays ;
+ }
+ }
+ if (!creditLimit.equals("")) {
+ if("0".equals(creditLimits)){
+ sqlwhere += " and ISNUMERIC(creditLimit)=1 and (cast (isnull(nullif(creditLimit,''),0) as decimal(19,2)))>" + creditLimit ;
+ }
+ if("1".equals(creditLimits)){
+ sqlwhere += " and ISNUMERIC(creditLimit)=1 and (cast (isnull(nullif(creditLimit,''),0) as decimal(19,2)))=" + creditLimit ;
+ }
+ if("2".equals(creditLimits)){
+ sqlwhere += " and ISNUMERIC(creditLimit)=1 and (cast (isnull(nullif(creditLimit,''),0) as decimal(19,2)))<" + creditLimit ;
+ }
+ }
+
+ if (!settleAccountsUnit.equals("")) sqlwhere += " and settleAccountsUnit like '%" + settleAccountsUnit + "%'";
+ if (!status.equals("")) sqlwhere += " and status='" + status + "'";
+
+ if (!contractBackFileTimeFirst.equals("")) sqlwhere += " and CONVERT(varchar(100), contractBackFileTime, 23)>='" + contractBackFileTimeFirst + "'";
+ if (!contractBackFileTimeEnd.equals("")) sqlwhere += " and CONVERT(varchar(100), contractBackFileTime, 23)<='" + contractBackFileTimeEnd + "'";
+ // ADD BY LIST 20141106
+ //if (!subCompanyId.equals("")) sqlwhere += " and subcompanyid1 = '" + subCompanyId + "'";
+ if (!subCompanyId.equals("")) sqlwhere += " and subcompanyid1 in ("+subCompanyId+")";
+ // ADD BY LIST 20141106
+ //System.out.println("sqlwhere:"+sqlwhere);
+
+ //ADD BY ZWL 20191122
+ if(opentype > -1){
+ sqlwhere += " and isnull(opentype,0) = " + opentype;
+ }
+
+ String orderStr = " order by startDate desc, id desc ";
+
+ session.setAttribute("sqlwhere", sqlwhere);
+ session.setAttribute("orderStr", orderStr);
+
+ new BaseBean().writeLog(">>SalesContractList.jsp查询条件====== :"+sqlwhere);
+ %>
+ |
+
+ |
+ |
+
+