//获取设置值
this.getvalue=function(excludfields)
{
var objfield =this.container.children;
var i;
var htmls=new Array();
var andor,lbracket,fieldname,condition,setvalue,rbracket;
var fieldtype;
var s;
var lrquotation;
for(i=0;i<objfield.length;i++)
{
fieldname=objfield[i].all.fieldname.value;
if(fieldname=="")continue;
condition=objfield[i].all.condition.value;
setvalue=objfield[i].all.setvalue.value;
if(condition=="" && setvalue=="")continue;
fieldtype=objfield[i].all.fieldname.options[objfield[i].all.fieldname.options.selectedIndex].ftype;
andor=objfield[i].all.andor.value;
lbracket=objfield[i].all.lbracket.value;
rbracket=objfield[i].all.rbracket.value;
//htmls.push(fieldname+"("+fieldtype+")"+condition+setvalue);
if(fieldtype=="N")
{
lrquotation="";
if(condition=="")condition="=";
if(condition=="like")
{
s="只有字符才能使用'包含',而["+fieldname+"]是数字,所以不能使用包含条件,请调整查询设置";
alert(s);
throw(s);
}
}
else
{
if(condition=="")condition="like";
lrquotation="'";
setvalue=setvalue.replace(/'/g,"''");
if(condition=="like")
{
setvalue=setvalue.replace(/\[/g,"\[\[]");
if(setvalue.indexOf("%")==-1)setvalue="%"+setvalue+"%";
}
}
if(condition=="like" && setvalue=="%%")
{
condition="=";
setvalue="";
}
if(andor=="")andor="and";
if(andor=="and")andor=" and ";
if(andor=="or") andor=" or ";//长度和and时是一样的,这样有利于截取
if(condition=="like")condition=" like ";
//对null的处理
if(fieldtype=="N")
{
if(setvalue=="")
if(condition=="<>")
s=fieldname+" is not null";
else if(condition=="=")
s=fieldname+" is null";
else
s=fieldname+condition+"null";
else
s=fieldname+condition+lrquotation+setvalue+lrquotation;
}
else
{
if(setvalue=="")
{
if(condition=="<>")
s="("+fieldname+" is not null and "+fieldname+"<>'')";
else if(condition=="=")
s="("+fieldname+" is null or "+fieldname+"='')";
else
s=fieldname+condition+"''";
}
else
s=fieldname+condition+lrquotation+setvalue+lrquotation;
}
htmls.push(andor+lbracket+s+rbracket);
}
s=htmls.join("");
htmls.splice(0,100000000);
htmls=null;
if(s.length>0)s=s.substring(5);
//alert("*"+s+"*");
return s;
}
//设置复杂度
this.setlevel=function(level)
{
this.level=level;
var i;
var objfield =this.container.children;
for(i=0 ;i< objfield.length; i++)
{
if(level>=4)
{
objfield[i].all.lbracket.style.display="inline";
objfield[i].all.rbracket.style.display="inline";;
}
else
{
objfield[i].all.lbracket.style.display="none";
objfield[i].all.rbracket.style.display="none";
objfield[i].all.lbracket.value="";
objfield[i].all.rbracket.value="";
}
if(level>=3)
objfield[i].all.andor.style.display="inline";
else
{
objfield[i].all.andor.style.display="none";
objfield[i].all.andor.value="";
}
if(level>=2)
objfield[i].all.condition.style.display="inline";
else
{
objfield[i].all.condition.style.display="none";
objfield[i].all.condition.value="";
}
} }
//删除某个条件
this.deletesetter=function(i)
{
if(this.maxrowno==i)return;//最后一个不能删除
var s=this.container.id+".all.fieldno_"+i;
var obj=eval(s);
this.container.removeChild(obj);
}
//点击最后一条时自动再追加一个空的
this.addjudge=function(i)
{
if(this.maxrowno==i)this.addsetter();
}
}
//queryer end
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++var qe=new queryer();
qe.level=3;
qe.create("栏目,类别,头条,顺序号,标题,创建日期,创建人,最后修改日期,最后修改人,点击率,部门,公司","C,C,C,N,C,C,C,C,C,N,C,C",SearchContent);
qe.addsetter("公司","=","泰森");
qe.addsetter("点击率",">","100");
qe.addsetter("点击率","<=","200");
qe.addallfield("公司","点击率");
</script>
this.getvalue=function(excludfields)
{
var objfield =this.container.children;
var i;
var htmls=new Array();
var andor,lbracket,fieldname,condition,setvalue,rbracket;
var fieldtype;
var s;
var lrquotation;
for(i=0;i<objfield.length;i++)
{
fieldname=objfield[i].all.fieldname.value;
if(fieldname=="")continue;
condition=objfield[i].all.condition.value;
setvalue=objfield[i].all.setvalue.value;
if(condition=="" && setvalue=="")continue;
fieldtype=objfield[i].all.fieldname.options[objfield[i].all.fieldname.options.selectedIndex].ftype;
andor=objfield[i].all.andor.value;
lbracket=objfield[i].all.lbracket.value;
rbracket=objfield[i].all.rbracket.value;
//htmls.push(fieldname+"("+fieldtype+")"+condition+setvalue);
if(fieldtype=="N")
{
lrquotation="";
if(condition=="")condition="=";
if(condition=="like")
{
s="只有字符才能使用'包含',而["+fieldname+"]是数字,所以不能使用包含条件,请调整查询设置";
alert(s);
throw(s);
}
}
else
{
if(condition=="")condition="like";
lrquotation="'";
setvalue=setvalue.replace(/'/g,"''");
if(condition=="like")
{
setvalue=setvalue.replace(/\[/g,"\[\[]");
if(setvalue.indexOf("%")==-1)setvalue="%"+setvalue+"%";
}
}
if(condition=="like" && setvalue=="%%")
{
condition="=";
setvalue="";
}
if(andor=="")andor="and";
if(andor=="and")andor=" and ";
if(andor=="or") andor=" or ";//长度和and时是一样的,这样有利于截取
if(condition=="like")condition=" like ";
//对null的处理
if(fieldtype=="N")
{
if(setvalue=="")
if(condition=="<>")
s=fieldname+" is not null";
else if(condition=="=")
s=fieldname+" is null";
else
s=fieldname+condition+"null";
else
s=fieldname+condition+lrquotation+setvalue+lrquotation;
}
else
{
if(setvalue=="")
{
if(condition=="<>")
s="("+fieldname+" is not null and "+fieldname+"<>'')";
else if(condition=="=")
s="("+fieldname+" is null or "+fieldname+"='')";
else
s=fieldname+condition+"''";
}
else
s=fieldname+condition+lrquotation+setvalue+lrquotation;
}
htmls.push(andor+lbracket+s+rbracket);
}
s=htmls.join("");
htmls.splice(0,100000000);
htmls=null;
if(s.length>0)s=s.substring(5);
//alert("*"+s+"*");
return s;
}
//设置复杂度
this.setlevel=function(level)
{
this.level=level;
var i;
var objfield =this.container.children;
for(i=0 ;i< objfield.length; i++)
{
if(level>=4)
{
objfield[i].all.lbracket.style.display="inline";
objfield[i].all.rbracket.style.display="inline";;
}
else
{
objfield[i].all.lbracket.style.display="none";
objfield[i].all.rbracket.style.display="none";
objfield[i].all.lbracket.value="";
objfield[i].all.rbracket.value="";
}
if(level>=3)
objfield[i].all.andor.style.display="inline";
else
{
objfield[i].all.andor.style.display="none";
objfield[i].all.andor.value="";
}
if(level>=2)
objfield[i].all.condition.style.display="inline";
else
{
objfield[i].all.condition.style.display="none";
objfield[i].all.condition.value="";
}
} }
//删除某个条件
this.deletesetter=function(i)
{
if(this.maxrowno==i)return;//最后一个不能删除
var s=this.container.id+".all.fieldno_"+i;
var obj=eval(s);
this.container.removeChild(obj);
}
//点击最后一条时自动再追加一个空的
this.addjudge=function(i)
{
if(this.maxrowno==i)this.addsetter();
}
}
//queryer end
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++var qe=new queryer();
qe.level=3;
qe.create("栏目,类别,头条,顺序号,标题,创建日期,创建人,最后修改日期,最后修改人,点击率,部门,公司","C,C,C,N,C,C,C,C,C,N,C,C",SearchContent);
qe.addsetter("公司","=","泰森");
qe.addsetter("点击率",">","100");
qe.addsetter("点击率","<=","200");
qe.addallfield("公司","点击率");
</script>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货