コード例 #1
0
        public override void BeforeFillList(LibHandle libHandle, DataTable table, object listingQuery, LibEntryParam entryParam)
        {
            base.BeforeFillList(libHandle, table, listingQuery, entryParam);
            if (libHandle == null || table == null || listingQuery == null)
            {
                return;
            }
            BillListingQuery queryinfo = listingQuery as BillListingQuery;

            if (queryinfo == null)
            {
                return;
            }
            int dirType = 0;

            if (int.TryParse((from item in queryinfo.Condition.QueryFields
                              where item.Name.Equals("DIRTYPE") && item.QueryChar.Equals(LibQueryChar.Equal) &&
                              item.Value.Count == 1
                              select item.Value[0]).FirstOrDefault().ToString(), out dirType) == false)
            {
                return;
            }
            if (dirType == (int)DirTypeEnum.Private)
            {
                //私有目录,根据创建人进行标识
                AxCRL.Core.Comm.LibQueryField libQueryField = new AxCRL.Core.Comm.LibQueryField();
                libQueryField.Name      = "CREATORID";
                libQueryField.QueryChar = LibQueryChar.Equal;
                libQueryField.Value.Add(libHandle.PersonId);
                queryinfo.Condition.QueryFields.Add(libQueryField);
            }
            //公共目录,在Fill后在根据目录权限设置
        }
コード例 #2
0
        public static string GetQueryFieldStr(LibDataType dataType, LibQueryField queryField, bool needAnd = false, string prefix = "A", string realName = "")
        {
            StringBuilder builder = new StringBuilder();

            BuildQueryStr(dataType, queryField, builder, prefix, needAnd, realName);
            return(builder.ToString());
        }
