浏览代码

Merge branch 'master' of https://e.coding.net/chuanghaikeji/smartCampus/backend_code

夏文涛 2 年之前
父节点
当前提交
72eb3a494f
共有 29 个文件被更改,包括 654 次插入14 次删除
  1. 1 1
      src/main/java/com/template/api/SmartAccessControllerAPI.java
  2. 11 1
      src/main/java/com/template/api/SmartCarAccessControllerAPI.java
  3. 4 0
      src/main/java/com/template/api/SmartGradeControllerAPI.java
  4. 20 0
      src/main/java/com/template/api/SmartRelationControllerAPI.java
  5. 7 1
      src/main/java/com/template/api/SmartVisitorParentsConfigControllerAPI.java
  6. 19 1
      src/main/java/com/template/controller/SmartCarAccessController.java
  7. 27 0
      src/main/java/com/template/controller/SmartEvaluateStudentController.java
  8. 29 3
      src/main/java/com/template/controller/SmartGradeController.java
  9. 40 0
      src/main/java/com/template/controller/SmartRelationController.java
  10. 42 6
      src/main/java/com/template/controller/SmartVisitorParentsConfigController.java
  11. 8 0
      src/main/java/com/template/mapper/SmartCarAccessMapper.java
  12. 18 0
      src/main/java/com/template/mapper/SmartRelationMapper.java
  13. 39 0
      src/main/java/com/template/model/dto/SvpcDto.java
  14. 76 0
      src/main/java/com/template/model/pojo/SmartRelation.java
  15. 22 0
      src/main/java/com/template/model/vo/SmartCarAccessVo.java
  16. 3 0
      src/main/java/com/template/model/vo/SmartVisitorParentsConfigVo.java
  17. 3 0
      src/main/java/com/template/services/SmartAccessService.java
  18. 3 0
      src/main/java/com/template/services/SmartCarAccessService.java
  19. 2 0
      src/main/java/com/template/services/SmartFaceDiscernService.java
  20. 18 0
      src/main/java/com/template/services/SmartRelationService.java
  21. 2 0
      src/main/java/com/template/services/SmartVisitorParentsConfigService.java
  22. 9 0
      src/main/java/com/template/services/impl/SmartAccessServiceImpl.java
  23. 16 1
      src/main/java/com/template/services/impl/SmartCarAccessServiceImpl.java
  24. 9 0
      src/main/java/com/template/services/impl/SmartFaceDiscernServiceImpl.java
  25. 190 0
      src/main/java/com/template/services/impl/SmartRelationServiceImpl.java
  26. 8 0
      src/main/java/com/template/services/impl/SmartVisitorParentsConfigServiceImpl.java
  27. 22 0
      src/main/resources/mapper/template/SmartCarAccessMapper.xml
  28. 5 0
      src/main/resources/mapper/template/SmartRelationMapper.xml
  29. 1 0
      src/main/resources/mapper/template/SmartVisitorParentsConfigMapper.xml

+ 1 - 1
src/main/java/com/template/api/SmartAccessControllerAPI.java

@@ -21,7 +21,7 @@ public interface SmartAccessControllerAPI {
 
 
 
 
     @GetMapping("/getAccessPage")
     @GetMapping("/getAccessPage")
-    @ApiOperation(value = "门禁通行汇总", notes = "门禁通行汇总", httpMethod = "GET")
+    @ApiOperation(value = "驾驶舱——门禁通行汇总", notes = "门禁通行汇总", httpMethod = "GET")
     CommonResult getAccessPage(@RequestParam Integer currentPage, @RequestParam Integer pageCount,String keyWord,Integer gradeId,Integer classId,String resultStatus,String inOut,String startTime,String endTime);
     CommonResult getAccessPage(@RequestParam Integer currentPage, @RequestParam Integer pageCount,String keyWord,Integer gradeId,Integer classId,String resultStatus,String inOut,String startTime,String endTime);
 
 
 
 

+ 11 - 1
src/main/java/com/template/api/SmartCarAccessControllerAPI.java

@@ -1,7 +1,17 @@
 package com.template.api;
 package com.template.api;
 
 
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 
 
-@RequestMapping("/auto/smart-car-access")
+@RequestMapping("/api/smartCarAccess")
 public interface SmartCarAccessControllerAPI {
 public interface SmartCarAccessControllerAPI {
+
+    @GetMapping("/getPage")
+    @ApiOperation(value = "驾驶舱——车闸通行记录", notes = "门禁通行记录", httpMethod = "GET")
+    CommonResult getPage(@RequestParam Integer currentPage, @RequestParam Integer pageCount, String keyWord , String type, String startTime, String endTime);
+
+
 }
 }

+ 4 - 0
src/main/java/com/template/api/SmartGradeControllerAPI.java

@@ -43,4 +43,8 @@ public interface SmartGradeControllerAPI {
     @ApiOperation(value = "将年级数据添加到百胜系统", notes = "将年级数据添加到百胜系统", httpMethod = "POST")
     @ApiOperation(value = "将年级数据添加到百胜系统", notes = "将年级数据添加到百胜系统", httpMethod = "POST")
     CommonResult insertSmartGradeToBaisheng(@Validated @RequestBody insertSmartGradeRequest isgr, BindingResult bindingResult) throws Exception;
     CommonResult insertSmartGradeToBaisheng(@Validated @RequestBody insertSmartGradeRequest isgr, BindingResult bindingResult) throws Exception;
 
 
+    @GetMapping("/getGradeAndClass")
+    @ApiOperation(value = "班级和年级联动列表",notes = "班级和年级联动列表", httpMethod = "GET")
+    CommonResult getGradeAndClass();
+
 }
 }

