使用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}