def query_all_by_active(self): sql = self._query_all_by_active_sql isdelete = state.Boole['false'] sql = sql + ' and status = %s order by createTime asc ' yz = (isdelete, state.statusActive) products = mysql.find_all(sql, yz, self._query_all_by_active_col) return products
def query_all_by_active(self): sql = self._query_all_by_active_sql isdelete = state.Boole['false'] sql = sql + ' and status != %s order by createTime desc ' yz = (isdelete, state.projectStatusActive) products = mysql.find_all(sql, yz, self._query_all_by_active_col) return products
def query_user_user_group(id='', name='', realName='', departmentID=0, tel='', mobile='', email='', status=0, createTimeBegin='', createTimeEnd='', lastUpdateTimeBegin='', lastUpdateTimeEnd=''): sql = _query_user_user_group_sql1 isdelete = state.Boole['false'] ps = [isdelete] if '' != id: sql = sql + ' and u.id = %s ' ps.append(id) if 0 != status: sql = sql + ' and u.status = %s ' ps.append(status) if 0 != departmentID: sql = sql + ' and u.departmentID = %s ' ps.append(departmentID) if '' != name: sql = sql + ' and u.name like %s ' ps.append('%' + name + '%') if '' != realName: sql = sql + ' and u.realName like %s ' ps.append('%' + realName + '%') if '' != tel: sql = sql + ' and u.tel like %s ' ps.append('%' + tel + '%') if '' != email: sql = sql + ' and u.email like %s ' ps.append('%' + email + '%') if '' != mobile: sql = sql + ' and u.mobile like %s ' ps.append('%' + mobile + '%') if None != createTimeBegin and '' != createTimeBegin: sql = sql + ' and u.createTime >= %s ' ps.append(createTimeBegin) if None != createTimeEnd and '' != createTimeEnd: sql = sql + ' and u.createTime <= %s ' ps.append(createTimeEnd) if None != lastUpdateTimeBegin and '' != lastUpdateTimeBegin: sql = sql + ' and u.lastUpdateTime >= %s ' ps.append(lastUpdateTimeBegin) if None != lastUpdateTimeEnd and '' != lastUpdateTimeEnd: sql = sql + ' and u.lastUpdateTime <= %s ' ps.append(lastUpdateTimeEnd) sql = sql + _query_user_user_group_sql2 ps.append(isdelete) ps.append(state.statusActive) yz = tuple(ps) userGroups = mysql.find_all(sql, yz, _query_user_user_group_col) return userGroups
def query_all_by_active(self): sql = self._query_all_by_active_sql isdelete = state.Boole['false'] sql = sql + ' and status = %s order by createTime asc ' yz = (isdelete, state.statusActive) apps = mysql.find_all(sql, yz, self._query_all_by_active_col) return apps
def query_all_by_active(): sql = _query_all_by_active_sql isdelete = state.Boole['false'] sql = sql + ' and status = %s order by createTime asc ' yz = (isdelete, state.statusActive) deps = mysql.find_all(sql, yz, _query_all_by_active_col) return deps
def query_page(self, projectID): sql = self._query_sql isdelete = state.Boole['false'] sql = sql + ' AND projectID = %s order by sort asc ' tasks = mysql.find_all(sql, yz, self._query_col) yz = (isdelete, projectID) tasks = self._format_project_tasks(tasks) return tasks
def query_all_by_app(appCode): sql = _query_all_by_app_sql isdelete = state.Boole['false'] sql = sql + ' and appCode = %s order by sort desc' yz = (isdelete, appCode) funcs = mysql.find_all(sql, yz, _query_all_by_app_col) if funcs == None: return [] return _func_tree(funcs)
def query_all_by_active(self): isdelete = state.Boole['false'] sql = self._query_sql + ' and status = %s order by id desc ' yz = (isdelete, state.statusActive) usergroups = mysql.find_all(sql, yz, self._query_col) if None != usergroups: for r in usergroups: r['statusname'] = state.Status.get(r['status']) return usergroups
def query_all_by_active(): isdelete = state.Boole['false'] sql = _query_sql + ' and status = %s order by id desc ' yz = (isdelete, state.statusActive) usergroups = mysql.find_all(sql, yz, _query_col) if None != usergroups: for r in usergroups: r['statusname'] = state.Status.get(r['status']) return usergroups
def query_by_projectID(self, projectID): sql = self._query_sql isdelete = state.Boole['false'] sql = sql + ' AND t.projectID = %s AND t.type = %s order by sort asc ' yz = (isdelete, projectID, state.TaskProjectPlanType) tasks = mysql.find_all(sql, yz, self._query_col) if tasks != None or len(tasks) > 0: for task in tasks: task = self._format_task_status_type(task) return tasks
def query_user_user_group_role( id = '', name = '', realName = '', departmentID = 0, tel = '', mobile = '', email = '', status = 0, createTimeBegin = '', createTimeEnd = '', lastUpdateTimeBegin = '', lastUpdateTimeEnd = ''): sql = _query_user_user_group_role_sql1 isdelete = state.Boole['false'] ps = [isdelete] if '' != id: sql = sql + ' and u.id = %s ' ps.append(id) if 0 != status: sql = sql + ' and u.status = %s ' ps.append(status) if 0 != departmentID: sql = sql + ' and u.departmentID = %s ' ps.append(departmentID) if '' != name: sql = sql + ' and u.name like %s ' ps.append('%'+name+'%') if '' != realName: sql = sql + ' and u.realName like %s ' ps.append('%'+realName+'%') if '' != tel: sql = sql + ' and u.tel like %s ' ps.append('%'+tel+'%') if '' != email: sql = sql + ' and u.email like %s ' ps.append('%'+email+'%') if '' != mobile: sql = sql + ' and u.mobile like %s ' ps.append('%'+mobile+'%') if None != createTimeBegin and '' != createTimeBegin: sql = sql + ' and u.createTime >= %s ' ps.append(createTimeBegin) if None != createTimeEnd and '' != createTimeEnd: sql = sql + ' and u.createTime <= %s ' ps.append(createTimeEnd) if None != lastUpdateTimeBegin and '' != lastUpdateTimeBegin: sql = sql + ' and u.lastUpdateTime >= %s ' ps.append(lastUpdateTimeBegin) if None != lastUpdateTimeEnd and '' != lastUpdateTimeEnd: sql = sql + ' and u.lastUpdateTime <= %s ' ps.append(lastUpdateTimeEnd) sql = sql + _query_user_user_group_role_sql2 ps.append(isdelete) ps.append(state.statusActive) ps.append(isdelete) ps.append(state.statusActive) yz = tuple(ps) roles = mysql.find_all(sql, yz, _query_user_user_group_role_col) return roles
def query_by_ids(self, ids = []): sql = self._query_all_by_active_sql isdelete = state.Boole['false'] idss = '' for i in ids: if idss == '': idss = i else: idss = idss + ',' + i if idss == '': return [] sql = sql + ' and id in ('+idss+') order by createTime asc ' yz = (isdelete) products = mysql.find_all(sql, yz, self._query_all_by_active_col) return products
def query_by_ids(self, ids=[]): sql = self._query_all_by_active_sql isdelete = state.Boole['false'] idss = '' for i in ids: if idss == '': idss = i else: idss = idss + ',' + i if idss == '': return [] sql = sql + ' and id in (' + idss + ') order by createTime asc ' yz = (isdelete) products = mysql.find_all(sql, yz, self._query_all_by_active_col) return products
def query_all_by_active(): sql = _query_all_by_active_sql isdelete = state.Boole['false'] yz = (isdelete, state.statusActive) roles = mysql.find_all(sql, yz, _query_all_by_active_col) return roles
def query_right_by_role_app( roleID, appCode): sql = _query_right_by_role_app_sql isdelete = state.Boole['false'] yz = (isdelete, roleID, appCode) roles = mysql.find_all(sql, yz, _query_right_by_role_app_col) return roles
def query_right_by_role_app(roleID, appCode): sql = _query_right_by_role_app_sql isdelete = state.Boole['false'] yz = (isdelete, roleID, appCode) roles = mysql.find_all(sql, yz, _query_right_by_role_app_col) return roles
def query_all_by_project(self, projectID): sql = self._query_all_by_project_sql isdelete = state.Boole['false'] yz = (projectID, isdelete) products = mysql.find_all(sql, yz, self._query_all_by_project_col) return products
def query_all_group_roles(userGroupID): isdelete = state.Boole['false'] yz = (userGroupID, isdelete, state.statusActive) roles = mysql.find_all(_query_group_roles_sql, yz, _query_group_roles_col) return roles
def query_all_user_groups(userID): isdelete = state.Boole['false'] yz = (userID, isdelete, state.statusActive) users = mysql.find_all(_query_user_groups_sql, yz, _query_user_groups_col) return users
def query_all_user_roles( userID): isdelete = state.Boole['false'] yz = (userID, isdelete, state.statusActive) roles = mysql.find_all(_query_user_roles_sql, yz, _query_user_roles_col) return roles
def query_user_by_project(self, projectID): isdelete = state.Boole['false'] yz = (projectID, isdelete) users = mysql.find_all(self._query_user_by_projectID_sql, yz, self._query_user_by_projectID_col) return users
def query_all_group_roles(self, userGroupID): isdelete = state.Boole['false'] yz = (userGroupID, isdelete, state.statusActive) roles = mysql.find_all(self._query_group_roles_sql, yz, self._query_group_roles_col) return roles
def query_all_user_groups(self, userID): isdelete = state.Boole['false'] yz = (userID, isdelete, state.statusActive) users = mysql.find_all(self._query_user_groups_sql, yz, self._query_user_groups_col) return users
def query_all_group_users( userGroupID): isdelete = state.Boole['false'] yz = (userGroupID, isdelete, state.statusActive) users = mysql.find_all(_query_group_users_sql, yz, _query_group_users_col) return users