+ 20 - 0
src/main/java/com/template/api/SmartRelationControllerAPI.java

@@ -0,0 +1,20 @@
+package com.template.api;
+
+import com.template.model.pojo.SmartSchool;
+import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@RequestMapping("/api/smartRelation")
+public interface SmartRelationControllerAPI {
+
+    @PostMapping(value = "/getList")
+    @ApiOperation(value = "个人亲密度展示", notes = "个人亲密度展示", httpMethod = "GET")
+    CommonResult getList(@RequestParam int currentPage, @RequestParam int pageCount,@RequestParam Integer userId);
+
+}

+ 7 - 1
src/main/java/com/template/api/SmartVisitorParentsConfigControllerAPI.java

@@ -1,5 +1,6 @@
 package com.template.api;
 package com.template.api;
 
 
+import com.template.model.dto.SvpcDto;
 import com.template.model.pojo.SmartAskForLeaveConfig;
 import com.template.model.pojo.SmartAskForLeaveConfig;
 import com.template.model.pojo.SmartVisitorParentsConfig;
 import com.template.model.pojo.SmartVisitorParentsConfig;
 import com.template.model.result.CommonResult;
 import com.template.model.result.CommonResult;
@@ -17,10 +18,15 @@ public interface SmartVisitorParentsConfigControllerAPI {
 
 
     @PostMapping(value = "/update")
     @PostMapping(value = "/update")
     @ApiOperation(value = "家长访客配置修改", notes = "家长访客配置修改", httpMethod = "POST")
     @ApiOperation(value = "家长访客配置修改", notes = "家长访客配置修改", httpMethod = "POST")
-    CommonResult update(@RequestBody List<SmartVisitorParentsConfig> smartVisitorParentsConfigs);
+    CommonResult update(@RequestBody SmartVisitorParentsConfig smartVisitorParentsConfig);
 
 
     @GetMapping(value = "/getUserId")
     @GetMapping(value = "/getUserId")
     @ApiOperation(value = "根据用户id获取所管理的班级配置", notes = "根据用户id获取所管理的班级配置", httpMethod = "GET")
     @ApiOperation(value = "根据用户id获取所管理的班级配置", notes = "根据用户id获取所管理的班级配置", httpMethod = "GET")
     CommonResult getUserId(@RequestParam Integer userId);
     CommonResult getUserId(@RequestParam Integer userId);
 
 
+    @PostMapping(value = "/updates")
+    @ApiOperation(value = "家长访客配置批量修改", notes = "家长访客配置批量修改", httpMethod = "POST")
+    CommonResult updates(@RequestBody SvpcDto svpcDto);
+
+
 }
 }

+ 19 - 1
src/main/java/com/template/controller/SmartCarAccessController.java

@@ -3,7 +3,14 @@ package com.template.controller;
 
 
 import com.template.annotation.DESRespondSecret;
 import com.template.annotation.DESRespondSecret;
 import com.template.api.SmartCarAccessControllerAPI;
 import com.template.api.SmartCarAccessControllerAPI;
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.template.model.pojo.SmartCarAccess;
+import com.template.model.result.CommonResult;
+import com.template.model.result.PageUtils;
+import com.template.model.vo.SmartAccessVo;
+import com.template.model.vo.SmartCarAccessVo;
+import com.template.services.SmartCarAccessService;
+import org.springframework.beans.factory.annotation.Autowired;
+
 
 
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
@@ -20,5 +27,16 @@ import org.springframework.web.bind.annotation.RestController;
 @DESRespondSecret
 @DESRespondSecret
 public class SmartCarAccessController implements SmartCarAccessControllerAPI {
 public class SmartCarAccessController implements SmartCarAccessControllerAPI {
 
 
+    @Autowired
+    SmartCarAccessService smartCarAccessService;
+
+    @Override
+    @DESRespondSecret(validated = true)
+    public CommonResult getPage(Integer currentPage, Integer pageCount, String keyWord, String type, String startTime, String endTime) {
+        PageUtils<SmartCarAccessVo> pageUtils=smartCarAccessService.getPage(currentPage,pageCount,keyWord,type,startTime,endTime);
+        return CommonResult.ok(pageUtils);
+
+    }
+
 }
 }
 
 

+ 27 - 0
src/main/java/com/template/controller/SmartEvaluateStudentController.java

@@ -313,8 +313,35 @@ public class SmartEvaluateStudentController implements SmartEvaluateStudentContr
     }
     }
 
 
     @Override
     @Override
+    @DESRespondSecret(validated = true)
     public CommonResult historicalEvaluation(String cardNo) {
     public CommonResult historicalEvaluation(String cardNo) {
         List<HistoricalEvaluationVo> vos = smartEvaluateStudentService.getHistoricalEvaluation(cardNo);
         List<HistoricalEvaluationVo> vos = smartEvaluateStudentService.getHistoricalEvaluation(cardNo);
+
+//        获取评级
+        for (int i = 0; i < vos.size(); i++) {
+            HistoricalEvaluationVo vo = vos.get(i);
+            String term = vo.getTerm();
+            String scoreNum = vo.getScoreNum();
+            QueryWrapper<SmartSubjectRule> queryWrapper1 = new QueryWrapper<>();
+            queryWrapper1.eq("subject_name", "平均成绩");
+            queryWrapper1.eq("term", term);
+            List<SmartSubjectRule> rule = smartSubjectRuleService.list(queryWrapper1);
+
+            for (int j = 0; j < rule.size(); j++) {
+                String[] range = rule.get(j).getScoreRange().split("-");
+                double min = Double.parseDouble(range[0]);
+                double max = Double.parseDouble(range[1]);
+                Double num = Double.valueOf(scoreNum);
+                if (num >= min && num <= max) {
+                   String scoreLevel = rule.get(j).getLevel();
+                   vo.setScoreLevel(scoreLevel);
+                   break;
+                }
+            }
+
+        }
+
+
         return CommonResult.ok(vos);
         return CommonResult.ok(vos);
     }
     }
 
 

