![]()
![]() /**//// <summary>
/**//// <summary>
![]() /// Class2 的摘要说明。
    /// Class2 的摘要说明。
![]() /// </summary>
    /// </summary>![]() public class QuerySet
    public class QuerySet
![]()
![]() 
    ![]() {
{
![]() private ObjectDictionary z_dicConditions;
        private ObjectDictionary z_dicConditions;
![]() private string z_strTableName;
        private string z_strTableName;
![]() 
        
![]() public QuerySet(string strTableName)
        public QuerySet(string strTableName)
![]()
![]() 
        ![]() {
{
![]() //
            //
![]() // TODO: 在此处添加构造函数逻辑
            // TODO: 在此处添加构造函数逻辑
![]() //
            //
![]() z_dicConditions = new ObjectDictionary();
            z_dicConditions = new ObjectDictionary();
![]() this.z_strTableName = strTableName;
            this.z_strTableName = strTableName;
![]() }
        }
![]() 
        
![]() public void AddCellModalCondition(string strCellModalName, EnumConditionType enumType, string strValue)
        public void AddCellModalCondition(string strCellModalName, EnumConditionType enumType, string strValue)
![]()
![]() 
        ![]() {
{
![]() if (strValue == null || strValue == "")
            if (strValue == null || strValue == "")
![]() return;
                return;
![]() z_dicConditions[strCellModalName] = String.Format(" {0} {1} '{2}' ", strCellModalName, this.EnumConditionType2SqlSymbol(enumType), strValue);
            z_dicConditions[strCellModalName] = String.Format(" {0} {1} '{2}' ", strCellModalName, this.EnumConditionType2SqlSymbol(enumType), strValue);
![]() }
        }
![]()
![]() //2005.03.20
//2005.03.20
![]()
![]() public void AddStringCondition(string strDataItemName, StringConditionType enumType, string strValue)
        public void AddStringCondition(string strDataItemName, StringConditionType enumType, string strValue)
![]()
![]() 
        ![]() {
{
![]() if (strValue == null || strValue == "")
            if (strValue == null || strValue == "")
![]() return;
                return;
![]() z_dicConditions[strDataItemName] = String.Format(" {0} {1} '{2}' ", strDataItemName, this.StringConditionType2SqlSymbol(enumType), strValue);
            z_dicConditions[strDataItemName] = String.Format(" {0} {1} '{2}' ", strDataItemName, this.StringConditionType2SqlSymbol(enumType), strValue);
![]() }
        }
![]()
![]() public void AddNumberCondition(string strDataItemName, NumberConditionType enumType, string strValue)
        public void AddNumberCondition(string strDataItemName, NumberConditionType enumType, string strValue)
![]()
![]() 
        ![]() {
{
![]() if (strValue == null || strValue == "")
            if (strValue == null || strValue == "")
![]() return;
                return;
![]() z_dicConditions[strDataItemName] = String.Format(" {0} {1} {2} ", strDataItemName, this.NumberConditionType2SqlSymbol(enumType), strValue);
            z_dicConditions[strDataItemName] = String.Format(" {0} {1} {2} ", strDataItemName, this.NumberConditionType2SqlSymbol(enumType), strValue);
![]() }
        }
![]()
![]() public void AddDateTimeCondition(string strDataItemName, DateTimeConditionType enumType, string strValue)
        public void AddDateTimeCondition(string strDataItemName, DateTimeConditionType enumType, string strValue)
![]()
![]() 
        ![]() {
{
![]() if (strValue == null || strValue == "" || strValue == new DateTime(1, 1, 1).ToString())
            if (strValue == null || strValue == "" || strValue == new DateTime(1, 1, 1).ToString())
![]()
![]() return ;
            return ;
![]() 
            
![]() //strValue = " to_date('" + strValue +  "','YYYY-MM-DD hh24:mi:ss') ";
            //strValue = " to_date('" + strValue +  "','YYYY-MM-DD hh24:mi:ss') ";
![]() 
            
![]() z_dicConditions[strDataItemName] = String.Format(" {0} {1}  '{2}' ", strDataItemName, this.DateTimeConditionType2SqlSymbol(enumType), strValue);
            z_dicConditions[strDataItemName] = String.Format(" {0} {1}  '{2}' ", strDataItemName, this.DateTimeConditionType2SqlSymbol(enumType), strValue);
![]() }
        }
![]()
![]() public void AddEnumCondition(string strDataItemName, EnumConditionType enumType, string strValue)
        public void AddEnumCondition(string strDataItemName, EnumConditionType enumType, string strValue)
![]()
![]() 
        ![]() {
{
![]() if (strValue == null || strValue == "" || strValue == "0")
            if (strValue == null || strValue == "" || strValue == "0")
![]() return;
                return;
![]() z_dicConditions[strDataItemName] = String.Format(" {0} {1} {2} ", strDataItemName, this.EnumConditionType2SqlSymbol(enumType), strValue);
            z_dicConditions[strDataItemName] = String.Format(" {0} {1} {2} ", strDataItemName, this.EnumConditionType2SqlSymbol(enumType), strValue);
![]() }
        }
![]()
![]()
![]() private string StringConditionType2SqlSymbol(StringConditionType enumType)
        private string StringConditionType2SqlSymbol(StringConditionType enumType)
![]()
![]() 
        ![]() {
{
![]() switch (enumType)
            switch (enumType)
![]()
![]() 
            ![]() {
{
![]() case StringConditionType.匹配:
                case StringConditionType.匹配:
![]() return " like ";
                    return " like ";
![]() case StringConditionType.等于:
                case StringConditionType.等于:
![]() return " = ";
                    return " = ";
![]() default:
                default:
![]() throw new Exception("无法识别的枚举值!");
                    throw new Exception("无法识别的枚举值!");
![]() }
            }
![]() }
        }
![]()
![]() private string NumberConditionType2SqlSymbol(NumberConditionType enumType)
        private string NumberConditionType2SqlSymbol(NumberConditionType enumType)
![]()
![]() 
        ![]() {
{
![]() switch (enumType)
            switch (enumType)
![]()
![]() 
            ![]() {
{
![]() case NumberConditionType.大于:
                case NumberConditionType.大于:
![]() return " > ";
                    return " > ";
![]() case NumberConditionType.大于等于:
                case NumberConditionType.大于等于:
![]() return " >= ";
                    return " >= ";
![]() case NumberConditionType.小于:
                case NumberConditionType.小于:
![]() return " < ";
                    return " < ";
![]() case NumberConditionType.小于等于:
                case NumberConditionType.小于等于:
![]() return " <= ";
                    return " <= ";
![]() case NumberConditionType.等于:
                case NumberConditionType.等于:
![]() return " = ";
                    return " = ";
![]() case NumberConditionType.不等于:
                case NumberConditionType.不等于:
![]() return "<>";
                    return "<>";
![]() default:
                default:
![]() throw new Exception("无法识别的枚举值!");
                    throw new Exception("无法识别的枚举值!");
![]()
![]() }
            }
![]() }
        }
![]()
![]() private string DateTimeConditionType2SqlSymbol(DateTimeConditionType enumType)
        private string DateTimeConditionType2SqlSymbol(DateTimeConditionType enumType)
![]()
![]() 
        ![]() {
{
![]() switch (enumType)
            switch (enumType)
![]()
![]() 
            ![]() {
{
![]() case DateTimeConditionType.早于:
                case DateTimeConditionType.早于:
![]() return " < ";
                    return " < ";
![]() case DateTimeConditionType.晚于:
                case DateTimeConditionType.晚于:
![]() return " > ";
                    return " > ";
![]() case DateTimeConditionType.等于:
                case DateTimeConditionType.等于:
![]() return " = ";
                    return " = ";
![]() default:
                default:
![]() throw new Exception("无法识别的枚举值!");
                    throw new Exception("无法识别的枚举值!");
![]() }
            }
![]() }
        }
![]()
![]() private string EnumConditionType2SqlSymbol(EnumConditionType enumType)
        private string EnumConditionType2SqlSymbol(EnumConditionType enumType)
![]()
![]() 
        ![]() {
{
![]() switch (enumType)
            switch (enumType)
![]()
![]() 
            ![]() {
{
![]() case EnumConditionType.等于:
                case EnumConditionType.等于:
![]() return " = ";
                    return " = ";
![]() case EnumConditionType.不等于:
                case EnumConditionType.不等于:
![]() return " <> ";
                    return " <> ";
![]() default:
                default:
![]() throw new Exception("无法识别的枚举值!");
                    throw new Exception("无法识别的枚举值!");
![]() }
            }
![]() }
        }
![]()
![]()
![]() public string ConditionText
        public string ConditionText
![]()
![]() 
        ![]() {
{
![]() get
            get
![]()
![]() 
            ![]() {
{
![]() string strConditionText = "";
                string strConditionText = "";
![]() if (this.z_dicConditions.Values.Length == 0) return strConditionText;
                if (this.z_dicConditions.Values.Length == 0) return strConditionText;
![]() for (int i = 0; i < this.z_dicConditions.Values.Length; i++)
                for (int i = 0; i < this.z_dicConditions.Values.Length; i++)
![]()
![]() 
                ![]() {
{
![]() strConditionText += this.z_dicConditions.Values[i].ToString();
                    strConditionText += this.z_dicConditions.Values[i].ToString();
![]() if (i + 1 < this.z_dicConditions.Values.Length)
                    if (i + 1 < this.z_dicConditions.Values.Length)
![]() strConditionText += " AND ";
                        strConditionText += " AND ";
![]() }
                }
![]() z_dicConditions.Clear();
                z_dicConditions.Clear();
![]() return String.Format(" SELECT * FROM {0} WHERE {1}", this.z_strTableName, strConditionText);
                return String.Format(" SELECT * FROM {0} WHERE {1}", this.z_strTableName, strConditionText);
![]() 
                
![]() }
            }
![]() }
        }
![]()
![]() }
    }
