Browse Source

修改信息系统功能展示缺陷 修改limit,intr

guoyuanquan@mail.taiji.com.cn 8 months ago
parent
commit
313cb730b9

+ 3 - 2
cn.com.taiji.system/src/main/java/cn/com/taiji/util/Pagination.java

@@ -133,11 +133,12 @@ public class Pagination<T> {
 		   else if(database_type.equals("mysql")){
 		       paginationSQL.append(" SELECT temp.* FROM ( ");
 			   paginationSQL.append(sql);
-			   paginationSQL.append(" limit "+startIndex+","+pag.getPageSize());
+//			   paginationSQL.append(" limit "+startIndex+","+pag.getPageSize());
+			   paginationSQL.append(" limit "+pag.getPageSize()+" offset "+startIndex);
 			   paginationSQL.append(" ) as temp  " );
 			   paginationSQL.append(" ) as result");  
 		   }
-		 
+
 		   pag.setPageResult(jdbcTemplate.query(paginationSQL.toString(), array, rowMapper));
 		   pag.setPageCount((total-1)/pag.getPageSize()+1);
 		   pag.setPageTotal(total);

+ 3 - 2
cn.com.taiji.system/src/main/java/cn/com/taiji/zhongxiao/service/TsystemInfoService.java

@@ -118,8 +118,9 @@ public class TsystemInfoService {
 //		    lastDepts=lastDepts+")";
 //		}
 //		sql.append(" where  p.sys_dept_id in ").append(lastDepts);
-		sql.append(" where   (p.sys_dept_id in  (select dept_id from deptinfo where instr(concat(pdeptids,','),?)>0 or dept_id=?) or iskj='1' )");
-		    paramList.add(","+deptid+",");
+//		sql.append(" where   (p.sys_dept_id in  (select dept_id from deptinfo where instr(concat(pdeptids,','),?)>0 or dept_id=?) or iskj='1' )");
+			sql.append(" where   (p.sys_dept_id in  (select dept_id from deptinfo where position (? in concat(pdeptids,',')) or dept_id=?) or iskj='1' )");
+			paramList.add(","+deptid+",");
 		    paramList.add(deptid);
 	    }