+ 29 - 3
src/main/java/com/template/controller/SmartGradeController.java

@@ -15,9 +15,7 @@ import com.template.model.request.insertSmartGradeRequest;
 import com.template.model.request.updateSmartGradeRequest;
 import com.template.model.request.updateSmartGradeRequest;
 import com.template.model.result.CommonResult;
 import com.template.model.result.CommonResult;
 import com.template.model.result.PageUtils;
 import com.template.model.result.PageUtils;
-import com.template.model.vo.BsGradeNoVo;
-import com.template.model.vo.BsGradeVo;
-import com.template.model.vo.SemesterVo;
+import com.template.model.vo.*;
 import com.template.services.SmartClassService;
 import com.template.services.SmartClassService;
 import com.template.services.SmartGradeService;
 import com.template.services.SmartGradeService;
 import com.template.services.SmartSubjectService;
 import com.template.services.SmartSubjectService;
@@ -286,5 +284,33 @@ public class SmartGradeController implements SmartGradeControllerAPI {
 
 
     }
     }
 
 
+    @Override
+    @DESRespondSecret(validated = true)
+    public CommonResult getGradeAndClass() {
+        List<SmartGrade> grades = smartGradeService.list(null);
+        List<SmartClass> classes = smartClassService.list(null);
+
+        List<SubjectGradeVo> subjectVos = new ArrayList<>();
+        for (SmartGrade grade : grades) {
+            SubjectGradeVo subjectGradeVo = new SubjectGradeVo();
+            subjectGradeVo.setId(grade.getId());
+            subjectGradeVo.setName(grade.getName());
+            List<SubjectClassVo> classVos=new ArrayList<>();
+            List<SmartClass> ownerClasses = classes.stream().filter(e -> e.getGradeId().equals(grade.getId())).collect(Collectors.toList());
+            if(ownerClasses != null && ownerClasses.size() > 0){
+                for (SmartClass ownerClass :ownerClasses){
+                    SubjectClassVo classVo = new SubjectClassVo();
+                    classVo.setId(ownerClass.getId());
+                    classVo.setName(ownerClass.getName());
+                    classVos.add(classVo);
+                }
+            }
+            subjectGradeVo.setChildren(classVos);
+            subjectVos.add(subjectGradeVo);
+        }
+
+        return CommonResult.ok(subjectVos);
+    }
+
 }
 }
 
 

+ 40 - 0
src/main/java/com/template/controller/SmartRelationController.java

@@ -0,0 +1,40 @@
+package com.template.controller;
+
+
+import com.template.annotation.DESRespondSecret;
+import com.template.api.SmartRelationControllerAPI;
+import com.template.model.pojo.SmartRelation;
+import com.template.model.result.CommonResult;
+import com.template.model.result.PageUtils;
+import com.template.services.SmartRelationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-06-28
+ */
+@RestController
+@DESRespondSecret
+public class SmartRelationController implements SmartRelationControllerAPI {
+
+    @Autowired
+    SmartRelationService smartRelationService;
+
+
+    @Override
+    public CommonResult getList(int currentPage, int pageCount, Integer userId) {
+        PageUtils<SmartRelation> pageUtils=smartRelationService.getPage(currentPage,pageCount,userId);
+
+        return CommonResult.ok(pageUtils);
+    }
+
+
+}
+

+ 42 - 6
src/main/java/com/template/controller/SmartVisitorParentsConfigController.java

@@ -1,11 +1,14 @@
 package com.template.controller;
 package com.template.controller;
 
 
 
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.template.annotation.DESRespondSecret;
 import com.template.annotation.DESRespondSecret;
 import com.template.api.SmartVisitorParentsConfigControllerAPI;
 import com.template.api.SmartVisitorParentsConfigControllerAPI;
 import com.template.mapper.SmartVisitorParentsConfigMapper;
 import com.template.mapper.SmartVisitorParentsConfigMapper;
+import com.template.model.dto.SvpcDto;
 import com.template.model.pojo.SmartAskForLeaveConfig;
 import com.template.model.pojo.SmartAskForLeaveConfig;
 import com.template.model.pojo.SmartDuties;
 import com.template.model.pojo.SmartDuties;
 import com.template.model.pojo.SmartUser;
 import com.template.model.pojo.SmartUser;
@@ -16,6 +19,7 @@ import com.template.model.vo.SmartVisitorParentsConfigVo;
 import com.template.services.SmartDutiesService;
 import com.template.services.SmartDutiesService;
 import com.template.services.SmartUserService;
 import com.template.services.SmartUserService;
 import com.template.services.SmartVisitorParentsConfigService;
 import com.template.services.SmartVisitorParentsConfigService;
