gozap.sql 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. -- phpMyAdmin SQL Dump
  2. -- version 5.2.0
  3. -- https://www.phpmyadmin.net/
  4. --
  5. -- Host: 127.0.0.1
  6. -- Generation Time: Oct 30, 2022 at 09:23 AM
  7. -- Server version: 10.4.25-MariaDB
  8. -- PHP Version: 8.0.23
  9. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  10. START TRANSACTION;
  11. SET time_zone = "+00:00";
  12. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  13. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  14. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  15. /*!40101 SET NAMES utf8mb4 */;
  16. --
  17. -- Database: `gozap`
  18. --
  19. -- --------------------------------------------------------
  20. --
  21. -- Table structure for table `asset`
  22. --
  23. CREATE TABLE `asset` (
  24. `AssetID` varchar(50) NOT NULL,
  25. `AssetName` varchar(100) NOT NULL,
  26. `IsActive` tinyint(1) NOT NULL DEFAULT 1,
  27. `CreatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  28. `UpdatedAt` timestamp(1) NOT NULL DEFAULT current_timestamp(1),
  29. `AssetCategoryID` int(11) NOT NULL,
  30. `IsInServiceCenter` tinyint(1) NOT NULL DEFAULT 1
  31. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  32. --
  33. -- Dumping data for table `asset`
  34. --
  35. INSERT INTO `asset` (`AssetID`, `AssetName`, `IsActive`, `CreatedAt`, `UpdatedAt`, `AssetCategoryID`, `IsInServiceCenter`) VALUES
  36. ('HE5130TK22157196', 'Lithium - ion Battery', 1, '2022-10-28 09:06:49', '2022-10-28 09:06:49.2', 1, 0),
  37. ('HE5130TK22158489', 'Lithium - ion Battery', 1, '2022-10-28 09:09:14', '2022-10-28 09:09:14.1', 1, 1),
  38. ('HE5130TK22159795', 'Lithium Battery', 1, '2022-10-28 10:41:17', '2022-10-28 10:41:17.3', 1, 1);
  39. -- --------------------------------------------------------
  40. --
  41. -- Table structure for table `assetcategory`
  42. --
  43. CREATE TABLE `assetcategory` (
  44. `AssetCategoryID` int(11) NOT NULL,
  45. `AssetCategoryTitle` varchar(20) NOT NULL,
  46. `IsActive` tinyint(1) DEFAULT 1,
  47. `CreatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  48. `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp()
  49. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  50. --
  51. -- Dumping data for table `assetcategory`
  52. --
  53. INSERT INTO `assetcategory` (`AssetCategoryID`, `AssetCategoryTitle`, `IsActive`, `CreatedAt`, `UpdatedAt`) VALUES
  54. (1, 'Battery', 1, '2022-10-28 09:08:24', '2022-10-28 09:08:24'),
  55. (2, 'Vehicle', 1, '2022-10-28 09:08:29', '2022-10-28 09:08:29');
  56. -- --------------------------------------------------------
  57. --
  58. -- Table structure for table `paymenttypes`
  59. --
  60. CREATE TABLE `paymenttypes` (
  61. `PaymentTypeID` int(11) NOT NULL,
  62. `PaymentTypeTitle` varchar(20) NOT NULL,
  63. `IsActive` int(11) NOT NULL,
  64. `CreatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  65. `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp()
  66. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  67. -- --------------------------------------------------------
  68. --
  69. -- Table structure for table `rechargehistory`
  70. --
  71. CREATE TABLE `rechargehistory` (
  72. `RechargeHistoryID` int(11) NOT NULL,
  73. `RiderID` varchar(20) NOT NULL,
  74. `TransactionID` varchar(20) DEFAULT NULL,
  75. `PaymentTypeID` int(11) NOT NULL DEFAULT 1,
  76. `IsActive` int(11) NOT NULL DEFAULT 1,
  77. `CreatedAt` timestamp NULL DEFAULT current_timestamp(),
  78. `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  79. `RechargeCount` int(11) NOT NULL
  80. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  81. --
  82. -- Dumping data for table `rechargehistory`
  83. --
  84. INSERT INTO `rechargehistory` (`RechargeHistoryID`, `RiderID`, `TransactionID`, `PaymentTypeID`, `IsActive`, `CreatedAt`, `UpdatedAt`, `RechargeCount`) VALUES
  85. (1, '8124308141', '', 1, 1, '2022-10-28 09:10:21', '2022-10-28 09:10:21', 2),
  86. (2, '7305325141', '', 1, 1, '2022-10-28 10:38:37', '2022-10-28 10:38:37', 2);
  87. -- --------------------------------------------------------
  88. --
  89. -- Table structure for table `refer`
  90. --
  91. CREATE TABLE `refer` (
  92. `ReferID` int(11) NOT NULL,
  93. `UserID` int(11) NOT NULL,
  94. `UserReferID` int(11) NOT NULL,
  95. `ReferedUserID` int(11) NOT NULL,
  96. `IsApproved` tinyint(1) NOT NULL DEFAULT 0,
  97. `IsActive` tinyint(1) NOT NULL DEFAULT 1,
  98. `CreatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  99. `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp()
  100. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  101. -- --------------------------------------------------------
  102. --
  103. -- Table structure for table `rider`
  104. --
  105. CREATE TABLE `rider` (
  106. `RiderID` varchar(20) NOT NULL,
  107. `UserID` int(11) NOT NULL,
  108. `IsActive` tinyint(1) NOT NULL DEFAULT 1,
  109. `CreatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  110. `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp()
  111. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  112. --
  113. -- Dumping data for table `rider`
  114. --
  115. INSERT INTO `rider` (`RiderID`, `UserID`, `IsActive`, `CreatedAt`, `UpdatedAt`) VALUES
  116. ('7305325141', 2, 1, '2022-10-28 10:32:23', '2022-10-28 10:32:23'),
  117. ('8124308141', 1, 1, '2022-10-28 09:04:51', '2022-10-28 09:04:51'),
  118. ('9789910828', 3, 1, '2022-10-28 11:35:19', '2022-10-28 11:35:19');
  119. -- --------------------------------------------------------
  120. --
  121. -- Table structure for table `servicehistory`
  122. --
  123. CREATE TABLE `servicehistory` (
  124. `ServiceHistoryID` int(11) NOT NULL,
  125. `AssetID` varchar(20) NOT NULL,
  126. `isServiced` tinyint(1) NOT NULL DEFAULT 0,
  127. `outWard` timestamp NOT NULL DEFAULT current_timestamp(),
  128. `InWard` timestamp NULL DEFAULT NULL,
  129. `IsActive` tinyint(1) NOT NULL DEFAULT 1,
  130. `CreatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  131. `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp()
  132. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  133. --
  134. -- Dumping data for table `servicehistory`
  135. --
  136. INSERT INTO `servicehistory` (`ServiceHistoryID`, `AssetID`, `isServiced`, `outWard`, `InWard`, `IsActive`, `CreatedAt`, `UpdatedAt`) VALUES
  137. (1, 'HE5130TK22157196', 1, '2022-10-28 09:09:44', '2022-10-28 09:09:54', 1, '2022-10-28 09:09:44', '2022-10-28 09:09:44'),
  138. (2, 'HE5130TK22157196', 1, '2022-10-28 10:39:54', '2022-10-28 10:40:16', 1, '2022-10-28 10:39:54', '2022-10-28 10:39:54'),
  139. (3, 'HE5130TK22158489', 1, '2022-10-28 10:55:03', '2022-10-28 10:55:22', 1, '2022-10-28 10:55:03', '2022-10-28 10:55:03');
  140. -- --------------------------------------------------------
  141. --
  142. -- Table structure for table `swap`
  143. --
  144. CREATE TABLE `swap` (
  145. `SwapID` int(11) NOT NULL,
  146. `RiderID` varchar(20) NOT NULL,
  147. `SwapReferID` int(11) DEFAULT 0,
  148. `SwapRechargeID` int(11) DEFAULT 0,
  149. `ReturnBatterID` varchar(20) NOT NULL,
  150. `SwappedBatterID` varchar(20) NOT NULL,
  151. `IsFreeSwap` tinyint(1) NOT NULL DEFAULT 1,
  152. `IsActive` tinyint(1) NOT NULL DEFAULT 1,
  153. `CreatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  154. `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp()
  155. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  156. --
  157. -- Dumping data for table `swap`
  158. --
  159. INSERT INTO `swap` (`SwapID`, `RiderID`, `SwapReferID`, `SwapRechargeID`, `ReturnBatterID`, `SwappedBatterID`, `IsFreeSwap`, `IsActive`, `CreatedAt`, `UpdatedAt`) VALUES
  160. (1, '8124308141', 0, 0, 'HE5130TK22157196', 'HE5130TK22158489', 1, 1, '2022-10-28 09:13:34', '2022-10-28 09:13:34'),
  161. (2, '8124308141', 0, 0, 'HE5130TK22158489', 'HE5130TK22157196', 1, 1, '2022-10-28 09:15:34', '2022-10-28 09:15:34'),
  162. (3, '8124308141', 0, 1, 'HE5130TK22157196', 'HE5130TK22158489', 0, 1, '2022-10-28 09:16:14', '2022-10-28 09:16:14'),
  163. (4, '8124308141', 0, 1, 'HE5130TK22158489', 'HE5130TK22157196', 0, 1, '2022-10-28 10:36:52', '2022-10-28 10:36:52');
  164. -- --------------------------------------------------------
  165. --
  166. -- Table structure for table `swaprecharge`
  167. --
  168. CREATE TABLE `swaprecharge` (
  169. `SwapRechargeID` int(11) NOT NULL,
  170. `RiderID` varchar(20) NOT NULL,
  171. `TotalRechargedSwapCount` varchar(20) NOT NULL,
  172. `UsedSwapCount` varchar(20) NOT NULL,
  173. `AvailableSwapCount` varchar(20) NOT NULL,
  174. `IsActive` tinyint(1) NOT NULL DEFAULT 1,
  175. `CreatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  176. `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp()
  177. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  178. --
  179. -- Dumping data for table `swaprecharge`
  180. --
  181. INSERT INTO `swaprecharge` (`SwapRechargeID`, `RiderID`, `TotalRechargedSwapCount`, `UsedSwapCount`, `AvailableSwapCount`, `IsActive`, `CreatedAt`, `UpdatedAt`) VALUES
  182. (1, '8124308141', '2', '2', '0', 1, '2022-10-28 09:04:51', '2022-10-28 09:04:51'),
  183. (2, '7305325141', '2', '0', '2', 1, '2022-10-28 10:32:23', '2022-10-28 10:32:23'),
  184. (3, '9789910828', '0', '0', '0', 1, '2022-10-28 11:35:19', '2022-10-28 11:35:19');
  185. -- --------------------------------------------------------
  186. --
  187. -- Table structure for table `swaprefer`
  188. --
  189. CREATE TABLE `swaprefer` (
  190. `SwapReferID` int(11) NOT NULL,
  191. `RiderID` varchar(20) NOT NULL,
  192. `TotalFreeSwapCount` varchar(20) NOT NULL,
  193. `UsedSwapCount` varchar(20) NOT NULL,
  194. `AvailableSwapCount` varchar(20) NOT NULL,
  195. `IsActive` tinyint(1) NOT NULL DEFAULT 1,
  196. `CreatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  197. `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp()
  198. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  199. --
  200. -- Dumping data for table `swaprefer`
  201. --
  202. INSERT INTO `swaprefer` (`SwapReferID`, `RiderID`, `TotalFreeSwapCount`, `UsedSwapCount`, `AvailableSwapCount`, `IsActive`, `CreatedAt`, `UpdatedAt`) VALUES
  203. (1, '8124308141', '0', '0', '0', 1, '2022-10-28 09:04:51', '2022-10-28 09:04:51'),
  204. (2, '7305325141', '0', '0', '0', 1, '2022-10-28 10:32:23', '2022-10-28 10:32:23'),
  205. (3, '9789910828', '0', '0', '0', 1, '2022-10-28 11:35:19', '2022-10-28 11:35:19');
  206. -- --------------------------------------------------------
  207. --
  208. -- Table structure for table `user`
  209. --
  210. CREATE TABLE `user` (
  211. `UserID` int(11) NOT NULL,
  212. `UserName` varchar(20) NOT NULL,
  213. `PhoneNumber` varchar(20) NOT NULL,
  214. `Password` varchar(50) NOT NULL,
  215. `IsAdmin` int(11) NOT NULL DEFAULT 0,
  216. `IsActive` tinyint(1) NOT NULL DEFAULT 1,
  217. `CreatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  218. `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  219. `DEID` varchar(20) NOT NULL
  220. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  221. --
  222. -- Dumping data for table `user`
  223. --
  224. INSERT INTO `user` (`UserID`, `UserName`, `PhoneNumber`, `Password`, `IsAdmin`, `IsActive`, `CreatedAt`, `UpdatedAt`, `DEID`) VALUES
  225. (1, 'Dinesh', '8124308141', '12345', 1, 1, '2022-10-28 09:04:51', '2022-10-28 09:04:51', ''),
  226. (2, 'Dinesh', '7305325141', '12345', 0, 1, '2022-10-28 10:32:23', '2022-10-28 10:32:23', ''),
  227. (3, 'Vishnu', '9789910828', '12345', 0, 1, '2022-10-28 11:35:19', '2022-10-28 11:35:19', 'DIN001487459');
  228. -- --------------------------------------------------------
  229. --
  230. -- Table structure for table `userrefer`
  231. --
  232. CREATE TABLE `userrefer` (
  233. `UserReferID` int(11) NOT NULL,
  234. `UserID` int(11) NOT NULL,
  235. `IsActive` tinyint(1) NOT NULL DEFAULT 1,
  236. `CreatedAt` timestamp NOT NULL DEFAULT current_timestamp(),
  237. `UpdatedAt` timestamp NOT NULL DEFAULT current_timestamp()
  238. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  239. --
  240. -- Indexes for dumped tables
  241. --
  242. --
  243. -- Indexes for table `asset`
  244. --
  245. ALTER TABLE `asset`
  246. ADD PRIMARY KEY (`AssetID`);
  247. --
  248. -- Indexes for table `assetcategory`
  249. --
  250. ALTER TABLE `assetcategory`
  251. ADD PRIMARY KEY (`AssetCategoryID`);
  252. --
  253. -- Indexes for table `rechargehistory`
  254. --
  255. ALTER TABLE `rechargehistory`
  256. ADD PRIMARY KEY (`RechargeHistoryID`);
  257. --
  258. -- Indexes for table `refer`
  259. --
  260. ALTER TABLE `refer`
  261. ADD PRIMARY KEY (`ReferID`);
  262. --
  263. -- Indexes for table `rider`
  264. --
  265. ALTER TABLE `rider`
  266. ADD PRIMARY KEY (`RiderID`),
  267. ADD UNIQUE KEY `UserID` (`UserID`);
  268. --
  269. -- Indexes for table `servicehistory`
  270. --
  271. ALTER TABLE `servicehistory`
  272. ADD PRIMARY KEY (`ServiceHistoryID`);
  273. --
  274. -- Indexes for table `swap`
  275. --
  276. ALTER TABLE `swap`
  277. ADD PRIMARY KEY (`SwapID`);
  278. --
  279. -- Indexes for table `swaprecharge`
  280. --
  281. ALTER TABLE `swaprecharge`
  282. ADD PRIMARY KEY (`SwapRechargeID`),
  283. ADD UNIQUE KEY `RaiderID` (`RiderID`);
  284. --
  285. -- Indexes for table `swaprefer`
  286. --
  287. ALTER TABLE `swaprefer`
  288. ADD PRIMARY KEY (`SwapReferID`);
  289. --
  290. -- Indexes for table `user`
  291. --
  292. ALTER TABLE `user`
  293. ADD PRIMARY KEY (`UserID`);
  294. --
  295. -- Indexes for table `userrefer`
  296. --
  297. ALTER TABLE `userrefer`
  298. ADD PRIMARY KEY (`UserReferID`);
  299. --
  300. -- AUTO_INCREMENT for dumped tables
  301. --
  302. --
  303. -- AUTO_INCREMENT for table `assetcategory`
  304. --
  305. ALTER TABLE `assetcategory`
  306. MODIFY `AssetCategoryID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  307. --
  308. -- AUTO_INCREMENT for table `rechargehistory`
  309. --
  310. ALTER TABLE `rechargehistory`
  311. MODIFY `RechargeHistoryID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  312. --
  313. -- AUTO_INCREMENT for table `refer`
  314. --
  315. ALTER TABLE `refer`
  316. MODIFY `ReferID` int(11) NOT NULL AUTO_INCREMENT;
  317. --
  318. -- AUTO_INCREMENT for table `servicehistory`
  319. --
  320. ALTER TABLE `servicehistory`
  321. MODIFY `ServiceHistoryID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  322. --
  323. -- AUTO_INCREMENT for table `swap`
  324. --
  325. ALTER TABLE `swap`
  326. MODIFY `SwapID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
  327. --
  328. -- AUTO_INCREMENT for table `swaprecharge`
  329. --
  330. ALTER TABLE `swaprecharge`
  331. MODIFY `SwapRechargeID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  332. --
  333. -- AUTO_INCREMENT for table `swaprefer`
  334. --
  335. ALTER TABLE `swaprefer`
  336. MODIFY `SwapReferID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  337. --
  338. -- AUTO_INCREMENT for table `user`
  339. --
  340. ALTER TABLE `user`
  341. MODIFY `UserID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  342. --
  343. -- AUTO_INCREMENT for table `userrefer`
  344. --
  345. ALTER TABLE `userrefer`
  346. MODIFY `UserReferID` int(11) NOT NULL AUTO_INCREMENT;
  347. COMMIT;
  348. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  349. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  350. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;