Browse Source

Update Oracle

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
8de0a50b64
  1. 24
      Src/Asp.Net/OracleTest/Program.cs
  2. 4
      Src/Asp.Net/OracleTest/UnitTest/ExpressionTest/Select.cs
  3. 100
      Src/Asp.Net/OracleTest/UnitTest/ExpressionTest/Where.cs
  4. 2
      Src/Asp.Net/SqlSugar/SqlSugarClient.cs

24
Src/Asp.Net/OracleTest/Program.cs

@ -17,12 +17,12 @@ namespace OrmTest
{
static void Main(string[] args)
{
throw new Exception(" Oracle developed 60%,to be continued.");
//throw new Exception(" Oracle developed 60%,to be continued.");
// /***Unit Test***/
new Select(1).Init();
//new Field(1).Init();
//new Where(1).Init();
new Field(1).Init();
new Where(1).Init();
//new Method(1).Init();
//new JoinQuery(1).Init();
//new SingleQuery(1).Init();
@ -38,15 +38,15 @@ namespace OrmTest
//new SqlSugarPerformance(100).Select();
/***Demo***/
OrmTest.Demo.Query.Init();
OrmTest.Demo.Insert.Init();
OrmTest.Demo.Delete.Init();
OrmTest.Demo.Update.Init();
OrmTest.Demo.DbFirst.Init();
OrmTest.Demo.JoinSql.Init();
OrmTest.Demo.Filter.Init();
OrmTest.Demo.ComplexModel.Init();
OrmTest.Demo.CodeFirst.Init();
//OrmTest.Demo.Query.Init();
//OrmTest.Demo.Insert.Init();
//OrmTest.Demo.Delete.Init();
//OrmTest.Demo.Update.Init();
//OrmTest.Demo.DbFirst.Init();
//OrmTest.Demo.JoinSql.Init();
//OrmTest.Demo.Filter.Init();
//OrmTest.Demo.ComplexModel.Init();
//OrmTest.Demo.CodeFirst.Init();
}
}
}

4
Src/Asp.Net/OracleTest/UnitTest/ExpressionTest/Select.cs

