Skip to content
Permalink
Browse files

- 优化 ReadAnonymous 映射类型不一致的容错;

  • Loading branch information
28810 28810
28810 authored and 28810 committed Nov 29, 2019
1 parent bfed0cd commit 27f053f00be75d9dc4eaeb9eced659f3fe181658

Some generated files are not rendered by default. Learn more.

@@ -0,0 +1,79 @@
using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace kwlib
{
/// <summary>
/// 部门表
/// </summary>
[Serializable]
[Index("部门代码deptcode唯一", "deptcode", true)]
public class department
{
/// <summary>
/// 部门ID
/// </summary>
[Column(IsPrimary = true, IsIdentity = true)]
public int id { get; set; }

/// <summary>
/// 员工列表 对应employee.deptid
/// </summary>
[Navigate("deptid")]
public List<employee> Employees { get; set; }

/// <summary>
/// 上级部门ID
/// </summary>
public int? supdeptid { get; set; }
/// <summary>
/// 上级部门对象
/// </summary>
[Navigate("supdeptid")]
public department parentdepartments { get; set; }

/// <summary>
/// 部门主管ID
/// </summary>
public int? managerid { get; set; }
/// <summary>
/// 部门主管对象
/// </summary>
[Navigate("managerid")]
public employee manager { get; set; }


/// <summary>
/// 下级部门列表
/// </summary>
[Navigate("supdeptid")]
public List<department> childDepartments { get; set; }


[Navigate(ManyToMany = typeof(department_employee))]
public List<employee> employees22 { get; set; }


#region MyRegion
/// <summary>
/// 部门代码
/// </summary>
public string deptcode { get; set; }

/// <summary>
/// 部门名称
/// </summary>
public string deptname { get; set; }
#endregion




}

}
@@ -0,0 +1,20 @@
using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace kwlib
{
public class department_employee
{
public int departmentId { get; set; }
public int employeeId { get; set; }

[Navigate("departmentId")]
public department dept { get; set; }
[Navigate("employeeId")]
public employee empe { get; set; }
}
}
@@ -0,0 +1,171 @@
using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace kwlib
{
/// <summary>
/// 员工表
/// </summary>
[Serializable]
[Index("员工代码empcode唯一", "empcode", true)]
public class employee
{


/// <summary>
/// 员工ID
/// </summary>
[Column(IsPrimary = true, IsIdentity = true)]
[System.ComponentModel.DisplayName("员工ID ")]
public int id { get; set; }

[System.ComponentModel.DisplayName("上级主管ID")]
/// <summary>
/// 上级主管ID
/// </summary>
public int? managerid { get; set; }
/// <summary>
/// 上级主管对象
/// </summary>
[Navigate("managerid")]
public employee parentManager { get; set; }

/// <summary>
/// 下级员工列表
/// </summary>
[Navigate("managerid")]
public List<employee> Employees { get; set; }


[Navigate(ManyToMany = typeof(department_employee))]
public List<department> departments { get; set; }

[System.ComponentModel.DisplayName("部门ID ")]
/// <summary>
/// 部门ID
/// </summary>
public int? deptid { get; set; }
/// <summary>
/// 部门对象
/// </summary>
[Navigate("deptid")]
public department Department { get; set; }



[System.ComponentModel.DisplayName("员工工号")]
/// <summary>
/// 员工工号
/// </summary>
public String empcode { get; set; }



[System.ComponentModel.DisplayName("员工姓名")]
/// <summary>
/// 员工姓名
/// </summary>
public String empname { get; set; }


[System.ComponentModel.DisplayName("地址")]
/// <summary>
/// 地址
/// </summary>
public String address { get; set; }


[System.ComponentModel.DisplayName("工卡ID ")]
/// <summary>
/// 工卡ID
/// </summary>

public String cardid { get; set; }


[System.ComponentModel.DisplayName("邮件地址 ")]
/// <summary>
/// 邮件地址
/// </summary>

public String email { get; set; }


[System.ComponentModel.DisplayName("合同日期")]
/// <summary>
/// 合同日期
/// </summary>

public DateTime? hetongdate { get; set; }


[System.ComponentModel.DisplayName("籍贯")]
/// <summary>
/// 籍贯
/// </summary>

public String homeaddress { get; set; }


[System.ComponentModel.DisplayName("入职时间")]
/// <summary>
/// 入职时间
/// </summary>

public DateTime jointime { get; set; }


[System.ComponentModel.DisplayName("离职日期")]
/// <summary>
/// 离职日期
/// </summary>
public DateTime? leavedate { get; set; }


[System.ComponentModel.DisplayName("登录密码")]
/// <summary>
/// 登录密码
/// </summary>
public String loginpass { get; set; }



[System.ComponentModel.DisplayName("电话")]
/// <summary>
/// 电话
/// </summary>
public String phone { get; set; }


[System.ComponentModel.DisplayName("相片地址")]
/// <summary>
/// 相片地址
/// </summary>

public String picurl { get; set; }



[System.ComponentModel.DisplayName("身份证")]
/// <summary>
/// 身份证
/// </summary>

public String sfz { get; set; }


}









}
@@ -798,9 +798,15 @@ public void AsTable()
};
var query = select.LeftJoin(a => a.Type.Guid == a.TypeGuid).AsTable(tableRule).AsTable(tableRule2);
var sql = query.ToSql();
var sql2 = query.ToSql("count(1)");
var count2 = query.ToList<int>("count(1)");



query = select.AsTable((type, oldname) => "table_1").AsTable((type, oldname) => "table_2").AsTable((type, oldname) => "table_3");
sql = query.ToSql(a => a.Id);
sql2 = query.ToSql("count(1)");
count2 = query.ToList<int>("count(1)");


//����е�������a.Type��a.Type.Parent ���ǵ�������

0 comments on commit 27f053f

Please sign in to comment.
You can’t perform that action at this time.