+import io.swagger.annotations.ApiModelProperty;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -23,11 +27,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
  * <p>
  * <p>
- *  前端控制器
+ * 前端控制器
  * </p>
  * </p>
  *
  *
  * @author ceshi
  * @author ceshi
@@ -48,15 +53,16 @@ public class SmartVisitorParentsConfigController implements SmartVisitorParentsC
 
 
     @Override
     @Override
     @DESRespondSecret(validated = true)
     @DESRespondSecret(validated = true)
-    public CommonResult getClassId(Integer page,Integer size, Integer classId,Integer gradeId) {
-        PageUtils<SmartVisitorParentsConfigVo> smartVisitorParentsConfig=smartVisitorParentsConfigService.getClassIdPage(page,size,classId,gradeId);
+    public CommonResult getClassId(Integer page, Integer size, Integer classId, Integer gradeId) {
+        PageUtils<SmartVisitorParentsConfigVo> smartVisitorParentsConfig = smartVisitorParentsConfigService.getClassIdPage(page, size, classId, gradeId);
         return CommonResult.ok(smartVisitorParentsConfig);
         return CommonResult.ok(smartVisitorParentsConfig);
     }
     }
 
 
     @Override
     @Override
     @DESRespondSecret(validated = true)
     @DESRespondSecret(validated = true)
-    public CommonResult update(List<SmartVisitorParentsConfig> smartVisitorParentsConfigs) {
-        boolean update = smartVisitorParentsConfigService.updateBatchById(smartVisitorParentsConfigs);
+    public CommonResult update(SmartVisitorParentsConfig smartVisitorParentsConfig) {
+
+        boolean update = smartVisitorParentsConfigService.updateById(smartVisitorParentsConfig);
 
 
         if (update) {
         if (update) {
             return CommonResult.ok();
             return CommonResult.ok();
@@ -86,10 +92,40 @@ public class SmartVisitorParentsConfigController implements SmartVisitorParentsC
 
 
         Integer schoolClass = smartById.getSchoolClass();
         Integer schoolClass = smartById.getSchoolClass();
 
 
-        SmartVisitorParentsConfigVo smartVisitorParentsConfigVo=smartVisitorParentsConfigService.getClassId(schoolClass);
+        SmartVisitorParentsConfigVo smartVisitorParentsConfigVo = smartVisitorParentsConfigService.getClassId(schoolClass);
 
 
         return CommonResult.ok(smartVisitorParentsConfigVo);
         return CommonResult.ok(smartVisitorParentsConfigVo);
     }
     }
 
 
+    @Override
+    public CommonResult updates(SvpcDto svpcDto) {
+        List<Integer> classIds = svpcDto.getClassIds();
+        if (ObjectUtils.isEmpty(classIds) || classIds.size() == 0) {
+            return CommonResult.fail("参数异常");
+        }
+        ArrayList<SmartVisitorParentsConfig> svpcs = new ArrayList<>();
+        for (Integer classId : classIds) {
+            SmartVisitorParentsConfig svpc = smartVisitorParentsConfigService.getByClassId(classId);
+            if (ObjectUtils.isNotEmpty(svpc)) {
+                svpc.setAppAuditConfig(svpcDto.getAppAuditConfig());
+                svpc.setAppPushConfig(svpcDto.getAppPushConfig());
+                svpc.setAppCancelConfig(svpcDto.getAppCancelConfig());
+                svpc.setScreenAuditConfig(svpcDto.getScreenAuditConfig());
+                svpc.setScreenPushConfig(svpcDto.getScreenPushConfig());
+                svpc.setScreenCancelConfig(svpcDto.getScreenCancelConfig());
+                svpc.setAccessConfig(svpcDto.getAccessConfig());
+                svpc.setCarConfig(svpcDto.getCarConfig());
+                svpcs.add(svpc);
+            }
+
+        }
+        boolean update = smartVisitorParentsConfigService.updateBatchById(svpcs);
+
+        if (update) {
+            return CommonResult.ok();
+        }
+        return CommonResult.fail();
+    }
+
 }
 }
 
 

+ 8 - 0
src/main/java/com/template/mapper/SmartCarAccessMapper.java

@@ -1,7 +1,12 @@
 package com.template.mapper;
 package com.template.mapper;
 
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.model.pojo.SmartCarAccess;
 import com.template.model.pojo.SmartCarAccess;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.template.model.vo.SmartCarAccessVo;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -11,6 +16,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @author ceshi
  * @author ceshi
  * @since 2024-02-23
  * @since 2024-02-23
  */
  */
+@Repository
 public interface SmartCarAccessMapper extends BaseMapper<SmartCarAccess> {
 public interface SmartCarAccessMapper extends BaseMapper<SmartCarAccess> {
 
 
+    IPage<SmartCarAccessVo> getPage(Page<SmartCarAccessVo> page, @Param("keyWord") String keyWord,@Param("type") String type,@Param("startTime") String startTime,@Param("endTime") String endTime);
+
 }
 }

+ 18 - 0
src/main/java/com/template/mapper/SmartRelationMapper.java

@@ -0,0 +1,18 @@
+package com.template.mapper;
+
+import com.template.model.pojo.SmartRelation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-06-28
+ */
+@Repository
+public interface SmartRelationMapper extends BaseMapper<SmartRelation> {
+
+}

+ 39 - 0
src/main/java/com/template/model/dto/SvpcDto.java