コード例 #3
0
        private static void BuildQueryStr(LibDataType dataType, LibQueryField queryField, StringBuilder builder, string prefix, bool needAnd, string realName)
        {
            bool   needQuot  = dataType == LibDataType.Text || dataType == LibDataType.NText;
            string addStr    = needAnd ? "and " : string.Empty;
            string fieldName = string.IsNullOrEmpty(realName) ? queryField.Name : realName;

            if (!string.IsNullOrEmpty(prefix))
            {
                prefix = string.Format("{0}.", prefix);
            }
            switch (queryField.QueryChar)
            {
            case LibQueryChar.Equal:
                if (queryField.Value.Count > 0)
                {
                    if (needQuot)
                    {
                        builder.AppendFormat("{0}{1}={2} {3}", prefix, fieldName, LibStringBuilder.GetQuotObject(queryField.Value[0]), addStr);
                    }
                    else
                    {
                        builder.AppendFormat("{0}{1}={2} {3}", prefix, fieldName, queryField.Value[0], addStr);
                    }
                }
                break;

            case LibQueryChar.Contain:
                if (queryField.Value.Count > 0)
                {
                    builder.AppendFormat("{0}{1} like '%{2}%' {3}", prefix, fieldName, queryField.Value[0], addStr);
                }
                break;

            case LibQueryChar.Region:
                if (queryField.Value.Count == 2)
                {
                    if (needQuot)
                    {
                        builder.AppendFormat("{0}{1} between {2} and {3} {4}", prefix, fieldName, LibStringBuilder.GetQuotObject(queryField.Value[0]), LibStringBuilder.GetQuotObject(queryField.Value[1]), addStr);
                    }
                    else
                    {
                        builder.AppendFormat("{0}{1} between {2} and {3} {4}", prefix, fieldName, queryField.Value[0], queryField.Value[1], addStr);
                    }
                }
                break;

            case LibQueryChar.GreaterOrEqual:
                if (queryField.Value.Count > 0)
                {
                    if (needQuot)
                    {
                        builder.AppendFormat("{0}{1}>={2} {3}", prefix, fieldName, LibStringBuilder.GetQuotObject(queryField.Value[0]), addStr);
                    }
                    else
                    {
                        builder.AppendFormat("{0}{1}>={2} {3}", prefix, fieldName, queryField.Value[0], addStr);
                    }
                }
                break;

            case LibQueryChar.LessOrEqual:
                if (queryField.Value.Count > 0)
                {
                    if (needQuot)
                    {
                        builder.AppendFormat("{0}{1}<={2} {3}", prefix, fieldName, LibStringBuilder.GetQuotObject(queryField.Value[0]), addStr);
                    }
                    else
                    {
                        builder.AppendFormat("{0}{1}<={2} {3}", prefix, fieldName, queryField.Value[0], addStr);
                    }
                }
                break;

            case LibQueryChar.GreaterThan:
                if (queryField.Value.Count > 0)
                {
                    if (needQuot)
                    {
                        builder.AppendFormat("{0}{1}>{2} {3}", prefix, fieldName, LibStringBuilder.GetQuotObject(queryField.Value[0]), addStr);
                    }
                    else
                    {
                        builder.AppendFormat("{0}{1}>{2} {3}", prefix, fieldName, queryField.Value[0], addStr);
                    }
                }
                break;

            case LibQueryChar.LessThan:
                if (queryField.Value.Count > 0)
                {
                    if (needQuot)
                    {
                        builder.AppendFormat("{0}{1}<{2} {3}", prefix, fieldName, LibStringBuilder.GetQuotObject(queryField.Value[0]), addStr);
                    }
                    else
                    {
                        builder.AppendFormat("{0}{1}<{2} {3}", prefix, fieldName, queryField.Value[0], addStr);
                    }
                }
                break;

            case LibQueryChar.UnequalTo:
                if (queryField.Value.Count > 0)
                {
                    if (needQuot)
                    {
                        builder.AppendFormat("{0}{1}<>{2} {3}", prefix, fieldName, LibStringBuilder.GetQuotObject(queryField.Value[0]), addStr);
                    }
                    else
                    {
                        builder.AppendFormat("{0}{1}<>{2} {3}", prefix, fieldName, queryField.Value[0], addStr);
                    }
                }
                break;

            case LibQueryChar.Include:
                if (queryField.Value.Count > 0)
                {
                    if (needQuot)
                    {
                        StringBuilder tempBuilder = new StringBuilder();
                        string[]      dest        = queryField.Value[0].ToString().Split(',');
                        for (int i = 0; i < dest.Length; i++)
                        {
                            if (i == 0)
                            {
                                tempBuilder.AppendFormat("{0}", LibStringBuilder.GetQuotString(dest[i]));
                            }
                            else
                            {
                                tempBuilder.AppendFormat(",{0}", LibStringBuilder.GetQuotString(dest[i]));
                            }
                        }
                        builder.AppendFormat("{0}{1} in ({2}) {3}", prefix, fieldName, tempBuilder.ToString(), addStr);
                    }
                    else
                    {
                        builder.AppendFormat("{0}{1} in ({2}) {3}", prefix, fieldName, queryField.Value[0], addStr);
                    }
                }
                break;
            }
        }
