Browse Source

SqlServer相关的服务初始化 并新增几个demo测试方法

王苗苗 2 months ago
parent
commit
24ae661d69
37 changed files with 1128 additions and 0 deletions
  1. BIN
      .DS_Store
  2. 13 0
      .idea/compiler.xml
  3. 7 0
      .idea/encodings.xml
  4. 20 0
      .idea/jarRepositories.xml
  5. 14 0
      .idea/misc.xml
  6. 6 0
      .idea/vcs.xml
  7. 103 0
      .idea/workspace.xml
  8. 19 0
      HELP.md
  9. 100 0
      pom.xml
  10. BIN
      src/.DS_Store
  11. BIN
      src/main/.DS_Store
  12. 13 0
      src/main/java/com/robot/remote/smartrobotremote/SmartRobotRemoteApplication.java
  13. 27 0
      src/main/java/com/robot/remote/smartrobotremote/conf/JdbcConfig.java
  14. 53 0
      src/main/java/com/robot/remote/smartrobotremote/controller/TestController.java
  15. 67 0
      src/main/java/com/robot/remote/smartrobotremote/demos/web/BasicController.java
  16. 44 0
      src/main/java/com/robot/remote/smartrobotremote/demos/web/PathVariableController.java
  17. 43 0
      src/main/java/com/robot/remote/smartrobotremote/demos/web/User.java
  18. 99 0
      src/main/java/com/robot/remote/smartrobotremote/domain/BizDevice.java
  19. 67 0
      src/main/java/com/robot/remote/smartrobotremote/mapper/BizDeviceMapper.java
  20. 14 0
      src/main/resources/application.yml
  21. 190 0
      src/main/resources/mapper/BizDeviceMapper.xml
  22. 6 0
      src/main/resources/static/index.html
  23. 13 0
      src/test/java/com/robot/remote/smartrobotremote/SmartRobotRemoteApplicationTests.java
  24. BIN
      target/.DS_Store
  25. BIN
      target/classes/.DS_Store
  26. 14 0
      target/classes/application.yml
  27. BIN
      target/classes/com/robot/remote/smartrobotremote/SmartRobotRemoteApplication.class
  28. BIN
      target/classes/com/robot/remote/smartrobotremote/conf/JdbcConfig.class
  29. BIN
      target/classes/com/robot/remote/smartrobotremote/controller/TestController.class
  30. BIN
      target/classes/com/robot/remote/smartrobotremote/demos/web/BasicController.class
  31. BIN
      target/classes/com/robot/remote/smartrobotremote/demos/web/PathVariableController.class
  32. BIN
      target/classes/com/robot/remote/smartrobotremote/demos/web/User.class
  33. BIN
      target/classes/com/robot/remote/smartrobotremote/domain/BizDevice$BizDeviceBuilder.class
  34. BIN
      target/classes/com/robot/remote/smartrobotremote/domain/BizDevice.class
  35. BIN
      target/classes/com/robot/remote/smartrobotremote/mapper/BizDeviceMapper.class
  36. 190 0
      target/classes/mapper/BizDeviceMapper.xml
  37. 6 0
      target/classes/static/index.html

BIN
.DS_Store


+ 13 - 0
.idea/compiler.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <annotationProcessing>
+      <profile name="Maven default annotation processors profile" enabled="true">
+        <sourceOutputDir name="target/generated-sources/annotations" />
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
+        <outputRelativeToContentRoot value="true" />
+        <module name="smart-robot-remote" />
+      </profile>
+    </annotationProcessing>
+  </component>
+</project>

+ 7 - 0
.idea/encodings.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
+  </component>
+</project>

+ 20 - 0
.idea/jarRepositories.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Central Repository" />
+      <option name="url" value="https://repo.maven.apache.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+  </component>
+</project>

+ 14 - 0
.idea/misc.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
+  <component name="MavenProjectsManager">
+    <option name="originalFiles">
+      <list>
+        <option value="$PROJECT_DIR$/pom.xml" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>

+ 103 - 0
.idea/workspace.xml

