Commit 64c1bf01 authored by 吴春's avatar 吴春

提交

parent 60445506
using Mall.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Common.Enum.GuideCar
{
public enum CarClassEnum
{
/// <summary>
/// 新能源
/// </summary>
[EnumField("新能源")]
NewEnergy = 1,
/// <summary>
/// 微型
/// </summary>
[EnumField("微型")]
Miniature = 2,
/// <summary>
/// 小型
/// </summary>
[EnumField("小型")]
SmallScale = 3,
/// <summary>
/// 紧凑型
/// </summary>
[EnumField("紧凑型")]
Compact = 4,
/// <summary>
/// 中型
/// </summary>
[EnumField("中型")]
MediumSized = 5,
/// <summary>
/// 中大型
/// </summary>
[EnumField("中大型")]
MediumLargeScale =6,
/// <summary>
/// 大型
/// </summary>
[EnumField("大型")]
Large = 7,
/// <summary>
/// SUV
/// </summary>
[EnumField("SUV")]
SUV = 8,
/// <summary>
/// MPV
/// </summary>
[EnumField("MPV")]
MPV = 9,
/// <summary>
/// 跑车
/// </summary>
[EnumField("跑车")]
SportsCar = 10
}
}
using System;
using Mall.Common.Enum.GuideCar;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
......@@ -52,7 +53,7 @@ namespace Mall.Model.Entity.GuideCar
/// <summary>
/// 车辆分类
/// </summary>
public int CarClass { get; set; }
public CarClassEnum CarClass { get; set; }
/// <summary>
/// 车辆品牌
/// </summary>
......
......@@ -8,5 +8,7 @@ namespace Mall.Model.Extend.GuideCar
public class RB_GuideCar_CarColor_Extend : RB_GuideCar_CarColor
{
public List<string> PicList { get; set; }
public string CardIds { get; set; }
}
}
This diff is collapsed.
using Mall.Model.Entity.GuideCar;
using Mall.Model.Extend.GuideCar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mall.Repository.GuideCar
{
/// <summary>
/// 车辆颜色仓储层
/// </summary>
public class RB_GuideCar_CarColorRepository : BaseRepository<RB_GuideCar_CarColor>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_GuideCar_CarColor); } }
/// <summary>
/// 车辆颜色列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_GuideCar_CarColor_Extend> GetCarColorPageListRepository(int pageIndex, int pageSize, out long rowCount, RB_GuideCar_CarColor_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_GuideCar_CarColor_Extend.Status)}=0");
if (query != null)
{
// where += $@" and {nameof(RB_Customer_InfoCreate.CustomerId)}={dmodel.CustomerId}";
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_CarColor_Extend.TenantId)}={query.TenantId}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_CarColor_Extend.MallBaseId)}={query.MallBaseId}");
}
if (query.CarId > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_CarColor_Extend.CarId)}={query.CarId}");
}
}
return GetPage<RB_GuideCar_CarColor_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
/// <summary>
/// 车辆颜色列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_GuideCar_CarColor_Extend> GetCarColorList(RB_GuideCar_CarColor_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_GuideCar_CarColor_Extend.Status)}=0 ");
if (query != null)
{
if (query.ID > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_CarColor_Extend.ID)}={query.ID}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_CarColor_Extend.TenantId)}={query.TenantId}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_CarColor_Extend.MallBaseId)}={query.MallBaseId}");
}
if (query.CarId > 0)
{
builder.Append($" AND {nameof(RB_GuideCar_CarColor_Extend.CarId)}={query.CarId}");
}
if (!string.IsNullOrWhiteSpace(query.CardIds))
{
builder.Append($" AND {nameof(RB_GuideCar_CarColor_Extend.CarId)} in ({query.CardIds})");
}
}
return Get<RB_GuideCar_CarColor_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