if (pr?.Data?.ContainsKey("glogal") == true && pr.Data["glogal"]?.Piplines?.ContainsKey(to.ToString().ToLower()) == true)
{
StringBuilder sbSql = new StringBuilder(sql);
var lstGlogal = pr.Data["glogal"].Piplines[to.ToString().ToLower()].OrderBy(temp => temp.Order).Where(temp => (!string.IsNullOrEmpty(temp.Source) && !string.IsNullOrEmpty(temp.Target)));
foreach (var item in lstGlogal)
{
if (item.Expression == PF.PipLines.Enums.PipLineExpression.StringExpression)
sbSql.Replace(item.Source, item.Target);
}
if (lstGlogal.Any() && lstGlogal.Count() > 0)
sql = sbSql.ToString();
}
{
"success": true,
"data": {
"glogal": {
"piplines": {
"postgresql": [
{
"expression": 1, // 1 字符串替换 StringExpression 2 正则替换 RegexExpression 3 LambdaExpression
"source": "===", // 来源目标
"target": "aaa", // 替换目标
"order": 1
}
],
"mysql": [
{
"expression": 1,
"source": "", // 来源目标
"target": "", // 替换目标
"order": 1
}
],
"oracle": [
{
"expression": 1,
"source": "", // 来源目标
"target": "", // 替换目标
"order": 1
}
],
"sqlserver": [
{
"expression": 1,
"source": "", // 来源目标
"target": "", // 替换目标
"order": 1
}
],
"sinoregal": [
{
"expression": 1,
"source": "", // 来源目标
"target": "", // 替换目标
"order": 1
}
],
"sqlite": [
{
"method": 1,
"source": "", // 来源目标
"target": "", // 替换目标
"order": 1
}
]
}
},
"id": {
"dataType": "int", //long int string date datetime
"piplines": {
"postgresql": [
{
"expression": 1,
"source": "", // 来源目标
"target": "", // 替换目标
"order": 1
}
],
"mysql": [
{
"expression": 1,
"source": "", // 来源目标
"target": "", // 替换目标
"order": 1
}
],
"oracle": [
{
"expression": 1,
"source": "", // 来源目标
"target": "", // 替换目标
"order": 1
}
],
"sqlserver": [
{
"expression": 1,
"source": "", // 来源目标
"target": "", // 替换目标
"order": 1
}
],
"sinoregal": [
{
"expression": 1,
"source": "", // 来源目标
"target": "", // 替换目标
"order": 1
}
],
"sqlite": [
{
"method": 1,
"source": "", // 来源目标
"target": "", // 替换目标
"order": 1
}
]
}
}
}
}
using RG3.DO.Abstractions.Attributes;
namespace RG3.DO.Abstractions.Enums
{
/// <summary>
/// 数据库类型枚举
/// </summary>
public enum DatabaseType
{
/// <summary>
/// 未知
/// </summary>
[DatabaseTypeDescription("未知")]
Unknown,
/// <summary>
/// MS sql server
/// </summary>
[DatabaseTypeDescription("SqlServer")]
SqlServer,
/// <summary>
/// Oracle
/// </summary>
[DatabaseTypeDescription("Oracle")]
Oracle,
/// <summary>
/// MySql
/// </summary>
[DatabaseTypeDescription("MySql")]
MySql,
/// <summary>
/// SQLite
/// </summary>
[DatabaseTypeDescription("SQLite")]
SQLite,
/// <summary>
/// 星瑞格Sinoregal
/// </summary>
[DatabaseTypeDescription("星瑞格")]
Sinoregal,
/// <summary>
/// Informix
/// </summary>
[DatabaseTypeDescription("Informix")]
Informix,
/// <summary>
/// DB2
/// </summary>
[DatabaseTypeDescription("DB2")]
DB2,
/// <summary>
/// PostgreSQL
/// </summary>
[DatabaseTypeDescription("PostgreSQL")]
PostgreSQL,
/// <summary>
/// Firebird
/// </summary>
[DatabaseTypeDescription("Firebird")]
Firebird,
/// <summary>
/// 达梦Dameng
/// </summary>
[DatabaseTypeDescription("达梦")]
Dameng,
/// <summary>
/// 人大金仓Kingbase
/// </summary>
[DatabaseTypeDescription("人大金仓")]
Kingbase,
/// <summary>
/// Access
/// </summary>
[DatabaseTypeDescription("Access OleDb")]
OleDb
}
}
文档更新时间: 2023-07-16 23:40 作者:admin