@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="AutoImportSettings">
+    <option name="autoReloadType" value="SELECTIVE" />
+  </component>
+  <component name="ChangeListManager">
+    <list default="true" id="494e7e12-0e43-41f1-b914-44d06666de04" name="Changes" comment="" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="FileTemplateManagerImpl">
+    <option name="RECENT_TEMPLATES">
+      <list>
+        <option value="Class" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectColorInfo"><![CDATA[{
+  "associatedIndex": 6
+}]]></component>
+  <component name="ProjectId" id="2rZDms9Sm1X0MozaUkRiWMPw3Mu" />
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
+  <component name="ProjectViewState">
+    <option name="hideEmptyMiddlePackages" value="true" />
+    <option name="showLibraryContents" value="true" />
+  </component>
+  <component name="PropertiesComponent"><![CDATA[{
+  "keyToString": {
+    "RequestMappingsPanelOrder0": "0",
+    "RequestMappingsPanelOrder1": "1",
+    "RequestMappingsPanelWidth0": "75",
+    "RequestMappingsPanelWidth1": "75",
+    "RunOnceActivity.ShowReadmeOnStart": "true",
+    "Spring Boot.SmartRobotRemoteApplication.executor": "Debug",
+    "kotlin-language-version-configured": "true",
+    "last_opened_file_path": "/Users/wangmiaomiao/IdeaProjects/smart-robot-remote",
+    "node.js.detected.package.eslint": "true",
+    "node.js.detected.package.tslint": "true",
+    "node.js.selected.package.eslint": "(autodetect)",
+    "node.js.selected.package.tslint": "(autodetect)",
+    "nodejs_package_manager_path": "npm",
+    "project.structure.last.edited": "Project",
+    "project.structure.proportion": "0.15",
+    "project.structure.side.proportion": "0.2",
+    "vue.rearranger.settings.migration": "true"
+  }
+}]]></component>
+  <component name="RecentsManager">
+    <key name="CopyFile.RECENT_KEYS">
+      <recent name="$PROJECT_DIR$" />
+      <recent name="$PROJECT_DIR$/src/main/resources/mapper" />
+    </key>
+    <key name="CopyClassDialog.RECENTS_KEY">
+      <recent name="com.robot.remote.smartrobotremote.domain" />
+      <recent name="com.robot.remote.smartrobotremote.mapper" />
+    </key>
+  </component>
+  <component name="RunManager">
+    <configuration name="SmartRobotRemoteApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
+      <module name="smart-robot-remote" />
+      <option name="SPRING_BOOT_MAIN_CLASS" value="com.robot.remote.smartrobotremote.SmartRobotRemoteApplication" />
+      <extension name="coverage">
+        <pattern>
+          <option name="PATTERN" value="com.robot.remote.smartrobotremote.*" />
+          <option name="ENABLED" value="true" />
+        </pattern>
+      </extension>
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
+    <recent_temporary>
+      <list>
+        <item itemvalue="Spring Boot.SmartRobotRemoteApplication" />
+      </list>
+    </recent_temporary>
+  </component>
+  <component name="SharedIndexes">
+    <attachedChunks>
+      <set>
+        <option value="bundled-jdk-9f38398b9061-39b83d9b5494-intellij.indexing.shared.core-IU-241.18034.62" />
+        <option value="bundled-js-predefined-1d06a55b98c1-0b3e54e931b4-JavaScript-IU-241.18034.62" />
+      </set>
+    </attachedChunks>
+  </component>
+  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="494e7e12-0e43-41f1-b914-44d06666de04" name="Changes" comment="" />
+      <created>1736757867945</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1736757867945</updated>
+      <workItem from="1736757869096" duration="8039000" />
+    </task>
+    <servers />
+  </component>
+  <component name="TypeScriptGeneratedFilesManager">
+    <option name="version" value="3" />
+  </component>
+</project>

+ 19 - 0
HELP.md

@@ -0,0 +1,19 @@
+# Getting Started
+
+### Reference Documentation
+
+For further reference, please consider the following sections:
+
+* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
+* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.6.13/maven-plugin/reference/html/)
+* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.6.13/maven-plugin/reference/html/#build-image)
+* [Spring Web](https://docs.spring.io/spring-boot/docs/2.6.13/reference/htmlsingle/#web)
+
+### Guides
+
+The following guides illustrate how to use some features concretely:
+
+* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
+* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
+* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
+

+ 100 - 0
pom.xml

@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>com.robot.remote</groupId>
+    <artifactId>smart-robot-remote</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>smart-robot-remote</name>
+    <description>smart-robot-remote</description>
+    <properties>
+        <java.version>1.8</java.version>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <spring-boot.version>2.6.13</spring-boot.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- SQL Server Driver -->
+        <dependency>
+            <groupId>com.microsoft.sqlserver</groupId>
+            <artifactId>mssql-jdbc</artifactId>
+            <!--<scope>runtime</scope>-->
+            <version>8.1.0.jre8-preview</version>
+        </dependency>
+
+        <!-- Spring JDBC -->
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-jdbc</artifactId>
+            <version>5.3.10</version>
+        </dependency>
+
+        <!-- MyBatis -->
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>2.2.0</version>
+        </dependency>
+
+    </dependencies>
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring-boot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.8.1</version>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                    <encoding>UTF-8</encoding>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>${spring-boot.version}</version>
+                <configuration>
+                    <mainClass>com.robot.remote.smartrobotremote.SmartRobotRemoteApplication</mainClass>
+                    <skip>true</skip>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>repackage</id>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

BIN
src/.DS_Store


BIN
src/main/.DS_Store


+ 13 - 0
src/main/java/com/robot/remote/smartrobotremote/SmartRobotRemoteApplication.java

@@ -0,0 +1,13 @@
+package com.robot.remote.smartrobotremote;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class SmartRobotRemoteApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(SmartRobotRemoteApplication.class, args);
+    }
+
+}

+ 27 - 0
src/main/java/com/robot/remote/smartrobotremote/conf/JdbcConfig.java

@@ -0,0 +1,27 @@
+package com.robot.remote.smartrobotremote.conf;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+@Configuration
+public class JdbcConfig {
+
+    @Bean
+    public DataSource dataSource() {
+        DriverManagerDataSource dataSource = new DriverManagerDataSource();
+        dataSource.setDriverClassName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
+        dataSource.setUrl("jdbc:sqlserver://10.0.0.20:1433;DatabaseName=Water");
+        dataSource.setUsername("sa");
+        dataSource.setPassword("Abc123456");
+        return dataSource;
+    }
+
+    @Bean
+    public JdbcTemplate jdbcTemplate(DataSource dataSource) {
+        return new JdbcTemplate(dataSource);
+    }
+}

+ 53 - 0
src/main/java/com/robot/remote/smartrobotremote/controller/TestController.java