@@ -0,0 +1,39 @@
+package com.template.model.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class SvpcDto {
+
+
+    @ApiModelProperty(value = "年级ID")
+    private List<Integer> classIds;
+
+    @ApiModelProperty(value = "小程序审核配置 1:需要审核, 4:不需要审核")
+    private Integer appAuditConfig;
+
+    @ApiModelProperty(value = "小程序推送配置 5:需要推送,3:不需要推送")
+    private Integer appPushConfig;
+
+    @ApiModelProperty(value = "小程序核销配置 6:需要核销,7:不需要核销")
+    private Integer appCancelConfig;
+
+    @ApiModelProperty(value = "大屏序审核配置 1:需要审核, 4:不需要审核")
+    private Integer screenAuditConfig;
+
+    @ApiModelProperty(value = "大屏序推送配置 5:需要推送,3:不需要推送")
+    private Integer screenPushConfig;
+
+    @ApiModelProperty(value = "大屏核销配置 6:需要核销,7:不需要核销")
+    private Integer screenCancelConfig;
+
+    @ApiModelProperty(value = "门禁配置 0:推送到门禁,1:不推送到门禁")
+    private Integer accessConfig;
+
+    @ApiModelProperty(value = "车闸配置 0:推送到车闸,1:不推送到车闸")
+    private Integer carConfig;
+
+}

+ 76 - 0
src/main/java/com/template/model/pojo/SmartRelation.java

@@ -0,0 +1,76 @@
+package com.template.model.pojo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.Version;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-06-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="SmartRelation对象", description="")
+public class SmartRelation implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "用户id")
+    private Integer userId;
+
+    @ApiModelProperty(value = "名字")
+    private String name;
+
+    @ApiModelProperty(value = "关联人id")
+    private Integer relationId;
+
+    @ApiModelProperty(value = "关联人名称")
+    private String relationName;
+
+    @ApiModelProperty(value = "时间")
+    private String dateTime;
+
+    @ApiModelProperty(value = "次数")
+    private Integer count;
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新时间")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Date updateTime;
+
+    @ApiModelProperty(value = "创建人员")
+    @TableField(fill = FieldFill.INSERT)
+    private String createUser;
+
+    @ApiModelProperty(value = "更新人员")
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private String updateUser;
+
+    @ApiModelProperty(value = "逻辑删除 未删除:0;删除:1")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleted;
+
+
+}

+ 22 - 0
src/main/java/com/template/model/vo/SmartCarAccessVo.java

@@ -0,0 +1,22 @@
+package com.template.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class SmartCarAccessVo {
+
+    private Integer id;
+
+    @ApiModelProperty(value = "状态,1:进站,2:出站")
+    private String type;
+
+    @ApiModelProperty(value = "车牌号码")
+    private String carNo;
+
+    @ApiModelProperty(value = "产生时间")
+    private String dataTime;
+
+    @ApiModelProperty(value = "图片")
+    private String image;
+}

+ 3 - 0
src/main/java/com/template/model/vo/SmartVisitorParentsConfigVo.java

@@ -39,6 +39,9 @@ public class SmartVisitorParentsConfigVo {
     @ApiModelProperty(value = "门禁配置 0:推送到门禁,1:不推送到门禁")
     @ApiModelProperty(value = "门禁配置 0:推送到门禁,1:不推送到门禁")
     private Integer accessConfig;
     private Integer accessConfig;
 
 
+    @ApiModelProperty(value = "车闸配置 0:推送到车闸,1:不推送到车闸")
+    private Integer carConfig;
+
     @ApiModelProperty(value = "创建时间")
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
     private Date createTime;
 
 

+ 3 - 0
src/main/java/com/template/services/SmartAccessService.java

@@ -6,6 +6,7 @@ import com.template.model.result.PageUtils;
 import com.template.model.vo.SmartAccessVo;
 import com.template.model.vo.SmartAccessVo;
 import org.springframework.stereotype.Repository;
 import org.springframework.stereotype.Repository;
 
 
+import java.time.LocalDateTime;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -25,4 +26,6 @@ public interface SmartAccessService extends IService<SmartAccess> {
     List<SmartAccessVo> getPageExport(String keyWord, Integer gradeId, Integer classId, Integer departmentId,String openType,String resultStatus, String startTime, String endTime);
     List<SmartAccessVo> getPageExport(String keyWord, Integer gradeId, Integer classId, Integer departmentId,String openType,String resultStatus, String startTime, String endTime);
 
 
     PageUtils<SmartAccessVo> getAccessPage(Integer currentPage, Integer pageCount, String keyWord, Integer gradeId, Integer classId, String resultStatus, String inOut, String startTime, String endTime);
     PageUtils<SmartAccessVo> getAccessPage(Integer currentPage, Integer pageCount, String keyWord, Integer gradeId, Integer classId, String resultStatus, String inOut, String startTime, String endTime);
+
+    List<SmartAccess> toDatelist(LocalDateTime start, LocalDateTime end);
 }
 }

+ 3 - 0
src/main/java/com/template/services/SmartCarAccessService.java

@@ -2,6 +2,8 @@ package com.template.services;
 
 
 import com.template.model.pojo.SmartCarAccess;
 import com.template.model.pojo.SmartCarAccess;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.template.model.result.PageUtils;
+import com.template.model.vo.SmartCarAccessVo;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -13,4 +15,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
  */
 public interface SmartCarAccessService extends IService<SmartCarAccess> {
 public interface SmartCarAccessService extends IService<SmartCarAccess> {
 
 
+    PageUtils<SmartCarAccessVo> getPage(Integer currentPage, Integer pageCount, String keyWord, String type, String startTime, String endTime);
 }
 }