コード例 #4
0
        private static void MergeFieldQuery <T>(List <LibQueryField> addList, LibQueryField item, LibQueryField other, T curValue1, T otherValue1, T curValue2, T otherValue2) where T : System.IComparable <T>
        {
            bool needReset = false;

            switch (item.QueryChar)
            {
            case LibQueryChar.Equal:
                switch (other.QueryChar)
                {
                case LibQueryChar.Equal:
                    needReset = curValue1.CompareTo(otherValue1) != 0;
                    break;

                case LibQueryChar.Contain:
                    needReset = !curValue1.ToString().Contains(otherValue1.ToString());
                    break;

                case LibQueryChar.Region:
                    needReset = curValue1.CompareTo(otherValue1) < 0 || curValue2.CompareTo(otherValue2) > 0;
                    break;

                case LibQueryChar.GreaterOrEqual:
                    needReset = curValue1.CompareTo(otherValue1) < 0;
                    break;

                case LibQueryChar.LessOrEqual:
                    needReset = curValue1.CompareTo(otherValue1) > 0;
                    break;

                case LibQueryChar.GreaterThan:
                    needReset = curValue1.CompareTo(otherValue1) <= 0;
                    break;

                case LibQueryChar.LessThan:
                    needReset = curValue1.CompareTo(otherValue1) >= 0;
                    break;

                case LibQueryChar.UnequalTo:
                    needReset = curValue1.CompareTo(otherValue1) == 0;
                    break;

                case LibQueryChar.Include:
                    needReset = !otherValue1.ToString().Split(',').Contains(curValue1.ToString());
                    break;
                }
                break;

            case LibQueryChar.Contain:
                switch (other.QueryChar)
                {
                case LibQueryChar.Equal:
                    needReset = true;
                    break;

                case LibQueryChar.Contain:
                    needReset = !curValue1.ToString().Contains(otherValue1.ToString());
                    break;

                case LibQueryChar.Region:
                case LibQueryChar.GreaterOrEqual:
                case LibQueryChar.LessOrEqual:
                case LibQueryChar.GreaterThan:
                case LibQueryChar.LessThan:
                case LibQueryChar.UnequalTo:
                case LibQueryChar.Include:
                    addList.Add(new LibQueryField()
                    {
                        Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                    });
                    break;
                }
                break;

            case LibQueryChar.Region:
                switch (other.QueryChar)
                {
                case LibQueryChar.Equal:
                    needReset = true;
                    break;

                case LibQueryChar.Contain:
                    addList.Add(new LibQueryField()
                    {
                        Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                    });
                    break;

                case LibQueryChar.Region:
                    if (curValue1.CompareTo(otherValue1) < 0)
                    {
                        item.Value[0] = otherValue1;
                    }
                    else if (curValue2.CompareTo(otherValue2) > 0)
                    {
                        item.Value[1] = other.Value[1];
                    }
                    break;

                case LibQueryChar.GreaterOrEqual:
                    needReset = curValue2.CompareTo(otherValue1) < 0;
                    if (!needReset && curValue1.CompareTo(otherValue1) < 0)
                    {
                        item.Value[0] = otherValue1;
                    }
                    break;

                case LibQueryChar.LessOrEqual:
                    needReset = curValue1.CompareTo(otherValue1) > 0;
                    if (!needReset && curValue2.CompareTo(otherValue1) > 0)
                    {
                        item.Value[1] = otherValue1;
                    }
                    break;

                case LibQueryChar.GreaterThan:
                    needReset = curValue2.CompareTo(otherValue1) <= 0;
                    if (!needReset && curValue1.CompareTo(otherValue1) <= 0)
                    {
                        item.Value[0] = otherValue1;
                    }
                    break;

                case LibQueryChar.LessThan:
                    needReset = curValue1.CompareTo(otherValue1) >= 0;
                    if (!needReset && curValue2.CompareTo(otherValue1) >= 0)
                    {
                        item.Value[1] = otherValue1;
                    }
                    break;

                case LibQueryChar.UnequalTo:
                    if (curValue1.CompareTo(otherValue1) <= 0 || curValue2.CompareTo(otherValue1) >= 0)
                    {
                        addList.Add(new LibQueryField()
                        {
                            Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                        });
                    }
                    break;

                case LibQueryChar.Include:
                    addList.Add(new LibQueryField()
                    {
                        Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                    });
                    break;
                }
                break;

            case LibQueryChar.GreaterOrEqual:
                switch (other.QueryChar)
                {
                case LibQueryChar.Equal:
                    needReset = true;
                    break;

                case LibQueryChar.Contain:
                    addList.Add(new LibQueryField()
                    {
                        Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                    });
                    break;

                case LibQueryChar.Region:
                    needReset = curValue1.CompareTo(otherValue2) > 0;
                    if (!needReset)
                    {
                        item.QueryChar = LibQueryChar.Region;
                        item.Value     = other.Value;
                        item.Value[0]  = curValue1;
                    }
                    break;

                case LibQueryChar.GreaterOrEqual:
                    needReset = curValue1.CompareTo(otherValue1) < 0;
                    break;

                case LibQueryChar.LessOrEqual:
                    needReset = curValue1.CompareTo(otherValue1) > 0;
                    if (!needReset)
                    {
                        item.QueryChar = LibQueryChar.Region;
                        item.Value     = new object[] { curValue1, otherValue1 };
                    }
                    break;

                case LibQueryChar.GreaterThan:
                    needReset = curValue1.CompareTo(otherValue1) <= 0;
                    break;

                case LibQueryChar.LessThan:
                    needReset = curValue1.CompareTo(otherValue1) >= 0;
                    if (!needReset)
                    {
                        addList.Add(new LibQueryField()
                        {
                            Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                        });
                    }
                    break;

                case LibQueryChar.UnequalTo:
                    if (curValue1.CompareTo(otherValue1) < 0)
                    {
                        addList.Add(new LibQueryField()
                        {
                            Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                        });
                    }
                    break;

                case LibQueryChar.Include:
                    addList.Add(new LibQueryField()
                    {
                        Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                    });
                    break;
                }
                break;

            case LibQueryChar.LessOrEqual:
                switch (other.QueryChar)
                {
                case LibQueryChar.Equal:
                    needReset = true;
                    break;

                case LibQueryChar.Contain:
                    addList.Add(new LibQueryField()
                    {
                        Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                    });
                    break;

                case LibQueryChar.Region:
                    needReset = curValue1.CompareTo(otherValue1) < 0;
                    if (!needReset)
                    {
                        item.QueryChar = LibQueryChar.Region;
                        item.Value     = other.Value;
                        item.Value[1]  = curValue1;
                    }
                    break;

                case LibQueryChar.GreaterOrEqual:
                    needReset = curValue1.CompareTo(otherValue1) < 0;
                    if (!needReset)
                    {
                        item.QueryChar = LibQueryChar.Region;
                        item.Value     = new object[] { otherValue1, curValue1 };
                    }
                    break;

                case LibQueryChar.LessOrEqual:
                    needReset = curValue1.CompareTo(otherValue1) > 0;
                    break;

                case LibQueryChar.GreaterThan:
                    needReset = curValue1.CompareTo(otherValue1) < 0;
                    if (!needReset)
                    {
                        addList.Add(new LibQueryField()
                        {
                            Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                        });
                    }
                    break;

                case LibQueryChar.LessThan:
                    needReset = curValue1.CompareTo(otherValue1) >= 0;
                    break;

                case LibQueryChar.UnequalTo:
                    if (curValue1.CompareTo(otherValue1) > 0)
                    {
                        addList.Add(new LibQueryField()
                        {
                            Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                        });
                    }
                    break;

                case LibQueryChar.Include:
                    addList.Add(new LibQueryField()
                    {
                        Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                    });
                    break;
                }
                break;

            case LibQueryChar.GreaterThan:
                switch (other.QueryChar)
                {
                case LibQueryChar.Equal:
                    needReset = true;
                    break;

                case LibQueryChar.Contain:
                    addList.Add(new LibQueryField()
                    {
                        Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                    });
                    break;

                case LibQueryChar.Region:
                    needReset = curValue1.CompareTo(otherValue2) >= 0;
                    if (!needReset)
                    {
                        addList.Add(new LibQueryField()
                        {
                            Name = other.Name, QueryChar = LibQueryChar.LessOrEqual, Value = new object[] { otherValue2 }
                        });
                    }
                    break;

                case LibQueryChar.GreaterOrEqual:
                    needReset = curValue1.CompareTo(otherValue1) <= 0;
                    break;

                case LibQueryChar.LessOrEqual:
                    needReset = curValue1.CompareTo(otherValue1) >= 0;
                    if (!needReset)
                    {
                        addList.Add(new LibQueryField()
                        {
                            Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                        });
                    }
                    break;

                case LibQueryChar.GreaterThan:
                    needReset = curValue1.CompareTo(otherValue1) < 0;
                    break;

                case LibQueryChar.LessThan:
                    needReset = curValue1.CompareTo(otherValue1) > 0;
                    if (!needReset)
                    {
                        addList.Add(new LibQueryField()
                        {
                            Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                        });
                    }
                    break;

                case LibQueryChar.UnequalTo:
                    if (curValue1.CompareTo(otherValue1) <= 0)
                    {
                        addList.Add(new LibQueryField()
                        {
                            Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                        });
                    }
                    break;

                case LibQueryChar.Include:
                    addList.Add(new LibQueryField()
                    {
                        Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                    });
                    break;
                }
                break;

            case LibQueryChar.LessThan:
                switch (other.QueryChar)
                {
                case LibQueryChar.Equal:
                    needReset = true;
                    break;

                case LibQueryChar.Contain:
                    addList.Add(new LibQueryField()
                    {
                        Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                    });
                    break;

                case LibQueryChar.Region:
                    needReset = curValue1.CompareTo(otherValue1) <= 0;
                    if (!needReset)
                    {
                        addList.Add(new LibQueryField()
                        {
                            Name = other.Name, QueryChar = LibQueryChar.GreaterOrEqual, Value = new object[] { otherValue1 }
                        });
                    }
                    break;

                case LibQueryChar.GreaterOrEqual:
                    needReset = curValue1.CompareTo(otherValue1) <= 0;
                    if (!needReset)
                    {
                        item.QueryChar = LibQueryChar.Region;
                        item.Value     = new object[] { otherValue1, curValue1 };
                    }
                    break;

                case LibQueryChar.LessOrEqual:
                    needReset = curValue1.CompareTo(otherValue1) >= 0;
                    break;

                case LibQueryChar.GreaterThan:
                    needReset = curValue1.CompareTo(otherValue1) <= 0;
                    if (!needReset)
                    {
                        addList.Add(new LibQueryField()
                        {
                            Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                        });
                    }
                    break;

                case LibQueryChar.LessThan:
                    needReset = curValue1.CompareTo(otherValue1) > 0;
                    break;

                case LibQueryChar.UnequalTo:
                    if (curValue1.CompareTo(otherValue1) >= 0)
                    {
                        addList.Add(new LibQueryField()
                        {
                            Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                        });
                    }
                    break;

                case LibQueryChar.Include:
                    addList.Add(new LibQueryField()
                    {
                        Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                    });
                    break;
                }
                break;

            case LibQueryChar.UnequalTo:
                switch (other.QueryChar)
                {
                case LibQueryChar.Equal:
                    needReset = true;
                    break;

                case LibQueryChar.Contain:
                case LibQueryChar.Region:
                case LibQueryChar.GreaterOrEqual:
                case LibQueryChar.LessOrEqual:
                case LibQueryChar.GreaterThan:
                case LibQueryChar.LessThan:
                case LibQueryChar.UnequalTo:
                case LibQueryChar.Include:
                    addList.Add(new LibQueryField()
                    {
                        Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                    });
                    break;
                }
                break;

            case LibQueryChar.Include:
                switch (other.QueryChar)
                {
                case LibQueryChar.Equal:
                    needReset = true;
                    break;

                case LibQueryChar.Contain:
                case LibQueryChar.Region:
                case LibQueryChar.GreaterOrEqual:
                case LibQueryChar.LessOrEqual:
                case LibQueryChar.GreaterThan:
                case LibQueryChar.LessThan:
                case LibQueryChar.UnequalTo:
                    addList.Add(new LibQueryField()
                    {
                        Name = other.Name, QueryChar = other.QueryChar, Value = other.Value
                    });
                    break;

                case LibQueryChar.Include:
                    string[]      array1  = curValue1.ToString().Split(',');
                    string[]      array2  = otherValue1.ToString().Split(',');
                    StringBuilder builder = new StringBuilder();
                    foreach (string temp in array1)
                    {
                        if (array2.Contains(temp))
                        {
                            builder.AppendFormat("{0},", temp);
                        }
                    }
                    if (builder.Length > 0)
                    {
                        builder.Remove(builder.Length - 1, 1);
                        item.Value[0] = builder.ToString();
                    }
                    else
                    {
                        needReset = true;
                    }
                    break;
                }
                break;
            }
            if (needReset)
            {
                item.QueryChar = other.QueryChar;
                item.Value     = other.Value;
            }
        }
