//str = " (ob.SALECORPID='" + companyid + "' or (select companyid from vw_user where showname=ob.OPNAME)='" + companyid + "' or (select companyid from vw_user where showname=ob.AUDITOR)='" + companyid + "' ) ";
str=" (ob.SALECORPID='"+companyid+"' or exists(select 1 from vw_user where companyid='"+companyid+"' and showname in(ob.OPNAME,ob.AUDITOR,ob.SALE)) ";
str=" (ob.SALECORPID='"+companyid+"' or exists(select 1 from vw_user where companyid='"+companyid+"' and showname in(ob.OPNAME,ob.AUDITOR,ob.SALE))) ";
var其他未签出业务List=GetDataList($" b.CUSTOMERNAME='{headList[0].CUSTOMERNAME}' and b.BLISSUESTATUS<>'提单签出' and b.BSNO not in({bsnostr})",0,9,outrecordcount);
var其他未签出业务List=GetDataList($" b.CUSTOMERNAME='{headList[0].CUSTOMERNAME}' and b.BLISSUESTATUS<>'提单签出' and exists(select 1 from op_ctn where BSNO=b.BSNO and len(CNTRNO)=11) and b.BSNO not in({bsnostr})",0,9,outrecordcount);
strSql.Append(" left join (select t3.* from (select *,row_number() over (partition by EDICODE order by portid asc) as rownum from code_disport) t3 where t3.rownum = 1 ) cd on B.DESTINATIONID = cd.EDICODE ");
if(!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" where "+strCondition);
}
//
strSql.Append(@")as t2 )as t ");
strSql.Append(string.Format("where t.num>{0} and t.num<={1} order by t.num ",start,start+limit));//
strSql.Append(",(CASE ORSTATUS WHEN '8' THEN '确认订舱' WHEN '0' THEN '审核通过' WHEN '1' THEN '提交审核' WHEN '2' THEN '驳回' WHEN '4' THEN '退舱' else '录入状态' end) as ORSTATUSREF ");
strSql.Append(",(SELECT CUSTNO FROM V_OP_BILL V WHERE V.BSNO=B.BSNO) as CUSTNO ");
strSql.Append(",(SELECT MBLNO FROM V_OP_BILL V WHERE V.BSNO=B.BSNO) as MBLNOREF,MBLNO,SALEDEPT,BSSOURCE,BSSOURCEDETAIL,(select top 1 sale from info_client where SHORTNAME=B.CUSTOMERNAME) DEFSALE ");
varcmdupdate=db.GetSqlStringCommand(@"update op_seae set ETD='"+headData.ETD+"',ATD='"+headData.ATD+"',STLNAME='"+STLNAME+"',STLDATE='"+STLDATE+"' where BSNO='"+enumValue.BSNO+"'");