| | |
| | | public partial class FrmMyBatisPlus : Form |
| | | { |
| | | #region 成员变量+构造函数 |
| | | private static List<string> excludes = new List<string>() { "gid", "objectid", "eventid", "dirid", "depid", "verid", "createtime", "createuser", "updateuser", "updatetime", "geom", "shape_leng", "shape_area" }; |
| | | private static List<string> excludes = new List<string>() { "gid", "parentid", "objectid", "eventid", "dirid", "depid", "verid", "createtime", "createuser", "updateuser", "updatetime", "geom", "shape_leng", "shape_area" }; |
| | | |
| | | string baseDir = AppDomain.CurrentDomain.BaseDirectory; |
| | | |
| | |
| | | string tabName = this.txtTabPre.Text.Trim(); |
| | | string tabFilter = string.IsNullOrEmpty(tabName) ? "" : string.Format("and c.relname like '{0}%'", tabName); |
| | | |
| | | string sql = string.Format("select c.relname \"tab\", cast(obj_description(c.oid) as varchar) \"desc\", a.attnum \"num\", a.attname \"col\", t.typname \"type\", d.description \"bak\" from pg_attribute a left join pg_description d on d.objoid = a.attrelid and d.objsubid = a.attnum left join pg_class c on a.attrelid = c.oid left join pg_type t on a.atttypid = t.oid where a.attnum >= 0 and reltype>0 and relnamespace in ({0}) {1} order by c.relname desc, a.attnum asc", this.txtNS.Text.Trim(), tabFilter); |
| | | string sql = string.Format("select c.relname \"tab\", cast(obj_description(c.oid) as varchar) \"desc\", a.attnum \"num\", a.attname \"col\", t.typname \"type\", d.description \"bak\" from pg_attribute a left join pg_description d on d.objoid = a.attrelid and d.objsubid = a.attnum left join pg_class c on a.attrelid = c.oid left join pg_type t on a.atttypid = t.oid where a.attnum >= 0 and reltype>0 and relnamespace in ({0}) {1} and position('pg.dropped' in a.attname) = 0 order by c.relname desc, a.attnum asc", this.txtNS.Text.Trim(), tabFilter); |
| | | |
| | | DataTable dt = _dbHelper.GetDataTable(sql, null); |
| | | _list = ModelHandler.FillModel<TabInfo>(dt); |
| | |
| | | //sb.Append("\r\n @TableField(value = \"class\")"); |
| | | //ti.col = "clazz"; |
| | | //ti.col = "classes"; |
| | | MessageBox.Show(ti.tab); |
| | | MessageBox.Show(ti.tab + "." + ti.col); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | str += strs[i].Length == 1 ? strs[i] : ToUpperFirst(strs[i]); |
| | | } |
| | | if (str.Length == 1 && firstUpper) |
| | | { |
| | | return str.ToUpper(); |
| | | } |
| | | |
| | | return str; |
| | | } |
| | |
| | | { |
| | | switch (ti.type) |
| | | { |
| | | case "timestamptz": |
| | | case "timestamp": |
| | | return "Timestamp"; |
| | | case "date": |
| | | return "LocalDate"; |
| | | case "time": |
| | | return "LocalTime"; |
| | | case "float4": // float |
| | | return "Float"; |
| | | case "float8": // double |
| | |
| | | case "int2": |
| | | case "int4": // int |
| | | return "Integer"; |
| | | default: |
| | | default: // text, varchar |
| | | return "String"; |
| | | } |
| | | } |