コード例 #5
0
        public static LibQueryCondition MergeQueryCondition(DataTable table, LibQueryCondition condition, Dictionary <string, List <LibQueryField> > powerQueryFieldDic)
        {
            if (powerQueryFieldDic == null || powerQueryFieldDic.Count == 0)
            {
                return(condition);
            }
            if (condition == null || condition.QueryFields.Count == 0)
            {
                condition = new LibQueryCondition();
                foreach (var item in powerQueryFieldDic)
                {
                    foreach (var subItem in item.Value)
                    {
                        condition.QueryFields.Add(subItem);
                    }
                }
                return(condition);
            }
            List <LibQueryField> addList    = new List <LibQueryField>();
            List <string>        removeList = new List <string>();

            //将权限(仅存在一个权限设定,即非or的情况)合并到当前用户的选择条件中
            foreach (var powerQuery in powerQueryFieldDic)
            {
                if (powerQuery.Value.Count == 1)
                {
                    bool          exist = false;
                    LibQueryField other = powerQuery.Value[0];
                    foreach (var item in condition.QueryFields)
                    {
                        if (item.Name == powerQuery.Key)
                        {
                            exist = true;
                            DataColumn  col      = table.Columns[item.Name];
                            LibDataType dataType = (LibDataType)col.ExtendedProperties[FieldProperty.DataType];
                            switch (dataType)
                            {
                            case LibDataType.Text:
                            case LibDataType.NText:
                            case LibDataType.Binary:
                                string curStr1   = item.Value[0].ToString();
                                string otherStr1 = other.Value[0].ToString();
                                string curStr2   = string.Empty;
                                string otherStr2 = string.Empty;
                                if (item.Value.Count == 2)
                                {
                                    curStr2 = item.Value[1].ToString();
                                }
                                if (other.Value.Count == 2)
                                {
                                    otherStr2 = other.Value[1].ToString();
                                }
                                MergeFieldQuery(addList, item, other, curStr1, otherStr1, curStr2, otherStr2);
                                break;

                            case LibDataType.Int32:
                                int curInt1   = LibSysUtils.ToInt32(item.Value[0]);
                                int otherInt1 = LibSysUtils.ToInt32(other.Value[0]);
                                int curInt2   = 0;
                                int otherInt2 = 0;
                                if (item.Value.Count == 2)
                                {
                                    curInt2 = LibSysUtils.ToInt32(item.Value[1]);
                                }
                                if (other.Value.Count == 2)
                                {
                                    otherInt2 = LibSysUtils.ToInt32(other.Value[1]);
                                }
                                MergeFieldQuery(addList, item, other, curInt1, otherInt1, curInt2, otherInt2);
                                break;

                            case LibDataType.Int64:
                                long curLong1   = LibSysUtils.ToInt64(item.Value[0]);
                                long otherLong1 = LibSysUtils.ToInt64(other.Value[0]);
                                long curLong2   = 0;
                                long otherLong2 = 0;
                                if (item.Value.Count == 2)
                                {
                                    curLong2 = LibSysUtils.ToInt64(item.Value[1]);
                                }
                                if (other.Value.Count == 2)
                                {
                                    otherLong2 = LibSysUtils.ToInt64(other.Value[1]);
                                }
                                MergeFieldQuery(addList, item, other, curLong1, otherLong1, curLong2, otherLong2);
                                break;

                            case LibDataType.Numeric:
                                decimal curDecimal1   = LibSysUtils.ToDecimal(item.Value[0]);
                                decimal otherDecimal1 = LibSysUtils.ToDecimal(other.Value[0]);
                                decimal curDecimal2   = 0;
                                decimal otherDecimal2 = 0;
                                if (item.Value.Count == 2)
                                {
                                    curDecimal2 = LibSysUtils.ToDecimal(item.Value[1]);
                                }
                                if (other.Value.Count == 2)
                                {
                                    otherDecimal2 = LibSysUtils.ToDecimal(other.Value[1]);
                                }
                                MergeFieldQuery(addList, item, other, curDecimal1, otherDecimal1, curDecimal2, otherDecimal2);
                                break;

                            case LibDataType.Float:
                                float curFloat1   = LibSysUtils.ToSingle(item.Value[0]);
                                float otherFloat1 = LibSysUtils.ToSingle(other.Value[0]);
                                float curFloat2   = 0;
                                float otherFloat2 = 0;
                                if (item.Value.Count == 2)
                                {
                                    curFloat2 = LibSysUtils.ToSingle(item.Value[1]);
                                }
                                if (other.Value.Count == 2)
                                {
                                    otherFloat2 = LibSysUtils.ToSingle(other.Value[1]);
                                }
                                MergeFieldQuery(addList, item, other, curFloat1, otherFloat1, curFloat2, otherFloat2);
                                break;

                            case LibDataType.Double:
                                double curDouble1   = LibSysUtils.ToDouble(item.Value[0]);
                                double otherDouble1 = LibSysUtils.ToDouble(other.Value[0]);
                                double curDouble2   = 0;
                                double otherDouble2 = 0;
                                if (item.Value.Count == 2)
                                {
                                    curDouble2 = LibSysUtils.ToDouble(item.Value[1]);
                                }
                                if (other.Value.Count == 2)
                                {
                                    otherDouble2 = LibSysUtils.ToDouble(other.Value[1]);
                                }
                                MergeFieldQuery(addList, item, other, curDouble1, otherDouble1, curDouble2, otherDouble2);
                                break;

                            case LibDataType.Byte:
                                byte curByte1   = LibSysUtils.ToByte(item.Value[0]);
                                byte otherByte1 = LibSysUtils.ToByte(other.Value[0]);
                                byte curByte2   = 0;
                                byte otherByte2 = 0;
                                if (item.Value.Count == 2)
                                {
                                    curByte2 = LibSysUtils.ToByte(item.Value[1]);
                                }
                                if (other.Value.Count == 2)
                                {
                                    otherByte2 = LibSysUtils.ToByte(other.Value[1]);
                                }
                                MergeFieldQuery(addList, item, other, curByte1, otherByte1, curByte2, otherByte2);
                                break;

                            case LibDataType.Boolean:
                                item.QueryChar = other.QueryChar;
                                item.Value     = other.Value;
                                break;
                            }
                            break;
                        }
                    }
                    if (!exist)
                    {
                        condition.QueryFields.Add(other);
                        removeList.Add(powerQuery.Key);
                    }
                }
            }
            foreach (var item in addList)
            {
                condition.QueryFields.Add(item);
            }

            //仅添加合并后剩余的权限条件(仅剩下or条件的权限)
            foreach (var item in powerQueryFieldDic)
            {
                if (!removeList.Contains(item.Key))
                {
                    condition.PowerQueryFieldDic.Add(item.Key, item.Value);
                }
            }
            return(condition);
        }