+ 2 - 0
src/main/java/com/template/services/SmartFaceDiscernService.java

@@ -42,4 +42,6 @@ public interface SmartFaceDiscernService extends IService<SmartFaceDiscern> {
     PageUtils<FaceManagementVo> faceManagement(int currentPage, int pageCount, String keyWord,String gradeId,String classId,String startTime,String endTime);
     PageUtils<FaceManagementVo> faceManagement(int currentPage, int pageCount, String keyWord,String gradeId,String classId,String startTime,String endTime);
 
 
     List<FaceManagementVo> faceManagementExport(String keyWord, String gradeId, String classId, String startTime, String endTime);
     List<FaceManagementVo> faceManagementExport(String keyWord, String gradeId, String classId, String startTime, String endTime);
+
+    List<SmartFaceDiscern> toDateList(LocalDateTime start, LocalDateTime end);
 }
 }

+ 18 - 0
src/main/java/com/template/services/SmartRelationService.java

@@ -0,0 +1,18 @@
+package com.template.services;
+
+import com.template.model.pojo.SmartRelation;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.template.model.result.PageUtils;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-06-28
+ */
+public interface SmartRelationService extends IService<SmartRelation> {
+
+    PageUtils<SmartRelation> getPage(int currentPage, int pageCount, Integer userId);
+}

+ 2 - 0
src/main/java/com/template/services/SmartVisitorParentsConfigService.java

@@ -19,4 +19,6 @@ public interface SmartVisitorParentsConfigService extends IService<SmartVisitorP
     PageUtils<SmartVisitorParentsConfigVo> getClassIdPage(Integer page, Integer size, Integer classId,Integer gradeId);
     PageUtils<SmartVisitorParentsConfigVo> getClassIdPage(Integer page, Integer size, Integer classId,Integer gradeId);
 
 
     SmartVisitorParentsConfigVo getClassId(Integer schoolClass);
     SmartVisitorParentsConfigVo getClassId(Integer schoolClass);
+
+    SmartVisitorParentsConfig getByClassId(Integer classId);
 }
 }

+ 9 - 0
src/main/java/com/template/services/impl/SmartAccessServiceImpl.java

@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.time.LocalDateTime;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -63,4 +64,12 @@ public class SmartAccessServiceImpl extends ServiceImpl<SmartAccessMapper, Smart
         IPage<SmartAccessVo> datas = smartAccessMapper.getAccessPage(page,keyWord,gradeId,classId,resultStatus,inOut,startTime,endTime);
         IPage<SmartAccessVo> datas = smartAccessMapper.getAccessPage(page,keyWord,gradeId,classId,resultStatus,inOut,startTime,endTime);
         return new PageUtils(datas);
         return new PageUtils(datas);
     }
     }
+
+    @Override
+    public List<SmartAccess> toDatelist(LocalDateTime start, LocalDateTime end) {
+        LambdaQueryWrapper<SmartAccess> wrapper=new LambdaQueryWrapper<>();
+        wrapper.between(SmartAccess::getDateTime,start,end);
+        List<SmartAccess> list = this.list(wrapper);
+        return list;
+    }
 }
 }

+ 16 - 1
src/main/java/com/template/services/impl/SmartCarAccessServiceImpl.java

@@ -4,13 +4,18 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.common.utils.CommonUtil;
 import com.template.common.utils.CommonUtil;
 import com.template.common.utils.RequestUtils;
 import com.template.common.utils.RequestUtils;
 import com.template.config.ParkConfig;
 import com.template.config.ParkConfig;
 import com.template.config.ScheduleConfig;
 import com.template.config.ScheduleConfig;
 import com.template.model.pojo.SmartCarAccess;
 import com.template.model.pojo.SmartCarAccess;
 import com.template.mapper.SmartCarAccessMapper;
 import com.template.mapper.SmartCarAccessMapper;
+import com.template.model.result.PageUtils;
+import com.template.model.vo.SmartAccessVo;
+import com.template.model.vo.SmartCarAccessVo;
 import com.template.services.SmartCarAccessService;
 import com.template.services.SmartCarAccessService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,6 +44,9 @@ public class SmartCarAccessServiceImpl extends ServiceImpl<SmartCarAccessMapper,
     @Resource
     @Resource
     private ScheduleConfig scheduleConfig;
     private ScheduleConfig scheduleConfig;
 
 
+    @Autowired
+    SmartCarAccessMapper smartCarAccessMapper;
+
     private Integer page = 0;
     private Integer page = 0;
     private Integer size = 20;
     private Integer size = 20;
 
 
@@ -279,5 +287,12 @@ public class SmartCarAccessServiceImpl extends ServiceImpl<SmartCarAccessMapper,
     }
     }
 
 
 
 
-
+    @Override
+    public PageUtils<SmartCarAccessVo> getPage(Integer currentPage, Integer pageCount, String keyWord, String type, String startTime, String endTime) {
+        Page<SmartCarAccessVo> page = new Page<>();
+        page.setCurrent(currentPage);
+        page.setSize(pageCount);
+        IPage<SmartCarAccessVo> datas = smartCarAccessMapper.getPage(page,keyWord,type,startTime,endTime);
+        return new PageUtils(datas);
+    }
 }
 }

+ 9 - 0
src/main/java/com/template/services/impl/SmartFaceDiscernServiceImpl.java

