package com.stylefeng.guns.modular.system.controller.util;
|
|
import java.util.List;
|
|
import org.springframework.stereotype.Controller;
|
|
import com.baomidou.mybatisplus.mapper.Wrapper;
|
import com.stylefeng.guns.core.base.controller.BaseController;
|
import com.stylefeng.guns.modular.system.model.User;
|
|
/**
|
* 条件查询封装工具类
|
*/
|
@Controller
|
public class WrapperUtil extends BaseController {
|
/**
|
* 封装查询用户ID组
|
*/
|
public static Wrapper getWrapperAndInUserId(List<User> list, Wrapper wrapper) {
|
Integer[] ids = new Integer[]{0};
|
if (ids != null && list.size() > 0) {
|
ids = new Integer[list.size()];
|
for (int i = 0; i < list.size(); i++) {
|
ids[i] = list.get(i).getId();
|
}
|
}
|
return wrapper.and().in("userId", ids);
|
}
|
|
}
|