有多个子查询的sql语句中在mybatis怎么写

时间:2014.10.29 发布人:bybv0436

有多个子查询的sql语句中在mybatis怎么写

已解决问题

谷歌bybv0436用户在2014.10.29提交了关于“永恒圣王有多个子查询的sql语句中在mybatis怎么写”的提问,欢迎大家涌跃发表自己的观点。目前共有1个回答,最后更新于2024-10-24T09:54:20。<selectid="selectByTCR"resultType="com.securityeva.model.CommonType"parameterType="Map">
**LECTwe.safeTypeId,COUNT(safeTypeId)assafeTypeId,***.namefromse_we**_analysiswe,se_common_typecomwhere
riskLevel=#{riskLevel}andwe.safeTypeId=com.idandinfosysId=(selectidfromse_info_sys
whereidin(selectinfosysIdfromse_reportwhereuploadTimebetween
#{beginTime}and#{endTime}GROUPBYinfosysId)andnetTypeId=#{netTypeId}
GROUPBYnetTypeId)GROUPBYsafeTypeId;
</.select>希望大家能够帮助她。

详细问题描述及疑问:<selectid="selectByTCR"resultType="com.securityeva.model.CommonType"parameterType="Map">
**LECTwe.safeTypeId,COUNT(safeTypeId)assafeTypeId,***.namefromse_we**_analysiswe,se_common_typecomwhere
riskLevel=#{riskLevel}andwe.safeTypeId=com.idandinfosysId=(selectidfromse_info_sys
whereidin(selectinfosysIdfromse_reportwhereuploadTimebetween
#{beginTime}and#{endTime}GROUPBYinfosysId)andnetTypeId=#{netTypeId}
GROUPBYnetTypeId)GROUPBYsafeTypeId;
</.select>期待您的答案,我不知道说什么才好,除了谢谢 !

希望以下的回答,能够帮助你。

第1个回答

用户名:gaojun映诉值斯工陆请围ke  

你不是已经写出来了吗?小小的修改如下:
<selectid="selectByTCR"resultTyp来自e="com.sec史合许很虽皮论什urityeva.model.CommonType"parameterType="Map">
**LECTwe.safeTypeId,COUNT(safeTypeId)assafeTypeId,***.name
fromse_we**_analysiswe,se_common_typecom
whereriskLevel=#{riskLevel}
andwe.safeTypeId=com.id
andinfosysIdin(selectid
from析间倍观济甲扬se_info_sys
whereidin(
selectinfosysId
fromse_report
whereuploadTimebetween#{beginTime问答}
and#{endTime}
GROUPBYinfosysId)
andnetTy下刚影科是至黄切严乎具peId=#{netTypeId}
GROUPBYnetTypeId)
GROUPBYsafeTypeId
</select>