1、亲mybatis是自己写sql语句啊,和hibernate不一样。
2、如何知道上面的,你还要知道mysql有一个分页语句叫limit,如:limit(1,10);前面一个参数是起始未知,后面一个是查询多少个。
3、oracle的分页方法是嵌套子查询,需要用到rownum这个属性
sql server是top。
分页例子:
oracle select * from (select emp.*,rownum rn from emp where rownum<9) where="" rn="">3;
mysql select * from emp limit startindex,maxnum9)>
你不是已经写出来了吗?小小的修改如下:
<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>
用户登录
还没有账号?立即注册
用户注册
投稿取消
| 文章分类: |
|
还能输入300字
上传中....
头像放大才能看清楚有什么哦