// ------------------------------------------------------- // 查询 // ------------------------------------------------------- #region 函数:FindByAccountIdentity(string accountIdentity) /// <summary>根据查找某条记录</summary> /// <param name="accountIdentity">帐号会话唯一标识</param> /// <returns>返回一个实例<see cref="AccountCacheInfo"/>的详细信息</returns> public AccountCacheInfo FindByAccountIdentity(string accountIdentity) { IStorageNode storageNode = storageStrategy.GetStorageNode("Query"); Dictionary <string, object> args = new Dictionary <string, object>(); args.Add("AccountIdentity", StringHelper.ToSafeSQL(accountIdentity, true)); return(this.ibatisMappers[storageNode.Name].QueryForObject <AccountCacheInfo>(StringHelper.ToProcedurePrefix(string.Format("{0}_FindByAccountIdentity", tableName)), args)); }
/// <summary>添加记录</summary> /// <param name="param">TaskWorkInfo 实例的详细信息</param> public void Insert(TaskWorkInfo param) { IList <TaskWorkItemInfo> list = param.GetTaskWorkItems(); // 接收者信息 foreach (TaskWorkItemInfo item in list) { IStorageNode storageNode = storageStrategy.GetStorageNode("Node", item.ReceiverId); this.ibatisMappers[storageNode.Name].Insert(StringHelper.ToProcedurePrefix(string.Format("{0}_Insert", this.tableName)), item); } }
/// <summary>查询某条记录</summary> /// <param name="taskId">任务标识</param> /// <param name="receiverId">接收人标识</param> /// <returns>返回一个 TaskWorkReceiverInfo 实例的详细信息</returns> public TaskWorkItemInfo FindOne(string taskId, string receiverId) { IStorageNode storageNode = storageStrategy.GetStorageNode("Node", receiverId); Dictionary <string, object> args = new Dictionary <string, object>(); args.Add("TaskId", taskId); args.Add("ReceiverId", receiverId); return(this.ibatisMappers[storageNode.Name].QueryForObject <TaskWorkItemInfo>(StringHelper.ToProcedurePrefix(string.Format("{0}_FindOne", this.tableName)), args)); }