Commit 8d0dd8a0 authored by 黄奎's avatar 黄奎

新增实体类

parent e491f2da
using Edu.Common.Enum;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Web
{
/// <summary>
/// 咨询管理实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Web_Advisory
{
/// <summary>
/// 主键编号(咨询编号)
/// </summary>
public int Id { get; set; }
/// <summary>
/// 咨询类型(1-课程,2-班级,3-留学就业)
/// </summary>
public int AdvType { get; set; }
/// <summary>
/// 对应咨询类型资源编号
/// </summary>
public int SourceId { get; set; }
/// <summary>
/// 联系人
/// </summary>
public string LinkMan { get; set; }
/// <summary>
/// 联系电话
/// </summary>
public string LinkTel { get; set; }
/// <summary>
/// 备注说明
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// 创建人编号
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
}
}
using Edu.Model.Entity.Web;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Web
{
/// <summary>
/// 咨询管理视图实体类
/// </summary>
public class RB_Web_Advisory_ViewModel: RB_Web_Advisory
{
}
}
using Edu.Model.Entity.Web;
using Edu.Model.ViewModel.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Web
{
/// <summary>
/// 咨询管理仓储层
/// </summary>
public class RB_Web_AdvisoryRepository : BaseRepository<RB_Web_Advisory>
{
/// <summary>
/// 获取网站咨询分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示调试</param>
/// <param name="rowsCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Web_Advisory_ViewModel> GetWebAdvisoryPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Web_Advisory_ViewModel query)
{
rowsCount = 0;
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.Append(@"
SELECT A.*
FROM RB_Web_Advisory AS A
WHERE 1=1
");
if (query == null)
{
return new List<RB_Web_Advisory_ViewModel>();
}
else
{
if (query.Group_Id > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Web_Advisory_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.LinkMan))
{
builder.AppendFormat(" AND A.{0} LIKE @LinkMan ", nameof(RB_Web_Advisory_ViewModel.LinkMan));
parameters.Add("LinkMan", "%" + query.LinkMan.Trim() + "%");
}
if (query.Status >= 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Web_Advisory_ViewModel.Status), (int)query.Status);
}
}
return GetPage<RB_Web_Advisory_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
}
\ No newline at end of file
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