8,497
社区成员
发帖
与我相关
我的任务
分享
var organizationidList=from o in organization_dept where o.deptid=@deptid select o.organizationid;
var linqquery=(from d in dept join od in organization_dept on d.id equals od.deptid
orderby d.ABC,d.forshort where str.Contains(od.organizationid)
&& d.ABC.Contains("+@ABC+") && (d.state==1 || d.state==3)
select new{d.id,d.forshort,d.ABC,od.organizationid}).Distinct()
departmentsDataContext db = new departmentsDataContext();
var query =(from dep in db.dept
join o_dep in db.organization_dept
on dep.id equals o_dep.deptid
let ListOrganizationid=db.organization_dept.Where(o=>o.deptid == @deptid).Select(o=>o.organizationid)
where ListOrganizationid.Contains(o_dep.organizationid)
&& dep.ABC.Contains(@ABC)
&& new int[]{1,3}.Contains(dep.state)
orderby dep.ABC,dep. forshort
select new
{
dep.id,
dep.forshort,
dep.ABC,
o_dep.organizationid
}).Distinct();