|
@@ -0,0 +1,48 @@
|
|
|
+package com.charging.chargingparking.modules.backController;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.charging.chargingparking.dto.MessageResult;
|
|
|
+import com.charging.chargingparking.entity.ParkingRecord;
|
|
|
+import com.charging.chargingparking.service.ParkingRecordService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author qxyzm
|
|
|
+ * @date 2022/6/14 0014 上午 9:34
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@Slf4j
|
|
|
+@RequestMapping("/backParkingRecord")
|
|
|
+public class BackParkingRecordController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ParkingRecordService parkingRecordService;
|
|
|
+
|
|
|
+ @PostMapping("parkingRecordList")
|
|
|
+ public MessageResult<Object> parkingRecordList(String parkingName, @RequestParam Integer pageSize, @RequestParam Integer pageIndex) {
|
|
|
+
|
|
|
+ MessageResult<Object> messageResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try{
|
|
|
+ QueryWrapper<ParkingRecord> parkingInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ parkingInfoQueryWrapper.like("parking_name",parkingName);
|
|
|
+ Page<ParkingRecord> page = parkingRecordService.page(new Page<>(pageIndex,pageSize),parkingInfoQueryWrapper);
|
|
|
+
|
|
|
+ messageResult.setData(page);
|
|
|
+ messageResult.setResult(true);
|
|
|
+
|
|
|
+ }catch (Exception ex){
|
|
|
+ log.error(ex.getMessage(),ex);
|
|
|
+ messageResult.setResult(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+ }
|
|
|
+}
|