分页写法3
export function getTaskPageList(query) {
return request({
url: '/XXX/getTaskPageList',
method: 'post',
data: query
})
}
@PostMapping("/getTaskPageList")
public R getTaskPageList(Page page, @RequestBody Map<String, Object> paramMap) {
return R.ok(socialworkWhistleTaskService.getTaskPageList(page, paramMap));
}
IPage getTaskPageList(Page page, Map<String, Object> paramMap);
@Override
public IPage getTaskPageList(Page page, Map<String, Object> paramMap){
String deptIds = dataScopeHandle.calcScope("socialworkWhistle");
paramMap.put("calcScopeDeptIds",deptIds);
return this.baseMapper.getTaskPageList(page,paramMap);
}
IPage getTaskPageList(Page page, @Param("query") Map<String,Object> paramMap);
<select id="getTaskPageList" parameterType="java.util.HashMap" resultType="java.util.HashMap">
SELECT a.* FROM table a WHERE 1 = 1
<if test='query.calcScopeDeptIds!="0"'>
AND a.zx_dept_id in (${query.calcScopeDeptIds})
</if>
<if test="query.treeDeptId!=null and query.treeDeptId !=''">
AND a.zx_dept_id in (${query.treeDeptId})
</if>
</select>
择善人而交,择善书而读,择善言而听,择善行而从。