Commit e1bd5bd9 authored by 黄奎's avatar 黄奎

新增实体类

parent 78033567
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Exam
{
/// <summary>
/// 学员练习考试实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Student_Exam
{
/// <summary>
/// 主键编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 题库编号
/// </summary>
public int BankId { get; set; }
/// <summary>
/// 学员编号
/// </summary>
public int StudentId { get; set; }
/// <summary>
/// 开始时间
/// </summary>
public DateTime StartTime { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public DateTime EndTime { get; set; }
/// <summary>
/// 得分
/// </summary>
public decimal Score { get; set; }
/// <summary>
/// 测评次数
/// </summary>
public int Times { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int GroupId { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Exam
{
/// <summary>
/// 学员练习考试详情实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Student_ExamDetails
{
/// <summary>
/// 主键编号
/// </summary>
public int DetailId { get; set; }
/// <summary>
/// 考试编号
/// </summary>
public int ExamId { get; set; }
/// <summary>
/// 问题编号
/// </summary>
public int? QuestionId { get; set; }
/// <summary>
/// 问题名称(题干)
/// </summary>
public string Title { get; set; }
/// <summary>
/// 问题内容
/// </summary>
public string QuestionContent { get; set; }
/// <summary>
/// 问题类型编号
/// </summary>
public int QuestionTypeId { get; set; }
/// <summary>
/// 问题类型Key
/// </summary>
public string QuestionTypeKey { get; set; }
/// <summary>
/// 问题答案
/// </summary>
public string Answer { get; set; }
/// <summary>
/// 答案解析
/// </summary>
public string AnswerParse { get; set; }
/// <summary>
/// 是否作答(1-是)
/// </summary>
public int IsAnswer { get; set; }
/// <summary>
/// 是否作答错误(1-是)
/// </summary>
public int IsWrong { get; set; }
}
}
using Edu.Model.Entity.Exam;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Exam
{
/// <summary>
/// 学员练习考试详情扩展实体类
/// </summary>
public class RB_Student_ExamDetails_Extend : RB_Student_ExamDetails
{
/// <summary>
/// 考试编号【查询使用】
/// </summary>
public string QExamIds { get; set; }
}
}
using Edu.Model.Entity.Exam;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Exam
{
/// <summary>
/// 学员练习考试扩展实体类
/// </summary>
public class RB_Student_Exam_Extend : RB_Student_Exam
{
/// <summary>
/// 学员考试详情列表
/// </summary>
public List<RB_Student_ExamDetails_Extend> ExamDetailsList { get; set; }
}
}
using Edu.Model.Entity.Exam;
using Edu.Model.ViewModel.Exam;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Exam
{
/// <summary>
/// 学员练习考试详情仓储层
/// </summary>
public class RB_Student_ExamDetailsRepository : BaseRepository<RB_Student_ExamDetails>
{
/// <summary>
/// 获取学员练习考试详情列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_ExamDetails_Extend> GetStudentExamDetailsListRepository(RB_Student_ExamDetails_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Student_ExamDetails AS A
WHERE 1=1
");
if (query != null)
{
if (query.ExamId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Student_ExamDetails_Extend.ExamId), query.ExamId);
}
if (!string.IsNullOrEmpty(query.QExamIds))
{
builder.AppendFormat(@" AND A.{0} IN ({1}) ", nameof(RB_Student_ExamDetails_Extend.ExamId), query.QExamIds);
}
}
return Get<RB_Student_ExamDetails_Extend>(builder.ToString()).ToList();
}
}
}
using Edu.Model.Entity.Exam;
using Edu.Model.ViewModel.Exam;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Exam
{
/// <summary>
/// 学员练习考试仓储层
/// </summary>
public class RB_Student_ExamRepository : BaseRepository<RB_Student_Exam>
{
/// <summary>
/// 获取学员练习考试分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Exam_Extend> GetStudentExamPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Student_Exam_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Student_Exam AS A
WHERE 1=1
");
if (query != null)
{
if (query.GroupId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Student_Exam_Extend.GroupId), query.GroupId);
}
if (query.StudentId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Student_Exam_Extend.StudentId), query.StudentId);
}
}
return GetPage<RB_Student_Exam_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
/// <summary>
/// 获取学员练习考试列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Exam_Extend> GetStudentExamListRepository( RB_Student_Exam_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Student_Exam AS A
WHERE 1=1
");
if (query != null)
{
if (query.GroupId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Student_Exam_Extend.GroupId), query.GroupId);
}
if (query.StudentId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Student_Exam_Extend.StudentId), query.StudentId);
}
}
return Get<RB_Student_Exam_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