林健华 před 2 roky
revize
1b3304b93a
38 změnil soubory, kde provedl 2293 přidání a 0 odebrání
  1. 25 0
      .gitignore
  2. 0 0
      README.md
  3. 46 0
      assembly/assembly.xml
  4. 154 0
      pom.xml
  5. 21 0
      src/main/java/com/benyun/Application.java
  6. 44 0
      src/main/java/com/benyun/config/CorsConfig.java
  7. 124 0
      src/main/java/com/benyun/controller/ApplyController.java
  8. 117 0
      src/main/java/com/benyun/controller/EventController.java
  9. 189 0
      src/main/java/com/benyun/controller/EventLogController.java
  10. 113 0
      src/main/java/com/benyun/controller/UserController.java
  11. 25 0
      src/main/java/com/benyun/dao/ApplyDao.java
  12. 28 0
      src/main/java/com/benyun/dao/EventDao.java
  13. 27 0
      src/main/java/com/benyun/dao/EventLogDao.java
  14. 22 0
      src/main/java/com/benyun/dao/UserDao.java
  15. 40 0
      src/main/java/com/benyun/entity/Apply.java
  16. 56 0
      src/main/java/com/benyun/entity/Event.java
  17. 107 0
      src/main/java/com/benyun/entity/EventLog.java
  18. 47 0
      src/main/java/com/benyun/entity/User.java
  19. 52 0
      src/main/java/com/benyun/service/ApplyService.java
  20. 52 0
      src/main/java/com/benyun/service/EventLogService.java
  21. 64 0
      src/main/java/com/benyun/service/EventService.java
  22. 46 0
      src/main/java/com/benyun/service/UserService.java
  23. 94 0
      src/main/java/com/benyun/service/impl/ApplyServiceImpl.java
  24. 99 0
      src/main/java/com/benyun/service/impl/EventLogServiceImpl.java
  25. 108 0
      src/main/java/com/benyun/service/impl/EventServiceImpl.java
  26. 78 0
      src/main/java/com/benyun/service/impl/UserServiceImpl.java
  27. 48 0
      src/main/java/com/benyun/vo/ApplyEventVo.java
  28. 17 0
      src/main/java/com/benyun/vo/EventLogPageVo.java
  29. 109 0
      src/main/java/com/benyun/vo/EventLogVo.java
  30. 16 0
      src/main/java/com/benyun/vo/EventPageVo.java
  31. 69 0
      src/main/resources/application-dev.yml
  32. 86 0
      src/main/resources/application-prod.yml
  33. 3 0
      src/main/resources/application.yml
  34. 49 0
      src/main/resources/logback.xml
  35. 19 0
      src/main/resources/sql/Apply.md
  36. 42 0
      src/main/resources/sql/Event.md
  37. 49 0
      src/main/resources/sql/EventLog.md
  38. 8 0
      src/main/resources/sql/User.md

+ 25 - 0
.gitignore

@@ -0,0 +1,25 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+logs/
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/build/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/

+ 0 - 0
README.md


+ 46 - 0
assembly/assembly.xml

@@ -0,0 +1,46 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+
+    <id>customAssembly</id>
+    <!-- dir -->
+    <formats>
+        <format>dir</format>
+        <format>tar.gz</format>
+    </formats>
+
+    <includeBaseDirectory>false</includeBaseDirectory>
+
+    <fileSets>
+        <fileSet>
+            <directory>${project.basedir}/bin/</directory>
+            <outputDirectory>./bin</outputDirectory>
+            <filtered>true</filtered>
+            <fileMode>0755</fileMode>
+            <lineEnding>unix</lineEnding>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/src/main/resources/</directory>
+            <outputDirectory>./resources</outputDirectory>
+        </fileSet>
+    </fileSets>
+
+    <dependencySets>
+        <dependencySet>
+            <outputDirectory>./lib</outputDirectory>
+            <scope>runtime</scope>
+            <excludes>
+                <exclude>${project.groupId}:${project.artifactId}</exclude>
+                <exclude>org.projectlombok:lombok</exclude>
+                <exclude>org.springframework.boot:spring-boot-devtools</exclude>
+            </excludes>
+        </dependencySet>
+        <dependencySet>
+            <outputDirectory>./</outputDirectory>
+            <includes>
+                <include>${project.groupId}:${project.artifactId}</include>
+            </includes>
+        </dependencySet>
+    </dependencySets>
+
+</assembly>

+ 154 - 0
pom.xml

@@ -0,0 +1,154 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+            http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>com.benyun</groupId>
+    <artifactId>burialPoint</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <name>burialPoint</name>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <java.version>1.8</java.version>
+    </properties>
+
+    <parent>
+        <groupId>com.benyun.boot</groupId>
+        <artifactId>benyun-boot</artifactId>
+        <version>2.0.0</version>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.benyun.boot</groupId>
+            <artifactId>benyun-boot-core</artifactId>
+<!--            <exclusions>-->
+<!--                <exclusion>-->
+<!--                    <groupId>com.baomidou</groupId>-->
+<!--                    <artifactId>mybatis-plus-boot-starter</artifactId>-->
+<!--                </exclusion>-->
+<!--            </exclusions>-->
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.ibeetl</groupId>
+            <artifactId>beetl-framework-starter</artifactId>
+            <version>1.1.78.RELEASE</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+            <version>2.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.retry</groupId>
+            <artifactId>spring-retry</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.28</version>
+        </dependency>
+
+        <!-- Sa-Token 权限认证,在线文档:https://sa-token.cc -->
+        <dependency>
+            <groupId>cn.dev33</groupId>
+            <artifactId>sa-token-spring-boot-starter</artifactId>
+            <version>1.34.0</version>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>${java.version}</source>
+                    <target>${java.version}</target>
+                    <compilerArgs>
+                        <arg>-parameters</arg>
+                    </compilerArgs>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <configuration>
+                    <finalName>burialPoint</finalName>
+                    <!--加上下面这一句,上面的finalName是什么,打包出来的目录就叫什么-->
+                    <appendAssemblyId>false</appendAssemblyId>
+                    <descriptors>
+                        <descriptor>${project.basedir}/assembly/assembly.xml</descriptor>
+                    </descriptors>
+                    <outputDirectory>${project.build.directory}/dist/</outputDirectory>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>com.benyun.Application</mainClass>
+                            <classpathPrefix>lib/</classpathPrefix>
+                            <addClasspath>true</addClasspath>
+                        </manifest>
+                        <manifestEntries>
+                            <Class-Path>resources/</Class-Path>
+                        </manifestEntries>
+                    </archive>
+                    <excludes>
+                        <exclude>static/**</exclude>
+                        <exclude>templates/**</exclude>
+                        <exclude>sql/**</exclude>
+                        <exclude>mapper/**</exclude>
+                        <exclude>data/**</exclude>
+                        <exclude>*.setting</exclude>
+                        <exclude>*.properties</exclude>
+                        <exclude>*.json</exclude>
+                        <exclude>*.yml</exclude>
+                        <exclude>*.xml</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <configuration>
+                    <failOnMissingWebXml>false</failOnMissingWebXml>
+                    <warName>${project.artifactId}</warName>
+                </configuration>
+            </plugin>
+            <!--SonarQube Maven插件-->
+            <!--指定版本:  mvn clean package org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar -->
+            <!--最新版本:  mvn clean package sonar:sonar -->
+            <plugin>
+                <groupId>org.sonarsource.scanner.maven</groupId>
+                <artifactId>sonar-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 21 - 0
src/main/java/com/benyun/Application.java

@@ -0,0 +1,21 @@
+package com.benyun;
+
+import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+
+@SpringBootApplication
+@EnableKnife4j
+public class Application extends SpringBootServletInitializer {
+    public static void main(String[] args) {
+        SpringApplication.run(Application.class, args);
+    }
+
+
+    @Override
+    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
+        return application.sources(Application.class);
+    }
+}

+ 44 - 0
src/main/java/com/benyun/config/CorsConfig.java

@@ -0,0 +1,44 @@
+package com.benyun.config;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+
+/**
+  * 跨域前后端配置类
+  * 赵毅梵
+  * 2021/9/8
+  **/
+@Configuration
+@Slf4j
+public class CorsConfig {
+  @Bean
+  public CorsFilter corsFilter() {
+    // 1.添加CORS配置信息
+    CorsConfiguration config = new CorsConfiguration();
+    // 放行哪些原始域
+    config.addAllowedOrigin("*");
+    // 是否发送Cookie信息
+    config.setAllowCredentials(true);
+    // 放行哪些原始域(请求方式)
+    config.addAllowedMethod("*");
+    // 放行哪些原始域(头部信息)
+    config.addAllowedHeader("*");
+    // 暴露哪些头部信息(因为跨域访问默认不能获取全部头部信息)
+    // config.addExposedHeader("*");
+    config.addExposedHeader("Content-Type");
+    config.addExposedHeader( "X-Requested-With");
+    config.addExposedHeader("accept");
+    config.addExposedHeader("Origin");
+    config.addExposedHeader( "Access-Control-Request-Method");
+    config.addExposedHeader("Access-Control-Request-Headers");
+    // 2.添加映射路径
+    UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
+    configSource.registerCorsConfiguration("/**", config);
+    // 3.返回新的CorsFilter.
+    return new CorsFilter(configSource);
+  }
+}

