Mabatis传入多个参数多个List查询以及手动分页

使用Map,key在mapper.xml中调用:
LinkedHashMap<String,Object>queryCondition=newLinkedHashMap<>();
queryCondition.put(“dimHierarchyCode”,dimHierarchyCode);
queryCondition.put(“dimValueCode”,dimValueCode);
//这个参数为集合
queryCondition.put(“tableIds”,tableIds);
queryCondition.put(“currentPage”,currentPage);
queryCondition.put(“pageSize”,pageSize);
ListchildNodes1=this.baseMapper.queryDbPageInfo(queryCondition);

mapper.java:
List queryDbPageInfo(LinkedHashMap<String, Object> queryCondition);

mapper.xml:
select a.index_num, PAGE_ID, FORM_ID, SHEET_ID, TAB_ID, DIM_VALUE_CODE, DIM_HIERARCHY_CODE, PARENT_CODE,childNum,isAll from
(
select ROWNUM as index_num,
t1.PAGE_ID,
t1.FORM_ID,
t1.SHEET_ID,
t1.TAB_ID,
t1.DIM_VALUE_CODE,
t1.DIM_HIERARCHY_CODE,
t1.PARENT_CODE,
(
select count(1)
from HRF_PAGE_DIMENSION t2
where t2.TAB_ID in

#{item}

and t2.DIM_HIERARCHY_CODE = #{dimHierarchyCode}
and t2.PARENT_CODE = t1.DIM_VALUE_CODE
)
as childNum,
(
select count(1)
from HRF_PAGE_DIMENSION t3
where t3.TAB_ID in

#{item}

and t3.DIM_HIERARCHY_CODE = #{dimHierarchyCode}
and t3.PARENT_CODE = t1.DIM_VALUE_CODE
and t3.DIM_VALUE_CODE = ‘ALL’
)
as isAll
from HRF_PAGE_DIMENSION t1
where t1.DIM_HIERARCHY_CODE = #{dimHierarchyCode}
and t1.PARENT_CODE = #{dimValueCode}
and t1.TAB_ID in

#{item}

and t1.DIM_VALUE_CODE ^= ‘ALL’
order by t1.PAGE_ID
) a
where a.index_num between (#{currentPage}-1)#{pageSize} and #{currentPage}#{pageSize}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值