小哈先生 2016-11-17 01:31 采纳率: 0%
浏览 4459
已结题

.net EF执行多表联查sql语句

select u.warningStatus,u.unitCode as unitCode,u.unitName as unitName,u.shortName as shortName,u.organizationCode as organizationCode,u.censusRegId as censusRegId,u.msgCenterCode as msgCenterCode,
mes.msgCenterName as msgCenterName,u.regionCode as regionCode,r.regionName as regionName,u.unitTypeCode as unitTypeCode,d.DIC_TEXT as unitTypeName,u.economicTypeCode as economicTypeCode,
ech.DIC_TEXT as economicTypeName,u.superviseLevelCode,s.DIC_TEXT as superviseLevelName,u.businessTypeCode as businessTypeCode,bus.DIC_TEXT as businessTypeName,u.unitTel as unitTel,
u.unitAddress as unitAddress,u.unitEmail as unitEmail,u.unitFax as unitFax,u.postCode as postCode,u.establishedTime as establishedTime,u.connectTime as connectTime,u.onlineStatusCode as onlineStatusCode,
f.DIC_TEXT as onlineStatusName,u.workForce as workForce,u.controlCenterNum as controlCenterNum,u.legalPersonCode as legalPersonCode,unit.unitManName as unitManName,u.responsibleManCode as responsibleManCode,
unit1.unitManName as responsibleManName,u.fireManagerCode as fireManagerCode,unit2.unitManName as fireManagerName,u.fixedAssets as fixedAssets,u.floorSpace as floorSpace,u.buildingArea buildingArea,
u.defendDepartmentTel as defendDepartmentTel,u.propertyMngCode as propertyMngCode,mng.enterpriseName as enterpriseName,u.detectUnitCode as detectUnitCode,detect.enterpriseName as detectName,u.operationUnitCode as operationUnitCode,
u.operationUnitCode as operationUnitCode,operate.enterpriseName as operateName,u.maintainUnitCode as maintainUnitCode,maintain.enterpriseName maintainName,u.unitBrigadeCode as unitBrigadeCode,fireBrigade.fireBrigadeName as fireBrigadeName,
u.longitude as longitude,u.latitude as latitude,u.isMonitor as isMonitor,u.isVideo as isVideo,u.grographyInfo as grographyInfo,u.otherInfo as otherInfo,u.superviseUserCode as superviseUserCode,usr.userName as userName,u.remark as remark,
u.policeCode as policeCode,police.departmentName as policeName,u.brigadeCode as brigadeCode,brigade.departmentName as brigadeName,u.detachmentCode as detachmentCode,detachment.departmentName as detachmentName from b_unit u
left join e_messageCenter mes on u.msgCenterCode=mes.msgCenterCode
left join e_fireDepartment police on u.policeCode=police.departmentCode
left join e_fireDepartment brigade on u.brigadeCode=brigade.departmentCode
left join e_fireDepartment detachment on u.detachmentCode=detachment.departmentCode
left join b_unitMan unit on u.legalPersonCode=unit.unitManCode
left join b_unitMan unit1 on u.responsibleManCode=unit1.unitManCode
left join b_unitMan unit2 on u.fireManagerCode=unit2.unitManCode
left join e_propertyMng mng on u.propertyMngCode=mng.enterpriseCode
left join e_detect detect on u.detectUnitCode=detect.enterpriseCode
left join e_operate operate on u.operationUnitCode=operate.enterpriseCode
left join e_maintain maintain on u.maintainUnitCode=maintain.enterpriseCode
left join b_unitFireBrigade fireBrigade on u.unitBrigadeCode=fireBrigade.fireBrigadeCode
left join b_sysUser usr on u.superviseUserCode=usr.userCode
left join sys_dic bus on u.businessTypeCode=bus.DIC_CODE and bus.DIC_SORT='businessType'
left join sys_dic ech on u.economicTypeCode=ech.DIC_CODE and ech.DIC_SORT='economicType'
left join sys_dic d on u.unitTypeCode=d.DIC_CODE and d.DIC_SORT='unittype'
left join sys_dic s on u.superviseLevelCode=s.DIC_CODE and s.DIC_SORT='UnitType'
left join sys_dic f on u.onlineStatusCode=f.DIC_CODE and f.DIC_SORT='online'
left join d_region r on u.regionCode=r.regionCode where u.unitCode='1305U00002' and u.contactDelete=1

这是一条sql 语句, 我返回的是多表的中的多列。并不是一张表的列,如何用ef 执行并得到返回的列

图片说明

  • 写回答

2条回答 默认 最新

  • 小哈先生 2016-11-17 01:37
    关注

    图片说明
    求解!!

    评论

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题