PatchFindModel.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. //if(stationId)
  31. StationId = stationId;
  32. if(patchFindType == PatchFindType.ALL)
  33. {
  34. RunFlag = -1;
  35. EqualFlag = -1;
  36. }
  37. else if(patchFindType == PatchFindType.RUN_YES)
  38. {
  39. RunFlag = 1;
  40. EqualFlag = -1;
  41. }
  42. else if(patchFindType == PatchFindType.RUN_NO)
  43. {
  44. RunFlag = 0;
  45. EqualFlag = -1;
  46. }
  47. else if(patchFindType == PatchFindType.RESULT_OK)
  48. {
  49. RunFlag = 1;
  50. EqualFlag = 1;
  51. }
  52. else if(patchFindType == PatchFindType.RESULT_ERROR)
  53. {
  54. RunFlag = 1;
  55. EqualFlag = 0;
  56. }
  57. else if(patchFindType == PatchFindType.RESULT_INVLIAD)
  58. {
  59. RunFlag = 1;
  60. EqualFlag = 2;
  61. }
  62. else if(patchFindType == PatchFindType.ALL_NO_STAND_VALUE)
  63. {
  64. RunFlag = -1;
  65. EqualFlag = 3;
  66. }
  67. else if (patchFindType == PatchFindType.RUN_YES_NO_STAND_VALUE)
  68. {
  69. RunFlag = 1;
  70. EqualFlag = 3;
  71. }
  72. else if (patchFindType == PatchFindType.RUN_NO_NO_STAND_VALUE)
  73. {
  74. RunFlag = 0;
  75. EqualFlag = 3;
  76. }
  77. else if (patchFindType == PatchFindType.HAVE_MEMO)
  78. {
  79. RunFlag = -1;
  80. EqualFlag = -1;
  81. }
  82. }
  83. //-----------------------------------------------------
  84. }
  85. }