@@ -0,0 +1,53 @@
+package com.robot.remote.smartrobotremote.controller;
+
+
+import com.robot.remote.smartrobotremote.domain.BizDevice;
+import com.robot.remote.smartrobotremote.mapper.BizDeviceMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+@RestController
+public class TestController {
+
+
+    @Autowired
+    private JdbcTemplate jdbcTemplate;
+
+    @Autowired
+    private BizDeviceMapper bizDeviceMapper;
+
+
+    @GetMapping("/hello")
+    public String hello(String name) {
+        return "hello " + name;
+    }
+
+
+    /**
+     * jdbcTemplate 模拟查询数据
+     *
+     */
+    @GetMapping("/testQuerySqlServerByJDBC")
+    public List<Map<String, Object>> testQuerySqlServerByJDBC() {
+        String sql = "SELECT * FROM biz_device";
+        return jdbcTemplate.queryForList(sql);
+    }
+
+
+    /**
+     * mybatis 模拟查询数据
+     *
+     */
+    @GetMapping("/testQuerySqlServerByMybatis")
+    public List<BizDevice> testQuerySqlServerByMybatis() {
+        return this.bizDeviceMapper.selectBizDeviceList(null);
+    }
+
+}

+ 67 - 0
src/main/java/com/robot/remote/smartrobotremote/demos/web/BasicController.java

@@ -0,0 +1,67 @@
+/*
+ * Copyright 2013-2018 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.robot.remote.smartrobotremote.demos.web;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+/**
+ * @author <a href="mailto:chenxilzx1@gmail.com">theonefx</a>
+ */
+@Controller
+public class BasicController {
+
+    // http://127.0.0.1:8080/hello?name=lisi
+    @RequestMapping("/hello")
+    @ResponseBody
+    public String hello(@RequestParam(name = "name", defaultValue = "unknown user") String name) {
+        return "Hello " + name;
+    }
+
+    // http://127.0.0.1:8080/user
+    @RequestMapping("/user")
+    @ResponseBody
+    public User user() {
+        User user = new User();
+        user.setName("theonefx");
+        user.setAge(666);
+        return user;
+    }
+
+    // http://127.0.0.1:8080/save_user?name=newName&age=11
+    @RequestMapping("/save_user")
+    @ResponseBody
+    public String saveUser(User u) {
+        return "user will save: name=" + u.getName() + ", age=" + u.getAge();
+    }
+
+    // http://127.0.0.1:8080/html
+    @RequestMapping("/html")
+    public String html() {
+        return "index.html";
+    }
+
+    @ModelAttribute
+    public void parseUser(@RequestParam(name = "name", defaultValue = "unknown user") String name
+            , @RequestParam(name = "age", defaultValue = "12") Integer age, User user) {
+        user.setName("zhangsan");
+        user.setAge(18);
+    }
+}

+ 44 - 0
src/main/java/com/robot/remote/smartrobotremote/demos/web/PathVariableController.java

@@ -0,0 +1,44 @@
+/*
+ * Copyright 2013-2018 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.robot.remote.smartrobotremote.demos.web;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+/**
+ * @author <a href="mailto:chenxilzx1@gmail.com">theonefx</a>
+ */
+@Controller
+public class PathVariableController {
+
+    // http://127.0.0.1:8080/user/123/roles/222
+    @RequestMapping(value = "/user/{userId}/roles/{roleId}", method = RequestMethod.GET)
+    @ResponseBody
+    public String getLogin(@PathVariable("userId") String userId, @PathVariable("roleId") String roleId) {
+        return "User Id : " + userId + " Role Id : " + roleId;
+    }
+
+    // http://127.0.0.1:8080/javabeat/somewords
+    @RequestMapping(value = "/javabeat/{regexp1:[a-z-]+}", method = RequestMethod.GET)
+    @ResponseBody
+    public String getRegExp(@PathVariable("regexp1") String regexp1) {
+        return "URI Part : " + regexp1;
+    }
+}

+ 43 - 0
src/main/java/com/robot/remote/smartrobotremote/demos/web/User.java

@@ -0,0 +1,43 @@
+/*
+ * Copyright 2013-2018 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.robot.remote.smartrobotremote.demos.web;
+
+/**
+ * @author <a href="mailto:chenxilzx1@gmail.com">theonefx</a>
+ */
+public class User {
+
+    private String name;
+
+    private Integer age;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getAge() {
+        return age;
+    }
+
+    public void setAge(Integer age) {
+        this.age = age;
+    }
+}

+ 99 - 0
src/main/java/com/robot/remote/smartrobotremote/domain/BizDevice.java

