str=" ( B.OP='"+username+"' OR B.CUSTSERVICE='"+username+"' OR B.DOC='"+username+"' )";
}
elseif(visiblerange=="2")
{
varrangeDa=newRangeDA();
vardeptid=rangeDa.GetDEPTGID(userid);
str=$" exists(select 1 from vw_user where deptgid='{deptid}' and SHOWNAME in(B.OP,B.CUSTSERVICE,B.DOC)) ";
}
elseif(visiblerange=="1")
{
str=" (UPPER(B.Corpid)='"+companyid+"') ";
}
elseif(visiblerange=="5")
{
str=" ob.OPNAME in (select SHOWNAME from vw_user where COMPANYID IN (select COMPANYID from user_authority_range_company where userid='"+userid+"' and AUTHORITYID='"+AUTHORITYID+"' and VISIBLERANGE=1)) ";
//var userstr = new StringBuilder();
//userstr.Append(" select COMPANYID from user_authority_range_company where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1");
str=" EXISTS (select 1 from user_authority_range_op P left join [user] u on (u.GID=P.OPID) where (B.OP=U.SHOWNAMEOR B.CUSTSERVICE=U.SHOWNAME OR B.DOC=U.SHOWNAME ) AND P.userid='"+userid+"' and P.AUTHORITYID='"+AUTHORITYID+"' and P.VISIBLERANGE=1) ";
this.storeBodyChFee.load({params:{billno:bsno,type:this.feeType,optype:'op_Seae', condition:" FeeType="+this.feeType+" and exists (select 1 from v_op_bill b where b.BSNO=ch_fee.BSNO and b.PARENTID='"+bsno+"')"}});