+ 124 - 0
src/main/java/com/benyun/controller/ApplyController.java

@@ -0,0 +1,124 @@
+package com.benyun.controller;
+
+
+import com.benyun.boot.core.vo.Result;
+import com.benyun.vo.ApplyEventVo;
+import lombok.RequiredArgsConstructor;
+import com.benyun.entity.Apply;
+import com.benyun.service.ApplyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.beetl.sql.core.engine.PageQuery;
+
+import java.util.List;
+
+/**
+ * @author makejava
+ * create on 2023-03-17 10:03:25
+ */
+@RestController
+@RequestMapping("apply")
+@RequiredArgsConstructor(onConstructor_ = {@Autowired})
+public class ApplyController {
+    /**
+     * 服务对象
+     */
+    private final ApplyService applyService;
+
+    /**
+     * 查询所有数据
+     *
+     * @return 所有数据
+     */
+    @GetMapping("/queryAll")
+    public Result<List<Apply>> queryAll() {
+        return Result.success(applyService.queryAll());
+    }
+
+    /**
+     * 查询所有数据
+     *
+     * @return 所有数据
+     */
+    @GetMapping("/queryList")
+    public Result<List<Apply>> queryList(@RequestParam(required = false) String applyName) {
+        return Result.success(applyService.queryList(applyName));
+    }
+    
+     /**
+     * 分页查询数据
+     *
+     * @return 所有数据
+     */
+    @GetMapping("/queryPage")
+    public Result<List<Apply>> queryPage(@RequestParam Integer pageNum, @RequestParam Integer pageSize, Apply apply) {
+        PageQuery<Apply> pageQuery = new PageQuery<Apply>();
+        pageQuery.setPageSize(pageSize);
+        pageQuery.setPageNumber(pageNum);
+        pageQuery.setParas(apply);
+        return applyService.queryByPage(pageQuery);
+    }
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id 主键
+     * @return 单条数据
+     */
+    @GetMapping("/queryOne")
+    public Result<Apply> queryOne(@RequestParam("id") String id) {
+        return Result.success(applyService.queryById(id));
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param apply 实体对象
+     * @return 新增结果
+     */
+    @PostMapping("/create")
+    public Result<?> create(@RequestBody Apply apply) {
+        applyService.insert(apply);
+        return Result.success(apply);
+    }
+
+    /**
+     * 修改数据
+     *
+     * @param apply 实体对象
+     * @return 修改结果
+     */
+    @PostMapping("/update")
+    public Result<?> update(@RequestBody Apply apply) {
+        return applyService.updateById(apply) ? Result.success() : Result.failure();
+    }
+
+    /**
+     * 删除数据
+     *
+     * @param id 主键
+     * @return 删除结果
+     */
+    @PostMapping("/delete")
+    public Result<Boolean> delete(@RequestParam("id") String id) {
+      return Result.success(this.applyService.deleteById(id));
+    }
+
+    /**
+     * 通过应用id查询应用的事件数据
+     *
+     * @return 所有数据
+     */
+    @GetMapping("/queryApplyEventByUUId")
+    public Result<ApplyEventVo> queryApplyEventByUUId(@RequestParam("uuid") String uuid) {
+        return Result.success(applyService.queryApplyEventByUUId(uuid));
+    }
+}

+ 117 - 0
src/main/java/com/benyun/controller/EventController.java

@@ -0,0 +1,117 @@
+package com.benyun.controller;
+
+
+import cn.hutool.core.util.StrUtil;
+import com.benyun.boot.core.vo.Result;
+import com.benyun.entity.Event;
+import com.benyun.service.EventService;
+import com.benyun.vo.EventPageVo;
+import lombok.RequiredArgsConstructor;
+import org.beetl.sql.core.engine.PageQuery;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @author makejava
+ * create on 2023-03-17 09:06:58
+ */
+@RestController
+@RequestMapping("event")
+@RequiredArgsConstructor(onConstructor_ = {@Autowired})
+public class EventController {
+    /**
+     * 服务对象
+     */
+    private final EventService eventService;
+
+    /**
+     * 查询所有数据
+     *
+     * @return 所有数据
+     */
+    @GetMapping("/queryAll")
+    public Result<List<Event>> queryAll() {
+        return Result.success(eventService.queryAll());
+    }
+
+    /**
+     * 分页查询数据
+     *
+     * @return 所有数据
+     */
+    @GetMapping("/queryPage")
+    public Result<EventPageVo> queryPage(@RequestParam Integer pageNum,
+                                         @RequestParam Integer pageSize,
+                                         @RequestParam String applyId,
+                                         @RequestParam(required = false) String eventName,
+                                         @RequestParam(required = false) String eventType) {
+        PageQuery<Event> pageQuery = new PageQuery<Event>();
+        pageQuery.setPageSize(pageSize);
+        pageQuery.setPageNumber(pageNum);
+        pageQuery.setPara("applyId", applyId);
+        if (StrUtil.isNotBlank(eventName))
+            pageQuery.setPara("eventName", "%" + eventName + "%");
+        if (StrUtil.isNotBlank(eventType))
+            pageQuery.setPara("eventType", "%" + eventType + "%");
+        EventPageVo eventPageVo = eventService.queryByPage(pageQuery);
+        return Result.success(eventPageVo);
+    }
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id 主键
+     * @return 单条数据
+     */
+    @GetMapping("/queryOne")
+    public Result<Event> queryOne(@RequestParam("id") String id, @RequestParam("applyId") String applyId) {
+        return Result.success(eventService.queryById(id, applyId));
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param event 实体对象
+     * @return 新增结果
+     */
+    @PostMapping("/create")
+    public Result<?> create(@RequestBody Event event) {
+        eventService.insert(event);
+        return Result.success(event);
+    }
+
+    /**
+     * 修改数据
+     *
+     * @param event 实体对象
+     * @return 修改结果
+     */
+    @PostMapping("/update")
+    public Result<?> update(@RequestBody Event event) {
+        return eventService.updateById(event) ? Result.success() : Result.failure();
+    }
+
+    /**
+     * 修改数据2
+     *
+     * @param event 实体对象
+     * @return 修改结果
+     */
+    @PostMapping("/update2")
+    public Result<?> update2(@RequestBody Event event) {
+        return eventService.updateById2(event) ? Result.success() : Result.failure();
+    }
+
+    /**
+     * 删除数据
+     *
+     * @param id 主键
+     * @return 删除结果
+     */
+    @PostMapping("/delete")
+    public Result<Boolean> delete(@RequestParam("id") String id, @RequestParam("applyId") String applyId) {
+        return Result.success(this.eventService.deleteById(id, applyId));
+    }
+}

+ 189 - 0
src/main/java/com/benyun/controller/EventLogController.java

@@ -0,0 +1,189 @@
+package com.benyun.controller;
+
+
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSON;
+import com.benyun.boot.core.vo.Result;
+import com.benyun.entity.Event;
+import com.benyun.vo.*;
+import lombok.RequiredArgsConstructor;
+import com.benyun.entity.EventLog;
+import com.benyun.service.EventLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.beetl.sql.core.engine.PageQuery;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author makejava
+ * create on 2023-03-22 09:25:07
+ */
+@RestController
+@RequestMapping("eventLog")
+@RequiredArgsConstructor(onConstructor_ = {@Autowired})
+public class EventLogController {
+    /**
+     * 服务对象
+     */
+    private final EventLogService eventLogService;
+
+    /**
+     * 查询所有数据
+     *
+     * @return 所有数据
+     */
+    @GetMapping("/queryAll")
+    public Result<List<EventLog>> queryAll() {
+        return Result.success(eventLogService.queryAll());
+    }
+    
+     /**
+     * 分页查询数据
+     *
+     * @return 所有数据
+     */
+    @GetMapping("/queryPage")
+    public Result<List<EventLog>> queryPage(@RequestParam Integer pageNum, @RequestParam Integer pageSize, EventLog eventLog) {
+        PageQuery<EventLog> pageQuery = new PageQuery<EventLog>();
+        pageQuery.setPageSize(pageSize);
+        pageQuery.setPageNumber(pageNum);
+        pageQuery.setParas(eventLog);
+        return eventLogService.queryByPage(pageQuery);
+    }
+
+    /**
+     * 分页查询数据2
+     *
+     * @return 所有数据
+     */
+    @GetMapping("/queryPage2")
+    public Result<EventLogPageVo> queryPage2(@RequestParam Integer pageNum,
+                                             @RequestParam Integer pageSize,
+                                             @RequestParam(required = false) String applyId,
+                                             @RequestParam(required = false) String eventId,
+                                             @RequestParam(required = false) String applyName,
+                                             @RequestParam(required = false) String eventName) {
+        PageQuery<EventLogVo> pageQuery = new PageQuery<EventLogVo>();
+        pageQuery.setPageSize(pageSize);
+        pageQuery.setPageNumber(pageNum);
+        if (StrUtil.isNotBlank(applyId))
+            pageQuery.setPara("applyId", applyId);
+        if (StrUtil.isNotBlank(eventId))
+            pageQuery.setPara("eventId", eventId);
+        if (StrUtil.isNotBlank(applyName))
+            pageQuery.setPara("applyName", "%" + applyName + "%");
+        if (StrUtil.isNotBlank(eventName))
+            pageQuery.setPara("eventName", "%" + eventName + "%");
+        return Result.success(eventLogService.queryByPage2(pageQuery));
+    }
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id 主键
+     * @return 单条数据
+     */
+    @GetMapping("/queryOne")
+    public Result<EventLogVo> queryOne(@RequestParam("id") Integer id) {
+        return Result.success(eventLogService.queryById(id));
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param eventLog 实体对象
+     * @return 新增结果
+     */
+    @PostMapping("/create")
+    public Result<?> create(@RequestBody EventLog eventLog) {
+        eventLogService.insert(eventLog);
+        return Result.success(eventLog);
+    }
+
+    /**
+     * 修改数据
+     *
+     * @param eventLog 实体对象
+     * @return 修改结果
+     */
+    @PostMapping("/update")
+    public Result<?> update(@RequestBody EventLog eventLog) {
+        return eventLogService.updateById(eventLog) ? Result.success() : Result.failure();
+    }
+
+    /**
+     * 删除数据
+     *
+     * @param id 主键
+     * @return 删除结果
+     */
+    @PostMapping("/delete")
+    public Result<Boolean> delete(@RequestParam("id") Integer id) {
+      return Result.success(this.eventLogService.deleteById(id));
+    }
+
+//    /**
+//     * 批量新增数据
+//     *
+//     * @param models 实体对象
+//     * @return 新增结果
+//     */
+//    @PostMapping("/createList")
+//    public Result<Boolean> createList(@RequestBody Map<String, Object> models) {
+//        List<EventLog> eventLogList = JSON.parseArray(JSON.toJSONString(models.get("eventLogList")), EventLog.class);
+//        eventLogService.insertList(eventLogList);
+//        return Result.success(true);
+//    }
+
+    /**
+     * 批量新增数据
+     *
+     * @param eventLogList 实体对象
+     * @return 新增结果
+     */
+    @PostMapping("/createList")
+    public Result<Boolean> createList(@RequestBody List<EventLog> eventLogList, HttpServletRequest request) {
+        String ip = getRealIp(request);
+        eventLogList.forEach(item -> {
+            item.setIpAddress(ip);
+        });
+        eventLogService.insertList(eventLogList);
+        return Result.success(true);
+    }
+
+    /**
+     * 获取id地址
+     *
+     * @param request
+     */
+    public static String getRealIp(HttpServletRequest request) {
+        String ip = request.getHeader("x-forwarded-for");
+        if (ip != null && ip.length() > 15 && ip.indexOf(",") > 0) {
+            ip = ip.substring(0, ip.indexOf(","));
+        }
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+            ip = request.getHeader("Proxy-Client-IP");
+        }
+
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+            ip = request.getHeader("WL-Proxy-Client-IP");
+        }
+
+        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
+            ip = request.getRemoteAddr();
+        }
+
+        return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
+    }
+}

