public string GetCVS <T>(List <T> objList)
        {
            if (objList == null)
            {
                return("");
            }
            var sl = ObjectListHelper.GetValidTypePropertyList(typeof(T), typeof(ReportOutputIgnore));
            var s  = "";

            sl.ForEach(v => s += (v + ","));
            s += "\r\n";
            objList.ForEach(v =>
            {
                foreach (var p in sl)
                {
                    var value = v.GetType().GetProperty(p).GetValue(v);
                    if (value != null)
                    {
                        s += value.ToString() + ",";
                    }
                    else
                    {
                        s += ",";
                    }
                }
                s += "\r\n";
            });
            return(s);
        }
        public string CreateInertSql(string tbName, object data, Type dataType = null)
        {
            if (data == null)
            {
                return(null);
            }
            if (dataType == null)
            {
                dataType = data.GetType();
            }
            StringBuilder sql = new StringBuilder();

            sql.Append(string.Format("INSERT INTO {0}(", tbName));
            var sl = ObjectListHelper.GetValidTypePropertyList(dataType, typeof(ReportOutputIgnore));
            var hs = "";

            sl.ForEach(v => hs += (v + ","));

            hs = FixKeyWordColumn(hs);
            sql.Append(hs);

            sql.Append(")");
            sql.Append(" VALUES ");

            var vs = "";

            vs += "(";
            for (int i = 0; i < sl.Count; i++)
            {
                var valueString = "";
                var value       = dataType.GetProperty(sl[i]).GetValue(data);
                if (value == null)
                {
                    valueString = GetDefaultValue(data.GetType().GetProperty(sl[i]));
                }
                else
                {
                    valueString = value.ToString();
                }
                if (IsNeedQuotation(data.GetType().GetProperty(sl[i])))
                {
                    valueString = "'" + valueString + "'";
                }
                if (i != sl.Count - 1)
                {
                    valueString += ",";
                }
                vs += valueString;
            }

            vs += ")";


            sql.Append(vs);
            return(sql.ToString());
        }
        public string CreateInertSql(string tbName, List <object> ObjectList)
        {
            if (ObjectList == null || ObjectList.Count == 0)
            {
                return(null);
            }
            var           o       = ObjectList.FirstOrDefault();
            var           objType = o.GetType();
            StringBuilder sql     = new StringBuilder();


            sql.Append(string.Format("INSERT INTO {0}(", tbName));
            var sl = ObjectListHelper.GetValidTypePropertyList(objType, typeof(ReportOutputIgnore));
            var hs = "";

            sl.ForEach(v => hs += (v + ","));
            hs = FixKeyWordColumn(hs);
            sql.Append(hs);

            sql.Append(")");
            sql.Append(" VALUES ");
            var vs = "";

            ObjectList.ForEach(v =>
            {
                try
                {
                    vs += "(";
                    for (int i = 0; i < sl.Count; i++)
                    {
                        var valueString = "";
                        var value       = v.GetType().GetProperty(sl[i]).GetValue(v);
                        if (value == null)
                        {
                            valueString = GetDefaultValue(v.GetType().GetProperty(sl[i]));
                        }
                        else
                        {
                            valueString = value.ToString();
                        }
                        if (IsNeedQuotation(v.GetType().GetProperty(sl[i])))
                        {
                            valueString = "'" + valueString + "'";
                        }
                        if (i != sl.Count - 1)
                        {
                            valueString += ",";
                        }
                        vs += valueString;
                    }

                    vs += "),";
                }
                catch (Exception ex)
                {
                    LogSupport.Error(ex);
                }
            });

            sql.Append(vs.Substring(0, vs.Length - 1));
            return(sql.ToString());
        }
        public string CreateUpdateSql(string tbName, object data, string conditions, Type dataType = null)
        {
            if (data == null)
            {
                return(null);
            }
            if (dataType == null)
            {
                dataType = data.GetType();
            }
            if (string.IsNullOrEmpty(conditions))
            {
                return(null);
            }
            StringBuilder sql = new StringBuilder();

            sql.Append(string.Format("Update {0} ", tbName));

            var sl = ObjectListHelper.GetValidTypePropertyList(dataType, typeof(ReportOutputIgnore));
            var vs = "";

            vs += "(";
            for (int i = 0; i < sl.Count; i++)
            {
                var cs = sl[i];
                if (IsColumnNameNeedBracket(cs))
                {
                    cs = "[" + cs + "]";
                }
                var s           = cs + "=";
                var valueString = "";
                var value       = dataType.GetProperty(sl[i]).GetValue(data);
                if (value == null)
                {
                    valueString = valueString + GetDefaultValue(data.GetType().GetProperty(sl[i]));
                }
                else
                {
                    valueString = value.ToString();
                }
                if (IsNeedQuotation(data.GetType().GetProperty(sl[i])))
                {
                    valueString = "'" + valueString + "'";
                }

                s = s + valueString;
                if (i != sl.Count - 1)
                {
                    s += ",";
                }
                vs += s;
            }

            vs += ")";


            sql.Append(vs);
            conditions = conditions.Trim();
            if (!conditions.StartsWith("where", StringComparison.CurrentCultureIgnoreCase))
            {
                conditions = " where " + conditions;
            }
            else
            {
                conditions = " " + conditions;
            }
            sql.Append(conditions);
            return(sql.ToString());
        }