Java Code Examples for org.nutz.dao.Cnd#and()

The following examples show how to use org.nutz.dao.Cnd#and() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WxUserController.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 查询微信用户列表
 */
@RequiresPermissions("wx:wxUser:list")
@At
@Ok("json")
public Object list(@Param("pageNum")Integer pageNum,
				   @Param("pageSize")Integer pageSize,
				   @Param("name") String name,
				   @Param("beginTime") Date beginTime,
				   @Param("endTime") Date endTime,
				   @Param("orderByColumn") String orderByColumn,
				   @Param("isAsc") String isAsc,
				   HttpServletRequest req) {
	Cnd cnd = Cnd.NEW();
	if (!Strings.isBlank(name)){
		//cnd.and("name", "like", "%" + name +"%");
	}
	if(Lang.isNotEmpty(beginTime)){
		cnd.and("create_time",">=", beginTime);
	}
	if(Lang.isNotEmpty(endTime)){
		cnd.and("create_time","<=", endTime);
	}
	return wxUserService.tableList(pageNum,pageSize,cnd,orderByColumn,isAsc,null);
}
 
Example 2
Source File: MasterController.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 查询主人列表
 */
@RequiresPermissions("test:master:list")
@At
@Ok("json")
public Object list(@Param("pageNum")int pageNum,
				   @Param("pageSize")int pageSize,
				   @Param("name") String name,
				   @Param("beginTime") Date beginTime,
				   @Param("endTime") Date endTime,
				   @Param("orderByColumn") String orderByColumn,
				   @Param("isAsc") String isAsc,
				   HttpServletRequest req) {
	Cnd cnd = Cnd.NEW();
	if (!Strings.isBlank(name)){
		//cnd.and("name", "like", "%" + name +"%");
	}
	if(Lang.isNotEmpty(beginTime)){
		cnd.and("create_time",">=", beginTime);
	}
	if(Lang.isNotEmpty(endTime)){
		cnd.and("create_time","<=", endTime);
	}
	return masterService.tableList(pageNum,pageSize,cnd,orderByColumn,isAsc,null);
}
 
Example 3
Source File: PetController.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 查询宠物列表
 */
@RequiresPermissions("test:pet:list")
@At
@Ok("json")
public Object list(@Param("pageNum")int pageNum,
				   @Param("pageSize")int pageSize,
				   @Param("name") String name,
				   @Param("beginTime") Date beginTime,
				   @Param("endTime") Date endTime,
				   @Param("orderByColumn") String orderByColumn,
				   @Param("isAsc") String isAsc,
				   HttpServletRequest req) {
	Cnd cnd = Cnd.NEW();
	if (!Strings.isBlank(name)){
		//cnd.and("name", "like", "%" + name +"%");
	}
	if(Lang.isNotEmpty(beginTime)){
		cnd.and("create_time",">=", beginTime);
	}
	if(Lang.isNotEmpty(endTime)){
		cnd.and("create_time","<=", endTime);
	}
	return petService.tableList(pageNum,pageSize,cnd,orderByColumn,isAsc,"master");
}
 
Example 4
Source File: CategoryServiceImpl.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 查询数据树
 * @param parentId
 * @param name
 * @return
 */
@Override
   public List<Map<String, Object>> selectTree(String parentId, String name) {
	Cnd cnd = Cnd.NEW();
	if (Strings.isNotBlank(name)) {
		//cnd.and("name", "like", "%" + name + "%");
	}
	if (Strings.isNotBlank(parentId)) {
		cnd.and("parent_id", "=", parentId);
	}
	//cnd.and("status", "=", false).and("del_flag", "=", false);
	cnd.asc("sort");
	List<Category> list = this.query(cnd);
	List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
	trees = getTrees(list);
	return trees;
}
 
Example 5
Source File: CategoryController.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 查询栏目列表
 */
@At
@Ok("json")
@RequiresPermissions("cms:category:list")
public Object list(@Param("name") String name,
				   @Param("beginTime") Date beginTime,
				   @Param("endTime") Date endTime,
				   HttpServletRequest req) {
	Cnd cnd = Cnd.NEW();
	if (!Strings.isBlank(name)){
		//cnd.and("name", "like", "%" + name +"%");
	}
	if(Lang.isNotEmpty(beginTime)){
		cnd.and("create_time",">=", beginTime);
	}
	if(Lang.isNotEmpty(endTime)){
		cnd.and("create_time","<=", endTime);
	}
	cnd.asc("sort");
	return categoryService.query(cnd);
}
 
