Commit 37ffbd48 authored by 黄奎's avatar 黄奎

新增实体类

parent 5eeec128
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_Consultant_Goal
{
/// <summary>
/// 主键
/// </summary>
public int Id { get; set; }
/// <summary>
/// 年份
/// </summary>
public int YearStr { get; set; }
/// <summary>
/// 月份
/// </summary>
public int MonthStr { get; set; }
/// <summary>
/// 目标金额
/// </summary>
public decimal GoalMoney { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 校区编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 部门编号
/// </summary>
public int Dept_Id { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public DateStateEnum Status { 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_Consultant_Goal_Extend : RB_Consultant_Goal
{
}
}
......@@ -11,6 +11,8 @@ using Edu.Repository.DataStatistics;
using Edu.Model.ViewModel.User;
using Edu.Model.ViewModel.DataStatistics;
using Edu.Model.ViewModel.Reserve;
using VT.FW.DB;
using Edu.Common.Enum;
namespace Edu.Module.Customer
{
......@@ -59,6 +61,11 @@ namespace Edu.Module.Customer
/// </summary>
private readonly RB_Consultant_DataRepository consultant_DataRepository = new RB_Consultant_DataRepository();
/// <summary>
/// 课程顾问部目标仓储层对象
/// </summary>
private readonly RB_Consultant_GoalRepository consultant_GoalRepository = new RB_Consultant_GoalRepository();
/// <summary>
/// 清除数据
/// </summary>
......@@ -689,5 +696,87 @@ namespace Edu.Module.Customer
};
return obj;
}
#region 课程顾问部目标设置
/// <summary>
/// 获取课程顾问部目标分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Consultant_Goal_Extend> GetConsultantGoalPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Consultant_Goal_Extend query)
{
var list = consultant_GoalRepository.GetConsultantGoalPageRepository(pageIndex, pageSize, out rowsCount, query);
return list;
}
/// <summary>
/// 获取课程顾问部目标列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Consultant_Goal_Extend> GetConsultantGoalListModule(RB_Consultant_Goal_Extend query)
{
var list = consultant_GoalRepository.GetConsultantGoalListRepository(query);
return list;
}
/// <summary>
/// 新增修改课程顾问部目标
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetConsultantGoalModule(RB_Consultant_Goal_Extend model)
{
bool flag = false;
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Consultant_Goal_Extend.YearStr),model.YearStr},
{ nameof(RB_Consultant_Goal_Extend.MonthStr),model.MonthStr},
{ nameof(RB_Consultant_Goal_Extend.GoalMoney),model.GoalMoney},
};
flag = consultant_GoalRepository.Update(fileds, new WhereHelper(nameof(RB_Consultant_Goal_Extend.Id), model.Id));
}
else
{
var newId = consultant_GoalRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
return flag;
}
/// <summary>
/// 根据编号获取课程顾问部目标
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public RB_Consultant_Goal_Extend GetConsultantGoalModule(object Id)
{
var extModel = consultant_GoalRepository.GetEntity<RB_Consultant_Goal_Extend>(Id);
return extModel;
}
/// <summary>
/// 根据编号删除课程顾问部目标
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public bool RemoveConsultantGoalModule(object Id)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Consultant_Goal_Extend.Status) ,(int)DateStateEnum.Delete}
};
bool flag = consultant_GoalRepository.Update(fileds, new WhereHelper(nameof(RB_Consultant_Goal_Extend.Id), Id));
return flag;
}
#endregion
}
}
\ No newline at end of file
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;
namespace Edu.Repository.DataStatistics
{
/// <summary>
/// 课程顾问部月目标仓储层
/// </summary>
public class RB_Consultant_GoalRepository : BaseRepository<RB_Consultant_Goal>
{
/// <summary>
/// 获取课程顾问部目标分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Consultant_Goal_Extend> GetConsultantGoalPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Consultant_Goal_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append(@"
SELECT A.*
FROM RB_Consultant_Goal AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Consultant_Goal_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Consultant_Goal_Extend.Group_Id), query.Group_Id);
}
if (query.YearStr > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Consultant_Goal_Extend.YearStr), query.YearStr);
}
if (query.MonthStr > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Consultant_Goal_Extend.MonthStr), query.MonthStr);
}
}
return GetPage<RB_Consultant_Goal_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
/// <summary>
/// 获取课程顾问部目标列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Consultant_Goal_Extend> GetConsultantGoalListRepository(RB_Consultant_Goal_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append(@"
SELECT A.*
FROM RB_Consultant_Goal AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Consultant_Goal_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Consultant_Goal_Extend.Group_Id), query.Group_Id);
}
if (query.YearStr > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Consultant_Goal_Extend.YearStr), query.YearStr);
}
if (query.MonthStr > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Consultant_Goal_Extend.MonthStr), query.MonthStr);
}
}
return Get<RB_Consultant_Goal_Extend>(builder.ToString()).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