@@ -2,6 +2,7 @@ package com.template.services.impl;
 
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@@ -310,4 +311,12 @@ public class SmartFaceDiscernServiceImpl extends ServiceImpl<SmartFaceDiscernMap
         List<FaceManagementVo> vos = smartFaceDiscernMapper.faceManagementExport(keyWord,gradeId,classId,startTime,endTime);
         List<FaceManagementVo> vos = smartFaceDiscernMapper.faceManagementExport(keyWord,gradeId,classId,startTime,endTime);
         return vos;
         return vos;
     }
     }
+
+    @Override
+    public List<SmartFaceDiscern> toDateList(LocalDateTime start, LocalDateTime end) {
+        LambdaQueryWrapper<SmartFaceDiscern> wrapper=new LambdaQueryWrapper<>();
+        wrapper.between(SmartFaceDiscern::getDateTime,start,end);
+        List<SmartFaceDiscern> list = this.list(wrapper);
+        return list;
+    }
 }
 }

+ 190 - 0
src/main/java/com/template/services/impl/SmartRelationServiceImpl.java

@@ -0,0 +1,190 @@
+package com.template.services.impl;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.template.config.ScheduleConfig;
+import com.template.model.dto.WarningUserDto;
+import com.template.model.pojo.SmartAccess;
+import com.template.model.pojo.SmartFaceDiscern;
+import com.template.model.pojo.SmartRelation;
+import com.template.mapper.SmartRelationMapper;
+import com.template.model.pojo.SmartUser;
+import com.template.model.result.PageUtils;
+import com.template.model.vo.UserVo;
+import com.template.services.SmartAccessService;
+import com.template.services.SmartFaceDiscernService;
+import com.template.services.SmartRelationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.template.services.SmartUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-06-28
+ */
+@Service
+public class SmartRelationServiceImpl extends ServiceImpl<SmartRelationMapper, SmartRelation> implements SmartRelationService {
+
+    @Resource
+    private ScheduleConfig scheduleConfig;
+
+    @Autowired
+    SmartAccessService smartAccessService;
+
+    @Autowired
+    SmartFaceDiscernService smartFaceDiscernService;
+
+    @Autowired
+    SmartUserService smartUserService;
+
+    @Autowired
+    SmartRelationMapper smartRelationMapper;
+
+    @Async
+    @Scheduled(cron = "0 0 1 * * ? ")//每天凌晨一点
+    public void getAccessSmartRelation() {
+        if (scheduleConfig.getIsOpen().equals("1")) {
+            DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            LocalDateTime now = LocalDateTime.now();
+            LocalDateTime start = now.withHour(0).withMinute(0).withSecond(0).minusDays(1);
+            LocalDateTime end = now.withHour(23).withMinute(59).withSecond(59).minusDays(1);
+            String format = start.format(pattern);
+//            找到昨天的所有数据
+            List<SmartAccess> accessList = smartAccessService.toDatelist(start, end);
+
+            for (SmartAccess smartAccess : accessList) {
+                String dateTime = smartAccess.getDateTime();
+                LocalDateTime date = LocalDateTime.parse(dateTime, pattern);
+                LocalDateTime startTime = date.minusSeconds(10);
+                LocalDateTime endTime = date.plusSeconds(10);
+                Integer userId = smartAccess.getUserId();
+                SmartUser smartUser = smartUserService.getSmartById(userId);
+                List<SmartAccess> accesses = smartAccessService.toDatelist(startTime, endTime);
+                if (ObjectUtils.isNotEmpty(accesses) && accesses.size() > 0) {
+
+                    for (SmartAccess access : accesses) {
+                        Integer userId1 = access.getUserId();
+                        SmartUser smartById = smartUserService.getSmartById(userId1);
+//                        判断是否已添加,有的话则加1
+                        LambdaQueryWrapper<SmartRelation> wrapper = new LambdaQueryWrapper<>();
+                        wrapper.eq(SmartRelation::getUserId, userId)
+                                .eq(SmartRelation::getRelationId, userId1)
+                                .eq(SmartRelation::getDateTime,format);
+                        SmartRelation one = this.getOne(wrapper);
+                        if (ObjectUtils.isEmpty(one)) {
+                            SmartRelation smartRelation = new SmartRelation();
+                            smartRelation.setUserId(userId);
+                            smartRelation.setRelationId(userId1);
+                            if (ObjectUtils.isNotEmpty(smartUser)) {
+                                smartRelation.setName(smartUser.getName());
+                            }
+                            if (ObjectUtils.isNotEmpty(smartById)) {
+                                smartRelation.setRelationName(smartById.getName());
+                            }
+                            smartRelation.setCount(0);
+                            smartRelation.setDateTime(format);
+                            this.save(smartRelation);
+                        } else {
+                            Integer count = one.getCount();
+                            count = count + 1;
+                            one.setCount(count);
+                            this.updateById(one);
+                        }
+
+                    }
+
+                }
+
+            }
+
+        }
+    }
+
+    @Async
+    @Scheduled(cron = "0 0 2 * * ? ")//每天凌晨一点
+    public void getFaceDiscernListSmartRelation() {
+        if (scheduleConfig.getIsOpen().equals("1")) {
+            DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            LocalDateTime now = LocalDateTime.now();
+            LocalDateTime start = now.withHour(0).withMinute(0).withSecond(0).minusDays(1);
+            LocalDateTime end = now.withHour(23).withMinute(59).withSecond(59).minusDays(1);
+
+            String format = start.format(pattern);
+
+//            找到昨天的所有数据
+            List<SmartFaceDiscern> faceDiscernList = smartFaceDiscernService.toDateList(start, end);
+
+            for (SmartFaceDiscern faceDiscern : faceDiscernList) {
+                String dateTime = faceDiscern.getDateTime();
+                LocalDateTime date = LocalDateTime.parse(dateTime, pattern);
+                LocalDateTime startTime = date.minusSeconds(10);
+                LocalDateTime endTime = date.plusSeconds(10);
+                Integer userId = faceDiscern.getUserId();
+                SmartUser smartUser = smartUserService.getSmartById(userId);
+                List<SmartFaceDiscern> faceDiscerns = smartFaceDiscernService.toDateList(startTime, endTime);
+                if (ObjectUtils.isNotEmpty(faceDiscerns) && faceDiscerns.size() > 0) {
+
+                    for (SmartFaceDiscern faceDiscern1 : faceDiscerns) {
+                        Integer userId1 = faceDiscern1.getUserId();
+                        SmartUser smartById = smartUserService.getSmartById(userId1);
+//                        判断是否已添加,有的话则加1
+                        LambdaQueryWrapper<SmartRelation> wrapper = new LambdaQueryWrapper<>();
+                        wrapper.eq(SmartRelation::getUserId, userId)
+                                .eq(SmartRelation::getRelationId, userId1)
+                                .eq(SmartRelation::getDateTime,format);
+                        SmartRelation one = this.getOne(wrapper);
+                        if (ObjectUtils.isEmpty(one)) {
+                            SmartRelation smartRelation = new SmartRelation();
+                            smartRelation.setUserId(userId);
+                            smartRelation.setRelationId(userId1);
+                            if (ObjectUtils.isNotEmpty(smartUser)) {
+                                smartRelation.setName(smartUser.getName());
+                            }
+                            if (ObjectUtils.isNotEmpty(smartById)) {
+                                smartRelation.setRelationName(smartById.getName());
+                            }
+                            smartRelation.setDateTime(format);
+                            smartRelation.setCount(0);
+                            this.save(smartRelation);
+                        } else {
+                            Integer count = one.getCount();
+                            count = count + 1;
+                            one.setCount(count);
+                            this.updateById(one);
+                        }
+
+                    }
+
+                }
+
+            }
+
+        }
+    }
+
+
+    @Override
+    public PageUtils<SmartRelation> getPage(int currentPage, int pageCount, Integer userId) {
+//        Page<UserVo> page = new Page<>();
+//        page.setCurrent(currentPage);
+//        page.setSize(pageCount);
+//        IPage<WarningUserDto> result = smartUserMapper.warningUserList(page, name);
+//        return new PageUtils(result);
+        return null;
+    }
+}

