using Infrastructure.Attribute;
using System.Collections.Generic;
using ZR.Model.System;
namespace ZR.Repository.System
{
///
/// 部门管理
///
[AppService(ServiceLifetime= LifeTime.Transient)]
public class SysDeptRepository : BaseRepository
{
///
///
///
///
///
public List SelectChildrenDeptById(long deptId)
{
string sql = "select * from sys_dept where find_in_set(@deptId, ancestors)";
return Context.SqlQueryable(sql).AddParameters(new { @deptId = deptId }).ToList();
}
public int UdateDeptChildren(SysDept dept)
{
return Context.Updateable(dept).UpdateColumns(it => new { it.Ancestors }).ExecuteCommand();
}
}
}