PatchFindModel.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using MeterVision.Patch;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace MeterVision.model
  8. {
  9. public class PatchFindModel
  10. {
  11. public PatchFindType PatchFindType { get; set; }
  12. public int PageNumber { get; set; }
  13. public int PageSize { get; set; }
  14. public string PatchId { get; set; }
  15. public string StationId { get; set; }
  16. //以上三个为必要条件
  17. //以下为相应Flag=1时,才作为SQL语句的条件
  18. //RunFlag >=0 时,作为where条件
  19. public int RunFlag { get; set; }
  20. //EqualFlag >=0 时,作为where 条件
  21. public int EqualFlag { get; set; }
  22. ////StandValueFlag>=0时,stand_value='',
  23. //public int StandValueFlag { get; set; }
  24. public PatchFindModel(int pageNumber,int pageSize, string patchId, string stationId, PatchFindType patchFindType)
  25. {
  26. PatchFindType = patchFindType;
  27. PageNumber = pageNumber;
  28. PageSize = pageSize;
  29. PatchId = patchId;
  30. StationId = stationId;
  31. if(patchFindType == PatchFindType.ALL)
  32. {
  33. RunFlag = -1;
  34. EqualFlag = -1;
  35. }
  36. else if(patchFindType == PatchFindType.RUN_YES)
  37. {
  38. RunFlag = 1;
  39. EqualFlag = -1;
  40. }
  41. else if(patchFindType == PatchFindType.RUN_NO)
  42. {
  43. RunFlag = 0;
  44. EqualFlag = -1;
  45. }
  46. else if(patchFindType == PatchFindType.RESULT_OK)
  47. {
  48. RunFlag = 1;
  49. EqualFlag = 1;
  50. }
  51. else if(patchFindType == PatchFindType.RESULT_ERROR)
  52. {
  53. RunFlag = 1;
  54. EqualFlag = 0;
  55. }
  56. else if(patchFindType == PatchFindType.ALL_NO_STAND_VALUE)
  57. {
  58. RunFlag = -1;
  59. EqualFlag = 2;
  60. }
  61. else if (patchFindType == PatchFindType.RUN_YES_NO_STAND_VALUE)
  62. {
  63. RunFlag = 1;
  64. EqualFlag = 2;
  65. }
  66. else if (patchFindType == PatchFindType.RUN_NO_NO_STAND_VALUE)
  67. {
  68. RunFlag = 0;
  69. EqualFlag = 2;
  70. }
  71. else if (patchFindType == PatchFindType.HAVE_MEMO)
  72. {
  73. RunFlag = -1;
  74. EqualFlag = -1;
  75. }
  76. }
  77. //-----------------------------------------------------
  78. }
  79. }