You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ZKLT.Hadoop.Model
|
|
{
|
|
/// <summary>
|
|
/// 命令函数
|
|
/// </summary>
|
|
public class HDP_CommandAction
|
|
{
|
|
/// <summary>
|
|
/// 当前日期
|
|
/// </summary>
|
|
public const string DATENOW = "DATE_NOW()";
|
|
|
|
/// <summary>
|
|
/// 转换命令
|
|
/// </summary>
|
|
/// <param name="command">命令</param>
|
|
/// <param name="param">参数</param>
|
|
/// <returns>命令</returns>
|
|
public static string ConvertCommand(string command, Dictionary<string, object> param)
|
|
{
|
|
command = command.Replace(DATENOW,@$"'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'");
|
|
|
|
return command;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 判断是否方法
|
|
/// </summary>
|
|
/// <param name="action">方法</param>
|
|
/// <returns>是否包含</returns>
|
|
public static bool IsAction(string action)
|
|
{
|
|
var _Result = false;
|
|
|
|
if (action == DATENOW) {
|
|
return true;
|
|
}
|
|
|
|
return _Result;
|
|
}
|
|
}
|
|
}
|