@ApiOperation(value = "公安分頁查詢安保值班表數據") @RequestMapping(value = "/read/gapage", method = RequestMethod.POST) public Object getGaPage(HttpServletRequest request, ModelMap modelMap) { Map<String, Object> params = WebUtil.getParameterMap(request); Session session = SecurityUtils.getSubject().getSession(); SysUser sysUser = ((SysUser)session.getAttribute(Constants.CURRENT_USER_OBJECT)); params.put("deptId", sysUser.getDeptId()); JqGridPageView<Map> nzSecurityDutyList = nzSecurityDutyService.getGapage(params); return nzSecurityDutyList; } <!-- 公安端分頁查詢值班表數據 --> <select id="getGapage" resultType="com.hitech.common.ExpandHashMap"> SELECT s.* FROM (SELECT ROW_NUMBER() OVER(PARTITION BY t.orgnization_id ORDER BY t.create_time DESC) rn, t.*,n.name as orgnization_name FROM NZ_SECURITY_DUTY t left join nz_orgnization n on t.orgnization_id=n.id ) s WHERE s.rn = 1 and s.state = '1' and s.orgnization_id in (select no.id from nz_orgnization no where exists (select t.id_ as id from sys_dept t where t.state_ = '1' and t.id_ = no.parent_id START WITH ID_ = '${deptId}' CONNECT BY PARENT_ID = PRIOR ID_) and no.STATE = '1') order by s.create_time desc </select>