public async Task <IEnumerable <ESysRoleMenu> > GetMenuByRoleAsync(string sWhere, Dapper.DynamicParameters param) { string sql = "select RoleID,MenuID from Sys_RoleMenu where 1=1 {0}"; sql = string.Format(sql, sWhere); return(await _context.QueryAsync <ESysRoleMenu>(sql, param)); }
public async Task <IEnumerable <Product> > GetAllAsync() { return(await _context.QueryAsync <Product>(@"SELECT Id ,Name ,Quantity ,Price ,CategoryId FROM Product")); }
public async Task <IEnumerable <UserAddress> > GetAllAsync() { return(await _context.QueryAsync <UserAddress>("SELECT * FROM UserAddress")); }
public async Task <IEnumerable <ESysRoleAlarmLevel> > GetAlarmLevelByRoleID(int RoleID, enAlarmLevelType alarmType) { string sql = "select RoleID,AlarmLevel,AlarmType from Sys_RoleAlarmLevel where RoleID=@RoleID and AlarmType=@AlarmType"; return(await _context.QueryAsync <ESysRoleAlarmLevel>(sql, new { RoleID = RoleID, AlarmType = (int)alarmType })); }
public async Task <IEnumerable <ESysAlarmLevel> > GetAlarmLevel(int AlarmLevelType) { string sql = "select ID,AlarmLevel,AlarmType,iAlarmLevel from Sys_AlarmLevel where AlarmType=@AlarmType"; return(await _context.QueryAsync <ESysAlarmLevel>(sql, new { AlarmType = AlarmLevelType })); }
public async Task <IEnumerable <ESysUserRole> > GetAllAsync() { return(await _context.QueryAsync <ESysUserRole>("select ID,RoleID,UserID,UserName from Sys_UserRole")); }
public async Task <IEnumerable <ESysKeywords> > GetAllAsync() { return(await _context.QueryAsync <ESysKeywords>("select ID,Keyword,ReplaceValue,Status from Sys_Keywords")); }
public async Task <IEnumerable <ESysMenu> > GetMenuByParentIDAsync(int ParentID) { return(await _context.QueryAsync <ESysMenu>( "select MenuID,MenuTitle,MenuUrl,ParentID,Sort,Status from Sys_Menu where Status=1 and ParentID=@ParentID order by Sort", new { ParentID = ParentID })); }
public async Task <IEnumerable <Category> > GetAllAsync() { return(await _context.QueryAsync <Category>(@"SELECT Id ,Name FROM category")); }
public async Task <IEnumerable <EMessageBox> > GetAllAsync() { return(await _context.QueryAsync <EMessageBox>("select ID,Sender,SenderID,Receiver,ReceiverID,SendTime,CreateTime,Title,Content,Type,Status from MessageBox")); }
public async Task <IEnumerable <ESysUserInfo> > GetAllAsync() { return(await _context.QueryAsync <ESysUserInfo>("select UserID,UserName,RealName,Pwd,Mobile,Wechat,OpenId,Dept,Position,Status from Sys_UserInfo")); }
public async Task <IEnumerable <Product> > GetAllAsync() { return(await _context.QueryAsync <Product>("SELECT * FROM Product")); }
public async Task <IEnumerable <ESysRole> > GetAllAsync() { return(await _context.QueryAsync <ESysRole>("select RoleID,RoleName,Status,Mark from Sys_Role")); }
/// <summary> /// 列表查询-sql通用查询 /// </summary> /// <typeparam name="TEnity"> 根据sql定义Model</typeparam> /// <param name="sql"></param> /// <param name="param"></param> /// <param name="isCommandTypeText"></param> /// <returns></returns> public Task <IEnumerable <TEnity> > SQLQueryAsync <TEnity>(string sql, object param = null, bool isCommandTypeText = true) { return(_context.QueryAsync <TEnity>(sql, param, isCommandTypeText ? CommandType.Text: CommandType.StoredProcedure)); }