diff --git a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj index 1a8546c0c..8f2bea4bf 100644 --- a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj +++ b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj @@ -95,6 +95,11 @@ + + + + + diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs b/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs index 3b6a8c32e..a4fefa460 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/Main.cs @@ -31,6 +31,7 @@ namespace OrmTest } public static void Init() { + UCustom023.Init(); UCustom22.Init(); UByteArray.Init(); UCustom021.Inti(); diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/Models/DSPersonScheduleModel.cs b/Src/Asp.Net/SqlServerTest/UnitTest/Models/DSPersonScheduleModel.cs new file mode 100644 index 000000000..78b9a5202 --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/UnitTest/Models/DSPersonScheduleModel.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ICrewApi.Models +{ + public class DSPersonScheduleModel + { + public string AC_REG { get; set; } + public string AC_TYPE { get; set; } + public string ARRIVAL_AIRPORT { get; set; } + public DateTime ATA { get; set; } + public DateTime ATD { get; set; } + public long CREW_LINK_LINE { get; set; } + public long CREW_PAIRING_LINE { get; set; } + public string DDO_CODE { get; set; } + public string DEPARTURE_AIRPORT { get; set; } + public string D_OR_I { get; set; } + public string FLIGHT_COM { get; set; } + public long FLIGHT_ID { get; set; } + public string FLIGHT_VOYAGE { get; set; } + public DateTime FROM_DATE { get; set; } + public string MODIFY_REASON { get; set; } + public string PAIRINGVOYAGE { get; set; } + public string P_CODE { get; set; } + public string RANK_NO { get; set; } + public string REASON { get; set; } + public string SCHEDULE_TYPE { get; set; } + public DateTime TA { get; set; } + public DateTime TD { get; set; } + public DateTime TIME_FROM_PORT { get; set; } + public DateTime TIME_TO_PORT { get; set; } + public DateTime TO_DATE { get; set; } + + public string FLG_CS { get; set; } + public string REMARKS { get; set; } + + public int FLY_HOURS { get; set; } + /// + /// 前车时间 + /// + public short? PREVIOUS_RIDE_TIME { set; get; } + /// + /// 后车程时间 + /// + public short? REAR_RIDE_TIME { set; get; } + public string DEPA_AIRPORT { get; set; } + public string DEPA_NATIVE { get; set; } + public int DEPA_RESTTIME { get; set; } + public int DEPA_ZONE_TIME { get; set; } + /// + /// 起飞机场类别 + /// + public string DEPA_TYPE { get; set; } + /// + /// 落地机场类别 + /// + public string ARRI_TYPE { get; set; } + public string ARRI_AIRPORT { get; set; } + public string ARRI_NATIVE { get; set; } + public int ARRI_RESTTIME { get; set; } + public int ARRI_ZONE_TIME { get; set; } + } + +} diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/Models/PersonScheduleParam.cs b/Src/Asp.Net/SqlServerTest/UnitTest/Models/PersonScheduleParam.cs new file mode 100644 index 000000000..91d59f474 --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/UnitTest/Models/PersonScheduleParam.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ICrewApi.Models +{ + public class PersonScheduleParam + { + public List P_CODE { get; set; } + public DateTime STARTDATE { get; set; } + public DateTime ENDDATE { get; set; } + public string MODULEFLAG { get; set; } + } +} diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/Models/T_BAS_AIRPORT.cs b/Src/Asp.Net/SqlServerTest/UnitTest/Models/T_BAS_AIRPORT.cs new file mode 100644 index 000000000..6cbbc7c4f --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/UnitTest/Models/T_BAS_AIRPORT.cs @@ -0,0 +1,553 @@ +using System; +using System.Linq; +using System.Text; +using SqlSugar; + +namespace ICrewApi.Entity +{ + /// + ///机场信息 + /// + [SugarTable("T_BAS_AIRPORT")] + public partial class T_BAS_AIRPORT + { + public T_BAS_AIRPORT(){ + + + } + /// + /// Desc:机场四码 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey=true)] + public string AIRPORT_4CODE {get;set;} + + /// + /// Desc:机场三字码 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey=true)] + public string AIRPORT_3CODE {get;set;} + + /// + /// Desc:机场中文名称 + /// Default: + /// Nullable:True + /// + public string CHINESE_NAME {get;set;} + + /// + /// Desc:机场英文名称 + /// Default: + /// Nullable:True + /// + public string ENGLISH_NAME {get;set;} + + /// + /// Desc:机场中文简称 + /// Default: + /// Nullable:True + /// + public string CHINESE_ABBR {get;set;} + + /// + /// Desc:所在城市三字码 + /// Default: + /// Nullable:True + /// + public string CITY_3CODE {get;set;} + + /// + /// Desc:所在城市中文名称 + /// Default: + /// Nullable:True + /// + public string CITY_CH_NAME {get;set;} + + /// + /// Desc:国际/国内(D国内I国际R地区) + /// Default: + /// Nullable:True + /// + public string D_OR_I {get;set;} + + /// + /// Desc:国家(字典) + /// Default: + /// Nullable:True + /// + public string NATIVE {get;set;} + + /// + /// Desc:时差 + /// Default: + /// Nullable:True + /// + public short? ZONE_TIME {get;set;} + + /// + /// Desc:飞行标准报道时间 + /// Default: + /// Nullable:True + /// + public short? IN_TIME {get;set;} + + /// + /// Desc:飞行标准离场时间 + /// Default: + /// Nullable:True + /// + public short? OUT_TIME {get;set;} + + /// + /// Desc:报务区域(字典)X + /// Default: + /// Nullable:True + /// + public string RADIO_AREA {get;set;} + + /// + /// Desc:是否外籍可飞(Y/N)X + /// Default: + /// Nullable:True + /// + public string FOREIGN_YN {get;set;} + + /// + /// Desc:是否有休息场所(Y/N) + /// Default: + /// Nullable:True + /// + public string REST_YN {get;set;} + + /// + /// Desc:ICAO(3,4,5,6,7,8级) + /// Default: + /// Nullable:True + /// + public short? A_ICAO {get;set;} + + /// + /// Desc:机场类型(1类2类3类=特殊、高原、高高原) + /// Default: + /// Nullable:True + /// + public string A_CLS {get;set;} + + /// + /// Desc:机场有效月数 + /// Default: + /// Nullable:True + /// + public short? A_CLS_CYCLE {get;set;} + + /// + /// Desc:机场仪表等级(CAT-I CAT-II RVR) + /// Default: + /// Nullable:True + /// + public string A_CATS {get;set;} + + /// + /// Desc:程序方式-传统,RNP-AR + /// Default: + /// Nullable:True + /// + public string A_RNPAR {get;set;} + + /// + /// Desc:长跑道/L 短跑道/S + /// Default: + /// Nullable:True + /// + public string A_RAILWAY {get;set;} + + /// + /// Desc:操作人 + /// Default: + /// Nullable:True + /// + public string OPER {get;set;} + + /// + /// Desc:操作时间 + /// Default: + /// Nullable:True + /// + public DateTime? OP_TIME {get;set;} + + /// + /// Desc:备注 + /// Default: + /// Nullable:True + /// + public string REMARKS {get;set;} + + /// + /// Desc:IP地址 + /// Default: + /// Nullable:True + /// + public string OPER_IP {get;set;} + + /// + /// Desc:主机名 + /// Default: + /// Nullable:True + /// + public string OPER_HOST {get;set;} + + /// + /// Desc:特殊机场放飞 + /// Default: + /// Nullable:True + /// + public string SPECIAL_YN {get;set;} + + /// + /// Desc:报务机场放飞X + /// Default: + /// Nullable:True + /// + public string RADIO_YN {get;set;} + + /// + /// Desc:外站值班人 + /// Default: + /// Nullable:True + /// + public string DUTY_PERSON {get;set;} + + /// + /// Desc:外站值班电话 + /// Default: + /// Nullable:True + /// + public string DUTY_TEL {get;set;} + + /// + /// Desc:长航线Y/N + /// Default: + /// Nullable:True + /// + public string A_DISTANCE {get;set;} + + /// + /// Desc:机长单飞区域(字典)X + /// Default: + /// Nullable:True + /// + public string CAPT_AREA {get;set;} + + /// + /// Desc:是否需要提前报备 + /// Default: + /// Nullable:True + /// + public string CERT_YN {get;set;} + + /// + /// Desc:开车时间 + /// Default: + /// Nullable:True + /// + public short? CAR_TIME {get;set;} + + /// + /// Desc:特殊机场适用分公司串 + /// Default: + /// Nullable:True + /// + public string SPECIAL_FILIALES {get;set;} + + /// + /// Desc:休息时间(分钟) + /// Default: + /// Nullable:True + /// + public short? RESTTIME {get;set;} + + /// + /// Desc:特殊机场放飞所属分公司 + /// Default: + /// Nullable:True + /// + public string SPECIAL_OWNER {get;set;} + + /// + /// Desc:领取武器包 + /// Default: + /// Nullable:True + /// + public string WEAPONS_YN {get;set;} + + /// + /// Desc:是否空警特殊机场 + /// Default: + /// Nullable:True + /// + public string SPECIAL_POLIC {get;set;} + + /// + /// Desc:机场类别 1:一类高原 2:二类高原 3:三类高原 ,来自t7501 + /// Default: + /// Nullable:True + /// + public string AIRPORT_TYPE {get;set;} + + /// + /// Desc:机场类别:4:港澳地区 5:台湾地区 6:日韩地区 7:东南亚地区 8:其他国际地区,来自t7501 + /// Default: + /// Nullable:True + /// + public string AIRPORT_I {get;set;} + + /// + /// Desc:是否双机长航线 + /// Default: + /// Nullable:False + /// + public string TWIN_CAPTAIN_YN {get;set;} + + /// + /// Desc:是否支持任务书打印 + /// Default: + /// Nullable:False + /// + public string FTBPRINT {get;set;} + + /// + /// Desc:机场可飞机型(飞管使用) + /// Default: + /// Nullable:True + /// + public string AC_TYPES {get;set;} + + /// + /// Desc:有值代表为带飞对标机场,如些机场带队,则其他相同类型的机场的带飞标准设置为此字段值 + /// Default: + /// Nullable:True + /// + public decimal? FNUMBER {get;set;} + + /// + /// Desc:飞行标准进场时间 + /// Default: + /// Nullable:True + /// + public short? REPORT_TIME {get;set;} + + /// + /// Desc:飞行标准前车程时间 + /// Default: + /// Nullable:True + /// + public short? PREVIOUS_RIDE_TIME_F {get;set;} + + /// + /// Desc:飞行标准后车程时间 + /// Default: + /// Nullable:True + /// + public short? REAR_RIDE_TIME_F {get;set;} + + /// + /// Desc:乘务标准报道时间 + /// Default: + /// Nullable:True + /// + public short? IN_TIME_C {get;set;} + + /// + /// Desc:乘务标准进场时间 + /// Default: + /// Nullable:True + /// + public short? REPORT_TIME_C {get;set;} + + /// + /// Desc:乘务标准离场时间 + /// Default: + /// Nullable:True + /// + public short? OUT_TIME_C {get;set;} + + /// + /// Desc:乘务标准前车程时间 + /// Default: + /// Nullable:True + /// + public short? PREVIOUS_RIDE_TIME_C {get;set;} + + /// + /// Desc:乘务标准后车程时间 + /// Default: + /// Nullable:True + /// + public short? REAR_RIDE_TIME_C {get;set;} + + /// + /// Desc:空警标准报道时间 + /// Default: + /// Nullable:True + /// + public short? IN_TIME_A {get;set;} + + /// + /// Desc:空警标准进场时间 + /// Default: + /// Nullable:True + /// + public short? REPORT_TIME_A {get;set;} + + /// + /// Desc:空警标准离场时间 + /// Default: + /// Nullable:True + /// + public short? OUT_TIME_A {get;set;} + + /// + /// Desc:空警标准前车程时间 + /// Default: + /// Nullable:True + /// + public short? PREVIOUS_RIDE_TIME_A {get;set;} + + /// + /// Desc:空警标准后车程时间 + /// Default: + /// Nullable:True + /// + public short? REAR_RIDE_TIME_A {get;set;} + + /// + /// Desc:飞行标准前车程时间2 + /// Default: + /// Nullable:True + /// + public short? PREVIOUS_RIDE_TIME_F2 {get;set;} + + /// + /// Desc:飞行标准后车程时间2 + /// Default: + /// Nullable:True + /// + public short? REAR_RIDE_TIME_F2 {get;set;} + + /// + /// Desc:货机标准报道时间 + /// Default: + /// Nullable:False + /// + public short IN_TIME_H {get;set;} + + /// + /// Desc:货机标准进场时间 + /// Default: + /// Nullable:False + /// + public short REPORT_TIME_H {get;set;} + + /// + /// Desc:货机标准离场时间 + /// Default: + /// Nullable:False + /// + public short OUT_TIME_H {get;set;} + + /// + /// Desc:货机标准前车程时间 + /// Default: + /// Nullable:False + /// + public short PREVIOUS_RIDE_TIME_H {get;set;} + + /// + /// Desc:货机标准后车程时间 + /// Default: + /// Nullable:False + /// + public short REAR_RIDE_TIME_H {get;set;} + + /// + /// Desc:货机标准前车程时间2 + /// Default: + /// Nullable:False + /// + public short PREVIOUS_RIDE_TIME_H2 {get;set;} + + /// + /// Desc:货机标准后车程时间2 + /// Default: + /// Nullable:False + /// + public short REAR_RIDE_TIME_H2 {get;set;} + + /// + /// Desc:乘务标准国际报道时间 + /// Default: + /// Nullable:True + /// + public short? IN_TIME_C_I {get;set;} + + /// + /// Desc:空保标准国际报道时间 + /// Default: + /// Nullable:True + /// + public short? IN_TIME_A_I {get;set;} + + /// + /// Desc:日出裕度 + /// Default: + /// Nullable:True + /// + public short? UP_MARGIN {get;set;} + + /// + /// Desc:日落裕度 + /// Default: + /// Nullable:True + /// + public short? DOWN_MARGIN {get;set;} + + /// + /// Desc:是否一般高原机场 + /// Default: + /// Nullable:True + /// + public string IS_YBGY_YN {get;set;} + + /// + /// Desc:是否不校验夜航规则 + /// Default: + /// Nullable:True + /// + public string IS_NO_CHECK_NIGHTAIR {get;set;} + + /// + /// Desc:是否一般高原机场备注 + /// Default: + /// Nullable:True + /// + public string IS_YBGY_YN_REMARK {get;set;} + + /// + /// Desc:是否不校验夜航规则备注 + /// Default: + /// Nullable:True + /// + public string IS_NO_NIGHTAIR_REMARK {get;set;} + + /// + /// Desc:标识特殊机场(Y-是,N-否)-飞管用 + /// Default: + /// Nullable:True + /// + public string SPECIAL_FLAG {get;set;} + + } +} diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/Models/V_PERSON_SCHEDULE_A.cs b/Src/Asp.Net/SqlServerTest/UnitTest/Models/V_PERSON_SCHEDULE_A.cs new file mode 100644 index 000000000..06941aff3 --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/UnitTest/Models/V_PERSON_SCHEDULE_A.cs @@ -0,0 +1,301 @@ +using System; +using System.Linq; +using System.Text; +using SqlSugar; + +namespace ICrewApi.Entity +{ + /// + /// + /// + [SugarTable("V_PERSON_SCHEDULE_A")] + public partial class V_PERSON_SCHEDULE_A + { + public V_PERSON_SCHEDULE_A(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(SqlParameterDbType = System.Data.DbType.Date)] + public DateTime? FROM_DATE {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + [SugarColumn(SqlParameterDbType = System.Data.DbType.Date)] + public DateTime? TO_DATE {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public decimal? ACTION_FLY_HOURS {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public decimal? CREW_ID {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public decimal? CREW_IDR5 {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string AC_TYPE {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string AC_REG {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string FLIGHT_COM {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string FLIGHT_VOYAGE {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string PAIRINGVOYAGE {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public decimal? FLIGHT_ID {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public decimal? CREW_LINK_LINE {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public decimal? FLY_HOURS {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public decimal? CAR_TIME {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? TIME_TO_PORT {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? TD {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? TA {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? ATD {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? ATA {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? TIME_FROM_PORT {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string DEPARTURE_AIRPORT {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string ARRIVAL_AIRPORT {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string FILIALE {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string REASON {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string P_CODE {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string MODIFY_REASON {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string DDO_CODE {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string RANK_NO {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string MODULE_FLAG {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string SCHEDULE_TYPE {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string VALID_FLAG {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string REMARKS {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string OPERNAME {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public DateTime? OPERTIME {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string WORK_NO {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public decimal? CREW_PAIRING_LINE {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string D_OR_I {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string HOME_BASE {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string PREPARE_NET {get;set;} + + /// + /// Desc: + /// Default: + /// Nullable:True + /// + public string FLG_CS {get;set;} + + } +} diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UCustom023.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UCustom023.cs new file mode 100644 index 000000000..294ab00af --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UCustom023.cs @@ -0,0 +1,40 @@ +using ICrewApi.Entity; +using ICrewApi.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrmTest +{ + public class UCustom023 + { + public static List Init() + { + PersonScheduleParam personScheduleParam = new PersonScheduleParam() + { + ENDDATE=DateTime.Now, + STARTDATE=DateTime.Now, + } ; + List result = new List(); + try + { + var result1 =NewUnitTest.Db.Queryable() + .LeftJoin((ps, sa) => ps.DEPARTURE_AIRPORT == sa.AIRPORT_3CODE) + .LeftJoin((ps, sa, sb) => ps.ARRIVAL_AIRPORT == sb.AIRPORT_3CODE) + .Where(ps => personScheduleParam.P_CODE.Contains(ps.P_CODE) && ps.FROM_DATE <= personScheduleParam.ENDDATE && ps.TO_DATE >= personScheduleParam.STARTDATE) + .ToSql(); + if (result1.Value.First().DbType != System.Data.DbType.Date) + { + throw new Exception("unit error"); + } + } + catch (Exception ex) + { + + } + return result; + } + } +}