fix issue #I3W5YR

This commit is contained in:
yubaolee 2021-06-18 16:53:28 +08:00
parent 8608ce78f5
commit 7893fe3024
3 changed files with 7 additions and 7 deletions

View File

@ -27,12 +27,12 @@ namespace OpenAuth.App
/// 按id批量删除
/// </summary>
/// <param name="ids"></param>
public void Delete(long[] ids)
public void Delete(decimal[] ids)
{
Repository.Delete(u => ids.Contains(u.Id));
}
public T Get(long id)
public T Get(decimal id)
{
return Repository.FirstOrDefault(u => u.Id == id);
}

View File

@ -275,7 +275,7 @@ namespace OpenAuth.App
{
throw new Exception($"未能找到表{sysTableInfo.TableName}的主键字段");
}
if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numberic") //是否为数字
if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numeric") //是否为数字
{
if(primarykey.IsIncrement) //是否自增
{
@ -386,7 +386,7 @@ namespace OpenAuth.App
{
throw new Exception($"未能找到表{sysTableInfo.TableName}的主键字段");
}
if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numberic") //是否为数字
if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numeric") //是否为数字
{
if(primarykey.IsIncrement) //是否自增
{
@ -394,7 +394,7 @@ namespace OpenAuth.App
}
else //普通的雪花算法生成id
{
domainContent = domainContent.Replace("{KeyTypeName}", "long");
domainContent = domainContent.Replace("{KeyTypeName}", "decimal");
}
}
else
@ -458,7 +458,7 @@ namespace OpenAuth.App
{
throw new Exception($"未能找到表{tableInfo.TableName}的主键字段");
}
if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numberic") //是否为数字
if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numeric") //是否为数字
{
if(primarykey.IsIncrement) //是否自增
{

View File

@ -10,7 +10,7 @@ namespace OpenAuth.Repository.Core
public class LongEntity :BaseEntity
{
[Browsable(false)]
public long Id { get; set; }
public decimal Id { get; set; }
public override bool KeyIsNull()
{
return Id == 0;