@@ -0,0 +1,99 @@
+package com.robot.remote.smartrobotremote.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+/**
+ * 设备对象 biz_device
+ * 
+ * @author slibra
+ * @date 2024-09-26
+ */
+
+@Builder
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class BizDevice
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long deviceId;
+
+    /** $column.columnComment */
+    private String deviceNo;
+
+    /** $column.columnComment */
+    private String deviceName;
+
+    /** $column.columnComment */
+    private String deviceSn;
+
+    /** $column.columnComment */
+    private String deviceModel;
+
+    /** $column.columnComment */
+    private String deviceMaker;
+
+    /** $column.columnComment */
+    private Long deviceWorks;
+
+    /** $column.columnComment */
+    private String deviceMaintainer;
+
+    /** $column.columnComment */
+    private String deviceTel;
+
+    /** $column.columnComment */
+    private String deviceType;
+
+    /** $column.columnComment */
+    private String deviceStatus;
+
+    /** $column.columnComment */
+    private String assayStatus;
+
+    /** $column.columnComment */
+    private Date assayTime;
+
+    /** $column.columnComment */
+    private Date repairTime;
+
+    /** $column.columnComment */
+    private String repairBy;
+
+    /** 故障代码 */
+    private String faultCode;
+
+    /** 结果续传文件名 */
+    private String deviceXujieJieguo;
+
+    /** 报警续传文件名 */
+    private String deviceXujieBaojing;
+
+    /** $column.columnComment */
+    private String deviceProvince;
+
+    /** $column.columnComment */
+    private String deviceCity;
+
+    /** $column.columnComment */
+    private String deviceArea;
+
+    /** $column.columnComment */
+    private String deviceLongitude;
+
+    /** $column.columnComment */
+    private String deviceLatitude;
+
+    /** $column.columnComment */
+    private String deviceAddress;
+
+    /** 设备类型(1:化验室,2:连续检测) */
+    private String type;
+}

+ 67 - 0
src/main/java/com/robot/remote/smartrobotremote/mapper/BizDeviceMapper.java

