| | |
| | | private void btnReadTab_Click(object sender, EventArgs e) |
| | | { |
| | | string txtTab = this.txtTabPre.Text.Trim(); |
| | | string sql = "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 c.relname like '" + txtTab + "%' and obj_description(c.oid) is not null and relnamespace=" + this.txtNS.Text.Trim() + " order by c.relname desc, a.attnum asc"; |
| | | string sql = "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 c.relname like '" + txtTab + "%' and attname not like '%pg.dropped%' and obj_description(c.oid) is not null and relnamespace=" + this.txtNS.Text.Trim() + " order by c.relname desc, a.attnum asc"; |
| | | |
| | | DataTable dt = _dbHelper.GetDataTable(sql, null); |
| | | |
| | |
| | | string colType = GetJavaType(selectTabInfo); |
| | | string colName = NameConvert(selectTabInfo.col, false); |
| | | string testExpr = colName + " != null"; |
| | | string testWhere = selectTabInfo.col + (colType == "String" ? " like " : " = ") + "#{" + colName + "}"; |
| | | //string testWhere = selectTabInfo.col + (colType == "String" ? " like " : " = ") + "#{" + colName + "}"; |
| | | string testWhere = (colType == "String" ? "upper(" + selectTabInfo.col + ") like " : selectTabInfo.col + " = ") + "#{" + colName + "}"; |
| | | |
| | | string insertCols = GetInsertCols(tabs); |
| | | string insertVal = GetInsertVal(tabs); |
| | |
| | | |
| | | //string where = isString ? "\r\n " + colName + " = \"%\" + (StringHelper.isNull(" + colName + ") ? \"\" : " + colName + ".trim()) + \"%\";\r\n" : ""; |
| | | //string where = colType == "String" ? "\r\n " + colName + " = StringHelper.isNull(" + colName + ") ? null : \"%\" + " + colName + ".trim() + \"%\";\r\n" : ""; |
| | | string where = colType == "String" ? "\r\n " + colName + " = StringHelper.getLikeStr(" + colName + ");\r\n" : ""; |
| | | string where = colType == "String" ? "\r\n " + colName + " = StringHelper.getLikeUpperStr(" + colName + ");\r\n" : ""; |
| | | |
| | | string xml = File.ReadAllText(Path.Combine(baseDir, "SysTemplate\\Service.java")); |
| | | xml = xml |