Commit 649b18d4 authored by 黄奎's avatar 黄奎

新增实体类

parent b75cd44b
using System;
using VT.FW.DB;
namespace Mall.Model.Entity.Product
{
/// <summary>
/// 商品评论标签实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Comment_Label
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 标签名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 商户号
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// CreateDate
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// UpdateDate
/// </summary>
public DateTime UpdateDate { get; set; }
}
}
using Mall.Model.Entity.Product;
namespace Mall.Model.Extend.Product
{
/// <summary>
/// 商品评论标签扩展实体类
/// </summary>
public class RB_Comment_Label_Extend: RB_Comment_Label
{
}
}
using Mall.Model.Entity.Product;
using Mall.Model.Extend.Product;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mall.Repository.Product
{
/// <summary>
/// 商品评论标签仓储层
/// </summary>
public class RB_Comment_LabelRepository : BaseRepository<RB_Comment_Label>
{
/// <summary>
/// 获取评论标签分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="totalCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Comment_Label_Extend> GetCommentLabelPageRepository(int pageIndex, int pageSize, out long totalCount, RB_Comment_Label_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Comment_Label AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Comment_Label_Extend.Status), 0);
if (query != null)
{
if (query.TenantId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Comment_Label_Extend.TenantId), query.TenantId);
}
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Comment_Label_Extend.MallBaseId), query.MallBaseId);
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Comment_Label_Extend.Id));
return GetPage<RB_Comment_Label_Extend>(pageIndex, pageSize, out totalCount, builder.ToString()).ToList();
}
/// <summary>
/// 获取评论标签列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Comment_Label_Extend> GetCommentLabelListRepository(RB_Comment_Label_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Comment_Label AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Comment_Label_Extend.Status), 0);
if (query != null)
{
if (query.TenantId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Comment_Label_Extend.TenantId), query.TenantId);
}
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Comment_Label_Extend.MallBaseId), query.MallBaseId);
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Comment_Label_Extend.Id));
return Get<RB_Comment_Label_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