Java Code Examples for org.nutz.dao.Cnd#NEW

The following examples show how to use org.nutz.dao.Cnd#NEW . 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: DeptServiceImpl.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
@Override
public boolean checkDeptNameUnique(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("dept_name", "=", menuName);
    }
    List<Dept> list = this.query(cnd);
    if (Lang.isEmpty(list)) {
        return true;
    }
    return false;
}
 
Example 2
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 3
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 4
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 5
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 6
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 7
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 8
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 9
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 10
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 11
Source File: RoleServiceImpl.java    From NutzSite with Apache License 2.0 6 votes vote down vote up
/**
 * 校验角色名称是否唯一
 * @param roleName
 * @return
 */
@Override
public boolean checkRoleNameUnique(String id, String roleName, String roleKey) {
    Cnd cnd =Cnd.NEW();
    if(Strings.isNotBlank(id)){
        cnd.and("id","!=",id);
    }
    if(Strings.isNotBlank(roleName)){
        cnd.and("role_name", "=", roleName);
    }
    if(Strings.isNotBlank(roleKey)){
        cnd.and("role_key", "=", roleKey);
    }
    List<Role> roleList = this.query(cnd);
    if (Lang.isEmpty(roleList)) {
        return true;
    }
    return false;
}
 
Example 12
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 13
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 14
Source File: ConfigController.java    From NutzSite with Apache License 2.0 5 votes vote down vote up
/**
 * 查询系统参数列表
 */
@RequiresPermissions("sys:config:list")
@At
@Ok("json")
public Object list(@Param("pageNum")Integer pageNum,
				   @Param("pageSize")Integer pageSize,
				   @Param("name") String name,
				   HttpServletRequest req) {
	Cnd cnd = Cnd.NEW();
	if (!Strings.isBlank(name)){
		//cnd.and("name", "like", "%" + name +"%");
	}
	return configService.tableList(pageNum,pageSize,cnd);
}
 
Example 15
Source File: AreaController.java    From NutzSite with Apache License 2.0 5 votes vote down vote up
/**
     * 查询区域列表
     */
    @RequiresPermissions("sys:area:list")
    @At
    @Ok("json")
    public Object list(@Param("name") String name, HttpServletRequest req) {
        Cnd cnd = Cnd.NEW();
//        if (!Strings.isBlank(name)) {
//            cnd.and("name", "like", "%" + name +"%");
//        }
        cnd.asc("adcode");
        return areaService.query(cnd);
    }
 
Example 16
Source File: PostController.java    From NutzSite with Apache License 2.0 5 votes vote down vote up
/**
 * 查询岗位列表
 */
@RequiresPermissions("sys:post:list")
@At
@Ok("json")
public Object list(@Param("pageNum")Integer pageNum,
				   @Param("pageSize")Integer pageSize,
				   @Param("name") String name,
				   HttpServletRequest req) {
	Cnd cnd = Cnd.NEW();
	if (!Strings.isBlank(name)){
		//cnd.and("name", "like", "%" + name +"%");
	}
	return postService.tableList(pageNum,pageSize,cnd);
}
 
Example 17
Source File: TaskController.java    From NutzSite with Apache License 2.0 5 votes vote down vote up
/**
 * 查询定时任务列表
 */
@RequiresPermissions("sys:task:list")
@At
@Ok("json")
public Object list(@Param("pageNum")Integer pageNum,
                   @Param("pageSize")Integer pageSize,
                   @Param("name") String name,
                   HttpServletRequest req) {
    Cnd cnd = Cnd.NEW();
    if (!Strings.isBlank(name)) {
        //cnd.and("name", "like", "%" + name +"%");
    }
    return taskService.tableList(pageNum, pageSize, 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");
}