Commit caa322d9 authored by 黄奎's avatar 黄奎

新增实体类

parent 00299133
using Edu.Common.Enum;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.DataStatistics
{
/// <summary>
/// 老师考评子类型配置表实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Assessment_Subtype
{
/// <summary>
/// 教师考评子类型主键编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 教师考评类型编号
/// </summary>
public int AssessmentTypeId { get; set; }
/// <summary>
/// 子类型名称
/// </summary>
public string SubTypeName { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 删除状态(0-正常,1-禁用)
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 考评类型JSON字符串
/// </summary>
public string Options { get; set; }
/// <summary>
/// 排序
/// </summary>
public int SortNum { get; set; }
}
}
using Edu.Common.Enum;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.DataStatistics
{
/// <summary>
/// 老师考评类型配置表实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Assessment_Type
{
/// <summary>
/// 教师考评类型主键编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 考评类型名称
/// </summary>
public string TypeName { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 删除状态(0-正常,1-禁用)
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 排序
/// </summary>
public int SortNum { get; set; }
}
}
using Edu.Model.Entity.DataStatistics;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.DataStatistics
{
/// <summary>
/// 老师考评子类型配置表扩展实体类
/// </summary>
public class RB_Assessment_Subtype_Extend : RB_Assessment_Subtype
{
/// <summary>
/// 考评项目列表
/// </summary>
public List<SubtypeItem> OptionList { get; set; }
}
/// <summary>
/// 考评具体项
/// </summary>
public class SubtypeItem
{
/// <summary>
/// 等级名称
/// </summary>
public string LevelTitle { get; set; }
/// <summary>
/// 等级描述
/// </summary>
public string LevelDesc { get; set; }
/// <summary>
/// 等级得分
/// </summary>
public decimal LevelScore { get; set; }
}
}
using Edu.Model.Entity.DataStatistics;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.DataStatistics
{
/// <summary>
/// 老师考评类型配置表扩展实体类
/// </summary>
public class RB_Assessment_Type_Extend : RB_Assessment_Type
{
/// <summary>
/// 子类型列表
/// </summary>
public List<RB_Assessment_Subtype_Extend> SubtypeList { get; set; }
}
}
using Edu.Common.Enum;
using Edu.Model.ViewModel.DataStatistics;
using Edu.Repository.DataStatistics;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Module.User
{
/// <summary>
/// 老师考评类型配置处理类
/// </summary>
public class TeacherAssessmentModule
{
/// <summary>
/// 老师考评类型配置表仓储层对象
/// </summary>
private RB_Assessment_TypeRepository assessment_TypeRepository = new RB_Assessment_TypeRepository();
/// <summary>
/// 老师考评子类型配置表仓储层对象
/// </summary>
private RB_Assessment_SubtypeRepository assessment_SubtypeRepository = new RB_Assessment_SubtypeRepository();
/// <summary>
/// 新增修改老师考评类型
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetAssessmentTypeModule(RB_Assessment_Type_Extend model)
{
bool flag = false;
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Assessment_Type_Extend.TypeName),model.TypeName }
};
flag = assessment_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Assessment_Type_Extend.Id), model.Id));
}
else
{
var newId = assessment_TypeRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
return flag;
}
/// <summary>
/// 根据编号获取老师考评类型
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public RB_Assessment_Type_Extend GetAssessmentTypeModule(object Id)
{
var extModel = assessment_TypeRepository.GetEntity<RB_Assessment_Type_Extend>(Id);
return extModel;
}
/// <summary>
/// 根据编号删除老师考评类型
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public bool RemoveAssessmentTypeModule(object Id)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Assessment_Type_Extend.Status),(int)DateStateEnum.Delete }
};
bool flag = assessment_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Assessment_Type_Extend.Id), Id));
return flag;
}
}
}
using Edu.Common.Enum;
using Edu.Model.Entity.DataStatistics;
using Edu.Model.ViewModel.DataStatistics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.DataStatistics
{
/// <summary>
/// 老师考评子类型配置表仓储层
/// </summary>
public class RB_Assessment_SubtypeRepository : BaseRepository<RB_Assessment_Subtype>
{
/// <summary>
/// 获取老师考评子类型配置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Assessment_Subtype_Extend> GetAssessmentSubtypeListRepository(RB_Assessment_Subtype_Extend query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Assessment_Subtype AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Assessment_Subtype_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Assessment_Subtype_Extend.Group_Id), query.Group_Id);
}
if (query.AssessmentTypeId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Assessment_Subtype_Extend.AssessmentTypeId), query.AssessmentTypeId);
}
if (!string.IsNullOrEmpty(query.SubTypeName))
{
builder.AppendFormat(" AND A.{0} LIKE @SubTypeName ", nameof(RB_Assessment_Subtype_Extend.SubTypeName));
parameters.Add("SubTypeName", "%" + query.SubTypeName.Trim() + "%");
}
}
builder.AppendFormat(" ORDER BY A.{0} ASC ", nameof(RB_Assessment_Subtype_Extend.SortNum));
return Get<RB_Assessment_Subtype_Extend>(builder.ToString(), parameters).ToList();
}
}
}
using Edu.Common.Enum;
using Edu.Model.Entity.DataStatistics;
using Edu.Model.ViewModel.DataStatistics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.DataStatistics
{
/// <summary>
/// 老师考评类型配置表仓储层
/// </summary>
public class RB_Assessment_TypeRepository : BaseRepository<RB_Assessment_Type>
{
/// <summary>
/// 获取老师考评类型配置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Assessment_Type_Extend> GetAssessmentTypeListRepository(RB_Assessment_Type_Extend query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Assessment_Type AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Assessment_Type_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Assessment_Type_Extend.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.TypeName))
{
builder.AppendFormat(" AND A.{0} LIKE @TypeName ", nameof(RB_Assessment_Type_Extend.TypeName));
parameters.Add("TypeName", "%" + query.TypeName.Trim() + "%");
}
}
builder.AppendFormat(" ORDER BY A.{0} ASC ", nameof(RB_Assessment_Type_Extend.SortNum));
return Get<RB_Assessment_Type_Extend>(builder.ToString(), parameters).ToList();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment