Commit d6efdb68 authored by 黄奎's avatar 黄奎

页面修改

parent cb34455d
using Edu.Common.Enum;
using Edu.Model.Entity.Course;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Course
{
......@@ -30,13 +27,11 @@ namespace Edu.Repository.Course
{
where += $@" and r.{nameof(RB_Activity_Config.Type)} ={demodel.Type}";
}
string sql = $@"
SELECT * From RB_Activity_Config r
WHERE {where}
ORDER BY r.Id DESC ";
return Get<RB_Activity_Config_ViewModel>(sql).ToList();
}
}
}
}
\ No newline at end of file
using Edu.Common.Enum;
using Edu.Model.Entity.Course;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Course
{
......@@ -22,7 +19,6 @@ namespace Edu.Repository.Course
public List<RB_Activity_PeriodsDetail_ViewModel> GetList(RB_Activity_PeriodsDetail_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.Group_Id)} ={demodel.Group_Id}";
......@@ -55,8 +51,6 @@ namespace Edu.Repository.Course
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.ActivityName)} like '%{demodel.ActivityName}%'";
}
string sql = $@" select r.* from RB_Activity_PeriodsDetail r where {where} order by r.Id asc";
return Get<RB_Activity_PeriodsDetail_ViewModel>(sql).ToList();
}
......@@ -69,7 +63,6 @@ namespace Edu.Repository.Course
public List<RB_Activity_PeriodsDetail_ViewModel> GetPageList(int pageIndex,int pageSize,out long count,RB_Activity_PeriodsDetail_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.Group_Id)} ={demodel.Group_Id}";
......@@ -110,7 +103,6 @@ namespace Edu.Repository.Course
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.DSUserName)} like '%{demodel.DSUserName}%'";
}
string sql = $@" select r.* from RB_Activity_PeriodsDetail r where {where} order by r.Id asc";
return GetPage<RB_Activity_PeriodsDetail_ViewModel>(pageIndex, pageSize, out count, sql).ToList();
}
......@@ -123,7 +115,6 @@ namespace Edu.Repository.Course
public List<RB_Activity_PeriodsDetail_ViewModel> GetActivityCommissionUserList(RB_Activity_PeriodsDetail_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.Group_Id)} ={demodel.Group_Id}";
......@@ -152,8 +143,6 @@ namespace Edu.Repository.Course
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.OrderId)} ={demodel.OrderId}";
}
string sql = $@" select r.UserId,r.Depart_Id,r.School_Id,sum(r.CommissionMoney) as CommissionMoney
from RB_Activity_PeriodsDetail r where {where} group by r.UserId,r.Depart_Id,r.School_Id";
return Get<RB_Activity_PeriodsDetail_ViewModel>(sql).ToList();
......@@ -167,7 +156,6 @@ from RB_Activity_PeriodsDetail r where {where} group by r.UserId,r.Depart_Id,r.S
public decimal GetSellCommissionStatistics(RB_Activity_PeriodsDetail_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.Group_Id)} ={demodel.Group_Id}";
......@@ -208,11 +196,9 @@ from RB_Activity_PeriodsDetail r where {where} group by r.UserId,r.Depart_Id,r.S
{
where += $@" and r.{nameof(RB_Activity_PeriodsDetail_ViewModel.DSUserName)} like '%{demodel.DSUserName}%'";
}
string sql = $@" select sum(r.CommissionMoney) from RB_Activity_PeriodsDetail r where {where}";
var obj = ExecuteScalar(sql);
return obj == null ? 0 : Convert.ToDecimal(obj);
}
}
}
using Edu.Common.Enum;
using Edu.Model.Entity.Course;
using Edu.Model.Entity.Course;
using Edu.Model.ViewModel.Course;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Course
{
......@@ -21,7 +18,6 @@ namespace Edu.Repository.Course
public List<RB_Activity_Periods_ViewModel> GetList(RB_Activity_Periods_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and r.{nameof(RB_Activity_Periods_ViewModel.Group_Id)} ={demodel.Group_Id}";
......@@ -34,7 +30,6 @@ namespace Edu.Repository.Course
{
where += $@" and r.{nameof(RB_Activity_Periods_ViewModel.Periods)} ='{demodel.Periods}'";
}
string sql = $@" select r.* from RB_Activity_Periods r where {where} order by r.Id desc";
return Get<RB_Activity_Periods_ViewModel>(sql).ToList();
}
......@@ -50,7 +45,6 @@ namespace Edu.Repository.Course
public List<RB_Activity_Periods_ViewModel> GetPageList(int pageIndex, int pageSize, out long count, RB_Activity_Periods_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and r.{nameof(RB_Activity_Periods_ViewModel.Group_Id)} ={demodel.Group_Id}";
......@@ -59,10 +53,8 @@ namespace Edu.Repository.Course
{
where += $@" and r.{nameof(RB_Activity_Periods_ViewModel.Name)} like '%{demodel.Name}%'";
}
string sql = $@" select r.* from RB_Activity_Periods r where {where} order by r.Id desc";
return GetPage<RB_Activity_Periods_ViewModel>(pageIndex, pageSize, out count, sql).ToList();
}
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.Advertising;
using Edu.Model.ViewModel.Advertising;
......@@ -28,8 +26,6 @@ namespace Edu.Repository.Advertising
public List<Rb_Advertising_Extend> GetAdvertisingList(int pageIndex, int pageSize, out long count, string advName, int IsFee, int RB_Group_id)
{
string where = $@" where 1=1 and A.{nameof(Rb_Advertising.Group_Id)}={RB_Group_id} and A.{nameof(Rb_Advertising.Status)}=0";
if (IsFee > 0)
{
where += $@" and A.{nameof(Rb_Advertising.IsFee)}={IsFee}";
......@@ -54,7 +50,6 @@ namespace Edu.Repository.Advertising
public List<Rb_Advertising_Extend> GetAdvertsingListForComboBox( string advName, int RB_Group_id)
{
string where = $@" where 1=1 and {nameof(Rb_Advertising.Group_Id)}={RB_Group_id} and {nameof(Rb_Advertising.Status)}=0";
if (!string.IsNullOrWhiteSpace(advName))
{
where += $@" and {nameof(Rb_Advertising.Title)} like '%{advName}%'";
......@@ -62,4 +57,4 @@ namespace Edu.Repository.Advertising
return Get<Rb_Advertising_Extend>($@"select * from {nameof(Rb_Advertising)} {where} order by {nameof(Rb_Advertising.CreateDate)} desc").ToList();
}
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.Advertising;
using Edu.Model.ViewModel.Advertising;
......@@ -14,7 +12,6 @@ namespace Edu.Repository.Advertising
/// </summary>
public string TableName { get { return nameof(Rb_Advertising_Make); } }
/// <summary>
/// 获取创建的广告信息
/// </summary>
......@@ -25,24 +22,19 @@ namespace Edu.Repository.Advertising
/// <returns></returns>
public List<Rb_Advertising_Make_Extend> GetPage(int pageIndex, int pageSize, Rb_Advertising_Make_Extend model, out long count)
{
string where = $@" where 1=1 and {nameof(Rb_Advertising_Make.Status)}={(int)Common.Enum.DateStateEnum.Normal}";
if (model.School_Id > 0)
{
where += $@" and {nameof(Rb_Advertising_Make.School_Id)}={model.School_Id}";
}
if (model.Group_Id > 0)
{
where += $@" and {nameof(Rb_Advertising_Make.Group_Id)}={model.Group_Id}";
}
if (model.UpdateBy > 0)
{
where += $@" and {nameof(Rb_Advertising_Make.UpdateBy)}={model.UpdateBy}";
}
string sql = $@" select * from {TableName} {where} ";
return GetPage<Rb_Advertising_Make_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
......@@ -55,15 +47,12 @@ namespace Edu.Repository.Advertising
public List<Rb_Advertising_Make_Extend> Get(Rb_Advertising_Make_Extend model)
{
string where = $@" where 1=1 and A.{nameof(Rb_Advertising_Make.Status)}={(int)Common.Enum.DateStateEnum.Normal}";
if (model.School_Id > 0)
{
where += $@" and {nameof(Rb_Advertising_Make.School_Id)}={model.School_Id}";
}
if (model.Group_Id > 0)
{
where += $@" and {nameof(Rb_Advertising_Make.Group_Id)}={model.Group_Id}";
}
if (model.UpdateBy > 0)
......@@ -78,22 +67,5 @@ namespace Edu.Repository.Advertising
ON A.AdvertisingID = B.ID {where}";
return Get<Rb_Advertising_Make_Extend>(sql).ToList();
}
/// <summary>
/// 获取广告信息
/// </summary>
/// <param name="ids">广告id</param>
/// <returns></returns>
public List<Rb_Advertising_Make_Extend> GetListByIds(List<int> ids)
{
List<Rb_Advertising_Make_Extend> sellAdvertisingList = new List<Rb_Advertising_Make_Extend>();
if (ids.Count > 0)
{
string sql = $@" SELECT * from Rb_Advertising_Make a where a.ID in ({string.Join(",", ids)}) and a.`Status` = 0";
sellAdvertisingList = Get<Rb_Advertising_Make_Extend>(sql).ToList();
}
return sellAdvertisingList;
}
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Common.Enum;
......@@ -36,4 +35,4 @@ namespace Edu.Repository.App
return Get<RB_HomePage_Banner>(builder.ToString()).ToList();
}
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Common.Enum;
......
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