@@ -0,0 +1,67 @@
+package com.robot.remote.smartrobotremote.mapper;
+
+
+import com.robot.remote.smartrobotremote.domain.BizDevice;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 设备Mapper接口
+ * 
+ * @author slibra
+ * @date 2024-09-26
+ */
+@Mapper
+public interface BizDeviceMapper 
+{
+    /**
+     * 查询设备
+     * 
+     * @param deviceId 设备主键
+     * @return 设备
+     */
+    public BizDevice selectBizDeviceByDeviceId(Long deviceId);
+
+    /**
+     * 查询设备列表
+     * 
+     * @param bizDevice 设备
+     * @return 设备集合
+     */
+    public List<BizDevice> selectBizDeviceList(BizDevice bizDevice);
+
+    /**
+     * 新增设备
+     * 
+     * @param bizDevice 设备
+     * @return 结果
+     */
+    public int insertBizDevice(BizDevice bizDevice);
+
+    /**
+     * 修改设备
+     * 
+     * @param bizDevice 设备
+     * @return 结果
+     */
+    public int updateBizDevice(BizDevice bizDevice);
+
+    /**
+     * 删除设备
+     * 
+     * @param deviceId 设备主键
+     * @return 结果
+     */
+    public int deleteBizDeviceByDeviceId(Long deviceId);
+
+    /**
+     * 批量删除设备
+     * 
+     * @param deviceIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBizDeviceByDeviceIds(Long[] deviceIds);
+
+
+}

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

@@ -0,0 +1,14 @@
+server:
+  port: 8881
+
+spring:
+  datasource:
+    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+    url: jdbc:sqlserver://10.0.0.20:1433;DatabaseName=Water
+    username: sa
+    password: Abc123456
+
+# MyBatis 配置
+mybatis:
+  mapper-locations: mapper/**/*Mapper.xml
+  type-aliases-package: com.robot.remote.smartrobotremote.domain

+ 190 - 0
src/main/resources/mapper/BizDeviceMapper.xml

@@ -0,0 +1,190 @@
+<?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.robot.remote.smartrobotremote.mapper.BizDeviceMapper">
+    
+    <resultMap type="BizDevice" id="BizDeviceResult">
+        <result property="deviceId"    column="device_id"    />
+        <result property="deviceNo"    column="device_no"    />
+        <result property="deviceName"    column="device_name"    />
+        <result property="deviceSn"    column="device_sn"    />
+        <result property="deviceModel"    column="device_model"    />
+        <result property="deviceMaker"    column="device_maker"    />
+        <result property="deviceWorks"    column="device_works"    />
+        <result property="deviceMaintainer"    column="device_maintainer"    />
+        <result property="deviceTel"    column="device_tel"    />
+        <result property="deviceType"    column="device_type"    />
+        <result property="deviceStatus"    column="device_status"    />
+        <result property="assayStatus"    column="assay_status"    />
+        <result property="assayTime"    column="assay_time"    />
+        <result property="repairTime"    column="repair_time"    />
+        <result property="repairBy"    column="repair_by"    />
+        <result property="faultCode"    column="fault_code"    />
+        <result property="deviceXujieJieguo"    column="device_xujie_jieguo"    />
+        <result property="deviceXujieBaojing"    column="device_xujie_baojing"    />
+        <result property="deviceProvince"    column="device_province"    />
+        <result property="deviceCity"    column="device_city"    />
+        <result property="deviceArea"    column="device_area"    />
+        <result property="deviceLongitude"    column="device_longitude"    />
+        <result property="deviceLatitude"    column="device_latitude"    />
+        <result property="deviceAddress"    column="device_address"    />
+        <result property="type"    column="type"    />
+    </resultMap>
+
+    <sql id="selectBizDeviceVo">
+        select device_id, device_no, device_name, device_sn, device_model, device_maker, device_works, device_maintainer, device_tel, device_type, device_status, assay_status, assay_time, repair_time, repair_by, create_by, create_time, update_by, update_time, fault_code, device_xujie_jieguo, device_xujie_baojing, device_province, device_city, device_area, device_longitude, device_latitude, device_address, type from biz_device
+    </sql>
+
+    <select id="selectBizDeviceList" parameterType="BizDevice" resultMap="BizDeviceResult">
+        <include refid="selectBizDeviceVo"/>
+        <where>
+            1 = 1
+            <if test="deviceNo != null  and deviceNo != ''"> and device_no = #{deviceNo}</if>
+            <if test="deviceName != null  and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
+            <if test="deviceSn != null  and deviceSn != ''"> and device_sn = #{deviceSn}</if>
+            <if test="deviceModel != null  and deviceModel != ''"> and device_model = #{deviceModel}</if>
+            <if test="deviceMaker != null  and deviceMaker != ''"> and device_maker = #{deviceMaker}</if>
+            <if test="deviceWorks != null "> and device_works = #{deviceWorks}</if>
+            <if test="deviceMaintainer != null  and deviceMaintainer != ''"> and device_maintainer = #{deviceMaintainer}</if>
+            <if test="deviceTel != null  and deviceTel != ''"> and device_tel = #{deviceTel}</if>
+            <if test="deviceType != null  and deviceType != ''"> and device_type = #{deviceType}</if>
+            <if test="deviceStatus != null  and deviceStatus != ''"> and device_status = #{deviceStatus}</if>
+            <if test="assayStatus != null  and assayStatus != ''"> and assay_status = #{assayStatus}</if>
+            <if test="assayTime != null "> and assay_time = #{assayTime}</if>
+            <if test="repairTime != null "> and repair_time = #{repairTime}</if>
+            <if test="repairBy != null  and repairBy != ''"> and repair_by = #{repairBy}</if>
+            <if test="faultCode != null  and faultCode != ''"> and fault_code = #{faultCode}</if>
+            <if test="deviceXujieJieguo != null  and deviceXujieJieguo != ''"> and device_xujie_jieguo = #{deviceXujieJieguo}</if>
+            <if test="deviceXujieBaojing != null  and deviceXujieBaojing != ''"> and device_xujie_baojing = #{deviceXujieBaojing}</if>
+            <if test="deviceProvince != null  and deviceProvince != ''"> and device_province = #{deviceProvince}</if>
+            <if test="deviceCity != null  and deviceCity != ''"> and device_city = #{deviceCity}</if>
+            <if test="deviceArea != null  and deviceArea != ''"> and device_area = #{deviceArea}</if>
+            <if test="deviceLongitude != null  and deviceLongitude != ''"> and device_longitude = #{deviceLongitude}</if>
+            <if test="deviceLatitude != null  and deviceLatitude != ''"> and device_latitude = #{deviceLatitude}</if>
+            <if test="deviceAddress != null  and deviceAddress != ''"> and device_address = #{deviceAddress}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+        </where>
+            order by device_id desc
+    </select>
+    
+    <select id="selectBizDeviceByDeviceId" parameterType="Long" resultMap="BizDeviceResult">
+        <include refid="selectBizDeviceVo"/>
+        where device_id = #{deviceId}
+    </select>
+        
+    <insert id="insertBizDevice" parameterType="BizDevice">
+        insert into biz_device
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="deviceId != null">device_id,</if>
+            <if test="deviceNo != null">device_no,</if>
+            <if test="deviceName != null">device_name,</if>
+            <if test="deviceSn != null">device_sn,</if>
+            <if test="deviceModel != null">device_model,</if>
+            <if test="deviceMaker != null">device_maker,</if>
+            <if test="deviceWorks != null">device_works,</if>
+            <if test="deviceMaintainer != null">device_maintainer,</if>
+            <if test="deviceTel != null">device_tel,</if>
+            <if test="deviceType != null">device_type,</if>
+            <if test="deviceStatus != null">device_status,</if>
+            <if test="assayStatus != null">assay_status,</if>
+            <if test="assayTime != null">assay_time,</if>
+            <if test="repairTime != null">repair_time,</if>
+            <if test="repairBy != null">repair_by,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="faultCode != null">fault_code,</if>
+            <if test="deviceXujieJieguo != null">device_xujie_jieguo,</if>
+            <if test="deviceXujieBaojing != null">device_xujie_baojing,</if>
+            <if test="deviceProvince != null">device_province,</if>
+            <if test="deviceCity != null">device_city,</if>
+            <if test="deviceArea != null">device_area,</if>
+            <if test="deviceLongitude != null">device_longitude,</if>
+            <if test="deviceLatitude != null">device_latitude,</if>
+            <if test="deviceAddress != null">device_address,</if>
+            <if test="type != null">type,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="deviceId != null">#{deviceId},</if>
+            <if test="deviceNo != null">#{deviceNo},</if>
+            <if test="deviceName != null">#{deviceName},</if>
+            <if test="deviceSn != null">#{deviceSn},</if>
+            <if test="deviceModel != null">#{deviceModel},</if>
+            <if test="deviceMaker != null">#{deviceMaker},</if>
+            <if test="deviceWorks != null">#{deviceWorks},</if>
+            <if test="deviceMaintainer != null">#{deviceMaintainer},</if>
+            <if test="deviceTel != null">#{deviceTel},</if>
+            <if test="deviceType != null">#{deviceType},</if>
+            <if test="deviceStatus != null">#{deviceStatus},</if>
+            <if test="assayStatus != null">#{assayStatus},</if>
+            <if test="assayTime != null">#{assayTime},</if>
+            <if test="repairTime != null">#{repairTime},</if>
+            <if test="repairBy != null">#{repairBy},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="faultCode != null">#{faultCode},</if>
+            <if test="deviceXujieJieguo != null">#{deviceXujieJieguo},</if>
+            <if test="deviceXujieBaojing != null">#{deviceXujieBaojing},</if>
+            <if test="deviceProvince != null">#{deviceProvince},</if>
+            <if test="deviceCity != null">#{deviceCity},</if>
+            <if test="deviceArea != null">#{deviceArea},</if>
+            <if test="deviceLongitude != null">#{deviceLongitude},</if>
+            <if test="deviceLatitude != null">#{deviceLatitude},</if>
+            <if test="deviceAddress != null">#{deviceAddress},</if>
+            <if test="type != null">#{type},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBizDevice" parameterType="BizDevice">
+        update biz_device
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="deviceNo != null">device_no = #{deviceNo},</if>
+            <if test="deviceName != null">device_name = #{deviceName},</if>
+            <if test="deviceSn != null">device_sn = #{deviceSn},</if>
+            <if test="deviceModel != null">device_model = #{deviceModel},</if>
+            <if test="deviceMaker != null">device_maker = #{deviceMaker},</if>
+            <if test="deviceWorks != null">device_works = #{deviceWorks},</if>
+            <if test="deviceMaintainer != null">device_maintainer = #{deviceMaintainer},</if>
+            <if test="deviceTel != null">device_tel = #{deviceTel},</if>
+            <if test="deviceType != null">device_type = #{deviceType},</if>
+            <if test="deviceStatus != null">device_status = #{deviceStatus},</if>
+            <if test="assayStatus != null">assay_status = #{assayStatus},</if>
+            <if test="assayTime != null">assay_time = #{assayTime},</if>
+            <if test="repairTime != null">repair_time = #{repairTime},</if>
+            <if test="repairBy != null">repair_by = #{repairBy},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="faultCode != null">fault_code = #{faultCode},</if>
+            <if test="deviceXujieJieguo != null">device_xujie_jieguo = #{deviceXujieJieguo},</if>
+            <if test="deviceXujieBaojing != null">device_xujie_baojing = #{deviceXujieBaojing},</if>
+            <if test="deviceProvince != null">device_province = #{deviceProvince},</if>
+            <if test="deviceCity != null">device_city = #{deviceCity},</if>
+            <if test="deviceArea != null">device_area = #{deviceArea},</if>
+            <if test="deviceLongitude != null">device_longitude = #{deviceLongitude},</if>
+            <if test="deviceLatitude != null">device_latitude = #{deviceLatitude},</if>
+            <if test="deviceAddress != null">device_address = #{deviceAddress},</if>
+            <if test="type != null">type = #{type},</if>
+        </trim>
+        where device_id = #{deviceId}
+    </update>
+
+    
+
+    <delete id="deleteBizDeviceByDeviceId" parameterType="Long">
+        update biz_device set del_flag = 2,revision = revision + 1 where del_flag = 0 and device_id = #{deviceId}
+    </delete>
+
+    <delete id="deleteBizDeviceByDeviceIds" parameterType="String">
+        update biz_device set del_flag = 2,revision = revision + 1 where del_flag = 0 and device_id in
+        <foreach item="deviceId" collection="array" open="(" separator="," close=")">
+            #{deviceId}
+        </foreach>
+    </delete>
+
+</mapper>

+ 6 - 0
src/main/resources/static/index.html

@@ -0,0 +1,6 @@
+<html>
+<body>
+<h1>hello word!!!</h1>
+<p>this is a html page</p>
+</body>
+</html>

+ 13 - 0
src/test/java/com/robot/remote/smartrobotremote/SmartRobotRemoteApplicationTests.java

@@ -0,0 +1,13 @@
+package com.robot.remote.smartrobotremote;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class SmartRobotRemoteApplicationTests {
+
+    @Test
+    void contextLoads() {
+    }
+
+}

BIN
target/.DS_Store


BIN
target/classes/.DS_Store


+ 14 - 0
target/classes/application.yml

@@ -0,0 +1,14 @@
+server:
+  port: 8881
+
+spring:
+  datasource:
+    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
+    url: jdbc:sqlserver://10.0.0.20:1433;DatabaseName=Water
+    username: sa
+    password: Abc123456
+
+# MyBatis 配置
+mybatis:
+  mapper-locations: mapper/**/*Mapper.xml
+  type-aliases-package: com.robot.remote.smartrobotremote.domain

BIN
target/classes/com/robot/remote/smartrobotremote/SmartRobotRemoteApplication.class


BIN
target/classes/com/robot/remote/smartrobotremote/conf/JdbcConfig.class


BIN
target/classes/com/robot/remote/smartrobotremote/controller/TestController.class


BIN
target/classes/com/robot/remote/smartrobotremote/demos/web/BasicController.class


BIN
target/classes/com/robot/remote/smartrobotremote/demos/web/PathVariableController.class


BIN
target/classes/com/robot/remote/smartrobotremote/demos/web/User.class


BIN
target/classes/com/robot/remote/smartrobotremote/domain/BizDevice$BizDeviceBuilder.class


BIN
target/classes/com/robot/remote/smartrobotremote/domain/BizDevice.class


BIN
target/classes/com/robot/remote/smartrobotremote/mapper/BizDeviceMapper.class


+ 190 - 0
target/classes/mapper/BizDeviceMapper.xml

@@ -0,0 +1,190 @@
+<?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.robot.remote.smartrobotremote.mapper.BizDeviceMapper">
+    
+    <resultMap type="BizDevice" id="BizDeviceResult">
+        <result property="deviceId"    column="device_id"    />
+        <result property="deviceNo"    column="device_no"    />
+        <result property="deviceName"    column="device_name"    />
+        <result property="deviceSn"    column="device_sn"    />
+        <result property="deviceModel"    column="device_model"    />
+        <result property="deviceMaker"    column="device_maker"    />
+        <result property="deviceWorks"    column="device_works"    />
+        <result property="deviceMaintainer"    column="device_maintainer"    />
+        <result property="deviceTel"    column="device_tel"    />
+        <result property="deviceType"    column="device_type"    />
+        <result property="deviceStatus"    column="device_status"    />
+        <result property="assayStatus"    column="assay_status"    />
+        <result property="assayTime"    column="assay_time"    />
+        <result property="repairTime"    column="repair_time"    />
+        <result property="repairBy"    column="repair_by"    />
+        <result property="faultCode"    column="fault_code"    />
+        <result property="deviceXujieJieguo"    column="device_xujie_jieguo"    />
+        <result property="deviceXujieBaojing"    column="device_xujie_baojing"    />
+        <result property="deviceProvince"    column="device_province"    />
+        <result property="deviceCity"    column="device_city"    />
+        <result property="deviceArea"    column="device_area"    />
+        <result property="deviceLongitude"    column="device_longitude"    />
+        <result property="deviceLatitude"    column="device_latitude"    />
+        <result property="deviceAddress"    column="device_address"    />
+        <result property="type"    column="type"    />
+    </resultMap>
+
+    <sql id="selectBizDeviceVo">
+        select device_id, device_no, device_name, device_sn, device_model, device_maker, device_works, device_maintainer, device_tel, device_type, device_status, assay_status, assay_time, repair_time, repair_by, create_by, create_time, update_by, update_time, fault_code, device_xujie_jieguo, device_xujie_baojing, device_province, device_city, device_area, device_longitude, device_latitude, device_address, type from biz_device
+    </sql>
+
+    <select id="selectBizDeviceList" parameterType="BizDevice" resultMap="BizDeviceResult">
+        <include refid="selectBizDeviceVo"/>
+        <where>
+            1 = 1
+            <if test="deviceNo != null  and deviceNo != ''"> and device_no = #{deviceNo}</if>
+            <if test="deviceName != null  and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
+            <if test="deviceSn != null  and deviceSn != ''"> and device_sn = #{deviceSn}</if>
+            <if test="deviceModel != null  and deviceModel != ''"> and device_model = #{deviceModel}</if>
+            <if test="deviceMaker != null  and deviceMaker != ''"> and device_maker = #{deviceMaker}</if>
+            <if test="deviceWorks != null "> and device_works = #{deviceWorks}</if>
+            <if test="deviceMaintainer != null  and deviceMaintainer != ''"> and device_maintainer = #{deviceMaintainer}</if>
+            <if test="deviceTel != null  and deviceTel != ''"> and device_tel = #{deviceTel}</if>
+            <if test="deviceType != null  and deviceType != ''"> and device_type = #{deviceType}</if>
+            <if test="deviceStatus != null  and deviceStatus != ''"> and device_status = #{deviceStatus}</if>
+            <if test="assayStatus != null  and assayStatus != ''"> and assay_status = #{assayStatus}</if>
+            <if test="assayTime != null "> and assay_time = #{assayTime}</if>
+            <if test="repairTime != null "> and repair_time = #{repairTime}</if>
+            <if test="repairBy != null  and repairBy != ''"> and repair_by = #{repairBy}</if>
+            <if test="faultCode != null  and faultCode != ''"> and fault_code = #{faultCode}</if>
+            <if test="deviceXujieJieguo != null  and deviceXujieJieguo != ''"> and device_xujie_jieguo = #{deviceXujieJieguo}</if>
+            <if test="deviceXujieBaojing != null  and deviceXujieBaojing != ''"> and device_xujie_baojing = #{deviceXujieBaojing}</if>
+            <if test="deviceProvince != null  and deviceProvince != ''"> and device_province = #{deviceProvince}</if>
+            <if test="deviceCity != null  and deviceCity != ''"> and device_city = #{deviceCity}</if>
+            <if test="deviceArea != null  and deviceArea != ''"> and device_area = #{deviceArea}</if>
+            <if test="deviceLongitude != null  and deviceLongitude != ''"> and device_longitude = #{deviceLongitude}</if>
+            <if test="deviceLatitude != null  and deviceLatitude != ''"> and device_latitude = #{deviceLatitude}</if>
+            <if test="deviceAddress != null  and deviceAddress != ''"> and device_address = #{deviceAddress}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+        </where>
+            order by device_id desc
+    </select>
+    
+    <select id="selectBizDeviceByDeviceId" parameterType="Long" resultMap="BizDeviceResult">
+        <include refid="selectBizDeviceVo"/>
+        where device_id = #{deviceId}
+    </select>
+        
+    <insert id="insertBizDevice" parameterType="BizDevice">
+        insert into biz_device
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="deviceId != null">device_id,</if>
+            <if test="deviceNo != null">device_no,</if>
+            <if test="deviceName != null">device_name,</if>
+            <if test="deviceSn != null">device_sn,</if>
+            <if test="deviceModel != null">device_model,</if>
+            <if test="deviceMaker != null">device_maker,</if>
+            <if test="deviceWorks != null">device_works,</if>
+            <if test="deviceMaintainer != null">device_maintainer,</if>
+            <if test="deviceTel != null">device_tel,</if>
+            <if test="deviceType != null">device_type,</if>
+            <if test="deviceStatus != null">device_status,</if>
+            <if test="assayStatus != null">assay_status,</if>
+            <if test="assayTime != null">assay_time,</if>
+            <if test="repairTime != null">repair_time,</if>
+            <if test="repairBy != null">repair_by,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="faultCode != null">fault_code,</if>
+            <if test="deviceXujieJieguo != null">device_xujie_jieguo,</if>
+            <if test="deviceXujieBaojing != null">device_xujie_baojing,</if>
+            <if test="deviceProvince != null">device_province,</if>
+            <if test="deviceCity != null">device_city,</if>
+            <if test="deviceArea != null">device_area,</if>
+            <if test="deviceLongitude != null">device_longitude,</if>
+            <if test="deviceLatitude != null">device_latitude,</if>
+            <if test="deviceAddress != null">device_address,</if>
+            <if test="type != null">type,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="deviceId != null">#{deviceId},</if>
+            <if test="deviceNo != null">#{deviceNo},</if>
+            <if test="deviceName != null">#{deviceName},</if>
+            <if test="deviceSn != null">#{deviceSn},</if>
+            <if test="deviceModel != null">#{deviceModel},</if>
+            <if test="deviceMaker != null">#{deviceMaker},</if>
+            <if test="deviceWorks != null">#{deviceWorks},</if>
+            <if test="deviceMaintainer != null">#{deviceMaintainer},</if>
+            <if test="deviceTel != null">#{deviceTel},</if>
+            <if test="deviceType != null">#{deviceType},</if>
+            <if test="deviceStatus != null">#{deviceStatus},</if>
+            <if test="assayStatus != null">#{assayStatus},</if>
+            <if test="assayTime != null">#{assayTime},</if>
+            <if test="repairTime != null">#{repairTime},</if>
+            <if test="repairBy != null">#{repairBy},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="faultCode != null">#{faultCode},</if>
+            <if test="deviceXujieJieguo != null">#{deviceXujieJieguo},</if>
+            <if test="deviceXujieBaojing != null">#{deviceXujieBaojing},</if>
+            <if test="deviceProvince != null">#{deviceProvince},</if>
+            <if test="deviceCity != null">#{deviceCity},</if>
+            <if test="deviceArea != null">#{deviceArea},</if>
+            <if test="deviceLongitude != null">#{deviceLongitude},</if>
+            <if test="deviceLatitude != null">#{deviceLatitude},</if>
+            <if test="deviceAddress != null">#{deviceAddress},</if>
+            <if test="type != null">#{type},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBizDevice" parameterType="BizDevice">
+        update biz_device
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="deviceNo != null">device_no = #{deviceNo},</if>
+            <if test="deviceName != null">device_name = #{deviceName},</if>
+            <if test="deviceSn != null">device_sn = #{deviceSn},</if>
+            <if test="deviceModel != null">device_model = #{deviceModel},</if>
+            <if test="deviceMaker != null">device_maker = #{deviceMaker},</if>
+            <if test="deviceWorks != null">device_works = #{deviceWorks},</if>
+            <if test="deviceMaintainer != null">device_maintainer = #{deviceMaintainer},</if>
+            <if test="deviceTel != null">device_tel = #{deviceTel},</if>
+            <if test="deviceType != null">device_type = #{deviceType},</if>
+            <if test="deviceStatus != null">device_status = #{deviceStatus},</if>
+            <if test="assayStatus != null">assay_status = #{assayStatus},</if>
+            <if test="assayTime != null">assay_time = #{assayTime},</if>
+            <if test="repairTime != null">repair_time = #{repairTime},</if>
+            <if test="repairBy != null">repair_by = #{repairBy},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="faultCode != null">fault_code = #{faultCode},</if>
+            <if test="deviceXujieJieguo != null">device_xujie_jieguo = #{deviceXujieJieguo},</if>
+            <if test="deviceXujieBaojing != null">device_xujie_baojing = #{deviceXujieBaojing},</if>
+            <if test="deviceProvince != null">device_province = #{deviceProvince},</if>
+            <if test="deviceCity != null">device_city = #{deviceCity},</if>
+            <if test="deviceArea != null">device_area = #{deviceArea},</if>
+            <if test="deviceLongitude != null">device_longitude = #{deviceLongitude},</if>
+            <if test="deviceLatitude != null">device_latitude = #{deviceLatitude},</if>
+            <if test="deviceAddress != null">device_address = #{deviceAddress},</if>
+            <if test="type != null">type = #{type},</if>
+        </trim>
+        where device_id = #{deviceId}
+    </update>
+
+    
+
+    <delete id="deleteBizDeviceByDeviceId" parameterType="Long">
+        update biz_device set del_flag = 2,revision = revision + 1 where del_flag = 0 and device_id = #{deviceId}
+    </delete>
+
+    <delete id="deleteBizDeviceByDeviceIds" parameterType="String">
+        update biz_device set del_flag = 2,revision = revision + 1 where del_flag = 0 and device_id in
+        <foreach item="deviceId" collection="array" open="(" separator="," close=")">
+            #{deviceId}
+        </foreach>
+    </delete>
+
+</mapper>

+ 6 - 0
target/classes/static/index.html

@@ -0,0 +1,6 @@
+<html>
+<body>
+<h1>hello word!!!</h1>
+<p>this is a html page</p>
+</body>
+</html>