@ -63,7 +63,7 @@ namespace OrmTest.UnitTest
base.Check(
selectorValue,
pars,
@" ""SCHOOL"".""NAME"" AS ""SCHOOLNAME"" ,IT.*",
@" ""SCHOOL"".""NAME"" AS ""SCHOOLNAME"" ,it.*",
new List<SugarParameter>()
{
@ -159,7 +159,7 @@ namespace OrmTest.UnitTest
var selectorValue = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(
@"( :CONSTANT0<>'' AND :CONSTANT0 IS NOT NULL )", new List<SugarParameter>() {
@"( :constant0<>'' AND :constant0 IS NOT NULL )", new List<SugarParameter>() {
new SugarParameter(":constant0",p)
}, selectorValue, pars,
"Select.single4 Error");

100
Src/Asp.Net/OracleTest/UnitTest/ExpressionTest/Where.cs

@ -59,8 +59,8 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereMultiple);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( \"it\".\"Id\" > @Id0 )", new List<SugarParameter>() {
new SugarParameter("@Id0",1)
base.Check(value, pars, "( \"it\".\"Id\" > :Id0 )", new List<SugarParameter>() {
new SugarParameter(":Id0",1)
}, "WhereMultiple1");
}
private void WhereMultiple2()
@ -72,11 +72,11 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereMultiple);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, " (((( \"it\".\"Id\" > @Id0 ) AND ( \"it\".\"Name\" <> @Name1 )) OR ( \"it\".\"Id\" = @Id2 )) OR ( \"it\".\"Name\" = @Name3 ))", new List<SugarParameter>() {
new SugarParameter("@Id0",1),
new SugarParameter("@Name1","a"),
new SugarParameter("@Id2",1),
new SugarParameter("@Name3","a1")
base.Check(value, pars, " (((( \"it\".\"Id\" > :Id0 ) AND ( \"it\".\"Name\" <> :Name1 )) OR ( \"it\".\"Id\" = :Id2 )) OR ( \"it\".\"Name\" = :Name3 ))", new List<SugarParameter>() {
new SugarParameter(":Id0",1),
new SugarParameter(":Name1","a"),
new SugarParameter(":Id2",1),
new SugarParameter(":Name3","a1")
}, "WhereMultiple2");
}
private void whereSingle1()
@ -86,8 +86,8 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( \"Id\" > @Id0 )", new List<SugarParameter>() {
new SugarParameter("@Id0",1)
base.Check(value, pars, "( \"Id\" > :Id0 )", new List<SugarParameter>() {
new SugarParameter(":Id0",1)
}, "whereSingle1");
}
private void whereSingle2()
@ -97,8 +97,8 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( @Id0 > \"Id\" )", new List<SugarParameter>() {
new SugarParameter("@Id0",1)
base.Check(value, pars, "( :Id0 > \"Id\" )", new List<SugarParameter>() {
new SugarParameter(":Id0",1)
}, "whereSingle2");
}
private void whereSingle3()
@ -108,9 +108,9 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, " (( \"Id\" > @Id0 ) OR ( \"Name\" = @Name1 ))", new List<SugarParameter>() {
new SugarParameter("@Id0",1),
new SugarParameter("@Name1","a")
base.Check(value, pars, " (( \"Id\" > :Id0 ) OR ( \"Name\" = :Name1 ))", new List<SugarParameter>() {
new SugarParameter(":Id0",1),
new SugarParameter(":Name1","a")
}, "whereSingle3");
}
private void whereSingle4()
@ -120,10 +120,10 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, " ((( \"Id\" > @Id0 ) AND ( \"Name\" <> @Name1 )) OR ( \"Name\" = @Name2 )) ", new List<SugarParameter>() {
new SugarParameter("@Id0",1),
new SugarParameter("@Name1","a"),
new SugarParameter("@Name2","a1")
base.Check(value, pars, " ((( \"Id\" > :Id0 ) AND ( \"Name\" <> :Name1 )) OR ( \"Name\" = :Name2 )) ", new List<SugarParameter>() {
new SugarParameter(":Id0",1),
new SugarParameter(":Name1","a"),
new SugarParameter(":Name2","a1")
}, "whereSingle4");
}
private void whereSingle5()
@ -135,10 +135,10 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, " ((( \"Id\" > @Id0 ) AND ( \"Name\" <> @Name1 )) OR ( \"Name\" = @Name2 )) ", new List<SugarParameter>() {
new SugarParameter("@Id0",1),
new SugarParameter("@Name1","a"),
new SugarParameter("@Name2","a1")
base.Check(value, pars, " ((( \"Id\" > :Id0 ) AND ( \"Name\" <> :Name1 )) OR ( \"Name\" = :Name2 )) ", new List<SugarParameter>() {
new SugarParameter(":Id0",1),
new SugarParameter(":Name1","a"),
new SugarParameter(":Name2","a1")
}, "whereSingle5");
}
private void whereSingle6()
@ -150,11 +150,11 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, " (((( \"Id\" > @Id0 ) AND ( \"Name\" <> @Name1 )) OR ( \"Id\" = @Id2 )) OR ( \"Name\" = @Name3 ))", new List<SugarParameter>() {
new SugarParameter("@Id0",1),
new SugarParameter("@Name1","a"),
new SugarParameter("@Id2",1),
new SugarParameter("@Name3","a1")
base.Check(value, pars, " (((( \"Id\" > :Id0 ) AND ( \"Name\" <> :Name1 )) OR ( \"Id\" = :Id2 )) OR ( \"Name\" = :Name3 ))", new List<SugarParameter>() {
new SugarParameter(":Id0",1),
new SugarParameter(":Name1","a"),
new SugarParameter(":Id2",1),
new SugarParameter(":Name3","a1")
}, "whereSingle6");
}
private void whereSingle7(Student st)
@ -164,8 +164,8 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( \"Id\" > @Id0 )", new List<SugarParameter>() {
new SugarParameter("@Id0",1)
base.Check(value, pars, "( \"ID\" > :Id0 )", new List<SugarParameter>() {
new SugarParameter(":Id0",1)
}, "whereSingle7");
}
@ -176,7 +176,7 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( \"Name\" IS NULL )", new List<SugarParameter>() {
base.Check(value, pars, "( \"NAME\" IS NULL )", new List<SugarParameter>() {
}, "whereSingle8");
}
@ -188,9 +188,9 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( \"Name\" = @Name0 )", new List<SugarParameter>()
base.Check(value, pars, "( \"NAME\" = :Name0 )", new List<SugarParameter>()
{
new SugarParameter("@Name0",null)
new SugarParameter(":Name0",null)
}, "whereSingle9");
}
@ -229,9 +229,9 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( \"Bool1\" = @Bool10 )", new List<SugarParameter>()
base.Check(value, pars, "( \"BOOL1\" = :Bool10 )", new List<SugarParameter>()
{
new SugarParameter("@Bool10",true)
new SugarParameter(":Bool10",true)
}, "whereSingle12");
}
@ -242,7 +242,7 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( \"Name\" IS NOT NULL )", new List<SugarParameter>()
base.Check(value, pars, "( \"NAME\" IS NOT NULL )", new List<SugarParameter>()
{
}, "whereSingle13");
@ -255,7 +255,7 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "(( 1 = 1 ) AND( \"Name\" IS NOT NULL ))", new List<SugarParameter>()
base.Check(value, pars, "(( 1 = 1 ) AND( \"NAME\" IS NOT NULL ))", new List<SugarParameter>()
{
}, "whereSingle14");
@ -268,9 +268,9 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( \"Money2\" = @Const0 )", new List<SugarParameter>()
base.Check(value, pars, "( \"MONEY2\" = :Const0 )", new List<SugarParameter>()
{
new SugarParameter("@Const0",1)
new SugarParameter(":Const0",1)
}, "whereSingle15");
}
@ -283,9 +283,9 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( \"String\" = @Const0 )", new List<SugarParameter>()
base.Check(value, pars, "( \"String\" = :Const0 )", new List<SugarParameter>()
{
new SugarParameter("@Const0",dic["key"])
new SugarParameter(":Const0",dic["key"])
}, "whereSingle16");
}
@ -296,9 +296,9 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "(( 1 = 1 ) AND (\"String\" like '%'+@MethodConst1+'%') )", new List<SugarParameter>()
base.Check(value, pars, "(( 1 = 1 ) AND (\"STRING\" like '%'+:MethodConst1+'%') )", new List<SugarParameter>()
{
new SugarParameter("@MethodConst1","a")
new SugarParameter(":MethodConst1","a")
}, "whereSingle17");
}
@ -309,7 +309,7 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "NOT ( \"Bool1\"=1 ) ", new List<SugarParameter>()
base.Check(value, pars, "NOT ( \"BOOL1\"=1 ) ", new List<SugarParameter>()
{
}, "whereSingle18");
@ -321,9 +321,9 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( \"Bool2\" = @Value0 )", new List<SugarParameter>()
base.Check(value, pars, "( \"BOOL2\" = :Value0 )", new List<SugarParameter>()
{
new SugarParameter("@Value0",false)
new SugarParameter(":Value0",false)
}, "whereSingle19");
}
private void whereSingle20()
@ -333,7 +333,7 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( \"Bool2\" = \"Bool1\" )", new List<SugarParameter>()
base.Check(value, pars, "( \"BOOL2\" = \"BOOL1\" )", new List<SugarParameter>()
{
}, "whereSingle19");
@ -346,7 +346,7 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( \"Bool2\"=1 )", new List<SugarParameter>()
base.Check(value, pars, "( \"BOOL2\"=1 )", new List<SugarParameter>()
{
}, "whereSingle21");
@ -359,7 +359,7 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "NOT ( \"Bool2\"=1 ) ", new List<SugarParameter>()
base.Check(value, pars, "NOT ( \"BOOL2\"=1 ) ", new List<SugarParameter>()
{
}, "whereSingle22");
@ -373,9 +373,9 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString();
var pars = expContext.Parameters;
base.Check(value, pars, "( \"Decimal2\" = @Const0 )", new List<SugarParameter>()
base.Check(value, pars, "( \"DECIMAL2\" = :Const0 )", new List<SugarParameter>()
{
new SugarParameter("@Const0",val)
new SugarParameter(":Const0",val)
}, "whereSingle23");
}
}

2
Src/Asp.Net/SqlSugar/SqlSugarClient.cs

@ -34,7 +34,7 @@ namespace SqlSugar
DependencyManagement.TrySqlite();
break;
case DbType.Oracle:
throw new Exception("Oracle developed 60%,to be continued");
break;
default:
throw new Exception("ConnectionConfig.DbType is null");
}

Loading…
Cancel
Save