20211130020237_sp-database.cs 75 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace wispro.sp.api.Migrations
  4. {
  5. public partial class spdatabase : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.CreateTable(
  10. name: "AppealType",
  11. columns: table => new
  12. {
  13. Id = table.Column<int>(type: "int", nullable: false)
  14. .Annotation("SqlServer:Identity", "1, 1"),
  15. Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  16. CanDoExpress = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  17. ReviewerExpress = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  18. Type = table.Column<int>(type: "int", nullable: false)
  19. },
  20. constraints: table =>
  21. {
  22. table.PrimaryKey("PK_AppealType", x => x.Id);
  23. });
  24. migrationBuilder.CreateTable(
  25. name: "BasePointRule",
  26. columns: table => new
  27. {
  28. Id = table.Column<int>(type: "int", nullable: false)
  29. .Annotation("SqlServer:Identity", "1, 1"),
  30. Rule = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
  31. PointExpress = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
  32. Priority = table.Column<int>(type: "int", nullable: false),
  33. Type = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true)
  34. },
  35. constraints: table =>
  36. {
  37. table.PrimaryKey("PK_BasePointRule", x => x.Id);
  38. });
  39. migrationBuilder.CreateTable(
  40. name: "CalMonth",
  41. columns: table => new
  42. {
  43. Id = table.Column<int>(type: "int", nullable: false)
  44. .Annotation("SqlServer:Identity", "1, 1"),
  45. year = table.Column<int>(type: "int", nullable: false),
  46. month = table.Column<int>(type: "int", nullable: false),
  47. status = table.Column<int>(type: "int", nullable: false)
  48. },
  49. constraints: table =>
  50. {
  51. table.PrimaryKey("PK_CalMonth", x => x.Id);
  52. });
  53. migrationBuilder.CreateTable(
  54. name: "CaseCeofficient",
  55. columns: table => new
  56. {
  57. Ceoffcient = table.Column<string>(type: "nvarchar(450)", nullable: false),
  58. Value = table.Column<double>(type: "float", nullable: false)
  59. },
  60. constraints: table =>
  61. {
  62. table.PrimaryKey("PK_CaseCeofficient", x => x.Ceoffcient);
  63. });
  64. migrationBuilder.CreateTable(
  65. name: "Department",
  66. columns: table => new
  67. {
  68. Id = table.Column<int>(type: "int", nullable: false)
  69. .Annotation("SqlServer:Identity", "1, 1"),
  70. Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
  71. ancestors = table.Column<string>(type: "nvarchar(max)", nullable: true),
  72. order_num = table.Column<int>(type: "int", nullable: true),
  73. Memo = table.Column<string>(type: "nvarchar(max)", nullable: true),
  74. parentId = table.Column<int>(type: "int", nullable: true)
  75. },
  76. constraints: table =>
  77. {
  78. table.PrimaryKey("PK_Department", x => x.Id);
  79. });
  80. migrationBuilder.CreateTable(
  81. name: "Position",
  82. columns: table => new
  83. {
  84. Id = table.Column<int>(type: "int", nullable: false)
  85. .Annotation("SqlServer:Identity", "1, 1"),
  86. Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
  87. Memo = table.Column<string>(type: "nvarchar(max)", nullable: true)
  88. },
  89. constraints: table =>
  90. {
  91. table.PrimaryKey("PK_Position", x => x.Id);
  92. });
  93. migrationBuilder.CreateTable(
  94. name: "StaffGrade",
  95. columns: table => new
  96. {
  97. Id = table.Column<int>(type: "int", nullable: false)
  98. .Annotation("SqlServer:Identity", "1, 1"),
  99. Grade = table.Column<string>(type: "nchar(5)", fixedLength: true, maxLength: 5, nullable: false),
  100. Coefficient = table.Column<double>(type: "float", nullable: false)
  101. },
  102. constraints: table =>
  103. {
  104. table.PrimaryKey("PK_StaffGrade", x => x.Id);
  105. });
  106. migrationBuilder.CreateTable(
  107. name: "InputField",
  108. columns: table => new
  109. {
  110. Id = table.Column<int>(type: "int", nullable: false)
  111. .Annotation("SqlServer:Identity", "1, 1"),
  112. FieldName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  113. FieldType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  114. MapObjectField = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  115. MapObjectFieldLabel = table.Column<string>(type: "nvarchar(max)", nullable: true),
  116. AppealTypeId = table.Column<int>(type: "int", nullable: false),
  117. AppealState = table.Column<int>(type: "int", nullable: false),
  118. CanMuliSelect = table.Column<bool>(type: "bit", nullable: false),
  119. MaxSize = table.Column<int>(type: "int", nullable: true),
  120. MapSaveCondition = table.Column<string>(type: "nvarchar(max)", nullable: true)
  121. },
  122. constraints: table =>
  123. {
  124. table.PrimaryKey("PK_InputField", x => x.Id);
  125. table.ForeignKey(
  126. name: "FK_InputField_AppealType_AppealTypeId",
  127. column: x => x.AppealTypeId,
  128. principalTable: "AppealType",
  129. principalColumn: "Id",
  130. onDelete: ReferentialAction.Cascade);
  131. });
  132. migrationBuilder.CreateTable(
  133. name: "Staff",
  134. columns: table => new
  135. {
  136. Id = table.Column<int>(type: "int", nullable: false)
  137. .Annotation("SqlServer:Identity", "1, 1"),
  138. Account = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  139. Password = table.Column<string>(type: "nvarchar(max)", nullable: false),
  140. Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  141. Sex = table.Column<string>(type: "nvarchar(max)", nullable: true),
  142. Tel = table.Column<string>(type: "nvarchar(max)", nullable: true),
  143. Mobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
  144. IsOnJob = table.Column<bool>(type: "bit", nullable: false),
  145. Status = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: false),
  146. isCalPerformsnce = table.Column<bool>(type: "bit", nullable: false),
  147. StaffGradeId = table.Column<int>(type: "int", nullable: true),
  148. Department = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  149. WorkPlace = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  150. EntyDate = table.Column<DateTime>(type: "date", nullable: true),
  151. Mail = table.Column<string>(type: "nvarchar(max)", nullable: true),
  152. Memo = table.Column<string>(type: "nvarchar(max)", nullable: true)
  153. },
  154. constraints: table =>
  155. {
  156. table.PrimaryKey("PK_Staff", x => x.Id);
  157. table.ForeignKey(
  158. name: "FK_Staff_StaffGrade",
  159. column: x => x.StaffGradeId,
  160. principalTable: "StaffGrade",
  161. principalColumn: "Id",
  162. onDelete: ReferentialAction.Restrict);
  163. });
  164. migrationBuilder.CreateTable(
  165. name: "VerifyCoefficient",
  166. columns: table => new
  167. {
  168. CheckerId = table.Column<int>(type: "int", nullable: false),
  169. DoPersonId = table.Column<int>(type: "int", nullable: false),
  170. Coefficient = table.Column<double>(type: "float", nullable: false)
  171. },
  172. constraints: table =>
  173. {
  174. table.PrimaryKey("PK_VerifyCoefficient", x => new { x.CheckerId, x.DoPersonId });
  175. table.ForeignKey(
  176. name: "FK_VerifyCoefficient_StaffGrade",
  177. column: x => x.CheckerId,
  178. principalTable: "StaffGrade",
  179. principalColumn: "Id",
  180. onDelete: ReferentialAction.Restrict);
  181. table.ForeignKey(
  182. name: "FK_VerifyCoefficient_StaffGrade1",
  183. column: x => x.DoPersonId,
  184. principalTable: "StaffGrade",
  185. principalColumn: "Id",
  186. onDelete: ReferentialAction.Restrict);
  187. });
  188. migrationBuilder.CreateTable(
  189. name: "SelectValue",
  190. columns: table => new
  191. {
  192. Id = table.Column<int>(type: "int", nullable: false)
  193. .Annotation("SqlServer:Identity", "1, 1"),
  194. Value = table.Column<string>(type: "nvarchar(max)", nullable: true),
  195. InputFieldId = table.Column<int>(type: "int", nullable: false)
  196. },
  197. constraints: table =>
  198. {
  199. table.PrimaryKey("PK_SelectValue", x => x.Id);
  200. table.ForeignKey(
  201. name: "FK_SelectValue_InputField_InputFieldId",
  202. column: x => x.InputFieldId,
  203. principalTable: "InputField",
  204. principalColumn: "Id",
  205. onDelete: ReferentialAction.Cascade);
  206. });
  207. migrationBuilder.CreateTable(
  208. name: "Customer",
  209. columns: table => new
  210. {
  211. Id = table.Column<int>(type: "int", nullable: false)
  212. .Annotation("SqlServer:Identity", "1, 1"),
  213. Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
  214. ContactMan = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  215. Address = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  216. Phone = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  217. ResponseManId = table.Column<int>(type: "int", nullable: true)
  218. },
  219. constraints: table =>
  220. {
  221. table.PrimaryKey("PK_Customer", x => x.Id);
  222. table.ForeignKey(
  223. name: "FK_Customer_Staff",
  224. column: x => x.ResponseManId,
  225. principalTable: "Staff",
  226. principalColumn: "Id",
  227. onDelete: ReferentialAction.Restrict);
  228. });
  229. migrationBuilder.CreateTable(
  230. name: "DepartmentPosition",
  231. columns: table => new
  232. {
  233. Id = table.Column<int>(type: "int", nullable: false)
  234. .Annotation("SqlServer:Identity", "1, 1"),
  235. departmentId = table.Column<int>(type: "int", nullable: false),
  236. PositionId = table.Column<int>(type: "int", nullable: false),
  237. StaffId = table.Column<int>(type: "int", nullable: false)
  238. },
  239. constraints: table =>
  240. {
  241. table.PrimaryKey("PK_DepartmentPosition", x => x.Id);
  242. table.ForeignKey(
  243. name: "FK_DepartmentPosition_Department_departmentId",
  244. column: x => x.departmentId,
  245. principalTable: "Department",
  246. principalColumn: "Id",
  247. onDelete: ReferentialAction.Cascade);
  248. table.ForeignKey(
  249. name: "FK_DepartmentPosition_Position_PositionId",
  250. column: x => x.PositionId,
  251. principalTable: "Position",
  252. principalColumn: "Id",
  253. onDelete: ReferentialAction.Cascade);
  254. table.ForeignKey(
  255. name: "FK_DepartmentPosition_Staff_StaffId",
  256. column: x => x.StaffId,
  257. principalTable: "Staff",
  258. principalColumn: "Id",
  259. onDelete: ReferentialAction.Cascade);
  260. });
  261. migrationBuilder.CreateTable(
  262. name: "Message",
  263. columns: table => new
  264. {
  265. Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
  266. MessageInfo = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  267. Type = table.Column<int>(type: "int", nullable: false),
  268. FromId = table.Column<int>(type: "int", nullable: false)
  269. },
  270. constraints: table =>
  271. {
  272. table.PrimaryKey("PK_Message", x => x.Id);
  273. table.ForeignKey(
  274. name: "FK_From_Staff",
  275. column: x => x.FromId,
  276. principalTable: "Staff",
  277. principalColumn: "Id",
  278. onDelete: ReferentialAction.Restrict);
  279. });
  280. migrationBuilder.CreateTable(
  281. name: "PerformanceItem",
  282. columns: table => new
  283. {
  284. Id = table.Column<int>(type: "int", nullable: false)
  285. .Annotation("SqlServer:Identity", "1, 1"),
  286. CaseNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  287. ApplicationType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  288. BusinessType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  289. AgentFeedbackMemo = table.Column<string>(type: "nvarchar(max)", nullable: true),
  290. DoItem = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  291. CaseStage = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  292. CaseCoefficient = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
  293. DoItemCoefficient = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  294. PreOAStaffId = table.Column<int>(type: "int", nullable: true),
  295. ReviewerId = table.Column<int>(type: "int", nullable: true),
  296. CustomerId = table.Column<int>(type: "int", nullable: true),
  297. ApplicationName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
  298. FinishedDate = table.Column<DateTime>(type: "date", nullable: true),
  299. FinalizationDate = table.Column<DateTime>(type: "date", nullable: true),
  300. ReturnDate = table.Column<DateTime>(type: "date", nullable: true),
  301. CaseType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  302. CaseState = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  303. DoItemMemo = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  304. DoItemState = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
  305. CaseName = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  306. CustomerLimitDate = table.Column<DateTime>(type: "date", nullable: true),
  307. EntrustingDate = table.Column<DateTime>(type: "date", nullable: true),
  308. InternalDate = table.Column<DateTime>(type: "date", nullable: true),
  309. FirstDraftDate = table.Column<DateTime>(type: "date", nullable: true),
  310. OverDueMemo = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
  311. BasePoint = table.Column<decimal>(type: "numeric(18,2)", nullable: true),
  312. Status = table.Column<int>(type: "int", nullable: true),
  313. CaseMemo = table.Column<string>(type: "nvarchar(max)", nullable: true),
  314. WordCount = table.Column<int>(type: "int", nullable: true),
  315. ReturnCasseNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
  316. Type = table.Column<string>(type: "nvarchar(max)", nullable: true),
  317. CalMonthId = table.Column<int>(type: "int", nullable: false)
  318. },
  319. constraints: table =>
  320. {
  321. table.PrimaryKey("PK_PerformanceItem", x => x.Id);
  322. table.ForeignKey(
  323. name: "FK_PerformanceItem_CalMonth",
  324. column: x => x.CalMonthId,
  325. principalTable: "CalMonth",
  326. principalColumn: "Id",
  327. onDelete: ReferentialAction.Cascade);
  328. table.ForeignKey(
  329. name: "FK_PerformanceItem_Customer",
  330. column: x => x.CustomerId,
  331. principalTable: "Customer",
  332. principalColumn: "Id",
  333. onDelete: ReferentialAction.Restrict);
  334. table.ForeignKey(
  335. name: "FK_PerformanceItem_Reviewer",
  336. column: x => x.ReviewerId,
  337. principalTable: "Staff",
  338. principalColumn: "Id",
  339. onDelete: ReferentialAction.Restrict);
  340. table.ForeignKey(
  341. name: "FK_PerformanceItem_Staff",
  342. column: x => x.PreOAStaffId,
  343. principalTable: "Staff",
  344. principalColumn: "Id",
  345. onDelete: ReferentialAction.Restrict);
  346. });
  347. migrationBuilder.CreateTable(
  348. name: "MessageReadRecord",
  349. columns: table => new
  350. {
  351. MessageId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
  352. StaffId = table.Column<int>(type: "int", nullable: false),
  353. isReaded = table.Column<bool>(type: "bit", nullable: false),
  354. MessageId1 = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
  355. },
  356. constraints: table =>
  357. {
  358. table.PrimaryKey("PK_MessageReadRecord", x => new { x.MessageId, x.StaffId });
  359. table.ForeignKey(
  360. name: "FK_MessageReadRecord_Message",
  361. column: x => x.MessageId,
  362. principalTable: "Message",
  363. principalColumn: "Id",
  364. onDelete: ReferentialAction.Restrict);
  365. table.ForeignKey(
  366. name: "FK_MessageReadRecord_Message_MessageId1",
  367. column: x => x.MessageId1,
  368. principalTable: "Message",
  369. principalColumn: "Id",
  370. onDelete: ReferentialAction.Restrict);
  371. table.ForeignKey(
  372. name: "FK_MessageReadRecord_Staff",
  373. column: x => x.StaffId,
  374. principalTable: "Staff",
  375. principalColumn: "Id",
  376. onDelete: ReferentialAction.Restrict);
  377. });
  378. migrationBuilder.CreateTable(
  379. name: "AppealRecord",
  380. columns: table => new
  381. {
  382. Id = table.Column<int>(type: "int", nullable: false)
  383. .Annotation("SqlServer:Identity", "1, 1"),
  384. CreaterId = table.Column<int>(type: "int", nullable: false),
  385. CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
  386. Reason = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  387. State = table.Column<int>(type: "int", nullable: false),
  388. ReviewerId = table.Column<int>(type: "int", nullable: true),
  389. ReviewerMemo = table.Column<string>(type: "nvarchar(max)", nullable: true),
  390. ReviewTime = table.Column<DateTime>(type: "datetime2", nullable: true),
  391. TypeId = table.Column<int>(type: "int", nullable: false),
  392. ItemId = table.Column<int>(type: "int", nullable: false)
  393. },
  394. constraints: table =>
  395. {
  396. table.PrimaryKey("PK_AppealRecord", x => x.Id);
  397. table.ForeignKey(
  398. name: "FK_AppealRecord_AppealType_TypeId",
  399. column: x => x.TypeId,
  400. principalTable: "AppealType",
  401. principalColumn: "Id");
  402. table.ForeignKey(
  403. name: "FK_AppealRecord_PerformanceItem_ItemId",
  404. column: x => x.ItemId,
  405. principalTable: "PerformanceItem",
  406. principalColumn: "Id",
  407. onDelete: ReferentialAction.Cascade);
  408. table.ForeignKey(
  409. name: "FK_AppealRecord_Staff_CreaterId",
  410. column: x => x.CreaterId,
  411. principalTable: "Staff",
  412. principalColumn: "Id",
  413. onDelete: ReferentialAction.Cascade);
  414. table.ForeignKey(
  415. name: "FK_AppealRecord_Staff_ReviewerId",
  416. column: x => x.ReviewerId,
  417. principalTable: "Staff",
  418. principalColumn: "Id");
  419. });
  420. migrationBuilder.CreateTable(
  421. name: "ItemStaff",
  422. columns: table => new
  423. {
  424. ItemId = table.Column<int>(type: "int", nullable: false),
  425. DoPersonId = table.Column<int>(type: "int", nullable: false),
  426. PerformancePoint = table.Column<double>(type: "float", nullable: true)
  427. },
  428. constraints: table =>
  429. {
  430. table.PrimaryKey("PK_ItemStaff", x => new { x.ItemId, x.DoPersonId });
  431. table.ForeignKey(
  432. name: "FK_ItemStaff_PerformanceItem",
  433. column: x => x.ItemId,
  434. principalTable: "PerformanceItem",
  435. principalColumn: "Id",
  436. onDelete: ReferentialAction.Restrict);
  437. table.ForeignKey(
  438. name: "FK_ItemStaff_Staff",
  439. column: x => x.DoPersonId,
  440. principalTable: "Staff",
  441. principalColumn: "Id",
  442. onDelete: ReferentialAction.Restrict);
  443. });
  444. migrationBuilder.CreateTable(
  445. name: "MessagePerformanceItems",
  446. columns: table => new
  447. {
  448. MessageId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
  449. ItemId = table.Column<int>(type: "int", nullable: false)
  450. },
  451. constraints: table =>
  452. {
  453. table.PrimaryKey("PK_MessagePerformanceItems", x => new { x.ItemId, x.MessageId });
  454. table.ForeignKey(
  455. name: "FK_MessagePerformanceItem_Item",
  456. column: x => x.ItemId,
  457. principalTable: "PerformanceItem",
  458. principalColumn: "Id",
  459. onDelete: ReferentialAction.Cascade);
  460. table.ForeignKey(
  461. name: "FK_MessagePerformanceItem_Message",
  462. column: x => x.MessageId,
  463. principalTable: "Message",
  464. principalColumn: "Id",
  465. onDelete: ReferentialAction.Cascade);
  466. });
  467. migrationBuilder.CreateTable(
  468. name: "AttachFile",
  469. columns: table => new
  470. {
  471. Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
  472. Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
  473. SavePath = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
  474. UploadUserId = table.Column<int>(type: "int", nullable: true),
  475. AppealRecordId = table.Column<int>(type: "int", nullable: true)
  476. },
  477. constraints: table =>
  478. {
  479. table.PrimaryKey("PK_AttachFile", x => x.Id);
  480. table.ForeignKey(
  481. name: "FK_AttachFile_AppealRecord",
  482. column: x => x.AppealRecordId,
  483. principalTable: "AppealRecord",
  484. principalColumn: "Id",
  485. onDelete: ReferentialAction.Restrict);
  486. table.ForeignKey(
  487. name: "FK_AttachFile_UpdateUser",
  488. column: x => x.UploadUserId,
  489. principalTable: "Staff",
  490. principalColumn: "Id");
  491. });
  492. migrationBuilder.CreateTable(
  493. name: "InputFieldValue",
  494. columns: table => new
  495. {
  496. Id = table.Column<int>(type: "int", nullable: false)
  497. .Annotation("SqlServer:Identity", "1, 1"),
  498. InputFieldId = table.Column<int>(type: "int", nullable: false),
  499. Label = table.Column<string>(type: "nvarchar(max)", nullable: true),
  500. Value = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  501. AppealRecordId = table.Column<int>(type: "int", nullable: false),
  502. mapExpress = table.Column<string>(type: "nvarchar(max)", nullable: true)
  503. },
  504. constraints: table =>
  505. {
  506. table.PrimaryKey("PK_InputFieldValue", x => x.Id);
  507. table.ForeignKey(
  508. name: "FK_InputFieldValue_AppealRecord_AppealRecordId",
  509. column: x => x.AppealRecordId,
  510. principalTable: "AppealRecord",
  511. principalColumn: "Id",
  512. onDelete: ReferentialAction.Cascade);
  513. table.ForeignKey(
  514. name: "FK_InputFieldValue_InputField_InputFieldId",
  515. column: x => x.InputFieldId,
  516. principalTable: "InputField",
  517. principalColumn: "Id",
  518. onDelete: ReferentialAction.Cascade);
  519. });
  520. migrationBuilder.CreateTable(
  521. name: "InputValueSetting",
  522. columns: table => new
  523. {
  524. Id = table.Column<int>(type: "int", nullable: false)
  525. .Annotation("SqlServer:Identity", "1, 1"),
  526. DisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true),
  527. valueType = table.Column<int>(type: "int", nullable: false),
  528. bindField = table.Column<string>(type: "nvarchar(max)", nullable: true),
  529. bindFieldSavetoObjectCondition = table.Column<string>(type: "nvarchar(max)", nullable: true),
  530. actionId = table.Column<int>(type: "int", nullable: false),
  531. Options = table.Column<string>(type: "nvarchar(max)", nullable: true),
  532. ParentSettingId = table.Column<int>(type: "int", nullable: true)
  533. },
  534. constraints: table =>
  535. {
  536. table.PrimaryKey("PK_InputValueSetting", x => x.Id);
  537. table.ForeignKey(
  538. name: "FK_InputValueSetting_InputValueSetting_ParentSettingId",
  539. column: x => x.ParentSettingId,
  540. principalTable: "InputValueSetting",
  541. principalColumn: "Id",
  542. onDelete: ReferentialAction.Restrict);
  543. });
  544. migrationBuilder.CreateTable(
  545. name: "Workflow",
  546. columns: table => new
  547. {
  548. Id = table.Column<int>(type: "int", nullable: false)
  549. .Annotation("SqlServer:Identity", "1, 1"),
  550. Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
  551. ContentObjectType = table.Column<string>(type: "nvarchar(max)", nullable: true),
  552. InitActionId = table.Column<int>(type: "int", nullable: false),
  553. EndStepId = table.Column<int>(type: "int", nullable: false)
  554. },
  555. constraints: table =>
  556. {
  557. table.PrimaryKey("PK_Workflow", x => x.Id);
  558. });
  559. migrationBuilder.CreateTable(
  560. name: "Step",
  561. columns: table => new
  562. {
  563. Id = table.Column<int>(type: "int", nullable: false)
  564. .Annotation("SqlServer:Identity", "1, 1"),
  565. Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
  566. workflowId = table.Column<int>(type: "int", nullable: false),
  567. stepType = table.Column<int>(type: "int", nullable: false),
  568. defaultResponseSetting = table.Column<string>(type: "nvarchar(max)", nullable: true)
  569. },
  570. constraints: table =>
  571. {
  572. table.PrimaryKey("PK_Step", x => x.Id);
  573. table.ForeignKey(
  574. name: "FK_Step_Workflow_workflowId",
  575. column: x => x.workflowId,
  576. principalTable: "Workflow",
  577. principalColumn: "Id",
  578. onDelete: ReferentialAction.Cascade);
  579. });
  580. migrationBuilder.CreateTable(
  581. name: "WorkflowInstance",
  582. columns: table => new
  583. {
  584. Id = table.Column<int>(type: "int", nullable: false)
  585. .Annotation("SqlServer:Identity", "1, 1"),
  586. workflowId = table.Column<int>(type: "int", nullable: false),
  587. ObjectId = table.Column<int>(type: "int", nullable: false)
  588. },
  589. constraints: table =>
  590. {
  591. table.PrimaryKey("PK_WorkflowInstance", x => x.Id);
  592. table.ForeignKey(
  593. name: "FK_WorkflowInstance_Workflow_workflowId",
  594. column: x => x.workflowId,
  595. principalTable: "Workflow",
  596. principalColumn: "Id",
  597. onDelete: ReferentialAction.Cascade);
  598. });
  599. migrationBuilder.CreateTable(
  600. name: "Action",
  601. columns: table => new
  602. {
  603. Id = table.Column<int>(type: "int", nullable: false)
  604. .Annotation("SqlServer:Identity", "1, 1"),
  605. Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
  606. InputForm = table.Column<string>(type: "nvarchar(max)", nullable: true),
  607. StepId = table.Column<int>(type: "int", nullable: false),
  608. OnActionObjectType = table.Column<string>(type: "nvarchar(max)", nullable: true)
  609. },
  610. constraints: table =>
  611. {
  612. table.PrimaryKey("PK_Action", x => x.Id);
  613. table.ForeignKey(
  614. name: "FK_Action_Step_StepId",
  615. column: x => x.StepId,
  616. principalTable: "Step",
  617. principalColumn: "Id",
  618. onDelete: ReferentialAction.Cascade);
  619. });
  620. migrationBuilder.CreateTable(
  621. name: "TrasferCondition",
  622. columns: table => new
  623. {
  624. Id = table.Column<int>(type: "int", nullable: false)
  625. .Annotation("SqlServer:Identity", "1, 1"),
  626. StepId = table.Column<int>(type: "int", nullable: false),
  627. Condition = table.Column<string>(type: "nvarchar(max)", nullable: true),
  628. nextStepId = table.Column<int>(type: "int", nullable: false)
  629. },
  630. constraints: table =>
  631. {
  632. table.PrimaryKey("PK_TrasferCondition", x => x.Id);
  633. table.ForeignKey(
  634. name: "FK_TrasferCondition_Step_nextStepId",
  635. column: x => x.nextStepId,
  636. principalTable: "Step",
  637. principalColumn: "Id");
  638. table.ForeignKey(
  639. name: "FK_TrasferCondition_Step_StepId",
  640. column: x => x.StepId,
  641. principalTable: "Step",
  642. principalColumn: "Id");
  643. });
  644. migrationBuilder.CreateTable(
  645. name: "InputValue",
  646. columns: table => new
  647. {
  648. Id = table.Column<int>(type: "int", nullable: false)
  649. .Annotation("SqlServer:Identity", "1, 1"),
  650. valueSettingId = table.Column<int>(type: "int", nullable: false),
  651. value = table.Column<string>(type: "nvarchar(max)", nullable: true),
  652. workflowInstanceId = table.Column<int>(type: "int", nullable: false)
  653. },
  654. constraints: table =>
  655. {
  656. table.PrimaryKey("PK_InputValue", x => x.Id);
  657. table.ForeignKey(
  658. name: "FK_InputValue_InputValueSetting_valueSettingId",
  659. column: x => x.valueSettingId,
  660. principalTable: "InputValueSetting",
  661. principalColumn: "Id",
  662. onDelete: ReferentialAction.Cascade);
  663. table.ForeignKey(
  664. name: "FK_InputValue_WorkflowInstance_workflowInstanceId",
  665. column: x => x.workflowInstanceId,
  666. principalTable: "WorkflowInstance",
  667. principalColumn: "Id",
  668. onDelete: ReferentialAction.Cascade);
  669. });
  670. migrationBuilder.CreateTable(
  671. name: "StepInstance",
  672. columns: table => new
  673. {
  674. Id = table.Column<int>(type: "int", nullable: false)
  675. .Annotation("SqlServer:Identity", "1, 1"),
  676. stepId = table.Column<int>(type: "int", nullable: false),
  677. workflowInstanceId = table.Column<int>(type: "int", nullable: false),
  678. PreviousStepId = table.Column<int>(type: "int", nullable: true)
  679. },
  680. constraints: table =>
  681. {
  682. table.PrimaryKey("PK_StepInstance", x => x.Id);
  683. table.ForeignKey(
  684. name: "FK_StepInstance_Step_stepId",
  685. column: x => x.stepId,
  686. principalTable: "Step",
  687. principalColumn: "Id",
  688. onDelete: ReferentialAction.Cascade);
  689. table.ForeignKey(
  690. name: "FK_StepInstance_WorkflowInstance_workflowInstanceId",
  691. column: x => x.workflowInstanceId,
  692. principalTable: "WorkflowInstance",
  693. principalColumn: "Id");
  694. });
  695. migrationBuilder.InsertData(
  696. table: "AppealType",
  697. columns: new[] { "Id", "CanDoExpress", "Name", "ReviewerExpress", "Type" },
  698. values: new object[,]
  699. {
  700. { 1, "p.ItemStaffs.Count()>1", "绩效点数分配比率", null, 0 },
  701. { 2, "p.DoItem==\"新申请\"", "案件系数复核", "p.Reviewer", 0 },
  702. { 3, "p.DoItem==\"新申请\"", "处理事项系数复核", "p.Reviewer", 0 },
  703. { 4, "", "案件缺漏申诉", "p.Reviewer", 1 },
  704. { 5, "p.isDanger()", "案件严重超期说明", null, 0 },
  705. { 6, "p.DoItem==\"新申请\" || p.DoItem==\"翻译\"", "按照翻译字数算绩效备注", null, 0 }
  706. });
  707. migrationBuilder.InsertData(
  708. table: "BasePointRule",
  709. columns: new[] { "Id", "PointExpress", "Priority", "Rule", "Type" },
  710. values: new object[,]
  711. {
  712. { 90, "0.2", 47, "p.DoItem==\"Non Final Action\" && p.DoItemCoefficient==\"形式\"", "OA" },
  713. { 91, "1.5", 46, "p.DoItem==\"Non Final Action\" && p.DoItemCoefficient==\"实质\"", "OA" },
  714. { 92, "0.1", 45, "p.DoItem==\"form 3-8(2)\" || p.DoItem==\"Form 3-8(2)\" || p.DoItem==\"Form 3-8(2)\"", "OA" },
  715. { 93, "0.1", 44, "p.DoItem==\"form 3\"", "OA" },
  716. { 94, "0.2", 43, "p.DoItem==\"Final Action\" && p.DoItemCoefficient==\"形式\"", "OA" },
  717. { 95, "1.5", 42, "p.DoItem==\"Final Action\" && p.DoItemCoefficient==\"实质\"", "OA" },
  718. { 98, "p.WordCount/1000*0.18", 39, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"中-德\" && p.WordCount !=null", "其它" },
  719. { 97, "1.5", 40, "p.DoItem==\"Advisory Action\" && p.DoItemCoefficient==\"实质\"", "OA" },
  720. { 89, "1.5", 48, "p.DoItem==\"RCE\" && p.DoItemCoefficient==\"实质\"", "OA" },
  721. { 99, "p.WordCount/1000*0.16", 38, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"中-英\" && p.WordCount !=null", "其它" },
  722. { 100, "p.WordCount/1000*0.1", 37, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"英-中\" && p.WordCount !=null", "其它" },
  723. { 101, "0", 36, "(p.ApplicationType==\"实用新型\" || p.ApplicationType==\"发明\") && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"客户不进行答辩\"", "其它" },
  724. { 102, "1.26", 35, "p.CaseNo.StartsWith(\"PAUS\") && p.AgentFeedbackMemo==\"发文后客户原因取消申请,系统结案\"", "新申请" },
  725. { 96, "0.2", 41, "p.DoItem==\"Advisory Action\" && p.DoItemCoefficient==\"形式\"", "OA" },
  726. { 88, "0.2", 49, "p.DoItem==\"RCE\" && p.DoItemCoefficient==\"形式\"", "OA" },
  727. { 85, "0.2", 52, "p.DoItem==\"口审评估\" && p.DoItemCoefficient==\"形式\"", "OA" },
  728. { 86, "0.2", 51, "p.DoItem==\"欧洲案答辩\" && p.DoItemCoefficient==\"形式\"", "OA" },
  729. { 71, "0.5", 66, "p.DoItem==\"申復\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PATW\")", "OA" },
  730. { 72, "0.2", 65, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAIN\")", "OA" },
  731. { 73, "0.2", 64, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAGB\")", "OA" },
  732. { 74, "0.2", 63, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAEPO\")", "OA" },
  733. { 75, "0.3", 62, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PADE\")", "OA" },
  734. { 77, "1.5", 60, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAIN\")", "OA" },
  735. { 87, "1.5", 50, "p.DoItem==\"欧洲案答辩\" && p.DoItemCoefficient==\"实质\"", "OA" },
  736. { 78, "1.5", 59, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAGB\")", "OA" },
  737. { 80, "1.6", 57, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PADE\")", "OA" },
  738. { 81, "1.5", 56, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAAU\")", "OA" },
  739. { 82, "0.2", 55, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAUS\")", "OA" },
  740. { 83, "1.5", 54, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAUS\")", "OA" },
  741. { 84, "1.5", 53, "p.DoItem==\"口审评估\" && p.DoItemCoefficient==\"实质\"", "OA" },
  742. { 103, "1.33", 34, "p.CaseNo.StartsWith(\"PADE\") && p.AgentFeedbackMemo==\"发文后客户原因取消申请,系统结案\"", "新申请" },
  743. { 79, "1.5", 58, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PAEPO\")", "OA" },
  744. { 104, "0.7", 33, "p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"发文后客户取消申请\"", "新申请" },
  745. { 107, "1.5", 30, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PCTCN\") && p.AgentFeedbackMemo==\"外到内首次申请\"", "新申请" },
  746. { 106, "0", 31, "p.AgentFeedbackMemo==\"撰写中客户取消申请\"", "其它" },
  747. { 137, "0", 250, "p.CaseNo.StartsWith(\"S\")", "专案" }
  748. });
  749. migrationBuilder.InsertData(
  750. table: "BasePointRule",
  751. columns: new[] { "Id", "PointExpress", "Priority", "Rule", "Type" },
  752. values: new object[,]
  753. {
  754. { 136, "1", 1, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\")", "新申请" },
  755. { 135, "1", 2, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseNo.EndsWith(\"-TS\")", "新申请" },
  756. { 134, "0.7", 3, "p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PACN\")", "新申请" },
  757. { 133, "1", 4, "p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PACN\") && (p.Customer!=null && p.Customer.Name.Contains(\"OPPO\"))", "新申请" },
  758. { 132, "0.1", 5, "p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseNo.EndsWith(\"-TS\")", "其它" },
  759. { 131, "1.9", 6, "p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PADE\")", "新申请" },
  760. { 130, "0.2", 7, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PAEPO\")", "其它" },
  761. { 129, "1.8", 8, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PAGB\")", "新申请" },
  762. { 128, "1.8", 9, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PAUS\")", "新申请" },
  763. { 127, "1.7", 10, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PAUS\") && (p.Customer!=null && p.Customer.Name.Contains(\"OPPO\"))", "新申请" },
  764. { 126, "0.1", 11, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PATW\") && p.AgentFeedbackMemo==\"同套大陆+台湾\"", "其它" },
  765. { 125, "0.7", 12, "p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"同套大陆+台湾\"", "新申请" },
  766. { 124, "0.1", 13, "p.DoItem==\"新申请\" && p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PATW\") && p.AgentFeedbackMemo==\"同套大陆+台湾\"", "其它" },
  767. { 123, "0.2", 14, "p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"台湾案转大陆案\"", "其它" },
  768. { 122, "1", 15, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"同套大陆+台湾\"", "新申请" },
  769. { 121, "0.2", 16, "p.DoItem==\"新申请\" && p.CaseNo.StartsWith(\"PATW\") && p.AgentFeedbackMemo==\"大陆案转台湾案\"", "其它" },
  770. { 70, "0.2", 67, "p.DoItem==\"申復\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PATW\")", "OA" },
  771. { 108, "0.1", 29, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"转格式\"", "其它" },
  772. { 109, "1.5", 28, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"外-内首次申请\"", "新申请" },
  773. { 110, "1", 27, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"首次中文案\"", "新申请" },
  774. { 111, "0.7", 26, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"涉外实质改权\"", "新申请" },
  775. { 112, "0.5", 25, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"改权+改说明书\"", "其它" },
  776. { 105, "0.49", 32, "p.ApplicationType==\"实用新型\" && p.CaseNo.StartsWith(\"PACN\") && p.AgentFeedbackMemo==\"发文后客户取消申请\"", "新申请" },
  777. { 113, "0.3", 24, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"改权\"", "其它" },
  778. { 115, "0.2", 22, "p.AgentFeedbackMemo==\"我方转格式、复核\"", "其它" },
  779. { 116, "0", 21, "p.AgentFeedbackMemo==\"我方代交\"", "其它" },
  780. { 117, "0.5", 20, "p.CaseNo.StartsWith(\"PAUS\") && (p.CaseNo.EndsWith(\"-同套\") || p.CaseNo.EndsWith(\"CA\") || p.CaseNo.EndsWith(\"CIP\") || p.CaseNo.EndsWith(\"分案\")) ", "其它" },
  781. { 118, "0.2", 19, "(p.CaseNo.StartsWith(\"PAMY \") || p.CaseNo.StartsWith(\"PADE\") || p.CaseNo.StartsWith(\"PAGB\") || p.CaseNo.StartsWith(\"PAIN\") || p.CaseNo.StartsWith(\"PAUS\") || p.CaseNo.StartsWith(\"PAEPO\") ) && p.AgentFeedbackMemo==\"同套\"", "其它" },
  782. { 119, "0.3", 18, "p.DoItem==\"新申请\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseNo.EndsWith(\"-分案\")", "其它" },
  783. { 120, "1.8", 17, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"欧洲案首次\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PAEPO\")", "新申请" },
  784. { 114, "1.8", 23, "p.DoItem==\"新申请\" && p.AgentFeedbackMemo==\"PCT首次英文案\"", "新申请" },
  785. { 69, "0.5", 68, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"客户提供答辩点,撰写英文报导函\"", "OA" },
  786. { 76, "0.2", 61, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PAAU\")", "OA" },
  787. { 67, "0.1", 70, "p.AgentFeedbackMemo==\"涉外OA不答辩,发报导函结案\"", "其它" },
  788. { 31, "0", 106, "p.DoItem.Contains(\"补正\") && p.CaseNo.StartsWith(\"PACN\")", "其它" },
  789. { 30, "0", 107, "p.DoItem.Contains(\"补正\") && p.CaseNo.StartsWith(\"PCTCN\")", "其它" },
  790. { 29, "0", 108, "p.DoItem.Contains(\"补正\") && p.CaseNo.StartsWith(\"WOCN\")", "其它" },
  791. { 28, "0.2", 109, "p.DoItem.Contains(\"补正\") && p.CaseNo.StartsWith(\"PADE\")", "其它" },
  792. { 27, "0.2", 110, "p.DoItem.Contains(\"补正\") && p.CaseNo.StartsWith(\"PAEPO\")", "其它" },
  793. { 26, "0.2", 111, "p.DoItem.Contains(\"补正\") && p.CaseNo.StartsWith(\"PAGB\")", "其它" },
  794. { 25, "0.2", 112, "p.DoItem.Contains(\"补正\") && p.CaseNo.StartsWith(\"PAIN\")", "其它" },
  795. { 68, "0.8", 69, "p.DoItem==\"处理审查意见\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"客户未提供答辩点,撰写英文报导函\"", "OA" }
  796. });
  797. migrationBuilder.InsertData(
  798. table: "BasePointRule",
  799. columns: new[] { "Id", "PointExpress", "Priority", "Rule", "Type" },
  800. values: new object[,]
  801. {
  802. { 23, "0.2", 114, "p.DoItem==\"Election Action\"", "其它" },
  803. { 22, "0.2", 115, "p.DoItem==\"OA答辩校核\"", "其它" },
  804. { 21, "0.1", 116, "p.DoItem==\"PPH\"", "其它" },
  805. { 20, "0", 117, "p.DoItem==\"电询\" && p.CaseNo.StartsWith(\"PACN\")", "其它" },
  806. { 19, "0.2", 118, "p.DoItem==\"电询\" && p.CaseNo.StartsWith(\"PAEPO\") ", "其它" },
  807. { 18, "0.2", 119, "p.DoItem==\"电询\" && p.CaseNo.StartsWith(\"PAUS\")", "其它" },
  808. { 17, "0.1", 120, "p.DoItem==\"分案评估\"", "其它" },
  809. { 16, "0.2", 121, "p.DoItem==\"分案评估+分案\"", "其它" },
  810. { 15, "0", 122, "p.DoItem==\"绘图\"", "其它" },
  811. { 1, "0", 136, "p.CaseNo.StartsWith(\"J\")", "其它" },
  812. { 2, "0", 135, "p.AgentFeedbackMemo==\"已算绩效\"", "其它" },
  813. { 3, "p.WordCount/1000*0.18", 134, "p.DoItem==\"翻译\" && p.AgentFeedbackMemo==\"中-德\"", "其它" },
  814. { 4, "p.WordCount/1000*0.16", 133, "p.DoItem==\"翻译\" && p.AgentFeedbackMemo==\"中-英\"", "其它" },
  815. { 5, "p.WordCount/1000*0.1", 132, "p.DoItem==\"翻译\" && p.AgentFeedbackMemo==\"英-中\"", "其它" },
  816. { 6, "0.2", 131, "(p.DoItem==\"提交检索主题申明\" || p.DoItem==\"提交检索主题声明\") && p.CaseNo.StartsWith(\"PAEPO\")", "其它" },
  817. { 32, "0.2", 105, "p.DoItem.Contains(\"补正\") && p.CaseNo.StartsWith(\"PAAU\")", "其它" },
  818. { 7, "0", 130, "p.DoItem==\"请求优先审查\"", "其它" },
  819. { 9, "0", 128, "p.DoItem==\"专利挖掘与布局\"", "其它" },
  820. { 10, "0", 127, "p.DoItem==\"知识点总结\"", "其它" },
  821. { 11, "0", 126, "p.DoItem==\"询问放弃或复审\"", "其它" },
  822. { 12, "0", 125, "p.DoItem==\"申请时提交IDS\"", "其它" },
  823. { 13, "0.1", 124, "p.DoItem==\"提交ids\" || p.DoItem==\"提交IDS\" ", "其它" },
  824. { 14, "0", 123, "p.DoItem==\"技术确认\"", "其它" },
  825. { 8, "0.2", 129, "p.ApplicationType==\"外观设计\" && p.DoItem==\"新申请\"", "其它" },
  826. { 33, "0.2", 104, "p.AgentFeedbackMemo==\"检索结案\"", "其它" },
  827. { 24, "0.2", 113, "p.DoItem.Contains(\"补正\") && p.CaseNo.StartsWith(\"PAUS\")", "其它" },
  828. { 35, "0.2", 102, "p.DoItem==\"翻译校核\" && p.DoItemCoefficient==\"形式\" && p.AgentFeedbackMemo==\"外-内\"", "其它" },
  829. { 66, "0.5", 71, "p.DoItem==\"请求复审\" && p.ApplicationType==\"发明\"", "OA" },
  830. { 65, "0.2", 72, "p.DoItem==\"意见陈述\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseStage==\"复审\"", "OA" },
  831. { 64, "0.3", 73, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"非实质\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseStage==\"一通\"", "OA" },
  832. { 63, "0.5", 74, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseStage==\"一通\"", "OA" },
  833. { 62, "0.2", 75, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseStage==\"一通\"", "OA" },
  834. { 34, "0", 103, "p.DoItem==\"内部检索\"", "其它" },
  835. { 60, "0.5", 77, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"实质\" && p.CaseNo.StartsWith(\"PCTCN\") && p.CaseStage==\"一通\"", "OA" },
  836. { 59, "0.2", 78, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"形式\" && p.CaseNo.StartsWith(\"PCTCN\") && p.CaseStage==\"一通\"", "OA" },
  837. { 58, "0.2", 79, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\") && p.CaseStage==\"二通\"", "OA" },
  838. { 57, "0.2", 80, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PCTCN\") && p.CaseStage==\"二通\"", "OA" },
  839. { 56, "0", 81, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PACN\") && (p.CaseStage==\"三通\" || p.CaseStage==\"四通\" || p.CaseStage==\"五通\")", "OA" },
  840. { 55, "0", 82, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.CaseNo.StartsWith(\"PCTCN\") && (p.CaseStage==\"三通\" || p.CaseStage==\"四通\" || p.CaseStage==\"五通\")", "OA" },
  841. { 54, "0.3", 83, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"非实质\" && p.AgentFeedbackMemo==\"外所/他人首次转入OA\"", "OA" },
  842. { 53, "0.5", 84, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"外所/他人首次转入OA\"", "OA" },
  843. { 52, "0.2", 85, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"形式\" && p.AgentFeedbackMemo==\"外所/他人首次转入OA\"", "OA" }
  844. });
  845. migrationBuilder.InsertData(
  846. table: "BasePointRule",
  847. columns: new[] { "Id", "PointExpress", "Priority", "Rule", "Type" },
  848. values: new object[,]
  849. {
  850. { 61, "0.3", 76, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"发明\" && p.DoItemCoefficient==\"非实质\" && p.CaseNo.StartsWith(\"PCTCN\") && p.CaseStage==\"一通\"", "OA" },
  851. { 50, "0.14", 87, "p.ApplicationType==\"实用新型\" && p.DoItemCoefficient==\"实质\" && p.CaseStage==\"二通\" && p.AgentFeedbackMemo==\"请款\"", "OA" },
  852. { 36, "0.3", 101, "p.DoItem==\"翻译校核\" && p.DoItemCoefficient==\"形式\" && p.AgentFeedbackMemo==\"内-外\"", "其它" },
  853. { 37, "0.5", 100, "p.DoItem==\"翻译校核\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"外-内\"", "其它" },
  854. { 38, "0.7", 99, "p.DoItem==\"翻译校核\" && p.DoItemCoefficient==\"实质\" && p.AgentFeedbackMemo==\"内-外\"", "其它" },
  855. { 39, "0.2", 98, "p.DoItem==\"发明一次OA授权\" && p.ApplicationType==\"发明\"", "其它" },
  856. { 40, "0", 97, "p.DoItem==\"处理审查意见\" && p.AgentFeedbackMemo==\"客户不进行答辩\"", "OA" },
  857. { 41, "0", 96, "p.DoItem==\"处理审查意见\" && p.AgentFeedbackMemo==\"电询/补正\"", "OA" },
  858. { 42, "0", 95, "p.DoItem==\"处理审查意见\" && p.ApplicationType==\"实用新型\" && p.AgentFeedbackMemo==\"不请款\"", "OA" },
  859. { 44, "0", 93, "p.DoItem==\"请求复审\" && p.ApplicationType==\"实用新型\" && p.AgentFeedbackMemo==\"不请款\"", "OA" },
  860. { 45, "0.14", 92, "p.DoItem==\"意见陈述\" && p.ApplicationType==\"实用新型\" && p.AgentFeedbackMemo==\"请款\"", "OA" },
  861. { 46, "0.35", 91, "p.DoItem==\"请求复审\" && p.ApplicationType==\"实用新型\" && p.AgentFeedbackMemo==\"请款\"", "OA" },
  862. { 47, "0.21", 90, "p.ApplicationType==\"实用新型\" && p.DoItemCoefficient==\"非实质\" && p.CaseStage==\"一通\" && p.AgentFeedbackMemo==\"请款\"", "OA" },
  863. { 48, "0.35", 89, "p.ApplicationType==\"实用新型\" && p.DoItemCoefficient==\"实质\" && p.CaseStage==\"一通\" && p.AgentFeedbackMemo==\"请款\"", "OA" },
  864. { 49, "0.14", 88, "p.ApplicationType==\"实用新型\" && p.DoItemCoefficient==\"形式\" && p.CaseStage==\"一通\" && p.AgentFeedbackMemo==\"请款\"", "OA" },
  865. { 43, "0", 94, "p.DoItem==\"意见陈述\" && p.ApplicationType==\"实用新型\" && p.AgentFeedbackMemo==\"不请款\"", "OA" },
  866. { 51, "0", 86, "p.ApplicationType==\"实用新型\" && p.DoItemCoefficient==\"实质\" && (p.CaseStage==\"三通\" || p.CaseStage==\"四通\" || p.CaseStage==\"五通\" || p.CaseStage==\"六通\" || p.CaseStage==\"七通\" || p.CaseStage==\"八通\") ", "OA" }
  867. });
  868. migrationBuilder.InsertData(
  869. table: "CaseCeofficient",
  870. columns: new[] { "Ceoffcient", "Value" },
  871. values: new object[,]
  872. {
  873. { "C", 0.69999999999999996 },
  874. { "D", 0.40000000000000002 },
  875. { "B", 1.0 },
  876. { "S", 2.5 },
  877. { "A", 1.5 }
  878. });
  879. migrationBuilder.InsertData(
  880. table: "StaffGrade",
  881. columns: new[] { "Id", "Coefficient", "Grade" },
  882. values: new object[,]
  883. {
  884. { 14, 1.1000000000000001, "A级" },
  885. { 13, 0.5, "D1级" },
  886. { 12, 0.59999999999999998, "D2级" },
  887. { 11, 0.59999999999999998, "D3级" },
  888. { 10, 0.69999999999999996, "C1级" },
  889. { 9, 0.69999999999999996, "C2级" },
  890. { 8, 0.90000000000000002, "C3级" },
  891. { 7, 0.90000000000000002, "B1级" },
  892. { 5, 1.0, "B3级" },
  893. { 4, 1.1000000000000001, "A1级" },
  894. { 3, 1.1000000000000001, "A2级" },
  895. { 2, 1.1000000000000001, "A3级" },
  896. { 1, 1.2, "S级" },
  897. { 15, 1.0, "C级" },
  898. { 6, 1.0, "B2级" },
  899. { 16, 0.90000000000000002, "D级" }
  900. });
  901. migrationBuilder.InsertData(
  902. table: "InputField",
  903. columns: new[] { "Id", "AppealState", "AppealTypeId", "CanMuliSelect", "FieldName", "FieldType", "MapObjectField", "MapObjectFieldLabel", "MapSaveCondition", "MaxSize" },
  904. values: new object[,]
  905. {
  906. { 1, 0, 1, false, "分配比率", "System.Double", "ItemStaffs.PerformancePoint", "ItemStaffs.DoPerson.Name", null, null },
  907. { 24, 1, 6, false, "翻译字数", "System.Int32", "WordCount", null, null, null },
  908. { 23, 1, 6, false, "审核意见", "System.Int32", null, null, null, null },
  909. { 20, 0, 6, false, "翻译字数", "System.Int32", "WordCount", null, null, null },
  910. { 19, 0, 6, false, "翻译类型", "System.String", "AgentFeedbackMemo", null, null, null },
  911. { 21, 1, 5, false, "审核意见", "System.String", null, null, null, null },
  912. { 18, 0, 5, false, "超期说明", "System.String", "OverDueMemo", null, null, null },
  913. { 17, 1, 4, false, "审核意见", "System.String", null, null, null, null },
  914. { 16, 1, 4, false, "备注", "System.String", null, null, null, null },
  915. { 15, 0, 4, false, "处理事项", "System.String", null, null, null, null },
  916. { 22, 1, 5, false, "备注", "System.String", null, null, null, null },
  917. { 13, 1, 3, false, "审核意见", "System.String", null, null, null, null },
  918. { 12, 1, 3, false, "备注", "System.String", null, null, null, null },
  919. { 11, 0, 3, false, "处理事项系数", "System.String", "DoItemCoefficient", null, null, null },
  920. { 10, 1, 2, false, "审核意见", "System.String", null, null, null, null },
  921. { 9, 1, 2, false, "备注", "System.String", null, null, null, null },
  922. { 6, 0, 2, false, "案件系数", "System.String", "CaseCoefficient", null, null, null },
  923. { 5, 1, 1, false, "审核意见", "System.String", null, null, null, null },
  924. { 4, 1, 1, false, "备注", "System.String", null, null, null, null },
  925. { 3, 0, 1, false, "原因", "System.String", null, null, null, null },
  926. { 14, 0, 4, false, "我方文号", "System.String", null, null, null, null }
  927. });
  928. migrationBuilder.InsertData(
  929. table: "VerifyCoefficient",
  930. columns: new[] { "CheckerId", "DoPersonId", "Coefficient" },
  931. values: new object[,]
  932. {
  933. { 2, 11, 0.40000000000000002 },
  934. { 1, 11, 0.5 },
  935. { 6, 10, 0.29999999999999999 },
  936. { 5, 10, 0.29999999999999999 },
  937. { 4, 10, 0.29999999999999999 },
  938. { 5, 9, 0.29999999999999999 },
  939. { 2, 10, 0.29999999999999999 },
  940. { 1, 10, 0.40000000000000002 },
  941. { 6, 9, 0.29999999999999999 },
  942. { 3, 11, 0.40000000000000002 },
  943. { 3, 10, 0.29999999999999999 },
  944. { 4, 11, 0.40000000000000002 },
  945. { 2, 13, 0.5 },
  946. { 6, 11, 0.40000000000000002 },
  947. { 1, 12, 0.5 },
  948. { 2, 12, 0.40000000000000002 },
  949. { 3, 12, 0.40000000000000002 },
  950. { 4, 12, 0.40000000000000002 },
  951. { 5, 12, 0.40000000000000002 },
  952. { 6, 12, 0.40000000000000002 },
  953. { 1, 13, 0.59999999999999998 }
  954. });
  955. migrationBuilder.InsertData(
  956. table: "VerifyCoefficient",
  957. columns: new[] { "CheckerId", "DoPersonId", "Coefficient" },
  958. values: new object[,]
  959. {
  960. { 4, 9, 0.29999999999999999 },
  961. { 3, 13, 0.5 },
  962. { 4, 13, 0.5 },
  963. { 5, 11, 0.40000000000000002 },
  964. { 3, 9, 0.29999999999999999 },
  965. { 5, 7, 0.20000000000000001 },
  966. { 1, 9, 0.40000000000000002 },
  967. { 1, 5, 0.29999999999999999 },
  968. { 2, 5, 0.20000000000000001 },
  969. { 3, 5, 0.20000000000000001 },
  970. { 4, 5, 0.20000000000000001 },
  971. { 5, 5, 0.20000000000000001 },
  972. { 1, 6, 0.29999999999999999 },
  973. { 2, 6, 0.20000000000000001 },
  974. { 3, 6, 0.20000000000000001 },
  975. { 4, 6, 0.20000000000000001 },
  976. { 5, 6, 0.20000000000000001 },
  977. { 6, 5, 0.20000000000000001 },
  978. { 2, 9, 0.29999999999999999 },
  979. { 6, 6, 0.20000000000000001 },
  980. { 2, 7, 0.20000000000000001 },
  981. { 3, 7, 0.20000000000000001 },
  982. { 4, 7, 0.20000000000000001 },
  983. { 5, 13, 0.5 },
  984. { 6, 7, 0.20000000000000001 },
  985. { 1, 8, 0.29999999999999999 },
  986. { 2, 8, 0.20000000000000001 },
  987. { 3, 8, 0.20000000000000001 },
  988. { 4, 8, 0.20000000000000001 },
  989. { 5, 8, 0.20000000000000001 },
  990. { 6, 8, 0.20000000000000001 },
  991. { 1, 7, 0.29999999999999999 },
  992. { 6, 13, 0.5 }
  993. });
  994. migrationBuilder.InsertData(
  995. table: "SelectValue",
  996. columns: new[] { "Id", "InputFieldId", "Value" },
  997. values: new object[,]
  998. {
  999. { 1, 5, "同意" },
  1000. { 16, 19, "中-德" },
  1001. { 20, 22, "拒绝" },
  1002. { 19, 22, "同意" },
  1003. { 8, 17, "拒绝" },
  1004. { 7, 17, "同意" },
  1005. { 6, 13, "拒绝" },
  1006. { 5, 13, "同意" },
  1007. { 15, 11, "形式" },
  1008. { 14, 11, "实质" },
  1009. { 4, 10, "拒绝" },
  1010. { 3, 10, "同意" },
  1011. { 13, 6, "D" },
  1012. { 12, 6, "C" },
  1013. { 11, 6, "B" },
  1014. { 10, 6, "A" },
  1015. { 9, 6, "S" },
  1016. { 2, 5, "拒绝" },
  1017. { 17, 19, "中-英" },
  1018. { 18, 19, "英-中" }
  1019. });
  1020. migrationBuilder.CreateIndex(
  1021. name: "IX_Action_StepId",
  1022. table: "Action",
  1023. column: "StepId");
  1024. migrationBuilder.CreateIndex(
  1025. name: "IX_AppealRecord_CreaterId",
  1026. table: "AppealRecord",
  1027. column: "CreaterId");
  1028. migrationBuilder.CreateIndex(
  1029. name: "IX_AppealRecord_ItemId",
  1030. table: "AppealRecord",
  1031. column: "ItemId");
  1032. migrationBuilder.CreateIndex(
  1033. name: "IX_AppealRecord_ReviewerId",
  1034. table: "AppealRecord",
  1035. column: "ReviewerId");
  1036. migrationBuilder.CreateIndex(
  1037. name: "IX_AppealRecord_TypeId",
  1038. table: "AppealRecord",
  1039. column: "TypeId");
  1040. migrationBuilder.CreateIndex(
  1041. name: "IX_AttachFile_AppealRecordId",
  1042. table: "AttachFile",
  1043. column: "AppealRecordId");
  1044. migrationBuilder.CreateIndex(
  1045. name: "IX_AttachFile_UploadUserId",
  1046. table: "AttachFile",
  1047. column: "UploadUserId");
  1048. migrationBuilder.CreateIndex(
  1049. name: "IX_Customer_ResponseManId",
  1050. table: "Customer",
  1051. column: "ResponseManId");
  1052. migrationBuilder.CreateIndex(
  1053. name: "IX_DepartmentPosition_departmentId",
  1054. table: "DepartmentPosition",
  1055. column: "departmentId");
  1056. migrationBuilder.CreateIndex(
  1057. name: "IX_DepartmentPosition_PositionId",
  1058. table: "DepartmentPosition",
  1059. column: "PositionId");
  1060. migrationBuilder.CreateIndex(
  1061. name: "IX_DepartmentPosition_StaffId",
  1062. table: "DepartmentPosition",
  1063. column: "StaffId");
  1064. migrationBuilder.CreateIndex(
  1065. name: "IX_InputField_AppealTypeId",
  1066. table: "InputField",
  1067. column: "AppealTypeId");
  1068. migrationBuilder.CreateIndex(
  1069. name: "IX_InputFieldValue_AppealRecordId",
  1070. table: "InputFieldValue",
  1071. column: "AppealRecordId");
  1072. migrationBuilder.CreateIndex(
  1073. name: "IX_InputFieldValue_InputFieldId",
  1074. table: "InputFieldValue",
  1075. column: "InputFieldId");
  1076. migrationBuilder.CreateIndex(
  1077. name: "IX_InputValue_valueSettingId",
  1078. table: "InputValue",
  1079. column: "valueSettingId");
  1080. migrationBuilder.CreateIndex(
  1081. name: "IX_InputValue_workflowInstanceId",
  1082. table: "InputValue",
  1083. column: "workflowInstanceId");
  1084. migrationBuilder.CreateIndex(
  1085. name: "IX_InputValueSetting_actionId",
  1086. table: "InputValueSetting",
  1087. column: "actionId");
  1088. migrationBuilder.CreateIndex(
  1089. name: "IX_InputValueSetting_ParentSettingId",
  1090. table: "InputValueSetting",
  1091. column: "ParentSettingId");
  1092. migrationBuilder.CreateIndex(
  1093. name: "IX_ItemStaff_DoPersonId",
  1094. table: "ItemStaff",
  1095. column: "DoPersonId");
  1096. migrationBuilder.CreateIndex(
  1097. name: "IX_Message_FromId",
  1098. table: "Message",
  1099. column: "FromId");
  1100. migrationBuilder.CreateIndex(
  1101. name: "IX_MessagePerformanceItems_MessageId",
  1102. table: "MessagePerformanceItems",
  1103. column: "MessageId");
  1104. migrationBuilder.CreateIndex(
  1105. name: "IX_MessageReadRecord_MessageId1",
  1106. table: "MessageReadRecord",
  1107. column: "MessageId1");
  1108. migrationBuilder.CreateIndex(
  1109. name: "IX_MessageReadRecord_StaffId",
  1110. table: "MessageReadRecord",
  1111. column: "StaffId");
  1112. migrationBuilder.CreateIndex(
  1113. name: "IX_PerformanceItem_CalMonthId",
  1114. table: "PerformanceItem",
  1115. column: "CalMonthId");
  1116. migrationBuilder.CreateIndex(
  1117. name: "IX_PerformanceItem_CustomerId",
  1118. table: "PerformanceItem",
  1119. column: "CustomerId");
  1120. migrationBuilder.CreateIndex(
  1121. name: "IX_PerformanceItem_PreOAStaffId",
  1122. table: "PerformanceItem",
  1123. column: "PreOAStaffId");
  1124. migrationBuilder.CreateIndex(
  1125. name: "IX_PerformanceItem_ReviewerId",
  1126. table: "PerformanceItem",
  1127. column: "ReviewerId");
  1128. migrationBuilder.CreateIndex(
  1129. name: "IX_SelectValue_InputFieldId",
  1130. table: "SelectValue",
  1131. column: "InputFieldId");
  1132. migrationBuilder.CreateIndex(
  1133. name: "IX_Staff_StaffGradeId",
  1134. table: "Staff",
  1135. column: "StaffGradeId");
  1136. migrationBuilder.CreateIndex(
  1137. name: "IX_Step_workflowId",
  1138. table: "Step",
  1139. column: "workflowId");
  1140. migrationBuilder.CreateIndex(
  1141. name: "IX_StepInstance_stepId",
  1142. table: "StepInstance",
  1143. column: "stepId");
  1144. migrationBuilder.CreateIndex(
  1145. name: "IX_StepInstance_workflowInstanceId",
  1146. table: "StepInstance",
  1147. column: "workflowInstanceId");
  1148. migrationBuilder.CreateIndex(
  1149. name: "IX_TrasferCondition_nextStepId",
  1150. table: "TrasferCondition",
  1151. column: "nextStepId");
  1152. migrationBuilder.CreateIndex(
  1153. name: "IX_TrasferCondition_StepId",
  1154. table: "TrasferCondition",
  1155. column: "StepId");
  1156. migrationBuilder.CreateIndex(
  1157. name: "IX_VerifyCoefficient_DoPersonId",
  1158. table: "VerifyCoefficient",
  1159. column: "DoPersonId");
  1160. migrationBuilder.CreateIndex(
  1161. name: "IX_Workflow_InitActionId",
  1162. table: "Workflow",
  1163. column: "InitActionId");
  1164. migrationBuilder.CreateIndex(
  1165. name: "IX_WorkflowInstance_workflowId",
  1166. table: "WorkflowInstance",
  1167. column: "workflowId");
  1168. migrationBuilder.AddForeignKey(
  1169. name: "FK_InputValueSetting_Action_actionId",
  1170. table: "InputValueSetting",
  1171. column: "actionId",
  1172. principalTable: "Action",
  1173. principalColumn: "Id");
  1174. migrationBuilder.AddForeignKey(
  1175. name: "FK_Workflow_Action_InitActionId",
  1176. table: "Workflow",
  1177. column: "InitActionId",
  1178. principalTable: "Action",
  1179. principalColumn: "Id");
  1180. }
  1181. protected override void Down(MigrationBuilder migrationBuilder)
  1182. {
  1183. migrationBuilder.DropForeignKey(
  1184. name: "FK_Action_Step_StepId",
  1185. table: "Action");
  1186. migrationBuilder.DropTable(
  1187. name: "AttachFile");
  1188. migrationBuilder.DropTable(
  1189. name: "BasePointRule");
  1190. migrationBuilder.DropTable(
  1191. name: "CaseCeofficient");
  1192. migrationBuilder.DropTable(
  1193. name: "DepartmentPosition");
  1194. migrationBuilder.DropTable(
  1195. name: "InputFieldValue");
  1196. migrationBuilder.DropTable(
  1197. name: "InputValue");
  1198. migrationBuilder.DropTable(
  1199. name: "ItemStaff");
  1200. migrationBuilder.DropTable(
  1201. name: "MessagePerformanceItems");
  1202. migrationBuilder.DropTable(
  1203. name: "MessageReadRecord");
  1204. migrationBuilder.DropTable(
  1205. name: "SelectValue");
  1206. migrationBuilder.DropTable(
  1207. name: "StepInstance");
  1208. migrationBuilder.DropTable(
  1209. name: "TrasferCondition");
  1210. migrationBuilder.DropTable(
  1211. name: "VerifyCoefficient");
  1212. migrationBuilder.DropTable(
  1213. name: "Department");
  1214. migrationBuilder.DropTable(
  1215. name: "Position");
  1216. migrationBuilder.DropTable(
  1217. name: "AppealRecord");
  1218. migrationBuilder.DropTable(
  1219. name: "InputValueSetting");
  1220. migrationBuilder.DropTable(
  1221. name: "Message");
  1222. migrationBuilder.DropTable(
  1223. name: "InputField");
  1224. migrationBuilder.DropTable(
  1225. name: "WorkflowInstance");
  1226. migrationBuilder.DropTable(
  1227. name: "PerformanceItem");
  1228. migrationBuilder.DropTable(
  1229. name: "AppealType");
  1230. migrationBuilder.DropTable(
  1231. name: "CalMonth");
  1232. migrationBuilder.DropTable(
  1233. name: "Customer");
  1234. migrationBuilder.DropTable(
  1235. name: "Staff");
  1236. migrationBuilder.DropTable(
  1237. name: "StaffGrade");
  1238. migrationBuilder.DropTable(
  1239. name: "Step");
  1240. migrationBuilder.DropTable(
  1241. name: "Workflow");
  1242. migrationBuilder.DropTable(
  1243. name: "Action");
  1244. }
  1245. }
  1246. }