Example 6
Source File: SiteController.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 查询站点列表
 */
@RequiresPermissions("cms:site:list")
@At
@Ok("json")
public Object list(@Param("pageNum")Integer pageNum,
				   @Param("pageSize")Integer pageSize,
				   @Param("name") String name,
				   @Param("beginTime") Date beginTime,
				   @Param("endTime") Date endTime,
				   @Param("orderByColumn") String orderByColumn,
				   @Param("isAsc") String isAsc,
				   HttpServletRequest req) {
	Cnd cnd = Cnd.NEW();
	if (!Strings.isBlank(name)){
		//cnd.and("name", "like", "%" + name +"%");
	}
	if(Lang.isNotEmpty(beginTime)){
		cnd.and("create_time",">=", beginTime);
	}
	if(Lang.isNotEmpty(endTime)){
		cnd.and("create_time","<=", endTime);
	}
	return siteService.tableList(pageNum,pageSize,cnd,orderByColumn,isAsc,null);
}
 
Example 7
Source File: WxMenuServiceImpl.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 查询数据树
 * @param parentId
 * @param name
 * @return
 */
@Override
public List<Map<String, Object>> selectTree(String parentId, String name) {
	Cnd cnd = Cnd.NEW();
	if (Strings.isNotBlank(name)) {
		//cnd.and("name", "like", "%" + name + "%");
	}
	if (Strings.isNotBlank(parentId)) {
		cnd.and("parent_id", "=", parentId);
	}
	//cnd.and("status", "=", false).and("del_flag", "=", false);
	List<WxMenu> list = this.query(cnd);
	List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
	trees = getTrees(list);
	return trees;
}
 
Example 8
Source File: WxMenuController.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 查询微信菜单列表
 */
@At
@Ok("json")
@RequiresPermissions("wx:menu:list")
public Object list(@Param("name") String name,
				   @Param("beginTime") Date beginTime,
				   @Param("endTime") Date endTime,
				   HttpServletRequest req) {
	Cnd cnd = Cnd.NEW();
	if (!Strings.isBlank(name)){
		//cnd.and("name", "like", "%" + name +"%");
	}
	if(Lang.isNotEmpty(beginTime)){
		cnd.and("create_time",">=", beginTime);
	}
	if(Lang.isNotEmpty(endTime)){
		cnd.and("create_time","<=", endTime);
	}
	return wxMenuService.query(cnd);
}
 
Example 9
Source File: MaterialController.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 查询微信素材列表
 */
@RequiresPermissions("wx:material:list")
@At
@Ok("json")
public Object list(@Param("pageNum")Integer pageNum,
				   @Param("pageSize")Integer pageSize,
				   @Param("name") String name,
				   @Param("beginTime") Date beginTime,
				   @Param("endTime") Date endTime,
				   @Param("orderByColumn") String orderByColumn,
				   @Param("isAsc") String isAsc,
				   HttpServletRequest req) {
	Cnd cnd = Cnd.NEW();
	if (!Strings.isBlank(name)){
		//cnd.and("name", "like", "%" + name +"%");
	}
	if(Lang.isNotEmpty(beginTime)){
		cnd.and("create_time",">=", beginTime);
	}
	if(Lang.isNotEmpty(endTime)){
		cnd.and("create_time","<=", endTime);
	}
	return materialService.tableList(pageNum,pageSize,cnd,orderByColumn,isAsc,null);
}
 
Example 10
Source File: DeptServiceImpl.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 查询数据树
 * @param parentId
 * @param name
 * @return
 */
@Override
public List<Map<String, Object>> selectTree(String parentId, String name) {
    Cnd cnd = Cnd.NEW();
    if (Strings.isNotBlank(name)) {
        cnd.and("dept_name", "like", "%" + name + "%");
    }
    if (Strings.isNotBlank(parentId)) {
        cnd.and("parent_id", "=", parentId);
    }
    cnd.and("status", "=", false).and("del_flag", "=", false);
    List<Dept> deptList = this.query(cnd);
    List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
    trees = getTrees(deptList);
    return trees;
}
 
