You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

269 lines
7.7 KiB

  1. using Dapper;
  2. using Learun.DataBase.Repository;
  3. using Learun.Util;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Text;
  8. namespace Learun.Application.TwoDevelopment.EducationalAdministration
  9. {
  10. /// <summary>
  11. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  12. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  13. /// 创 建:超级管理员
  14. /// 日 期:2020-05-21 16:16
  15. /// 描 述:毕业学生信息
  16. /// </summary>
  17. public class StuInfoGraduateService : RepositoryFactory
  18. {
  19. #region 构造函数和属性
  20. private string fieldSql;
  21. public StuInfoGraduateService()
  22. {
  23. fieldSql=@"
  24. t.StuId,
  25. t.StuNo,
  26. t.StuCode,
  27. t.NoticeNo,
  28. t.GraduateYear,
  29. t.ksh,
  30. t.DeptNo,
  31. t.MajorNo,
  32. t.Grade,
  33. t.ClassNo,
  34. t.StuName,
  35. t.SpellFull,
  36. t.SpellBrief,
  37. t.GenderNo,
  38. t.Birthday,
  39. t.PartyFaceNo,
  40. t.FamilyOriginNo,
  41. t.NationalityNo,
  42. t.ProvinceNo,
  43. t.RegionNo,
  44. t.ResidenceNo,
  45. t.TestStuSortNo,
  46. t.HealthStatusNo,
  47. t.WillNo,
  48. t.TestStuSubjectNo,
  49. t.GraduateNo,
  50. t.PlanFormNo,
  51. t.IsThreeGood,
  52. t.IsExcellent,
  53. t.IsNormalCadre,
  54. t.IsProvinceFirstThree,
  55. t.OverseasChineseNo,
  56. t.MatriculateSort,
  57. t.ComeProvinceNo,
  58. t.HighSchoolNo,
  59. t.HighSchoolName,
  60. t.EntranceDate,
  61. t.Religion,
  62. t.GoodAt,
  63. t.IdentityCardNo,
  64. t.JoinPartyDate,
  65. t.JoinLeagueDate,
  66. t.InSchoolAddress,
  67. t.InSchoolTelephone,
  68. t.AbmormityMoveMark,
  69. t.AwardMark,
  70. t.PunishMark,
  71. t.LinkmanMark,
  72. t.StuNoChangeMark,
  73. t.FinishSchoolMark,
  74. t.CurrentRegisterMark,
  75. t.FinishSchoolDate,
  76. t.DiplomaNo,
  77. t.DiplomaRemark,
  78. t.Remark,
  79. t.Photo,
  80. t.TeachPlanNo,
  81. t.CheckMark,
  82. t.mobile,
  83. t.EMail,
  84. t.QQ,
  85. t.FatherUnit,
  86. t.FatherName,
  87. t.FatherPhone,
  88. t.MatherName,
  89. t.MatherUnit,
  90. t.MatherPhone,
  91. t.username,
  92. t.password,
  93. t.MailAddress,
  94. t.PostalCode,
  95. t.InSchoolStatus,
  96. t.TransMark,
  97. t.ClassTutorNo,
  98. t.ResumeCheck,
  99. t.PracStatus,
  100. t.RegisterStatus,
  101. t.PunishmentDate,
  102. t.F_CityId,
  103. t.F_CountyId,
  104. t.F_ProvinceId,
  105. t.F_SchoolId,
  106. t.EduSystem,
  107. t.StudyModality,
  108. t.SyncFlag,
  109. t.ChangeStatus,
  110. t.Balance,
  111. t.HealthStatus
  112. ";
  113. }
  114. #endregion
  115. #region 获取数据
  116. /// <summary>
  117. /// 获取列表数据
  118. /// <summary>
  119. /// <returns></returns>
  120. public IEnumerable<StuInfoGraduateEntity> GetList( string queryJson )
  121. {
  122. try
  123. {
  124. //参考写法
  125. //var queryParam = queryJson.ToJObject();
  126. // 虚拟参数
  127. //var dp = new DynamicParameters(new { });
  128. //dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime);
  129. var strSql = new StringBuilder();
  130. strSql.Append("SELECT ");
  131. strSql.Append(fieldSql);
  132. strSql.Append(" FROM StuInfoGraduate t ");
  133. return this.BaseRepository("CollegeMIS").FindList<StuInfoGraduateEntity>(strSql.ToString());
  134. }
  135. catch (Exception ex)
  136. {
  137. if (ex is ExceptionEx)
  138. {
  139. throw;
  140. }
  141. else
  142. {
  143. throw ExceptionEx.ThrowServiceException(ex);
  144. }
  145. }
  146. }
  147. /// <summary>
  148. /// 获取列表分页数据
  149. /// <param name="pagination">分页参数</param>
  150. /// <summary>
  151. /// <returns></returns>
  152. public IEnumerable<StuInfoGraduateEntity> GetPageList(Pagination pagination, string queryJson)
  153. {
  154. try
  155. {
  156. var strSql = new StringBuilder();
  157. strSql.Append("SELECT ");
  158. strSql.Append(fieldSql);
  159. strSql.Append(" FROM StuInfoGraduate t ");
  160. return this.BaseRepository("CollegeMIS").FindList<StuInfoGraduateEntity>(strSql.ToString(), pagination);
  161. }
  162. catch (Exception ex)
  163. {
  164. if (ex is ExceptionEx)
  165. {
  166. throw;
  167. }
  168. else
  169. {
  170. throw ExceptionEx.ThrowServiceException(ex);
  171. }
  172. }
  173. }
  174. /// <summary>
  175. /// 获取实体数据
  176. /// <param name="keyValue">主键</param>
  177. /// <summary>
  178. /// <returns></returns>
  179. public StuInfoGraduateEntity GetEntity(string keyValue)
  180. {
  181. try
  182. {
  183. return this.BaseRepository("CollegeMIS").FindEntity<StuInfoGraduateEntity>(keyValue);
  184. }
  185. catch (Exception ex)
  186. {
  187. if (ex is ExceptionEx)
  188. {
  189. throw;
  190. }
  191. else
  192. {
  193. throw ExceptionEx.ThrowServiceException(ex);
  194. }
  195. }
  196. }
  197. #endregion
  198. #region 提交数据
  199. /// <summary>
  200. /// 删除实体数据
  201. /// <param name="keyValue">主键</param>
  202. /// <summary>
  203. /// <returns></returns>
  204. public void DeleteEntity(string keyValue)
  205. {
  206. try
  207. {
  208. this.BaseRepository("CollegeMIS").Delete<StuInfoGraduateEntity>(t=>t.StuId == keyValue);
  209. }
  210. catch (Exception ex)
  211. {
  212. if (ex is ExceptionEx)
  213. {
  214. throw;
  215. }
  216. else
  217. {
  218. throw ExceptionEx.ThrowServiceException(ex);
  219. }
  220. }
  221. }
  222. /// <summary>
  223. /// 保存实体数据(新增、修改)
  224. /// <param name="keyValue">主键</param>
  225. /// <summary>
  226. /// <returns></returns>
  227. public void SaveEntity(string keyValue, StuInfoGraduateEntity entity)
  228. {
  229. try
  230. {
  231. if (!string.IsNullOrEmpty(keyValue))
  232. {
  233. entity.Modify(keyValue);
  234. this.BaseRepository("CollegeMIS").Update(entity);
  235. }
  236. else
  237. {
  238. entity.Create();
  239. this.BaseRepository("CollegeMIS").Insert(entity);
  240. }
  241. }
  242. catch (Exception ex)
  243. {
  244. if (ex is ExceptionEx)
  245. {
  246. throw;
  247. }
  248. else
  249. {
  250. throw ExceptionEx.ThrowServiceException(ex);
  251. }
  252. }
  253. }
  254. #endregion
  255. }
  256. }