PatchFindModel.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. //以上三个为必要条件
  16. //以下为相应Flag=1时,才作为SQL语句的条件
  17. //RunFlag >=0 时,作为where条件
  18. public int RunFlag { get; set; }
  19. //EqualFlag >=0 时,作为where 条件
  20. public int EqualFlag { get; set; }
  21. ////StandValueFlag>=0时,stand_value='',
  22. //public int StandValueFlag { get; set; }
  23. public PatchFindModel(int pageNumber,int pageSize, string patchId,PatchFindType patchFindType)
  24. {
  25. PatchFindType = patchFindType;
  26. PageNumber = pageNumber;
  27. PageSize = pageSize;
  28. PatchId = patchId;
  29. if(patchFindType == PatchFindType.ALL)
  30. {
  31. RunFlag = -1;
  32. EqualFlag = -1;
  33. }
  34. else if(patchFindType == PatchFindType.RUN_YES)
  35. {
  36. RunFlag = 1;
  37. EqualFlag = -1;
  38. }
  39. else if(patchFindType == PatchFindType.RUN_NO)
  40. {
  41. RunFlag = 0;
  42. EqualFlag = -1;
  43. }
  44. else if(patchFindType == PatchFindType.RESULT_OK)
  45. {
  46. RunFlag = 1;
  47. EqualFlag = 1;
  48. }
  49. else if(patchFindType == PatchFindType.RESULT_ERROR)
  50. {
  51. RunFlag = 1;
  52. EqualFlag = 0;
  53. }
  54. else if(patchFindType == PatchFindType.ALL_NO_STAND_VALUE)
  55. {
  56. RunFlag = -1;
  57. EqualFlag = 2;
  58. }
  59. else if (patchFindType == PatchFindType.RUN_YES_NO_STAND_VALUE)
  60. {
  61. RunFlag = 1;
  62. EqualFlag = 2;
  63. }
  64. else if (patchFindType == PatchFindType.RUN_NO_NO_STAND_VALUE)
  65. {
  66. RunFlag = 0;
  67. EqualFlag = 2;
  68. }
  69. else if (patchFindType == PatchFindType.HAVE_MEMO)
  70. {
  71. RunFlag = -1;
  72. EqualFlag = -1;
  73. }
  74. }
  75. //-----------------------------------------------------
  76. }
  77. }