mybatis中包含data的sql语句该怎么写
2个回答
2016-06-01
展开全部
你不是已经写出来了吗?小小的修改如下:
<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>
<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>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询