+ 8 - 0
src/main/java/com/template/services/impl/SmartVisitorParentsConfigServiceImpl.java

@@ -43,4 +43,12 @@ public class SmartVisitorParentsConfigServiceImpl extends ServiceImpl<SmartVisit
         return smartVisitorParentsConfigMapper.getClassId(schoolClass);
         return smartVisitorParentsConfigMapper.getClassId(schoolClass);
     }
     }
 
 
+    @Override
+    public SmartVisitorParentsConfig getByClassId(Integer classId) {
+        LambdaQueryWrapper<SmartVisitorParentsConfig> wrapper=new LambdaQueryWrapper<>();
+        wrapper.eq(SmartVisitorParentsConfig::getClassId,classId);
+        SmartVisitorParentsConfig one = this.getOne(wrapper);
+        return one;
+    }
+
 }
 }

+ 22 - 0
src/main/resources/mapper/template/SmartCarAccessMapper.xml

@@ -2,4 +2,26 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.template.mapper.SmartCarAccessMapper">
 <mapper namespace="com.template.mapper.SmartCarAccessMapper">
 
 
+    <select id="getPage" resultType="com.template.model.vo.SmartCarAccessVo">
+        SELECT
+        sca.id as id,
+        sca.type as type,
+        sca.car_no as carNo,
+        sca.data_time as dataTime,
+        sca.image as image
+        FROM
+        `smart_car_access` sca
+        WHERE sca.deleted=0
+        <if test="keyWord != null and keyWord != ''">
+            and sca.car_no like '%' #{keyWord} '%'
+        </if>
+        <if test="type != null and type != ''">
+            and sca.type = #{type}
+        </if>
+        <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+            and sca.data_time &gt;= #{startTime} and sca.data_time &lt;= #{endTime}
+        </if>
+        ORDER BY sca.data_time DESC
+
+    </select>
 </mapper>
 </mapper>

+ 5 - 0
src/main/resources/mapper/template/SmartRelationMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.template.mapper.SmartRelationMapper">
+
+</mapper>

+ 1 - 0
src/main/resources/mapper/template/SmartVisitorParentsConfigMapper.xml

@@ -13,6 +13,7 @@
         svpc.screen_push_config as screenPushConfig,
         svpc.screen_push_config as screenPushConfig,
         svpc.screen_cancel_config as screenCancelConfig,
         svpc.screen_cancel_config as screenCancelConfig,
         svpc.access_config as accessConfig,
         svpc.access_config as accessConfig,
+        svpc.car_config as carConfig,
         svpc.create_time as createTime,
         svpc.create_time as createTime,
         sc.`name` as className,
         sc.`name` as className,
         sg.`name` as gradeName
         sg.`name` as gradeName