+ 113 - 0
src/main/java/com/benyun/controller/UserController.java

@@ -0,0 +1,113 @@
+package com.benyun.controller;
+
+
+import com.benyun.boot.core.vo.Result;
+import lombok.RequiredArgsConstructor;
+import com.benyun.entity.User;
+import com.benyun.service.UserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.beetl.sql.core.engine.PageQuery;
+
+import java.util.List;
+
+/**
+ * @author makejava
+ * create on 2023-03-17 09:06:58
+ */
+@RestController
+@RequestMapping("user")
+@RequiredArgsConstructor(onConstructor_ = {@Autowired})
+public class UserController {
+    /**
+     * 服务对象
+     */
+    private final UserService userService;
+
+    /**
+     * 查询所有数据
+     *
+     * @return 所有数据
+     */
+    @GetMapping("/queryAll")
+    public Result<List<User>> queryAll() {
+        return Result.success(userService.queryAll());
+    }
+    
+     /**
+     * 分页查询数据
+     *
+     * @return 所有数据
+     */
+    @GetMapping("/queryPage")
+    public Result<List<User>> queryPage(@RequestParam Integer pageNum, @RequestParam Integer pageSize, User user) {
+        PageQuery<User> pageQuery = new PageQuery<User>();
+        pageQuery.setPageSize(pageSize);
+        pageQuery.setPageNumber(pageNum);
+        pageQuery.setParas(user);
+        return userService.queryByPage(pageQuery);
+    }
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id 主键
+     * @return 单条数据
+     */
+    @GetMapping("/queryOne")
+    public Result<User> queryOne(@RequestParam("id") Integer id) {
+        return Result.success(userService.queryById(id));
+    }
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @return 单条数据
+     */
+    @GetMapping("/getUserInfo")
+    public Result<User> getUserInfo() {
+        return Result.success();
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param user 实体对象
+     * @return 新增结果
+     */
+    @PostMapping("/create")
+    public Result<?> create(@RequestBody User user) {
+        userService.insert(user);
+        return Result.success(user);
+    }
+
+    /**
+     * 修改数据
+     *
+     * @param user 实体对象
+     * @return 修改结果
+     */
+    @PostMapping("/update")
+    public Result<?> update(@RequestBody User user) {
+        return userService.updateById(user) ? Result.success() : Result.failure();
+    }
+
+    /**
+     * 删除数据
+     *
+     * @param id 主键
+     * @return 删除结果
+     */
+    @PostMapping("/delete")
+    public Result<Boolean> delete(@RequestParam("id") Integer id) {
+      return Result.success(this.userService.deleteById(id));
+    }
+}

+ 25 - 0
src/main/java/com/benyun/dao/ApplyDao.java

@@ -0,0 +1,25 @@
+package com.benyun.dao;
+
+import com.benyun.entity.Apply;
+import com.benyun.vo.ApplyEventVo;
+import org.beetl.sql.core.mapper.BaseMapper;
+import org.beetl.sql.core.engine.PageQuery;
+import org.beetl.sql.core.annotatoin.SqlResource;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 应用表(Apply)表数据库访问层
+ *
+ * @author makejava
+ * create on 2023-03-17 10:03:25
+ */
+@Repository
+@SqlResource("Apply")
+public interface ApplyDao extends BaseMapper<Apply> {
+    /**
+     * 分页查询
+     */
+    void queryByPage(PageQuery<Apply> pageQuery);
+
+    ApplyEventVo queryApplyEventByUUId(String uuid);
+}

+ 28 - 0
src/main/java/com/benyun/dao/EventDao.java

@@ -0,0 +1,28 @@
+package com.benyun.dao;
+
+import com.benyun.entity.Event;
+import org.beetl.sql.core.mapper.BaseMapper;
+import org.beetl.sql.core.engine.PageQuery;
+import org.beetl.sql.core.annotatoin.SqlResource;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 事件信息表(Event)表数据库访问层
+ *
+ * @author makejava
+ * create on 2023-03-21 09:20:28
+ */
+@Repository
+@SqlResource("Event")
+public interface EventDao extends BaseMapper<Event> {
+    /**
+     * 分页查询
+     */
+    void queryByPage(PageQuery<Event> pageQuery);
+
+    Event queryById(String id, String applyId);
+
+    int updateById2(Event event, String id);
+
+    int deleteByIdAndApplyId(String id, String applyId);
+}

+ 27 - 0
src/main/java/com/benyun/dao/EventLogDao.java

@@ -0,0 +1,27 @@
+package com.benyun.dao;
+
+import com.benyun.entity.EventLog;
+import com.benyun.vo.EventLogVo;
+import org.beetl.sql.core.mapper.BaseMapper;
+import org.beetl.sql.core.engine.PageQuery;
+import org.beetl.sql.core.annotatoin.SqlResource;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 日志信息表(EventLog)表数据库访问层
+ *
+ * @author makejava
+ * create on 2023-03-22 09:25:06
+ */
+@Repository
+@SqlResource("EventLog")
+public interface EventLogDao extends BaseMapper<EventLog> {
+    /**
+     * 分页查询
+     */
+    void queryByPage(PageQuery<EventLog> pageQuery);
+
+    void queryByPage2(PageQuery<EventLogVo> pageQuery);
+
+    EventLogVo queryById(Integer id);
+}

+ 22 - 0
src/main/java/com/benyun/dao/UserDao.java

@@ -0,0 +1,22 @@
+package com.benyun.dao;
+
+import com.benyun.entity.User;
+import org.beetl.sql.core.mapper.BaseMapper;
+import org.beetl.sql.core.engine.PageQuery;
+import org.beetl.sql.core.annotatoin.SqlResource;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 用户信息表(User)表数据库访问层
+ *
+ * @author makejava
+ * create on 2023-03-17 09:06:58
+ */
+@Repository
+@SqlResource("User")
+public interface UserDao extends BaseMapper<User> {
+    /**
+     * 分页查询
+     */
+    void queryByPage(PageQuery<User> pageQuery);
+}

+ 40 - 0
src/main/java/com/benyun/entity/Apply.java

@@ -0,0 +1,40 @@
+package com.benyun.entity;
+
+
+import lombok.*;
+import org.beetl.sql.core.TailBean;
+import org.beetl.sql.core.annotatoin.AssignID;
+import org.beetl.sql.core.annotatoin.Table;
+import org.beetl.sql.core.annotatoin.AutoID;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 应用表(Apply)实体类
+ *
+ * @author makejava
+ * @since 2023-03-18 09:53:06
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@Table(name = "apply")
+public class Apply extends TailBean {
+    private static final long serialVersionUID = 794570664248666299L;
+    /**
+     * uuId
+     */
+    @AssignID
+    private String uuid;
+    /**
+     * 应用名称
+     */
+    private String applyName;
+    /**
+     * 应用类型 如web、Android、小程序
+     */
+    private String applyType;
+
+}

+ 56 - 0
src/main/java/com/benyun/entity/Event.java

@@ -0,0 +1,56 @@
+package com.benyun.entity;
+
+
+import lombok.*;
+import org.beetl.sql.core.TailBean;
+import org.beetl.sql.core.annotatoin.Table;
+import org.beetl.sql.core.annotatoin.AutoID;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 事件信息表(Event)实体类
+ *
+ * @author makejava
+ * @since 2023-03-21 09:19:13
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@Table(name = "event")
+public class Event extends TailBean {
+    private static final long serialVersionUID = -97325402814750524L;
+    /**
+     * 事件ID
+     */
+    @AutoID
+    private String id;
+    /**
+     * 应用ID
+     */
+    @AutoID
+    private String applyId;
+    /**
+     * 事件名称
+     */
+    private String eventName;
+    /**
+     * 事件code
+     */
+    private String eventCode;
+    /**
+     * 事件类型
+     */
+    private String eventType;
+    /**
+     * 事件描述
+     */
+    private String description;
+    /**
+     * 创建时间
+     */
+    private Date createdTime;
+
+}

+ 107 - 0
src/main/java/com/benyun/entity/EventLog.java

@@ -0,0 +1,107 @@
+package com.benyun.entity;
+
+
+import lombok.*;
+import org.beetl.sql.core.TailBean;
+import org.beetl.sql.core.annotatoin.Table;
+import org.beetl.sql.core.annotatoin.AutoID;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 日志信息表(EventLog)实体类
+ *
+ * @author makejava
+ * @since 2023-03-22 09:25:06
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@Table(name = "event_log")
+public class EventLog extends TailBean {
+    private static final long serialVersionUID = -41253196173826747L;
+    /**
+     * ID
+     */
+    @AutoID
+    private Integer id;
+    /**
+     * 应用ID
+     */
+    private String applyId;
+    /**
+     * 应用名称
+     */
+    private String applyName;
+    /**
+     * 事件ID
+     */
+    private String eventId;
+    /**
+     * 事件名称
+     */
+    private String eventName;
+    /**
+     * 触发事件时间
+     */
+    private Date eventTime;
+    /**
+     * 触发事件用户
+     */
+    private Integer userId;
+    /**
+     * 触发事件用户统一id
+     */
+    private String userOpenid;
+    /**
+     * 触发事件用户名
+     */
+    private String userName;
+    /**
+     * 设备ID
+     */
+    private String deviceId;
+    /**
+     * 设备类型
+     */
+    private String deviceType;
+    /**
+     * 设备操作系统
+     */
+    private String deviceOs;
+    /**
+     * 设备操作系统版本
+     */
+    private String deviceOsVersion;
+    /**
+     * 设备浏览器
+     */
+    private String deviceBrowser;
+    /**
+     * 设备语言
+     */
+    private String deviceLanguage;
+    /**
+     * 设备地理位置
+     */
+    private String location;
+    /**
+     * 事件响应页地址
+     */
+    private String applyUrl;
+    /**
+     * 响应页浏览时长
+     */
+    private String applyUrlUv;
+    /**
+     * IP地址
+     */
+    private String ipAddress;
+    /**
+     * 文本
+     */
+    private String info;
+
+}

+ 47 - 0
src/main/java/com/benyun/entity/User.java

@@ -0,0 +1,47 @@
+package com.benyun.entity;
+
+
+import lombok.*;
+import org.beetl.sql.core.TailBean;
+import org.beetl.sql.core.annotatoin.Table;
+import org.beetl.sql.core.annotatoin.AutoID;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 用户信息表(User)实体类
+ *
+ * @author makejava
+ * @since 2023-03-18 09:53:06
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@Table(name = "user")
+public class User extends TailBean {
+    private static final long serialVersionUID = -61763948199949111L;
+    /**
+     * 用户ID
+     */
+    @AutoID
+    private Integer userId;
+    /**
+     * 用户名
+     */
+    private String username;
+    /**
+     * 邮箱
+     */
+    private String email;
+    /**
+     * 手机号码
+     */
+    private String phone;
+    /**
+     * 创建时间
+     */
+    private Date created;
+
+}

+ 52 - 0
src/main/java/com/benyun/service/ApplyService.java

@@ -0,0 +1,52 @@
+package com.benyun.service;
+
+
+import java.util.List;
+
+import com.benyun.entity.Apply;
+import com.benyun.boot.core.vo.Result;
+import com.benyun.vo.ApplyEventVo;
+import org.beetl.sql.core.engine.PageQuery;
+
+/**
+ * 应用表(Apply)表服务
+ *
+ * @author makejava
+ * create on 2023-03-17 10:03:25
+ */
+public interface ApplyService {
+
+    Apply queryById(String id);
+
+    List<Apply> queryAll();
+
+    void insert(Apply apply);
+
+    /**
+     * 根据主键更新记录
+     *
+     * @param apply 待更新的记录.包含主键在内,如果其他列的值为空则不更新
+     * @return 成功返回true,失败返回false
+     */
+    boolean updateById(Apply apply);
+    
+    /**
+     * 根据主键删除记录
+     *
+     * @param id 主键
+     * @return 成功返回true,反之返回false
+     */
+    boolean deleteById(String id);
+    
+    /**
+     * 分页查询
+     * @param pageQuery 封装分页条件的分页对象
+     * @return pageQuery 作为一个引用,将查询结果封装进去
+     */
+    Result<List<Apply>> queryByPage(PageQuery<Apply> pageQuery);
+
+
+    ApplyEventVo queryApplyEventByUUId(String uuid);
+
+    List<Apply> queryList(String applyName);
+}

+ 52 - 0
src/main/java/com/benyun/service/EventLogService.java

@@ -0,0 +1,52 @@
+package com.benyun.service;
+
+
+import java.util.List;
+
+import com.benyun.entity.EventLog;
+import com.benyun.boot.core.vo.Result;
+import com.benyun.vo.EventLogPageVo;
+import com.benyun.vo.EventLogVo;
+import org.beetl.sql.core.engine.PageQuery;
+
+/**
+ * 日志信息表(EventLog)表服务
+ *
+ * @author makejava
+ * create on 2023-03-22 09:25:07
+ */
+public interface EventLogService {
+
+    EventLogVo queryById(Integer id);
+
+    List<EventLog> queryAll();
+
+    void insert(EventLog eventLog);
+    
+    /**
+     * 根据主键更新记录
+     *
+     * @param eventLog 待更新的记录.包含主键在内,如果其他列的值为空则不更新
+     * @return 成功返回true,失败返回false
+     */
+    boolean updateById(EventLog eventLog);
+    
+    /**
+     * 根据主键删除记录
+     *
+     * @param id 主键
+     * @return 成功返回true,反之返回false
+     */
+    boolean deleteById(Integer id);
+    
+    /**
+     * 分页查询
+     * @param pageQuery 封装分页条件的分页对象
+     * @return pageQuery 作为一个引用,将查询结果封装进去
+     */
+    Result<List<EventLog>> queryByPage(PageQuery<EventLog> pageQuery);
+
+    EventLogPageVo queryByPage2(PageQuery<EventLogVo> pageQuery);
+
+    void insertList(List<EventLog> eventLogList);
+}

+ 64 - 0
src/main/java/com/benyun/service/EventService.java

@@ -0,0 +1,64 @@
+package com.benyun.service;
+
+
+import java.util.List;
+
+import com.benyun.entity.Event;
+import com.benyun.boot.core.vo.Result;
+import com.benyun.vo.EventPageVo;
+import org.beetl.sql.core.engine.PageQuery;
+
+/**
+ * 事件信息表(Event)表服务
+ *
+ * @author makejava
+ * create on 2023-03-21 09:20:28
+ */
+public interface EventService {
+
+    Event queryById(String id, String applyId);
+
+    List<Event> queryAll();
+
+    void insert(Event event);
+    
+    /**
+     * 根据主键更新记录
+     *
+     * @param event 待更新的记录.包含主键在内,如果其他列的值为空则不更新
+     * @return 成功返回true,失败返回false
+     */
+    boolean updateById(Event event);
+
+    /**
+     * 根据主键更新记录
+     *
+     * @param event 待更新的记录.包含主键在内,如果其他列的值为空则不更新
+     * @return 成功返回true,失败返回false
+     */
+    boolean updateById2(Event event);
+    
+    /**
+     * 根据主键删除记录
+     *
+     * @param id 主键
+     * @return 成功返回true,反之返回false
+     */
+    boolean deleteById(String id);
+
+    /**
+     * 根据主键删除记录
+     *
+     * @param id 主键
+     * @param applyId 应用uuid 主键
+     * @return 成功返回true,反之返回false
+     */
+    boolean deleteById(String id, String applyId);
+    
+    /**
+     * 分页查询
+     * @param pageQuery 封装分页条件的分页对象
+     * @return pageQuery 作为一个引用,将查询结果封装进去
+     */
+    EventPageVo queryByPage(PageQuery<Event> pageQuery);
+}

+ 46 - 0
src/main/java/com/benyun/service/UserService.java

@@ -0,0 +1,46 @@
+package com.benyun.service;
+
+
+import java.util.List;
+
+import com.benyun.entity.User;
+import com.benyun.boot.core.vo.Result;
+import org.beetl.sql.core.engine.PageQuery;
+
+/**
+ * 用户信息表(User)表服务
+ *
+ * @author makejava
+ * create on 2023-03-17 09:06:58
+ */
+public interface UserService {
+
+    User queryById(Integer id);
+
+    List<User> queryAll();
+
+    void insert(User user);
+    
+    /**
+     * 根据主键更新记录
+     *
+     * @param user 待更新的记录.包含主键在内,如果其他列的值为空则不更新
+     * @return 成功返回true,失败返回false
+     */
+    boolean updateById(User user);
+    
+    /**
+     * 根据主键删除记录
+     *
+     * @param id 主键
+     * @return 成功返回true,反之返回false
+     */
+    boolean deleteById(Integer id);
+    
+    /**
+     * 分页查询
+     * @param pageQuery 封装分页条件的分页对象
+     * @return pageQuery 作为一个引用,将查询结果封装进去
+     */
+    Result<List<User>> queryByPage(PageQuery<User> pageQuery);
+}

+ 94 - 0
src/main/java/com/benyun/service/impl/ApplyServiceImpl.java

@@ -0,0 +1,94 @@
+package com.benyun.service.impl;
+
+
+import cn.hutool.core.util.StrUtil;
+import com.benyun.boot.core.vo.Result;
+import com.benyun.dao.ApplyDao;
+import com.benyun.entity.Apply;
+import com.benyun.service.ApplyService;
+import com.benyun.vo.ApplyEventVo;
+import lombok.RequiredArgsConstructor;
+import org.beetl.sql.core.engine.PageQuery;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * 应用表(Apply)表服务实现
+ *
+ * @author makejava
+ * create on 2023-03-17 10:03:25
+ */
+@Service
+@RequiredArgsConstructor(onConstructor_ = {@Autowired})
+public class ApplyServiceImpl implements ApplyService {
+
+    private final ApplyDao applyDao;
+
+    @Override
+    public Apply queryById(String id) {
+        return applyDao.single(id);
+    }
+
+    @Override
+    public List<Apply> queryAll() {
+        return applyDao.all();
+    }
+
+    @Override
+    public List<Apply> queryList(String applyName) {
+        return applyDao.createLambdaQuery().andLike(Apply::getApplyName, "%" + (StrUtil.isNotBlank(applyName)? applyName: "") + "%").select();
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void insert(Apply apply) {
+        applyDao.insert(apply);
+    }
+
+    /**
+     * 根据主键更新记录
+     *
+     * @param apply 待更新的记录.包含主键在内,如果其他列的值为空则不更新
+     * @return 成功返回true,失败返回false
+     */
+    @Override
+    public boolean updateById(Apply apply) {
+        return applyDao.updateTemplateById(apply) > 0;
+    }
+
+    /**
+     * 根据主键删除记录
+     *
+     * @param id 主键
+     * @return 成功返回true,反之返回false
+     */
+    @Override
+    public boolean deleteById(String id) {
+        return applyDao.deleteById(id) > 0;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param pageQuery 封装分页条件的分页对象
+     * @return pageQuery 作为一个引用,将查询结果封装进去
+     */
+    @Override
+    public Result<List<Apply>> queryByPage(PageQuery<Apply> pageQuery) {
+        applyDao.queryByPage(pageQuery);
+        Result<List<Apply>> result = Result.success();
+        result.setData(pageQuery.getList());
+        result.setCount((int) pageQuery.getTotalRow());
+        return result;
+    }
+
+    @Override
+    public ApplyEventVo queryApplyEventByUUId(String uuid) {
+        ApplyEventVo applyEventVo = applyDao.queryApplyEventByUUId(uuid);
+        return applyEventVo;
+    }
+}

+ 99 - 0
src/main/java/com/benyun/service/impl/EventLogServiceImpl.java

@@ -0,0 +1,99 @@
+package com.benyun.service.impl;
+
+
+import java.util.List;
+
+import com.benyun.entity.EventLog;
+import com.benyun.dao.EventLogDao;
+import com.benyun.service.EventLogService;
+import com.benyun.boot.core.vo.Result;
+import com.benyun.vo.EventLogPageVo;
+import com.benyun.vo.EventLogVo;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.beetl.sql.core.engine.PageQuery;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+/**
+ * 日志信息表(EventLog)表服务实现
+ *
+ * @author makejava
+ * create on 2023-03-22 09:25:07
+ */
+@Service
+@RequiredArgsConstructor(onConstructor_ = {@Autowired})
+public class EventLogServiceImpl implements EventLogService {
+
+    private final EventLogDao eventLogDao;
+
+    @Override
+    public EventLogVo queryById(Integer id) {
+        return eventLogDao.queryById(id);
+    }
+
+    @Override
+    public List<EventLog> queryAll() {
+        return eventLogDao.all();
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void insert(EventLog eventLog) {
+        eventLogDao.insert(eventLog, true);
+    }
+    
+    /**
+     * 根据主键更新记录
+     *
+     * @param eventLog 待更新的记录.包含主键在内,如果其他列的值为空则不更新
+     * @return 成功返回true,失败返回false
+     */
+    @Override
+    public boolean updateById(EventLog eventLog) {
+        return eventLogDao.updateTemplateById(eventLog) > 0;
+    }
+    
+    /**
+     * 根据主键删除记录
+     *
+     * @param id 主键
+     * @return 成功返回true,反之返回false
+     */
+    @Override
+    public boolean deleteById(Integer id) {
+        return eventLogDao.deleteById(id) > 0;
+    }
+    
+    /**
+     * 分页查询
+     * @param pageQuery 封装分页条件的分页对象
+     * @return pageQuery 作为一个引用,将查询结果封装进去
+     */
+    @Override
+    public Result<List<EventLog>> queryByPage(PageQuery<EventLog> pageQuery) {
+        eventLogDao.queryByPage(pageQuery);
+        Result<List<EventLog>> result = Result.success();
+        result.setData(pageQuery.getList());
+        result.setCount((int) pageQuery.getTotalRow());
+        return result;
+    }
+
+    /**
+     * 分页查询2
+     * @param pageQuery 封装分页条件的分页对象
+     * @return pageQuery 作为一个引用,将查询结果封装进去
+     */
+    @Override
+    public EventLogPageVo queryByPage2(PageQuery<EventLogVo> pageQuery) {
+        eventLogDao.queryByPage2(pageQuery);
+        EventLogPageVo eventLogPageVo = new EventLogPageVo();
+        eventLogPageVo.setTotalRow((int) pageQuery.getTotalRow());
+        eventLogPageVo.setEventLogVos(pageQuery.getList());
+        return eventLogPageVo;
+    }
+
+    @Override
+    public void insertList(List<EventLog> eventLogList) {
+        eventLogDao.insertBatch(eventLogList);
+    }
+}

+ 108 - 0
src/main/java/com/benyun/service/impl/EventServiceImpl.java

@@ -0,0 +1,108 @@
+package com.benyun.service.impl;
+
+
+import com.benyun.dao.EventDao;
+import com.benyun.entity.Event;
+import com.benyun.service.EventService;
+import com.benyun.vo.EventPageVo;
+import lombok.RequiredArgsConstructor;
+import org.beetl.sql.core.engine.PageQuery;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 事件信息表(Event)表服务实现
+ *
+ * @author makejava
+ * create on 2023-03-21 09:20:28
+ */
+@Service
+@RequiredArgsConstructor(onConstructor_ = {@Autowired})
+public class EventServiceImpl implements EventService {
+
+    private final EventDao eventDao;
+
+    @Override
+    public Event queryById(String id, String applyId) {
+        return eventDao.queryById(id, applyId);
+    }
+
+    @Override
+    public List<Event> queryAll() {
+        return eventDao.all();
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void insert(Event event) {
+        event.setId(event.getApplyId() + "@" + event.getEventCode());
+        event.setCreatedTime(new Date());
+        eventDao.insert(event, true);
+    }
+
+    /**
+     * 根据主键更新记录
+     *
+     * @param event 待更新的记录.包含主键在内,如果其他列的值为空则不更新
+     * @return 成功返回true,失败返回false
+     */
+    @Override
+    public boolean updateById(Event event) {
+        return eventDao.updateTemplateById(event) > 0;
+    }
+
+    /**
+     * 根据主键更新记录
+     *
+     * @param event 待更新的记录.包含主键在内,如果其他列的值为空则不更新
+     * @return 成功返回true,失败返回false
+     */
+    @Override
+    public boolean updateById2(Event event) {
+        String eventId = event.getId();
+        event.setId(event.getApplyId() + "@" + event.getEventName());
+        return eventDao.updateById2(event, eventId) > 0;
+    }
+
+    /**
+     * 根据主键删除记录
+     *
+     * @param id 主键
+     * @return 成功返回true,反之返回false
+     */
+    @Override
+    public boolean deleteById(String id) {
+        return eventDao.deleteById(id) > 0;
+    }
+
+    /**
+     * 根据主键删除记录
+     *
+     * @param id 主键
+     * @param applyId 应用uuid 主键
+     * @return 成功返回true,反之返回false
+     */
+    @Override
+    public boolean deleteById(String id, String applyId) {
+        return eventDao.deleteByIdAndApplyId(id, applyId) > 0;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param pageQuery 封装分页条件的分页对象
+     * @return pageQuery 作为一个引用,将查询结果封装进去
+     */
+    @Override
+    public EventPageVo queryByPage(PageQuery<Event> pageQuery) {
+        eventDao.queryByPage(pageQuery);
+        EventPageVo eventPageVo = new EventPageVo();
+        eventPageVo.setTotalRow((int) pageQuery.getTotalRow());
+        eventPageVo.setEventList(pageQuery.getList());
+        return eventPageVo;
+    }
+}

+ 78 - 0
src/main/java/com/benyun/service/impl/UserServiceImpl.java

@@ -0,0 +1,78 @@
+package com.benyun.service.impl;
+
+
+import java.util.List;
+
+import com.benyun.entity.User;
+import com.benyun.dao.UserDao;
+import com.benyun.service.UserService;
+import com.benyun.boot.core.vo.Result;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.beetl.sql.core.engine.PageQuery;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+/**
+ * 用户信息表(User)表服务实现
+ *
+ * @author makejava
+ * create on 2023-03-17 09:06:58
+ */
+@Service
+@RequiredArgsConstructor(onConstructor_ = {@Autowired})
+public class UserServiceImpl implements UserService {
+
+    private final UserDao userDao;
+
+    @Override
+    public User queryById(Integer id) {
+        return userDao.single(id);
+    }
+
+    @Override
+    public List<User> queryAll() {
+        return userDao.all();
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void insert(User user) {
+        userDao.insert(user, true);
+    }
+    
+    /**
+     * 根据主键更新记录
+     *
+     * @param user 待更新的记录.包含主键在内,如果其他列的值为空则不更新
+     * @return 成功返回true,失败返回false
+     */
+    @Override
+    public boolean updateById(User user) {
+        return userDao.updateTemplateById(user) > 0;
+    }
+    
+    /**
+     * 根据主键删除记录
+     *
+     * @param id 主键
+     * @return 成功返回true,反之返回false
+     */
+    @Override
+    public boolean deleteById(Integer id) {
+        return userDao.deleteById(id) > 0;
+    }
+    
+    /**
+     * 分页查询
+     * @param pageQuery 封装分页条件的分页对象
+     * @return pageQuery 作为一个引用,将查询结果封装进去
+     */
+    @Override
+    public Result<List<User>> queryByPage(PageQuery<User> pageQuery) {
+        userDao.queryByPage(pageQuery);
+        Result<List<User>> result = Result.success();
+        result.setData(pageQuery.getList());
+        result.setCount((int) pageQuery.getTotalRow());
+        return result;
+    }
+}

+ 48 - 0
src/main/java/com/benyun/vo/ApplyEventVo.java

@@ -0,0 +1,48 @@
+package com.benyun.vo;
+
+
+import com.benyun.entity.Event;
+import lombok.*;
+import org.beetl.sql.core.TailBean;
+import org.beetl.sql.core.annotatoin.Table;
+import org.beetl.sql.core.annotatoin.AutoID;
+import org.beetl.sql.core.orm.OrmCondition;
+import org.beetl.sql.core.orm.OrmQuery;
+
+import java.util.List;
+
+/**
+ * 应用表(Apply)实体类
+ *
+ * @author makejava
+ * @since 2023-03-17 14:37:02
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+@OrmQuery({
+        @OrmCondition(target = Event.class, attr = "uuid", targetAttr = "applyId", alias ="eventList", type = OrmQuery.Type.MANY),
+})
+public class ApplyEventVo extends TailBean {
+    private static final long serialVersionUID = 313104691699963778L;
+    /**
+     * 应用id
+     */
+    private String uuid;
+    /**
+     * 应用名称
+     */
+    private String applyName;
+    /**
+     * 应用类型 如web、Android、小程序
+     */
+    private String applyType;
+
+    /**
+     * 应用-事件列表
+     */
+    private List<Event> eventList;
+
+}

+ 17 - 0
src/main/java/com/benyun/vo/EventLogPageVo.java

@@ -0,0 +1,17 @@
+package com.benyun.vo;
+
+import lombok.*;
+
+import java.util.List;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+public class EventLogPageVo {
+
+    private Integer totalRow;
+    private List<EventLogVo> eventLogVos;
+
+}

+ 109 - 0
src/main/java/com/benyun/vo/EventLogVo.java

@@ -0,0 +1,109 @@
+package com.benyun.vo;
+
+
+import lombok.*;
+import org.beetl.sql.core.TailBean;
+import org.beetl.sql.core.annotatoin.Table;
+import org.beetl.sql.core.annotatoin.AutoID;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 日志信息表(EventLog)实体类
+ *
+ * @author makejava
+ * @since 2023-03-22 09:25:47
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+public class EventLogVo extends TailBean {
+    private static final long serialVersionUID = 372748058767071877L;
+    /**
+     * ID
+     */
+    private Integer id;
+    /**
+     * 应用ID
+     */
+    private String applyId;
+    /**
+     * 事件ID
+     */
+    private String eventId;
+    /**
+     * 事件名称
+     */
+    private String eventName;
+    /**
+     * 事件应用名称
+     */
+    private String applyName;
+    /**
+     * 触发事件时间
+     */
+    private Date eventTime;
+    /**
+     * 触发事件用户
+     */
+    private Integer userId;
+    /**
+     * 触发事件用户统一id
+     */
+    private String userOpenid;
+    /**
+     * 触发事件用户名
+     */
+    private String userName;
+    /**
+     * 设备ID
+     */
+    private String deviceId;
+    /**
+     * 设备类型
+     */
+    private String deviceType;
+    /**
+     * 设备操作系统
+     */
+    private String deviceOs;
+    /**
+     * 设备操作系统版本
+     */
+    private String deviceOsVersion;
+    /**
+     * 设备浏览器
+     */
+    private String deviceBrowser;
+    /**
+     * 设备语言
+     */
+    private String deviceLanguage;
+    /**
+     * 设备地理位置
+     */
+    private String location;
+    /**
+     * 事件响应页地址
+     */
+    private String applyUrl;
+    /**
+     * 响应页浏览次数
+     */
+    private String applyUrlPv;
+    /**
+     * 响应页浏览时长
+     */
+    private String applyUrlUv;
+    /**
+     * IP地址
+     */
+    private String ipAddress;
+    /**
+     * 文本
+     */
+    private String info;
+
+}

+ 16 - 0
src/main/java/com/benyun/vo/EventPageVo.java

@@ -0,0 +1,16 @@
+package com.benyun.vo;
+
+import com.benyun.entity.Event;
+import lombok.*;
+
+import java.util.List;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = false)
+public class EventPageVo {
+    private Integer totalRow;
+    private List<Event> eventList;
+}

+ 69 - 0
src/main/resources/application-dev.yml

@@ -0,0 +1,69 @@
+server:
+  port: 9098
+  tomcat:
+    max-swallow-size: -1
+  undertow:
+    # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作
+    # 对于 bufferSize,最好和你系统的 TCP Socket Buffer 配置一样
+    # `/proc/sys/net/ipv4/tcp_rmem` (对于读取)
+    # `/proc/sys/net/ipv4/tcp_wmem` (对于写入)
+    # 在内存大于 128 MB 时,bufferSize 为 16 KB 减去 20 字节,这 20 字节用于协议头
+    buffer-size: 16364
+    # 是否分配的直接内存(NIO直接分配的堆外内存),这里开启,所以java启动参数需要配置下直接内存大小,减少不必要的GC
+    # 在内存大于 128 MB 时,默认就是使用直接内存的
+    direct-buffers: true
+    threads:
+      # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个读线程和一个写线程
+      # 不要设置过大,如果过大,启动项目会报错:打开文件数过多
+      io: 8
+      # 阻塞任务线程池, 当执行类似servlet请求阻塞IO操作, undertow会从这个线程池中取得线程
+      # 它的值设置取决于系统线程执行任务的阻塞系数,默认值是IO线程数*8
+      worker: 128
+  error:
+    include-exception: true
+    include-stacktrace: ALWAYS
+    include-message: ALWAYS
+  servlet:
+    context-path: /
+  compression:
+    enabled: true
+    min-response-size: 1024
+    mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
+
+spring:
+  servlet:
+    multipart:
+      max-file-size: 10MB
+      max-request-size: 10MB
+  datasource:
+    dynamic:
+      primary: master   #设置默认的数据源或者数据源组,默认值即为master
+      strict: false     #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
+      datasource:
+        master:
+          url: jdbc:mysql://192.168.2.64:3306/burial_point?characterEncoding=UTF-8&autoReconnect=true&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          username: root
+          password: benyun
+          driver-class-name: com.mysql.cj.jdbc.Driver
+  # redis 配置
+  redis:
+    database: 5
+    host: 192.168.2.64
+    lettuce:
+      pool:
+        max-active: 8   # 最大连接数据库连接数,设 0 为没有限制
+        max-idle: 8     # 最大等待连接中的数量,设 0 为没有限制
+        max-wait: -1ms  # 最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
+        min-idle: 0     # 最小等待连接中的数量,设 0 为没有限制
+      shutdown-timeout: 100ms
+    password: 123456
+    port: 6379
+
+# swagger
+knife4j:
+  production: true
+  basic:
+    enable: true
+    username: admin
+    password: benyun
+

+ 86 - 0
src/main/resources/application-prod.yml

@@ -0,0 +1,86 @@
+server:
+  port: 8081
+  tomcat:
+    max-swallow-size: -1
+  undertow:
+    # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作
+    # 对于 bufferSize,最好和你系统的 TCP Socket Buffer 配置一样
+    # `/proc/sys/net/ipv4/tcp_rmem` (对于读取)
+    # `/proc/sys/net/ipv4/tcp_wmem` (对于写入)
+    # 在内存大于 128 MB 时,bufferSize 默认为 16 KB 减去 20 字节,这 20 字节用于协议头
+    buffer-size: 16364
+    # 是否分配的直接内存(NIO直接分配的堆外内存),这里开启,所以java启动参数需要配置下直接内存大小,减少不必要的GC
+    # 在内存大于 128 MB 时,默认就是使用直接内存的
+    direct-buffers: true
+    threads:
+      # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个读线程和一个写线程
+      # 不要设置过大,如果过大,启动项目会报错:打开文件数过多
+      io: 16
+      # 阻塞任务线程池, 当执行类似servlet请求阻塞IO操作, undertow会从这个线程池中取得线程
+      # 它的值设置取决于系统线程执行任务的阻塞系数,默认值是IO线程数*8
+      worker: 256
+  error:
+    include-exception: true
+    include-stacktrace: ALWAYS
+    include-message: ALWAYS
+  servlet:
+    context-path: /
+  compression:
+    enabled: true
+    min-response-size: 1024
+    mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
+
+spring:
+  servlet:
+    multipart:
+      max-file-size: 10MB
+      max-request-size: 10MB
+  datasource:
+    dynamic:
+      primary: master   #设置默认的数据源或者数据源组,默认值即为master
+      strict: false     #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
+      datasource:
+        master:
+          url: jdbc:mysql://localhost:3306/master?characterEncoding=UTF-8&autoReconnect=true&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          username: root
+          password: 123456
+          driver-class-name: com.mysql.cj.jdbc.Driver
+  # redis 配置
+  redis:
+    database: 0
+    host: 127.0.0.1
+    lettuce:
+      pool:
+        max-active: 8   # 最大连接数据库连接数,设 0 为没有限制
+        max-idle: 8     # 最大等待连接中的数量,设 0 为没有限制
+        max-wait: -1ms  # 最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
+        min-idle: 0     # 最小等待连接中的数量,设 0 为没有限制
+      shutdown-timeout: 100ms
+    password: ''
+    port: 6379
+
+# mybatis plus 设置
+mybatis-plus:
+  type-aliases-package: com.benyun.**.entity
+  mapper-locations: classpath*:/mapper/**/*.xml
+  global-config:
+    # 关闭MP3.0自带的banner
+    banner: false
+    db-config:
+      # 主键类型
+      id-type: AUTO
+      # 默认数据库表下划线命名
+      table-underline: true
+  configuration:
+    # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
+    #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    # 返回类型为Map,显示null对应的字段
+    call-setters-on-nulls: true
+
+# swagger
+knife4j:
+  production: true
+  basic:
+    enable: true
+    username: admin
+    password: benyun

+ 3 - 0
src/main/resources/application.yml

@@ -0,0 +1,3 @@
+spring:
+  profiles:
+    active: dev

+ 49 - 0
src/main/resources/logback.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<configuration debug="false">
+    <!--此处要引用defaults.xml,不能引用base.xml,因为base.xml中有root标签,对控制台打印输出一次,此处又有一次,-->
+    <!--因此,同一条日志会打印两次,因此,使用默认的defaults.xml即可-->
+    <include resource="org/springframework/boot/logging/logback/defaults.xml"/>
+    <property name="CONSOLE_PATTERN"
+              value="%d{yyyy-MM-dd HH:mm:ss} [%X{reqId}] %5p --- [%15.15t] %-40.40logger{39} : %m%n"/>
+    <property name="FILE_PATTERN"
+              value="%d{yyyy-MM-dd HH:mm:ss} [%X{reqId}] %5p --- [%15.15t] %-40.40logger{39} : %m%n"/>
+    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${CONSOLE_PATTERN}</pattern>
+            <charset>utf8</charset>
+        </encoder>
+    </appender>
+
+    <appender name="infoAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>DENY</onMatch>  <!-- 如果命中就禁止这条日志 -->
+            <onMismatch>ACCEPT</onMismatch>  <!-- 如果没有命中就使用这条规则 -->
+        </filter>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>./logs/info/%d{yyyyMMdd}-info.log</fileNamePattern>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${FILE_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="errorAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>ERROR</level>
+        </filter>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>./logs/error/%d{yyyyMMdd}-error.log</fileNamePattern>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${FILE_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+
+    <root level="INFO">
+        <appender-ref ref="CONSOLE"/>
+        <appender-ref ref="infoAppender"/>
+        <appender-ref ref="errorAppender"/>
+    </root>
+</configuration>

+ 19 - 0
src/main/resources/sql/Apply.md

@@ -0,0 +1,19 @@
+queryByPage
+===
+SELECT 
+@pageTag(){
+ * 
+@}
+FROM apply 
+WHERE 1=1
+
+queryApplyEventByUUId
+===
+SELECT a.*
+FROM apply a
+LEFT JOIN `event` e on e.apply_id = a.uuid
+WHERE 1=1
+@if(!isEmpty(uuid)){
+and a.uuid = #uuid#
+@}
+

+ 42 - 0
src/main/resources/sql/Event.md

@@ -0,0 +1,42 @@
+queryByPage
+===
+SELECT 
+@pageTag(){
+ * 
+@}
+FROM event 
+WHERE 1=1
+and apply_id = #applyId#
+@if(!isEmpty(eventName)){
+and event_name like #eventName#
+@}
+@if(!isEmpty(eventType)){
+and event_type like #eventType#
+@}
+ORDER BY id DESC
+
+queryById
+===
+SELECT *
+FROM event
+WHERE 1=1
+and id = #id#
+and apply_id = #applyId#
+
+updateById2
+===
+update `event` 
+set
+`id` = #id#,
+`event_name`=#eventName#, 
+`event_type`=#eventType#, 
+`description`=#description# 
+where 1=1
+and `id` = #id# 
+and `apply_id` = #applyId#
+
+deleteByIdAndApplyId
+===
+delete from `event` 
+where `id` = #id#
+and `apply_id` = #applyId#

+ 49 - 0
src/main/resources/sql/EventLog.md

@@ -0,0 +1,49 @@
+queryByPage
+===
+SELECT 
+@pageTag(){
+ * 
+@}
+FROM event_log 
+WHERE 1=1
+
+queryById
+===
+SELECT
+el.*,
+a.apply_name apply_name,
+e.event_name event_name
+FROM event_log el
+LEFT JOIN `event` e on el.event_id = e.id
+LEFT JOIN `apply` a on el.apply_id = a.uuid
+WHERE 1=1
+@if(!isEmpty(id)){
+and el.id=#id#
+@}
+ORDER BY el.id
+
+queryByPage2
+===
+SELECT
+@pageTag(){
+el.*,
+a.apply_name apply_name,
+e.event_name event_name
+@}
+FROM event_log el
+LEFT JOIN `event` e on el.event_id = e.id
+LEFT JOIN `apply` a on el.apply_id = a.uuid
+WHERE 1=1
+@if(!isEmpty(applyId)){
+and a.uuid=#applyId#
+@}
+@if(!isEmpty(eventId)){
+and e.id=#eventId#
+@}
+@if(!isEmpty(applyName)){
+and a.apply_name like #applyName#
+@}
+@if(!isEmpty(eventName)){
+and e.event_name like #eventName#
+@}
+ORDER BY el.id

+ 8 - 0
src/main/resources/sql/User.md

@@ -0,0 +1,8 @@
+queryByPage
+===
+SELECT 
+@pageTag(){
+ * 
+@}
+FROM user 
+WHERE 1=1