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