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

<selectid="selectByTCR"resultType="com.securityeva.model.CommonType"parameterType="Ma... <select id="selectByTCR" resultType="com.securityeva.model.CommonType" parameterType="Map">
SELECT we.safeTypeId,COUNT(safeTypeId) as safeTypeId,com.name from se_weak_analysis we,se_common_type com where
riskLevel=#{riskLevel} and we.safeTypeId=com.id and infosysId=(select id from se_info_sys
where id in(select infosysId from se_report where uploadTime between
#{beginTime} and #{endTime} GROUP BY infosysId) and netTypeId=#{netTypeId}
GROUP BY netTypeId) GROUP BY safeTypeId;
</.select>
展开
 我来答
wwwzhangsan
2014-04-17 · TA获得超过286个赞
知道小有建树答主
回答量:119
采纳率:0%
帮助的人:115万
展开全部
你不是已经写出来了吗?小小的修改如下:
<select id="selectByTCR" resultType="com.securityeva.model.CommonType" parameterType="Map">
SELECT we.safeTypeId,COUNT(safeTypeId) as safeTypeId,com.name
from se_weak_analysis we,se_common_type com
where riskLevel=#{riskLevel}
and we.safeTypeId=com.id
and infosysId in ( select id
from se_info_sys
where id in(
select infosysId
from se_report
where uploadTime between#{beginTime}
and #{endTime}
GROUP BY infosysId )
and netTypeId=#{netTypeId}
GROUP BY netTypeId)
GROUP BY safeTypeId
</select>
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式