RecommendBLL.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. using Interface;
  2. using Models;
  3. using Models.Entity.LottomatBaseDB;
  4. using Models.Views;
  5. using Services;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace Business.TJ
  12. {
  13. public static class RecommendBLL
  14. {
  15. private static ZXInterface service;
  16. static RecommendBLL()
  17. {
  18. // log = new LogHelper();
  19. service = new ZXServic();
  20. }
  21. /// <summary>
  22. /// 获取分类下所有彩种集合
  23. /// </summary>
  24. /// <param name="recom">彩种code集合(code如:QGC)</param>
  25. /// <returns>返回所有彩种集合</returns>
  26. public static List<DataItemModel> GetLotteryList(List<string> recom)
  27. {
  28. List<string> expressionlist = new List<string>();
  29. List<EExpression> listexp = new List<EExpression>();
  30. listexp.Add(new EExpression("ItemId", EnumExpression.In, recom));
  31. for (int i = 0; i < listexp.Count; i++)
  32. {
  33. expressionlist.Add(@" AND " + listexp[i].GetSql());
  34. }
  35. string strsql = @"SELECT [ItemDetailId]
  36. ,[ItemId]
  37. ,[ParentId]
  38. ,[ItemCode]
  39. ,[ItemName]
  40. ,[ItemValue]
  41. ,[QuickQuery]
  42. ,[SimpleSpelling]
  43. ,[IsDefault]
  44. ,[SortCode]
  45. ,[DeleteMark]
  46. ,[EnabledMark]
  47. ,[Description]
  48. ,[CreateDate]
  49. ,[CreateUserId]
  50. ,[CreateUserName]
  51. ,[IsHot]
  52. ,[IsRecommend]
  53. ,[IsShowHomePage]
  54. FROM [Base_DataItemDetail]
  55. where 1=1
  56. {0}
  57. and DeleteMark=0
  58. and EnabledMark=1
  59. order by SortCode asc";
  60. string sql = string.Format(strsql, string.Join("", expressionlist));
  61. return service.ExSqlGetList<DataItemModel>(sql);
  62. }
  63. /// <summary>
  64. /// 友链及其底部快捷导航
  65. /// </summary>
  66. /// <returns></returns>
  67. public static List<FriendLinksModel> GetFriendLinksList()
  68. {
  69. string strsql = @"SELECT [PK]
  70. ,[ID]
  71. ,[Type]
  72. ,[TypeName]
  73. ,[Name]
  74. ,[Url]
  75. ,[IsEnable]
  76. ,[IsDelete]
  77. ,[CreateUserId]
  78. ,[CreateUserName]
  79. ,[CreateTime]
  80. ,isnull(Remark,'') as Remark
  81. ,[TermOfValidity]
  82. FROM [Base_FriendLinks] where 1=1 and IsEnable=1 and IsDelete=0";
  83. string sql = string.Format(strsql);
  84. return service.ExSqlGetList<FriendLinksModel>(sql);
  85. }
  86. /// <summary>
  87. /// [Base_DataItem]表中所有数据
  88. /// </summary>
  89. /// <returns></returns>
  90. public static List<Base_DataItem> GetDataItem()
  91. {
  92. string strsql = @"SELECT [ItemId]
  93. ,[ParentId]
  94. ,[ItemCode]
  95. ,[ItemName]
  96. ,[IsTree]
  97. ,[IsNav]
  98. ,[SortCode]
  99. ,[DeleteMark]
  100. ,[EnabledMark]
  101. ,[Description]
  102. ,[CreateDate]
  103. ,[CreateUserId]
  104. ,[CreateUserName]
  105. FROM [Base_DataItem]
  106. where 1=1 and EnabledMark=1 and DeleteMark=0";
  107. string sql = string.Format(strsql);
  108. return service.ExSqlGetList<Base_DataItem>(sql);
  109. }
  110. /// <summary>
  111. /// 得到广告
  112. /// </summary>
  113. /// <returns></returns>
  114. public static List<AdvertisementModel> GetAd()
  115. {
  116. string strsql = @"SELECT [PK]
  117. ,[ID]
  118. ,[Title]
  119. ,[Category]
  120. ,[CategoryId]
  121. ,[Position]
  122. ,[Href]
  123. ,[AddTime]
  124. ,[TermOfValidity]
  125. ,[Remark]
  126. ,[IsEnable]
  127. ,[IsDelete]
  128. FROM [Base_Advertisement]
  129. where
  130. 1=1 and isdelete= 0
  131. and IsEnable=1
  132. and TermOfValidity>getdate()";
  133. string sql = string.Format(strsql);
  134. return service.ExSqlGetList<AdvertisementModel>(sql);
  135. }
  136. }
  137. }