123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- using Interface;
- using Models;
- using Models.Entity.LottomatBaseDB;
- using Models.Views;
- using Services;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Business.TJ
- {
- public static class RecommendBLL
- {
- private static ZXInterface service;
- static RecommendBLL()
- {
- // log = new LogHelper();
- service = new ZXServic();
- }
- /// <summary>
- /// 获取分类下所有彩种集合
- /// </summary>
- /// <param name="recom">彩种code集合(code如:QGC)</param>
- /// <returns>返回所有彩种集合</returns>
- public static List<DataItemModel> GetLotteryList(List<string> recom)
- {
- List<string> expressionlist = new List<string>();
- List<EExpression> listexp = new List<EExpression>();
- listexp.Add(new EExpression("ItemId", EnumExpression.In, recom));
- for (int i = 0; i < listexp.Count; i++)
- {
- expressionlist.Add(@" AND " + listexp[i].GetSql());
- }
- string strsql = @"SELECT [ItemDetailId]
- ,[ItemId]
- ,[ParentId]
- ,[ItemCode]
- ,[ItemName]
- ,[ItemValue]
- ,[QuickQuery]
- ,[SimpleSpelling]
- ,[IsDefault]
- ,[SortCode]
- ,[DeleteMark]
- ,[EnabledMark]
- ,[Description]
- ,[CreateDate]
- ,[CreateUserId]
- ,[CreateUserName]
- ,[IsHot]
- ,[IsRecommend]
- ,[IsShowHomePage]
- FROM [Base_DataItemDetail]
- where 1=1
- {0}
- and DeleteMark=0
- and EnabledMark=1
- order by SortCode asc";
- string sql = string.Format(strsql, string.Join("", expressionlist));
- return service.ExSqlGetList<DataItemModel>(sql);
- }
- /// <summary>
- /// 友链及其底部快捷导航
- /// </summary>
- /// <returns></returns>
- public static List<FriendLinksModel> GetFriendLinksList()
- {
- string strsql = @"SELECT [PK]
- ,[ID]
- ,[Type]
- ,[TypeName]
- ,[Name]
- ,[Url]
- ,[IsEnable]
- ,[IsDelete]
- ,[CreateUserId]
- ,[CreateUserName]
- ,[CreateTime]
- ,isnull(Remark,'') as Remark
- ,[TermOfValidity]
- FROM [Base_FriendLinks] where 1=1 and IsEnable=1 and IsDelete=0";
- string sql = string.Format(strsql);
- return service.ExSqlGetList<FriendLinksModel>(sql);
- }
-
- /// <summary>
- /// [Base_DataItem]表中所有数据
- /// </summary>
- /// <returns></returns>
- public static List<Base_DataItem> GetDataItem()
- {
- string strsql = @"SELECT [ItemId]
- ,[ParentId]
- ,[ItemCode]
- ,[ItemName]
- ,[IsTree]
- ,[IsNav]
- ,[SortCode]
- ,[DeleteMark]
- ,[EnabledMark]
- ,[Description]
- ,[CreateDate]
- ,[CreateUserId]
- ,[CreateUserName]
- FROM [Base_DataItem]
- where 1=1 and EnabledMark=1 and DeleteMark=0";
- string sql = string.Format(strsql);
- return service.ExSqlGetList<Base_DataItem>(sql);
- }
- /// <summary>
- /// 得到广告
- /// </summary>
- /// <returns></returns>
- public static List<AdvertisementModel> GetAd()
- {
- string strsql = @"SELECT [PK]
- ,[ID]
- ,[Title]
- ,[Category]
- ,[CategoryId]
- ,[Position]
- ,[Href]
- ,[AddTime]
- ,[TermOfValidity]
- ,[Remark]
- ,[IsEnable]
- ,[IsDelete]
- FROM [Base_Advertisement]
- where
- 1=1 and isdelete= 0
- and IsEnable=1
- and TermOfValidity>getdate()";
- string sql = string.Format(strsql);
- return service.ExSqlGetList<AdvertisementModel>(sql);
- }
- }
- }
|