![]()
![]()
![]()
![]() public enum StringConditionType
    public enum StringConditionType ![]() { 匹配, 等于 };
{ 匹配, 等于 };
![]()
![]() public enum NumberConditionType
    public enum NumberConditionType ![]() { 等于, 大于, 大于等于, 小于, 小于等于, 不等于 };
{ 等于, 大于, 大于等于, 小于, 小于等于, 不等于 };
![]()
![]() public enum DateTimeConditionType
    public enum DateTimeConditionType ![]() { 等于, 晚于, 早于 };
{ 等于, 晚于, 早于 };
![]()
![]() public enum EnumConditionType
    public enum EnumConditionType ![]() { 等于, 不等于 };
{ 等于, 不等于 };
![]()
![]() public enum DataItemType
    public enum DataItemType ![]() { 未选择, 数字, 日期, 字符串 };
{ 未选择, 数字, 日期, 字符串 };
![]()
![]() public enum BooleanValue
    public enum BooleanValue ![]() { 未选择, 是, 否 };
{ 未选择, 是, 否 };
![]()
![]() public enum CellModal
    public enum CellModal    ![]() { 未选择, FDD_mode,TDD_mode_1_28Mcps, TDD_mode_3_84Mcps };
{ 未选择, FDD_mode,TDD_mode_1_28Mcps, TDD_mode_3_84Mcps };
![]()
![]() public enum SlotStatus
    public enum SlotStatus ![]() { 未选择, Active, Not_Active};
{ 未选择, Active, Not_Active};
![]()
![]() public enum SlotDirection
    public enum SlotDirection ![]() { 未选择, Active, Not_Active};
{ 未选择, Active, Not_Active};
![]()
![]() public enum InventoryUnitType
    public enum InventoryUnitType ![]() {未选择,rack,    shelf,    slot,    pack};
{未选择,rack,    shelf,    slot,    pack};
![]()
![]() public enum LinkStatus
    public enum LinkStatus ![]() {未选择,normal,deactivated,failed,localBlocked,remoteBlocked, localInhibited,remoteInhibited};
{未选择,normal,deactivated,failed,localBlocked,remoteBlocked, localInhibited,remoteInhibited};
![]()
![]() public enum SignallingLinkType
    public enum SignallingLinkType ![]() {未选择,窄带7号信令链路,    宽带7号信令链路};
{未选择,窄带7号信令链路,    宽带7号信令链路};
![]()
![]() public enum Networkindicator
    public enum Networkindicator ![]() { international,spare,national,nationalSpare};
{ international,spare,national,nationalSpare};
![]()
![]() public enum SignallingPointType
    public enum SignallingPointType ![]() {HSTP,LSTP,HSTP_LSTP};
{HSTP,LSTP,HSTP_LSTP};
![]()
![]() public enum AlarmType
    public enum AlarmType ![]() {FIRSTLEVEL,SECONEDLEVEL,THIRDLEVEL,FOURTHLEVEL,FIFTHLEVER};
{FIRSTLEVEL,SECONEDLEVEL,THIRDLEVEL,FOURTHLEVEL,FIFTHLEVER};
![]() 
    
![]()
![]() public enum UserDefinedNetworkType
    public enum UserDefinedNetworkType ![]() {AN,CN,AN_CN};
{AN,CN,AN_CN};