Example 11
Source File: RoleController.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
@At
@Ok("json")
public Object list(@Param("pageNum")Integer pageNum,
                   @Param("pageSize")Integer pageSize,
                   @Param("roleName") String roleName,
                   @Param("roleKey") String roleKey,
                   @Param("orderByColumn") String orderByColumn,
                   @Param("isAsc") String isAsc,
                   HttpServletRequest req) {
    Cnd cnd = Cnd.NEW();
    if (!Strings.isBlank(roleName)){
        cnd.and("role_name", "like", "%" + roleName +"%");
    }
    if (!Strings.isBlank(roleKey)){
        cnd.and("role_key", "=", roleKey);
    }
    return roleService.tableList(pageNum,pageSize,cnd,orderByColumn,isAsc,null);
}
 
Example 12
Source File: DictController.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 查询字典列表
 */
@RequiresPermissions("sys:dict:list")
@At
@Ok("json")
public Object list(@Param("pageNum")Integer pageNum,
				   @Param("pageSize")Integer pageSize,
				   @Param("name") String name,
				   @Param("orderByColumn") String orderByColumn,
				   @Param("isAsc") String isAsc,
				   HttpServletRequest req) {
	Cnd cnd = Cnd.NEW();
	if (!Strings.isBlank(name)){
		//cnd.and("name", "like", "%" + name +"%");
	}
       cnd.and("del_flag","=",false);
	return dictService.tableList(pageNum,pageSize,cnd,orderByColumn,isAsc,null);
}
 
Example 13
Source File: AreaServiceImpl.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
	 * 查询数据树
	 * @param parentId
	 * @param name
	 * @return
	 */
	@Override
    public List<Map<String, Object>> selectTree(String parentId, String name) {
		Cnd cnd = Cnd.NEW();
		if (Strings.isNotBlank(name)) {
			//cnd.and("name", "like", "%" + name + "%");
		}
		if (Strings.isNotBlank(parentId)) {
			cnd.and("parent_id", "=", parentId);
		}
//		cnd.and("status", "=", false).and("del_flag", "=", false);
		List<Area> list = this.query(cnd);
		List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
		trees = getTrees(list);
		return trees;
	}
 
Example 14
Source File: UserOnlineController.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 查询在线用户记录列表
 */
@RequiresPermissions("monitor:online:list")
@At
@Ok("json")
public Object list(@Param("pageNum")Integer pageNum,
				   @Param("pageSize")Integer pageSize,
				   @Param("name") String ipaddr,
				   @Param("loginName") String loginName,
				   @Param("orderByColumn") String orderByColumn,
				   @Param("isAsc") String isAsc,
				   HttpServletRequest req) {
	Cnd cnd = Cnd.NEW();
	if (!Strings.isBlank(ipaddr)){
		cnd.and("ipaddr", "=", ipaddr);
	}
	if (!Strings.isBlank(loginName)){
		cnd.and("login_name", "=", loginName);
	}
	return userOnlineService.tableList(pageNum,pageSize,cnd,orderByColumn,isAsc,null);
}
 
Example 15
Source File: MenuServiceImpl.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
@Override
public boolean checkMenuUnique(String id, String parentId, String menuName) {
    Cnd cnd =Cnd.NEW();
    if(Strings.isNotBlank(id)){
        cnd.and("id","!=",id);
    }
    if(Strings.isNotBlank(parentId)){
        cnd.and("parent_id","=",parentId);
    }
    if(Strings.isNotBlank(menuName)){
        cnd.and("menu_name", "=", menuName);
    }
    List<Menu> list = this.query(cnd);
    if (Lang.isEmpty(list)) {
        return true;
    }
    return false;
}
 
Example 16
Source File: OperLogController.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 查询操作日志记录列表
 */
@RequiresPermissions("monitor:operLog:list")
@At
@Ok("json")
public Object list(@Param("pageNum")Integer pageNum,
				   @Param("pageSize")Integer pageSize,
				   @Param("title") String name,
				   @Param("operName") String uid,
				   @Param("orderByColumn") String orderByColumn,
				   @Param("isAsc") String isAsc,
				   HttpServletRequest req) {
	Cnd cnd = Cnd.NEW();
	if (!Strings.isBlank(name)){
		cnd.and("tg", "like", "%" + name +"%");
	}
	if (!Strings.isBlank(uid)){
		cnd.and("u_name", "=", uid);
	}
	return operLogService.tableList(pageNum,pageSize,cnd,orderByColumn,isAsc);
}
 
