private static string Oper2Sql(I3SqlOperateType type) { switch (type) { case I3SqlOperateType.等于: return(" = "); case I3SqlOperateType.小于: return(" < "); case I3SqlOperateType.小于等于: return(" <= "); case I3SqlOperateType.大于: return(" > "); case I3SqlOperateType.大于等于: return(" >= "); case I3SqlOperateType.等于: return(" <> "); case I3SqlOperateType.前匹配: return(" Like "); case I3SqlOperateType.全匹配: return(" Like "); case I3SqlOperateType.后匹配: return(" Like "); case I3SqlOperateType.匹配: return(" Not Like "); case I3SqlOperateType.为空: return(" Is Null"); case I3SqlOperateType.为空: return(" Is Not Null"); default: return(""); } }
/// <summary> /// 构造Sql项目参数, /// </summary> /// <param name="tableAlias">表别名</param> /// <param name="sColName">字段名称</param> /// <param name="type">比较类型</param> /// <param name="oValue">比较值,根据比较值的类型来决定数据类型,如:时间必须为DateTime类型,数值必须为Int或decimal类型 /// ,如果要表示为空,请使用I3SqlOperateType.为空 来表示</param> public I3SqlItemParam(string tableAlias, string sColName, I3SqlOperateType type, object oValue) { this.sTableAlias = tableAlias; this.sColName = sColName; this.oValue = oValue; opType = type; paramType = I3SqlParamType.Item; this.sTableAlias = sTableAlias; }
/// <summary> /// 增加子项目, /// 只有组合参数才能增加子项目 /// </summary> /// <param name="tableAlias"></param> /// <param name="sColName"></param> /// <param name="type"></param> /// <param name="oValue"></param> /// <returns></returns> public I3SqlGroupParam AppendChild(string tableAlias, string sColName, I3SqlOperateType type, object oValue) { return(AppendChild(new I3SqlItemParam(tableAlias, sColName, type, oValue))); }
/// <summary> /// 构造Sql项目,表别名,默认为 t /// </summary> /// <param name="sColName">字段名称</param> /// <param name="type">比较类型</param> /// <param name="oValue">比较值,根据比较值的类型来决定数据类型,如:时间必须为DateTime类型,数值必须为Int或decimal类型 /// ,如果要表示为空,请使用I3SqlOperateType.为空 来表示</param> public I3SqlItemParam(string sColName, I3SqlOperateType type, object oValue) : this("t", sColName, type, oValue) { }