Commit 3ff13040 authored by liudong1993's avatar liudong1993

1

parent 9ab065d9
using VT.FW.DB;
using Mall.Common.Enum.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.Assess
{
/// <summary>
/// 估价品牌实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Assess_Brand
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 分类ID
/// </summary>
public int CategoryId { get; set; }
/// <summary>
/// 品牌名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 品牌图标
/// </summary>
public string Logo { get; set; }
/// <summary>
/// 用于排序
/// </summary>
public string PinYin { get; set; }
/// <summary>
/// 是否热门 1是
/// </summary>
public int IsHot { get; set; }
/// <summary>
/// 三组图 (json格式)
/// </summary>
public string BrandImg { get; set; }
/// <summary>
/// Status
/// </summary>
public int Status { get; set; }
/// <summary>
/// 商户号
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateDate { get; set; }
/// <summary>
/// 更多描述
/// </summary>
public string MoreDesc { get; set; }
/// <summary>
/// 备注描述
/// </summary>
public string RemarkDesc { get; set; }
}
}
using VT.FW.DB;
using Mall.Common.Enum.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.Assess
{
/// <summary>
/// 估价分类实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Assess_Category
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 分类名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 图片地址
/// </summary>
public string Image { get; set; }
/// <summary>
/// 启用状态 1是 2否
/// </summary>
public int Enable { get; set; }
/// <summary>
/// Status
/// </summary>
public int Status { get; set; }
/// <summary>
/// 商户号
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateDate { get; set; }
}
}
using VT.FW.DB;
using Mall.Common.Enum.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.Assess
{
/// <summary>
/// 估价商品实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Assess_Goods
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 分类ID
/// </summary>
public int CategoryId { get; set; }
/// <summary>
/// 品牌ID
/// </summary>
public int BrandId { get; set; }
/// <summary>
/// EmpId
/// </summary>
public int EmpId { get; set; }
/// <summary>
/// 三组图 (json格式)
/// </summary>
public string GoodsImg { get; set; }
/// <summary>
/// 更多图片 Json格式
/// </summary>
public string MoreImg { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 回复
/// </summary>
public string ReplyContent { get; set; }
/// <summary>
/// Status
/// </summary>
public int Status { get; set; }
/// <summary>
/// 商户号
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateDate { get; set; }
}
}
using VT.FW.DB;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Assess;
namespace Mall.Model.Extend.Assess
{
/// <summary>
/// 估价品牌扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Assess_Brand_Extend : RB_Assess_Brand
{
/// <summary>
/// 组图列表
/// </summary>
public List<AssessBrandImg> BrandImgList { get; set; }
}
public class AssessBrandImg {
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
/// <summary>
/// 图片标题
/// </summary>
public string Name { get; set; }
/// <summary>
/// 图片地址
/// </summary>
public string Path { get; set; }
}
}
using VT.FW.DB;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Assess;
namespace Mall.Model.Extend.Assess
{
/// <summary>
/// 估价分类扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Assess_Category_Extend : RB_Assess_Category
{
}
}
using VT.FW.DB;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Assess;
namespace Mall.Model.Extend.Assess
{
/// <summary>
/// 估价商品扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Assess_Goods_Extend : RB_Assess_Goods
{
/// <summary>
/// 商品图
/// </summary>
public List<AssessBrandImg> GoodsImgList { get; set; }
/// <summary>
/// 更多图
/// </summary>
public List<AssessBrandImg> MoreImgList { get; set; }
/// <summary>
/// 是否回复 1已回复 2未回复
/// </summary>
public int IsReply { get; set; }
/// <summary>
/// 用户昵称
/// </summary>
public string EmpName { get; set; }
/// <summary>
/// 用户头像
/// </summary>
public string EmpPhoto { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Assess;
using Mall.Model.Extend.Assess;
using System.Linq;
using VT.FW.DB.Dapper;
namespace Mall.Repository.Assess
{
/// <summary>
/// 估价品牌仓储层
/// </summary>
public class RB_Assess_BrandRepository : BaseRepository<RB_Assess_Brand>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Assess_Brand_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Assess_Brand_Extend dmodel)
{
var parameters = new DynamicParameters();
string where = $" 1=1 and e.{nameof(RB_Assess_Brand_Extend.Status)}=0 ";
if (dmodel.TenantId > 0) {
where += $@" and e.{nameof(RB_Assess_Brand_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and e.{nameof(RB_Assess_Brand_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.CategoryId > 0)
{
where += $@" and e.{nameof(RB_Assess_Brand_Extend.CategoryId)} ={dmodel.CategoryId}";
}
if (dmodel.IsHot > 0)
{
where += $@" and e.{nameof(RB_Assess_Brand_Extend.IsHot)} ={dmodel.IsHot}";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and e.{nameof(RB_Assess_Brand_Extend.Name)} like @Name";
parameters.Add("Name", "%" + dmodel.Name + "%");
}
string sql = $@"select * from RB_Assess_Brand e where {where} order by e.Id desc";
return GetPage<RB_Assess_Brand_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Assess_Brand_Extend> GetList(RB_Assess_Brand_Extend dmodel)
{
var parameters = new DynamicParameters();
string where = $" 1=1 and e.{nameof(RB_Assess_Brand_Extend.Status)}=0 ";
if (dmodel.TenantId > 0)
{
where += $@" and e.{nameof(RB_Assess_Brand_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and e.{nameof(RB_Assess_Brand_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.CategoryId > 0)
{
where += $@" and e.{nameof(RB_Assess_Brand_Extend.CategoryId)} ={dmodel.CategoryId}";
}
if (dmodel.IsHot > 0)
{
where += $@" and e.{nameof(RB_Assess_Brand_Extend.IsHot)} ={dmodel.IsHot}";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and e.{nameof(RB_Assess_Brand_Extend.Name)} like @Name";
parameters.Add("Name", "%" + dmodel.Name + "%");
}
string sql = $@"select * from RB_Assess_Brand e where {where} order by e.Id desc";
return Get<RB_Assess_Brand_Extend>(sql).ToList();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Assess;
using Mall.Model.Extend.Assess;
using System.Linq;
namespace Mall.Repository.Assess
{
/// <summary>
/// 估价分类仓储层
/// </summary>
public class RB_Assess_CategoryRepository : BaseRepository<RB_Assess_Category>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Assess_Category_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Assess_Category_Extend dmodel)
{
string where = $" 1=1 and e.{nameof(RB_Assess_Category_Extend.Status)}=0 ";
if (dmodel.TenantId > 0) {
where += $@" and e.{nameof(RB_Assess_Category_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and e.{nameof(RB_Assess_Category_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Enable > 0)
{
where += $@" and e.{nameof(RB_Assess_Category_Extend.Enable)} ={dmodel.Enable}";
}
if (dmodel.Id > 0)
{
where += $@" and e.{nameof(RB_Assess_Category_Extend.Id)} ={dmodel.Id}";
}
string sql = $@"select * from RB_Assess_Category e where {where} order by e.Id desc";
return GetPage<RB_Assess_Category_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Assess_Category_Extend> GetList(RB_Assess_Category_Extend dmodel)
{
string where = $" 1=1 and e.{nameof(RB_Assess_Category_Extend.Status)}=0 ";
if (dmodel.TenantId > 0)
{
where += $@" and e.{nameof(RB_Assess_Category_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and e.{nameof(RB_Assess_Category_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Enable > 0)
{
where += $@" and e.{nameof(RB_Assess_Category_Extend.Enable)} ={dmodel.Enable}";
}
if (dmodel.Id > 0)
{
where += $@" and e.{nameof(RB_Assess_Category_Extend.Id)} ={dmodel.Id}";
}
string sql = $@"select * from RB_Assess_Category e where {where} order by e.Id desc";
return Get<RB_Assess_Category_Extend>(sql).ToList();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Assess;
using Mall.Model.Extend.Assess;
using System.Linq;
namespace Mall.Repository.Assess
{
/// <summary>
/// 估价商品仓储层
/// </summary>
public class RB_Assess_GoodsRepository : BaseRepository<RB_Assess_Goods>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Assess_Goods_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Assess_Goods_Extend dmodel)
{
string where = $" 1=1 and e.{nameof(RB_Assess_Goods_Extend.Status)}=0 ";
if (dmodel.TenantId > 0) {
where += $@" and e.{nameof(RB_Assess_Goods_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and e.{nameof(RB_Assess_Goods_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.CategoryId > 0)
{
where += $@" and e.{nameof(RB_Assess_Goods_Extend.CategoryId)} ={dmodel.CategoryId}";
}
if (dmodel.BrandId > 0)
{
where += $@" and e.{nameof(RB_Assess_Goods_Extend.BrandId)} ={dmodel.BrandId}";
}
if (dmodel.EmpId > 0)
{
where += $@" and e.{nameof(RB_Assess_Goods_Extend.EmpId)} ={dmodel.EmpId}";
}
if (dmodel.IsReply == 1)
{
where += $" and IFNULL(e.{nameof(RB_Assess_Goods_Extend.ReplyContent)},'') <>''";
}
else if (dmodel.IsReply == 2) {
where += $" and IFNULL(e.{nameof(RB_Assess_Goods_Extend.ReplyContent)},'') =''";
}
string sql = $@"select e.*,u.Name as EmpName,u.Photo as EmpPhoto from RB_Assess_Goods e
inner join rb_member_user u on e.EmpId = u.Id
where {where} order by e.Id desc";
return GetPage<RB_Assess_Goods_Extend>(pageIndex, pageSize, out rowCount, sql).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