Example 17
Source File: DeptController.java    From NutzSite with Apache License 2.0 5 votes vote down vote up
@At
@Ok("json")
public Object list(@Param("deptName") String deptName, HttpServletRequest req) {
    Cnd cnd = Cnd.NEW();
    if (Strings.isNotBlank(deptName)) {
        cnd.and("dept_name", "like", "%" + deptName + "%");
    }
    cnd.and("del_flag", "=", false);
    return deptService.query(cnd);
}
 
Example 18
Source File: MenuController.java    From NutzSite with Apache License 2.0 5 votes vote down vote up
@At
@Ok("json")
public Object list(@Param("menuName") String menuName, HttpServletRequest req) {
    Cnd cnd = Cnd.NEW();
    if (Strings.isNotBlank(menuName)) {
        cnd.and("menu_name", "like", "%" + menuName + "%");
    }
    cnd.orderBy("order_num","asc");
    return menuService.query(cnd);
}
 
Example 19
Source File: UserController.java    From NutzSite with Apache License 2.0 5 votes vote down vote up
/**
 * 查询用户列表
 */
@At
@Ok("json")
public Object list(@Param("pageNum")Integer pageNum,
                   @Param("pageSize")Integer pageSize,
                   @Param("deptId") String deptId,
                   @Param("loginName") String loginName,
                   @Param("phonenumber") String phonenumber,
                   @Param("beginTime") Date beginTime,
                   @Param("endTime") Date endTime,
                   @Param("orderByColumn") String orderByColumn,
                   @Param("isAsc") String isAsc,
                   HttpServletRequest req) {
    Cnd cnd = Cnd.NEW();
    if (!Strings.isBlank(loginName)) {
        cnd.and("user_name", "like", "%" + loginName + "%");
    }
    if (!Strings.isBlank(phonenumber)) {
        cnd.and("phonenumber", "=", phonenumber);
    }
    if (Lang.isNotEmpty(beginTime)) {
        cnd.and("create_time", ">=", beginTime);
    }
    if (Lang.isNotEmpty(endTime)) {
        cnd.and("create_time", "<=", endTime);
    }
    if (!Strings.isBlank(deptId)) {
        cnd.where().andInBySql("dept_id", "SELECT id FROM sys_dept  WHERE FIND_IN_SET ('%s',ancestors)", deptId)
                .or("dept_id", "=", deptId);
    }
    return userService.tableList(pageNum, pageSize, cnd, orderByColumn, isAsc, "dept");
}
 
Example 20
Source File: ArticleController.java    From NutzSite with Apache License 2.0 5 votes vote down vote up
/**
 * 查询文章列表
 */
@RequiresPermissions("cms:article:list")
@At
@Ok("json")
public Object list(@Param("pageNum")Integer pageNum,
                   @Param("pageSize")Integer pageSize,
                   @Param("name") String name,
                   @Param("categoryId") String categoryId,
                   @Param("beginTime") Date beginTime,
                   @Param("endTime") Date endTime,
                   @Param("orderByColumn") String orderByColumn,
                   @Param("isAsc") String isAsc,
                   HttpServletRequest req) {
    Cnd cnd = Cnd.NEW();
    if (!Strings.isBlank(name)) {
        //cnd.and("name", "like", "%" + name +"%");
    }
    if (!Strings.isBlank(categoryId)){
        //cnd.and("category_id", "=", categoryId);
        cnd.where().andInBySql("category_id","SELECT id FROM cms_category  WHERE FIND_IN_SET ('%s',parent_ids)", categoryId)
                .or("category_id","=", categoryId);
    }
    if (Lang.isNotEmpty(beginTime)) {
        cnd.and("create_time", ">=", beginTime);
    }
    if (Lang.isNotEmpty(endTime)) {
        cnd.and("create_time", "<=", endTime);
    }
    return articleService.tableList(pageNum, pageSize, cnd, orderByColumn, isAsc, "category");
}