分页写法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>
posted @ 2024-10-22 09:52  寒冷的雨呢  阅读(4)  评论(0编辑  收藏  举报