if("moveUsers".equals(opration)){
String userId = UtilParam.isEmpty(request.getParameter("user_id"),"null");
String orderId = UtilParam.isEmpty(request.getParameter("order_id"),"null");
String orderType = UtilParam.isEmpty(request.getParameter("order_type"),"null");
if(!"null".equals(userId)){
StringBuffer selSql = new StringBuffer();
selSql.append(" SELECT (SELECT COUNT(*) FROM s_class_user WHERE TYPE = 'N' AND status = 'Y' AND class_info_id = ? ) all_num, ")
.append(" (SELECT COUNT(*) FROM s_class_user WHERE TYPE = 'N' AND status = 'Y' AND order_id = 0 AND class_info_id = ? ) default_num ")
.append(" FROM dual ");
String[] userNumInfo = DaoHelper.getResultStrings(selSql.toString(),new String[]{classInfoId,classInfoId},2);
//全部数量等于默认排序的数量时,说明尚未手动排序过
if(userNumInfo[0].equals(userNumInfo[1])){
//获取排序ID表
StringBuffer defaultOrderSql = new StringBuffer();
defaultOrderSql.append(" select zhiji.id,zhiji.username,zhiji.useroid,zhiji.order_id as zhijioid,gongsi.order_id as gsoid ")
.append(" from (select cu.id,cu.order_id as useroid,cu.username,so.name,so.order_id ")
.append(" from s_class_user cu, s_class_other so where cu.type = 'N' and cu.status = 'Y' and cu.class_info_id = ?")
.append(" and so.id = cu.zhiji_id) zhiji,(select cu.id,cu.order_id as useroid,cu.username,so.order_id from s_class_user cu, s_class_other so ")
.append(" where cu.type = 'N' and cu.status = 'Y' and cu.class_info_id = ? and so.id = cu.company_id) gongsi where gongsi.id = zhiji.id order by zhiji.useroid, gsoid, zhijioid, zhiji.username ");
List defaultOrderList = DaoHelper.getResultSet(defaultOrderSql.toString(),new String[]{classInfoId},3);
int orderSize = defaultOrderList.size();
String[] idArr = new String[orderSize];
for(int i=0;i<orderSize;i++){ //按照排序重构ID数组
String[] tmpArr = (String[])defaultOrderList.get(i);
idArr[i] = tm
列表编辑列下的“上移” “下移”操作
最新推荐文章于 2023-02-24 01:17:46 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)