Commit 92d76f7d authored by 黄奎's avatar 黄奎

页面修

parent dda6440e
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Mall
{
/// <summary>
/// 问卷调查实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "MallConnection")]
public class RB_ActivitySurvey
{
/// <summary>
/// 编号
/// </summary>
public int ID { get; set; }
/// <summary>
/// 标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// 活动开始时间
/// </summary>
public DateTime? StartDate { get; set; }
/// <summary>
/// 活动结束时间
/// </summary>
public DateTime? EndDate { get; set; }
/// <summary>
/// 份数
/// </summary>
public int SurveyNum { get; set; }
/// <summary>
/// 活动说明
/// </summary>
public string Description { get; set; }
/// <summary>
/// 奖品地址
/// </summary>
public string PrizeAddress { get; set; }
/// <summary>
/// 奖品类型
/// </summary>
public int PrizeType { get; set; }
/// <summary>
/// 删除
/// </summary>
public int State { get; set; }
/// <summary>
/// 小程序编号
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// 商户编号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// 修改时间
/// </summary>
public DateTime? UpdateDate
{
get;
set;
}
}
}
using Edu.Model.Entity.Mall;
using Edu.Repository.Mall;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Module.Goods
{
/// <summary>
/// 问卷调查处理类
/// </summary>
public class ActivitySurveyModule
{
/// <summary>
/// 意见调查表仓储层对象
/// </summary>
private readonly RB_ActivitySurveyRepository activitySurveyRepository = new RB_ActivitySurveyRepository();
/// <summary>
/// 获取问卷调查列表
/// </summary>
/// <param name="where"></param>
/// <param name="StuId"></param>
/// <returns></returns>
public List<RB_ActivitySurvey> GetActivitySurveyListModule(RB_ActivitySurvey where, string StuId)
{
return activitySurveyRepository.GetActivitySurveyListRepository(where, StuId);
}
}
}
using Edu.Model.Entity.Mall;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Mall
{
/// <summary>
/// 问卷调查仓储层
/// </summary>
public class RB_ActivitySurveyRepository : BaseRepository<RB_ActivitySurvey>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_ActivitySurvey); } }
/// <summary>
/// 获取问卷调查列表
/// </summary>
/// <param name="where"></param>
/// <param name="StuId"></param>
/// <returns></returns>
public List<RB_ActivitySurvey> GetActivitySurveyListRepository(RB_ActivitySurvey where,string StuId)
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat($@"
SELECT A.*
FROM RB_ActivitySurvey AS A
WHERE A.State=0 ");
sb.AppendFormat(" AND A.StartDate<'{0}' AND A.EndDate>'{0}' ", Common.ConvertHelper.FormatDate(DateTime.Now));
if (!string.IsNullOrEmpty(StuId))
{
sb.AppendFormat(" AND NOT EXISTS(SELECT 1 FROM rb_guestsurvey WHERE UserType=2 AND ActivitySurveyId=A.ID AND UserId={0}) ", StuId);
}
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" AND A.TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" AND A.MallBaseId={0}", where.MallBaseId);
}
}
return Get<RB_ActivitySurvey>(sb.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