init
This commit is contained in:
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
9
.idea/IETMWebBackend-main.iml
generated
Normal file
9
.idea/IETMWebBackend-main.iml
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
14
.idea/compiler.xml
generated
Normal file
14
.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="true" />
|
||||
<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="WebBackend" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
</project>
|
||||
7
.idea/encodings.xml
generated
Normal file
7
.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/ietmwebbackend/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/ietmwebbackend/src/main/resources" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
20
.idea/jarRepositories.xml
generated
Normal file
20
.idea/jarRepositories.xml
generated
Normal file
@@ -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
.idea/misc.xml
generated
Normal file
14
.idea/misc.xml
generated
Normal file
@@ -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$/ietmwebbackend/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_22" project-jdk-name="corretto-1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/IETMWebBackend-main.iml" filepath="$PROJECT_DIR$/.idea/IETMWebBackend-main.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
33
ietmwebbackend/.gitignore
vendored
Normal file
33
ietmwebbackend/.gitignore
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
112
ietmwebbackend/pom.xml
Normal file
112
ietmwebbackend/pom.xml
Normal file
@@ -0,0 +1,112 @@
|
||||
<?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.backend</groupId>
|
||||
<artifactId>WebBackend</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>607WebBackend</name>
|
||||
<description>607WebBackend</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.springframework.security</groupId>
|
||||
<artifactId>spring-security-crypto</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>1.2.23</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
|
||||
<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>
|
||||
</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.backend.webbackend.Application</mainClass>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>repackage</id>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.backend.webbackend;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.backend.webbackend.mapper")
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.backend.webbackend.Controller;
|
||||
|
||||
import com.backend.webbackend.Service.courseService;
|
||||
import com.backend.webbackend.Vo.ResultVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("course")
|
||||
public class CourseController {
|
||||
@Autowired
|
||||
private courseService courseService;
|
||||
|
||||
// 返回课程信息
|
||||
@GetMapping("getAll")
|
||||
public ResultVo getAllCourses() {
|
||||
return ResultVo.Success("",courseService.getAllCourseInfo());
|
||||
}
|
||||
|
||||
//返回课程资源
|
||||
@GetMapping("getResources")
|
||||
public ResultVo getCourseResources() {
|
||||
return ResultVo.Success("", courseService.getCourseResources());
|
||||
}
|
||||
|
||||
//用户上传课程资源
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.backend.webbackend.Controller;
|
||||
|
||||
import com.backend.webbackend.Service.faultcategoryService;
|
||||
import com.backend.webbackend.Service.faultitemService;
|
||||
import com.backend.webbackend.Service.faultsubcategoryService;
|
||||
import com.backend.webbackend.Vo.ResultVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("faultcategory")
|
||||
public class FaultCategoryController {
|
||||
@Autowired
|
||||
private faultcategoryService faultcategoryService;
|
||||
@Autowired
|
||||
private faultsubcategoryService faultsubcategoryService;
|
||||
@Autowired
|
||||
private faultitemService faultitemService;
|
||||
|
||||
// 返回一级目录所有信息
|
||||
@GetMapping("getAllFaultCategory")
|
||||
public ResultVo getAllFaultCategory() {
|
||||
return ResultVo.Success("",faultcategoryService.getAllFaultCategoryInfo());
|
||||
}
|
||||
|
||||
// 返回二级目录所有信息
|
||||
@GetMapping("getAllFaultSubCategory")
|
||||
public ResultVo getAllFaultSubCategory() {
|
||||
return ResultVo.Success("",faultsubcategoryService.getAllFaultSubCategoryInfo());
|
||||
}
|
||||
|
||||
// 返回故障条目(三级)所有信息
|
||||
@GetMapping("getAllFaultItem")
|
||||
public ResultVo getAllFaultItem() {
|
||||
return ResultVo.Success("",faultitemService.getAllFaultItemInfo());
|
||||
}
|
||||
|
||||
// 根据一级id返回所属一级id的二级目录详细信息
|
||||
@GetMapping("selectFaultCategoryByFaultSubCategoryId")
|
||||
public ResultVo selectFaultCategoryByFaultSubCategoryId(@RequestParam long id) {
|
||||
return ResultVo.Success("",faultsubcategoryService.selectFaultSubCategoryByFaultCategoryId(id));
|
||||
}
|
||||
|
||||
|
||||
// 根据二级id返回二级目录详细信息
|
||||
@GetMapping("selectByFaultSubCategoryId")
|
||||
public ResultVo selectByFaultSubCategoryId(@RequestParam long id) {
|
||||
return ResultVo.Success("",faultsubcategoryService.selectByFaultSubCategoryId(id));
|
||||
}
|
||||
|
||||
|
||||
// 根据故障条目(三级)id返回故障条目(三级)信息
|
||||
@GetMapping("selectByFaultItemId")
|
||||
public ResultVo selectByFaultItemId(@RequestParam long id) {
|
||||
return ResultVo.Success("",faultitemService.selectByFaultItemId(id));
|
||||
}
|
||||
|
||||
// 根据二级id返回故障条目详细信息
|
||||
@GetMapping("selectFaultItemByFaultSubCategoryId")
|
||||
public ResultVo selectFaultItemByFaultSubCategoryId(@RequestParam long id) {
|
||||
return ResultVo.Success("",faultitemService.selectFaultItemByFaultSubCategoryId(id));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.backend.webbackend.Controller;
|
||||
|
||||
import com.backend.webbackend.Service.userService;
|
||||
import com.backend.webbackend.Tools.Tools;
|
||||
import com.backend.webbackend.Vo.ResultVo;
|
||||
import com.backend.webbackend.domain.User;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("user")
|
||||
public class userController {
|
||||
@Autowired
|
||||
userService userService;
|
||||
@Autowired
|
||||
private Tools tools;
|
||||
|
||||
|
||||
//返回所有部门信息:用于用户注册时选择部门
|
||||
@GetMapping("dept")
|
||||
public ResultVo getAllDept(){
|
||||
return ResultVo.Success("",userService.getAlldept());
|
||||
}
|
||||
|
||||
//用户注册
|
||||
@PostMapping("register")
|
||||
public ResultVo register(@RequestBody User user){
|
||||
if(userService.register(user)){
|
||||
return ResultVo.Success("","注册成功");
|
||||
}
|
||||
else {
|
||||
return ResultVo.Error("","注册失败");
|
||||
}
|
||||
}
|
||||
|
||||
//用户登录
|
||||
@PostMapping("login")
|
||||
public ResultVo login(@RequestBody User user) {
|
||||
if(!userService.login(user.getUsername(),user.getPassword())){
|
||||
return ResultVo.Error("","用户名或密码错误");
|
||||
}
|
||||
return ResultVo.Success("","登陆成功");
|
||||
}
|
||||
|
||||
//用户信息修改
|
||||
@PostMapping("update")
|
||||
public ResultVo updateUserInfo(@RequestBody User user){
|
||||
try
|
||||
{
|
||||
//密码加密
|
||||
user.setPassword(tools.encryptPassword(user.getPassword()));
|
||||
userService.updateUserInfo(user);
|
||||
return ResultVo.Success("","用户信息修改成功");
|
||||
}
|
||||
catch (Exception e){
|
||||
throw new RuntimeException("用户信息修改失败");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.backend.webbackend.Exception;
|
||||
|
||||
import com.backend.webbackend.Vo.ResultVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@Slf4j
|
||||
@ControllerAdvice//主要作用:统一异常处理,全局数据绑定:通过InitBinder为所有控制器添加预定义的数据绑定规则,全局模型属性,通过ModelAttribute注解为所有控制器的模型添加公共属性
|
||||
public class GlobalExceptionHandler {
|
||||
@ExceptionHandler(Exception.class)//异常捕获,当与ControllerAdvice注解一起使用时,可以捕获所有控制器抛出的异常,并统一处理
|
||||
@ResponseBody//返回数据
|
||||
public ResultVo error(Exception e){
|
||||
log.error("Unhandled exception", e);
|
||||
return ResultVo.Error("",e.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.backend.webbackend.Service.Impl;
|
||||
|
||||
import com.backend.webbackend.domain.Course;
|
||||
import com.backend.webbackend.domain.TrainingResource;
|
||||
import com.backend.webbackend.mapper.CourseMapper;
|
||||
import com.backend.webbackend.mapper.TrainingResourceMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class courseServiceImpl implements com.backend.webbackend.Service.courseService {
|
||||
@Autowired
|
||||
CourseMapper courseMapper;
|
||||
@Autowired
|
||||
TrainingResourceMapper trainingResourceMapper;
|
||||
|
||||
// 返回课程信息
|
||||
@Override
|
||||
public List<Course> getAllCourseInfo() {
|
||||
return courseMapper.selectAllCourses();
|
||||
}
|
||||
|
||||
//返回课程资源
|
||||
@Override
|
||||
public List<TrainingResource> getCourseResources(){
|
||||
return trainingResourceMapper.getAllTraningResources();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.backend.webbackend.Service.Impl;
|
||||
|
||||
import com.backend.webbackend.Service.faultcategoryService;
|
||||
import com.backend.webbackend.domain.FaultCategory;
|
||||
import com.backend.webbackend.mapper.FaultCategoryMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class faultcategoryServiceImpl implements faultcategoryService{
|
||||
@Autowired
|
||||
FaultCategoryMapper faultcategoryMapper;
|
||||
|
||||
|
||||
|
||||
// 返回大类信息
|
||||
@Override
|
||||
public List<FaultCategory> getAllFaultCategoryInfo() {
|
||||
return faultcategoryMapper.selectAllFaultCategory();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.backend.webbackend.Service.Impl;
|
||||
|
||||
|
||||
import com.backend.webbackend.Service.faultitemService;
|
||||
import com.backend.webbackend.domain.FaultItem;
|
||||
import com.backend.webbackend.mapper.FaultItemMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class faultitemServiceImpl implements faultitemService {
|
||||
@Autowired
|
||||
FaultItemMapper faultitemMapper;
|
||||
|
||||
|
||||
|
||||
//返回所有故障条目信息
|
||||
@Override
|
||||
public List<FaultItem> getAllFaultItemInfo() {
|
||||
return faultitemMapper.getAllFaultItemInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FaultItem> selectFaultItemByFaultSubCategoryId(long id) {
|
||||
return faultitemMapper.getFaultItemInfoByFaultSubCategoryId(id);
|
||||
}
|
||||
|
||||
//根据id查询信息
|
||||
@Override
|
||||
public FaultItem selectByFaultItemId(long id) {
|
||||
return faultitemMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.backend.webbackend.Service.Impl;
|
||||
|
||||
|
||||
import com.backend.webbackend.Service.faultsubcategoryService;
|
||||
import com.backend.webbackend.domain.FaultSubCategory;
|
||||
import com.backend.webbackend.mapper.FaultSubCategoryMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class faultsubcategoryServiceImpl implements faultsubcategoryService {
|
||||
@Autowired
|
||||
FaultSubCategoryMapper faultsubcategoryMapper;
|
||||
|
||||
|
||||
// 返回大类信息
|
||||
@Override
|
||||
public List<FaultSubCategory> getAllFaultSubCategoryInfo() {
|
||||
return faultsubcategoryMapper.selectAllFaultSubCategory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FaultSubCategory selectByFaultSubCategoryId(long id) {
|
||||
return faultsubcategoryMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
//通过一级id获取所属一级目录的二级
|
||||
@Override
|
||||
public FaultSubCategory selectFaultSubCategoryByFaultCategoryId(long id) {
|
||||
return faultsubcategoryMapper.selectFaultSubCategoryByFaultCategoryId(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.backend.webbackend.Service.Impl;
|
||||
|
||||
import com.backend.webbackend.Service.userService;
|
||||
import com.backend.webbackend.Tools.Tools;
|
||||
import com.backend.webbackend.domain.Dept;
|
||||
import com.backend.webbackend.domain.User;
|
||||
import com.backend.webbackend.mapper.DeptMapper;
|
||||
import com.backend.webbackend.mapper.UserMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class userServiceImpl implements userService {
|
||||
@Autowired
|
||||
private UserMapper userMapper;
|
||||
@Autowired
|
||||
private DeptMapper deptMapper;
|
||||
@Autowired
|
||||
private Tools tools;
|
||||
|
||||
|
||||
//注册用户实现
|
||||
@Override
|
||||
public boolean register(User user) {
|
||||
//检查用户名唯一性
|
||||
String userName = user.getUsername()==null?null:user.getUsername().trim();
|
||||
user.setUsername(userName);
|
||||
if(!tools.checkUsernameUnique(userName)){
|
||||
throw new IllegalArgumentException("用户名已存在");
|
||||
}
|
||||
//校验手机号完整性
|
||||
if(!tools.checkPhoneUnique(user.getPhone())){
|
||||
throw new IllegalArgumentException("手机号格式不合法");
|
||||
}
|
||||
|
||||
//密码加密处理,内部已有异常处理
|
||||
String encryptedPassword = tools.encryptPassword(user.getPassword());
|
||||
user.setPassword(encryptedPassword);
|
||||
|
||||
//获取部门id
|
||||
Dept dept = deptMapper.selectIdByName(user.getDeptName());
|
||||
if(dept == null){
|
||||
throw new IllegalArgumentException("部门不存在");
|
||||
}
|
||||
|
||||
user.setDeptId(dept.getId());
|
||||
|
||||
//设置创建和登陆时间
|
||||
user.setCreateTime(new Date());
|
||||
user.setLastLoginTime(new Date());
|
||||
//默认用户状态为正常
|
||||
user.setStatus(1);
|
||||
user.setRole(2);
|
||||
return userMapper.insert(user) == 1;
|
||||
}
|
||||
|
||||
//用户登录实现
|
||||
@Override
|
||||
public boolean login(String username, String password) {
|
||||
User user = userMapper.selectByUsername(username);
|
||||
if(user == null){
|
||||
throw new IllegalArgumentException("用户不存在");
|
||||
}
|
||||
//验证密码
|
||||
if(!tools.matchesPassword(password, user.getPassword())){
|
||||
throw new IllegalArgumentException("密码错误");
|
||||
}
|
||||
//更新最后登录时间
|
||||
user.setLastLoginTime(new Date());
|
||||
return userMapper.updateById(user)==1;
|
||||
}
|
||||
|
||||
//返回部门列表
|
||||
@Override
|
||||
public List<Dept> getAlldept() {
|
||||
return deptMapper.selectAllDept();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateUserInfo(User user){
|
||||
return userMapper.updateByName(user);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.backend.webbackend.Service;
|
||||
|
||||
import com.backend.webbackend.domain.Course;
|
||||
import com.backend.webbackend.domain.TrainingResource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public interface courseService {
|
||||
List<Course> getAllCourseInfo();
|
||||
List<TrainingResource> getCourseResources();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.backend.webbackend.Service;
|
||||
|
||||
import com.backend.webbackend.domain.FaultCategory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public interface faultcategoryService {
|
||||
List<FaultCategory> getAllFaultCategoryInfo();
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.backend.webbackend.Service;
|
||||
|
||||
import com.backend.webbackend.domain.FaultItem;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public interface faultitemService {
|
||||
FaultItem selectByFaultItemId(long id);
|
||||
|
||||
|
||||
List<FaultItem> getAllFaultItemInfo();
|
||||
|
||||
|
||||
List<FaultItem> selectFaultItemByFaultSubCategoryId(long id);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.backend.webbackend.Service;
|
||||
|
||||
|
||||
import com.backend.webbackend.domain.FaultSubCategory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public interface faultsubcategoryService {
|
||||
List<FaultSubCategory> getAllFaultSubCategoryInfo();
|
||||
|
||||
FaultSubCategory selectByFaultSubCategoryId(long id);
|
||||
|
||||
|
||||
FaultSubCategory selectFaultSubCategoryByFaultCategoryId(long id);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.backend.webbackend.Service;
|
||||
|
||||
|
||||
import com.backend.webbackend.domain.Dept;
|
||||
import com.backend.webbackend.domain.User;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public interface userService {
|
||||
//注册
|
||||
boolean register(User user);
|
||||
boolean login(String username, String password);
|
||||
List<Dept> getAlldept();
|
||||
int updateUserInfo(User user);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.backend.webbackend.Tools;
|
||||
import com.backend.webbackend.mapper.UserMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Service
|
||||
public class Tools {
|
||||
|
||||
private static final Pattern CN_MOBILE_PATTERN = Pattern.compile("^1[3-9]\\d{9}$");
|
||||
// 定义编码器,解决 PASSWORD_ENCODER 无法解析
|
||||
private static final BCryptPasswordEncoder PASSWORD_ENCODER = new BCryptPasswordEncoder();
|
||||
|
||||
@Autowired
|
||||
private final UserMapper userMapper;
|
||||
|
||||
public Tools(UserMapper userMapper) {
|
||||
this.userMapper = userMapper;
|
||||
}
|
||||
|
||||
//校验用户名唯一性
|
||||
public boolean checkUsernameUnique(String username) {
|
||||
return userMapper.countByUsername(username)==0;
|
||||
}
|
||||
|
||||
//校验手机号格式合法性
|
||||
public boolean checkPhoneUnique(String phone) {
|
||||
if (phone == null) {
|
||||
return false;
|
||||
}
|
||||
String p = phone.trim();
|
||||
return CN_MOBILE_PATTERN.matcher(p).matches();
|
||||
}
|
||||
|
||||
// 用户名密码加密处理(BCrypt:加盐慢哈希)
|
||||
public String encryptPassword(String password) {
|
||||
if (password == null || password.trim().isEmpty()) {
|
||||
throw new IllegalArgumentException("密码不能为空");
|
||||
}
|
||||
return PASSWORD_ENCODER.encode(password);
|
||||
}
|
||||
|
||||
// 校验明文密码是否匹配已加密密码
|
||||
public boolean matchesPassword(String rawPassword, String encodedPassword) {
|
||||
if (rawPassword == null || encodedPassword == null) {
|
||||
return false;
|
||||
}
|
||||
return PASSWORD_ENCODER.matches(rawPassword, encodedPassword);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.backend.webbackend.Vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data //为所有字段自动生成getter、setter、toString、equals和hashCode方法
|
||||
@AllArgsConstructor //生成一个包含所有字段的构造函数
|
||||
@NoArgsConstructor// 生成一个无参构造函数
|
||||
public class ResultVo {
|
||||
private Integer Code; //返回代码
|
||||
private String msg; //返回消息
|
||||
private Object data; //返回数据
|
||||
|
||||
|
||||
static public ResultVo Success(String msg,Object data){
|
||||
return new ResultVo(2000,msg,data);
|
||||
}
|
||||
|
||||
static public ResultVo Error(String msg,Object data){return new ResultVo(5000,msg,data);}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName course
|
||||
*/
|
||||
@Data
|
||||
public class Course {
|
||||
private Long id;
|
||||
|
||||
private String courseName;
|
||||
|
||||
private String courseCode;
|
||||
|
||||
private String courseDesc;
|
||||
|
||||
private String courseCategory;
|
||||
|
||||
@JsonProperty("course_ico")
|
||||
private String courseIco;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName course_type
|
||||
*/
|
||||
@Data
|
||||
public class CourseType {
|
||||
private Integer id;
|
||||
|
||||
private String typename;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName dept
|
||||
*/
|
||||
@Data
|
||||
public class Dept {
|
||||
private Long id;
|
||||
|
||||
@JsonProperty("dept_name")
|
||||
private String deptName;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName device
|
||||
*/
|
||||
@Data
|
||||
public class Device {
|
||||
private Long id;
|
||||
|
||||
private String deviceCode;
|
||||
|
||||
private String deviceName;
|
||||
|
||||
private String deviceStatus;
|
||||
|
||||
private String model;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName exam_paper
|
||||
*/
|
||||
@Data
|
||||
public class ExamPaper {
|
||||
private Long id;
|
||||
|
||||
private String paperName;
|
||||
|
||||
private String paperCode;
|
||||
|
||||
private String paperDesc;
|
||||
|
||||
private Integer totalScore;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import lombok.Data;
|
||||
@Data
|
||||
public class FaultCategory {
|
||||
private Long id;
|
||||
private String categoryName;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName fault_event
|
||||
*/
|
||||
@Data
|
||||
public class FaultEvent {
|
||||
private Long id;
|
||||
|
||||
private String eventCode;
|
||||
|
||||
private Long deviceId;
|
||||
|
||||
private Long partId;
|
||||
|
||||
private Long faultItemId;
|
||||
|
||||
private Date occurTime;
|
||||
|
||||
private String phenomenonDesc;
|
||||
|
||||
private String reasonAnalysis;
|
||||
|
||||
private String processingMeasures;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @TableName fault_item
|
||||
*/
|
||||
@Data
|
||||
public class FaultItem {
|
||||
private Long id;
|
||||
|
||||
private String faultCode;
|
||||
|
||||
private String faultName;
|
||||
|
||||
private String faultDesc;
|
||||
|
||||
private Long deviceId;
|
||||
|
||||
private Long partId;
|
||||
|
||||
private Long creatorId;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Long subCategoryId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FaultSubCategory {
|
||||
private Long id;
|
||||
private Long categoryId;
|
||||
private String subCategoryName;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName model_file
|
||||
*/
|
||||
@Data
|
||||
public class ModelFile {
|
||||
private Long id;
|
||||
|
||||
private Long partId;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private String filePath;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName part
|
||||
*/
|
||||
@Data
|
||||
public class Part {
|
||||
private Long id;
|
||||
|
||||
private String partCode;
|
||||
|
||||
private String partName;
|
||||
|
||||
private Long deviceId;
|
||||
|
||||
private String partDesc;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName resourse_type
|
||||
*/
|
||||
@Data
|
||||
public class ResourseType {
|
||||
private Integer id;
|
||||
|
||||
private String resourseTypeName;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName training_resource
|
||||
*/
|
||||
@Data
|
||||
public class TrainingResource {
|
||||
private Long id;
|
||||
|
||||
private String resourceName;
|
||||
|
||||
private String resourceType;
|
||||
|
||||
private String filePath;
|
||||
|
||||
private Long courseId;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName troubleshoot_node
|
||||
*/
|
||||
@Data
|
||||
public class TroubleshootNode {
|
||||
private Long id;
|
||||
|
||||
private Long faultItemId;
|
||||
|
||||
private Integer stepOrder;
|
||||
|
||||
private String stepName;
|
||||
|
||||
private String stepDesc;
|
||||
|
||||
private String checkItems;
|
||||
|
||||
private String measurementPoint;
|
||||
|
||||
private String judgeStandard;
|
||||
|
||||
private Long nextNodeId;
|
||||
|
||||
private String branchCondition;
|
||||
|
||||
private Integer isLeaf;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName user
|
||||
*/
|
||||
@Data
|
||||
public class User {
|
||||
private Long id;
|
||||
|
||||
private String username;
|
||||
|
||||
private String password;
|
||||
|
||||
@JsonProperty("real_name")
|
||||
private String realName;
|
||||
|
||||
@JsonProperty("dept_id")
|
||||
private Long deptId;
|
||||
|
||||
@JsonProperty("dept_name")
|
||||
private String deptName;
|
||||
|
||||
|
||||
private String phone;
|
||||
|
||||
private Integer role;
|
||||
|
||||
private Integer status;
|
||||
|
||||
@JsonProperty("create_time")
|
||||
private Date createTime;
|
||||
|
||||
@JsonProperty("last_login_time")
|
||||
private Date lastLoginTime;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName user_exam_score
|
||||
*/
|
||||
@Data
|
||||
public class UserExamScore {
|
||||
private Long id;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Long paperId;
|
||||
|
||||
private Integer score;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.backend.webbackend.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName user_learning_record
|
||||
*/
|
||||
@Data
|
||||
public class UserLearningRecord {
|
||||
private Long id;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Long courseId;
|
||||
|
||||
private Long resourceId;
|
||||
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.Course;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【course(课程表)】的数据库操作Mapper
|
||||
* @createDate 2026-01-12 16:27:05
|
||||
* @Entity generator.domain.Course
|
||||
*/
|
||||
public interface CourseMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(Course record);
|
||||
|
||||
int insertSelective(Course record);
|
||||
|
||||
Course selectByPrimaryKey(Long id);
|
||||
|
||||
List<Course> selectAllCourses();
|
||||
|
||||
int updateByPrimaryKeySelective(Course record);
|
||||
|
||||
int updateByPrimaryKey(Course record);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.CourseType;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【course_type】的数据库操作Mapper
|
||||
* @createDate 2026-01-13 15:15:07
|
||||
* @Entity com.backend.webbackend.domain.CourseType
|
||||
*/
|
||||
public interface CourseTypeMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(CourseType record);
|
||||
|
||||
int insertSelective(CourseType record);
|
||||
|
||||
CourseType selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(CourseType record);
|
||||
|
||||
int updateByPrimaryKey(CourseType record);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.Dept;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【dept(部门表)】的数据库操作Mapper
|
||||
* @createDate 2026-01-12 16:27:05
|
||||
* @Entity generator.domain.Dept
|
||||
*/
|
||||
public interface DeptMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(Dept record);
|
||||
|
||||
int insertSelective(Dept record);
|
||||
|
||||
Dept selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(Dept record);
|
||||
|
||||
int updateByPrimaryKey(Dept record);
|
||||
|
||||
List<Dept> selectAllDept();
|
||||
|
||||
Dept selectIdByName(String name);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.Device;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【device(设备表)】的数据库操作Mapper
|
||||
* @createDate 2026-01-12 16:27:05
|
||||
* @Entity generator.domain.Device
|
||||
*/
|
||||
public interface DeviceMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(Device record);
|
||||
|
||||
int insertSelective(Device record);
|
||||
|
||||
Device selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(Device record);
|
||||
|
||||
int updateByPrimaryKey(Device record);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.ExamPaper;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【exam_paper(试卷表)】的数据库操作Mapper
|
||||
* @createDate 2026-01-12 16:27:05
|
||||
* @Entity generator.domain.ExamPaper
|
||||
*/
|
||||
public interface ExamPaperMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(ExamPaper record);
|
||||
|
||||
int insertSelective(ExamPaper record);
|
||||
|
||||
ExamPaper selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(ExamPaper record);
|
||||
|
||||
int updateByPrimaryKey(ExamPaper record);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
|
||||
import com.backend.webbackend.domain.FaultCategory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【 ( )】的数据库操作Mapper
|
||||
* @createDate 2026-01-12 16:27:05
|
||||
* @Entity generator.domain.Dept
|
||||
*/
|
||||
public interface FaultCategoryMapper {
|
||||
|
||||
|
||||
|
||||
FaultCategory selectByPrimaryKey(Long id);
|
||||
|
||||
List<FaultCategory> selectAllFaultCategory();
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.FaultEvent;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【fault_event(故障事件表)】的数据库操作Mapper
|
||||
* @createDate 2026-01-12 16:27:05
|
||||
* @Entity generator.domain.FaultEvent
|
||||
*/
|
||||
public interface FaultEventMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(FaultEvent record);
|
||||
|
||||
int insertSelective(FaultEvent record);
|
||||
|
||||
FaultEvent selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(FaultEvent record);
|
||||
|
||||
int updateByPrimaryKey(FaultEvent record);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.FaultItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【fault_item(故障条目表)】的数据库操作Mapper
|
||||
* @createDate 2026-01-12 16:27:05
|
||||
* @Entity generator.domain.FaultItem
|
||||
*/
|
||||
public interface FaultItemMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(FaultItem record);
|
||||
|
||||
int insertSelective(FaultItem record);
|
||||
|
||||
FaultItem selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(FaultItem record);
|
||||
|
||||
int updateByPrimaryKey(FaultItem record);
|
||||
|
||||
List<FaultItem> getAllFaultItemInfo();
|
||||
|
||||
List<FaultItem> getFaultItemInfoByFaultSubCategoryId(Long id);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.FaultSubCategory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FaultSubCategoryMapper {
|
||||
FaultSubCategory selectByPrimaryKey(Long id);
|
||||
List<FaultSubCategory> selectAllFaultSubCategory();
|
||||
|
||||
|
||||
FaultSubCategory selectFaultSubCategoryByFaultCategoryId(long id);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.ModelFile;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【model_file(模型文件表)】的数据库操作Mapper
|
||||
* @createDate 2026-01-12 16:27:05
|
||||
* @Entity generator.domain.ModelFile
|
||||
*/
|
||||
public interface ModelFileMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(ModelFile record);
|
||||
|
||||
int insertSelective(ModelFile record);
|
||||
|
||||
ModelFile selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(ModelFile record);
|
||||
|
||||
int updateByPrimaryKey(ModelFile record);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.Part;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【part(部件表)】的数据库操作Mapper
|
||||
* @createDate 2026-01-12 16:27:05
|
||||
* @Entity generator.domain.Part
|
||||
*/
|
||||
public interface PartMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(Part record);
|
||||
|
||||
int insertSelective(Part record);
|
||||
|
||||
Part selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(Part record);
|
||||
|
||||
int updateByPrimaryKey(Part record);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.ResourseType;
|
||||
import com.backend.webbackend.domain.TrainingResource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【resourse_type(资源类型)】的数据库操作Mapper
|
||||
* @createDate 2026-01-13 15:57:20
|
||||
* @Entity com.backend.webbackend.domain.ResourseType
|
||||
*/
|
||||
public interface ResourseTypeMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(ResourseType record);
|
||||
|
||||
int insertSelective(ResourseType record);
|
||||
|
||||
ResourseType selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(ResourseType record);
|
||||
|
||||
int updateByPrimaryKey(ResourseType record);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.TrainingResource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【training_resource(培训资源表)】的数据库操作Mapper
|
||||
* @createDate 2026-01-12 16:27:05
|
||||
* @Entity generator.domain.TrainingResource
|
||||
*/
|
||||
public interface TrainingResourceMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(TrainingResource record);
|
||||
|
||||
int insertSelective(TrainingResource record);
|
||||
|
||||
TrainingResource selectByPrimaryKey(Long id);
|
||||
|
||||
List<TrainingResource> getAllTraningResources();
|
||||
|
||||
int updateByPrimaryKeySelective(TrainingResource record);
|
||||
|
||||
int updateByPrimaryKey(TrainingResource record);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.TroubleshootNode;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【troubleshoot_node(排故流程节点表)】的数据库操作Mapper
|
||||
* @createDate 2026-01-12 16:27:05
|
||||
* @Entity generator.domain.TroubleshootNode
|
||||
*/
|
||||
public interface TroubleshootNodeMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(TroubleshootNode record);
|
||||
|
||||
int insertSelective(TroubleshootNode record);
|
||||
|
||||
TroubleshootNode selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(TroubleshootNode record);
|
||||
|
||||
int updateByPrimaryKey(TroubleshootNode record);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.UserExamScore;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【user_exam_score(用户考试成绩表)】的数据库操作Mapper
|
||||
* @createDate 2026-01-12 16:27:05
|
||||
* @Entity generator.domain.UserExamScore
|
||||
*/
|
||||
public interface UserExamScoreMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(UserExamScore record);
|
||||
|
||||
int insertSelective(UserExamScore record);
|
||||
|
||||
UserExamScore selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(UserExamScore record);
|
||||
|
||||
int updateByPrimaryKey(UserExamScore record);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.UserLearningRecord;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【user_learning_record(用户学习记录表)】的数据库操作Mapper
|
||||
* @createDate 2026-01-12 16:27:05
|
||||
* @Entity generator.domain.UserLearningRecord
|
||||
*/
|
||||
public interface UserLearningRecordMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(UserLearningRecord record);
|
||||
|
||||
int insertSelective(UserLearningRecord record);
|
||||
|
||||
UserLearningRecord selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByPrimaryKeySelective(UserLearningRecord record);
|
||||
|
||||
int updateByPrimaryKey(UserLearningRecord record);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.backend.webbackend.mapper;
|
||||
|
||||
import com.backend.webbackend.domain.User;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author Quella
|
||||
* @description 针对表【user(用户表)】的数据库操作Mapper
|
||||
* @createDate 2026-01-12 16:27:05
|
||||
* @Entity generator.domain.User
|
||||
*/
|
||||
public interface UserMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(User record);
|
||||
|
||||
int insertSelective(User record);
|
||||
|
||||
User selectByPrimaryKey(Long id);
|
||||
|
||||
User selectByUsername(@Param("username") String username);
|
||||
|
||||
int updateByPrimaryKeySelective(User record);
|
||||
|
||||
int updateByPrimaryKey(User record);
|
||||
|
||||
int countByUsername(@Param("username") String username);
|
||||
|
||||
int updateById(User user);
|
||||
|
||||
int updateByName(User user);
|
||||
}
|
||||
18
ietmwebbackend/src/main/resources/application.yml
Normal file
18
ietmwebbackend/src/main/resources/application.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
server:
|
||||
port: 8081
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://101.35.140.199:13306/ietm
|
||||
username: ietm
|
||||
password: ietm11335577
|
||||
|
||||
mybatis:
|
||||
mapper-locations: classpath:/mapper/*.xml
|
||||
|
||||
#logging:
|
||||
# level:
|
||||
# com:
|
||||
# backend:
|
||||
# webbackend:
|
||||
# mapper: debug
|
||||
88
ietmwebbackend/src/main/resources/mapper/CourseMapper.xml
Normal file
88
ietmwebbackend/src/main/resources/mapper/CourseMapper.xml
Normal file
@@ -0,0 +1,88 @@
|
||||
<?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.backend.webbackend.mapper.CourseMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.Course">
|
||||
<id property="id" column="id" />
|
||||
<result property="courseName" column="course_name" />
|
||||
<result property="courseCode" column="course_code" />
|
||||
<result property="courseDesc" column="course_desc" />
|
||||
<result property="courseCategory" column="course_category" />
|
||||
<result property="courseIco" column="course_ico" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,course_name,course_code,course_desc,course_category,course_ico
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from course
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectAllCourses" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from course
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from course
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.Course" useGeneratedKeys="true">
|
||||
insert into course
|
||||
( id,course_name,course_code,course_desc,course_category)
|
||||
values (#{id},#{courseName},#{courseCode},#{courseDesc},#{courseCategory})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.Course" useGeneratedKeys="true">
|
||||
insert into course
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="courseName != null">course_name,</if>
|
||||
<if test="courseCode != null">course_code,</if>
|
||||
<if test="courseDesc != null">course_desc,</if>
|
||||
<if test="courseCategory != null">course_category,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="courseName != null">#{courseName},</if>
|
||||
<if test="courseCode != null">#{courseCode},</if>
|
||||
<if test="courseDesc != null">#{courseDesc},</if>
|
||||
<if test="courseCategory != null">#{courseCategory},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.Course">
|
||||
update course
|
||||
<set>
|
||||
<if test="courseName != null">
|
||||
course_name = #{courseName},
|
||||
</if>
|
||||
<if test="courseCode != null">
|
||||
course_code = #{courseCode},
|
||||
</if>
|
||||
<if test="courseDesc != null">
|
||||
course_desc = #{courseDesc},
|
||||
</if>
|
||||
<if test="courseCategory != null">
|
||||
course_category = #{courseCategory},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.Course">
|
||||
update course
|
||||
set
|
||||
course_name = #{courseName},
|
||||
course_code = #{courseCode},
|
||||
course_desc = #{courseDesc},
|
||||
course_category = #{courseCategory}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?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.backend.webbackend.mapper.CourseTypeMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.CourseType">
|
||||
<id property="id" column="id" />
|
||||
<result property="typename" column="typeName" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,typeName
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from course_type
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from course_type
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.CourseType" useGeneratedKeys="true">
|
||||
insert into course_type
|
||||
( id,typeName)
|
||||
values (#{id},#{typename})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.CourseType" useGeneratedKeys="true">
|
||||
insert into course_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="typename != null">typeName,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="typename != null">#{typename},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.CourseType">
|
||||
update course_type
|
||||
<set>
|
||||
<if test="typename != null">
|
||||
typeName = #{typename},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.CourseType">
|
||||
update course_type
|
||||
set
|
||||
typeName = #{typename}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
69
ietmwebbackend/src/main/resources/mapper/DeptMapper.xml
Normal file
69
ietmwebbackend/src/main/resources/mapper/DeptMapper.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?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.backend.webbackend.mapper.DeptMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.Dept">
|
||||
<id property="id" column="id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,dept_name
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from dept
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectAllDept" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from dept
|
||||
</select>
|
||||
<select id="selectIdByName" resultType="com.backend.webbackend.domain.Dept">
|
||||
select *
|
||||
from dept
|
||||
where dept_name = #{deptName};
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from dept
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.Dept" useGeneratedKeys="true">
|
||||
insert into dept
|
||||
( id,dept_name)
|
||||
values (#{id},#{deptName})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.Dept" useGeneratedKeys="true">
|
||||
insert into dept
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="deptName != null">dept_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.Dept">
|
||||
update dept
|
||||
<set>
|
||||
<if test="deptName != null">
|
||||
dept_name = #{deptName},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.Dept">
|
||||
update dept
|
||||
set
|
||||
dept_name = #{deptName}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
79
ietmwebbackend/src/main/resources/mapper/DeviceMapper.xml
Normal file
79
ietmwebbackend/src/main/resources/mapper/DeviceMapper.xml
Normal file
@@ -0,0 +1,79 @@
|
||||
<?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.backend.webbackend.mapper.DeviceMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.Device">
|
||||
<id property="id" column="id" />
|
||||
<result property="deviceCode" column="device_code" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
<result property="deviceStatus" column="device_status" />
|
||||
<result property="model" column="model" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,device_code,device_name,device_status,model
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from device
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from device
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.Device" useGeneratedKeys="true">
|
||||
insert into device
|
||||
( id,device_code,device_name,device_status,model)
|
||||
values (#{id},#{deviceCode},#{deviceName},#{deviceStatus},#{model})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.Device" useGeneratedKeys="true">
|
||||
insert into device
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="deviceCode != null">device_code,</if>
|
||||
<if test="deviceName != null">device_name,</if>
|
||||
<if test="deviceStatus != null">device_status,</if>
|
||||
<if test="model != null">model,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="deviceCode != null">#{deviceCode},</if>
|
||||
<if test="deviceName != null">#{deviceName},</if>
|
||||
<if test="deviceStatus != null">#{deviceStatus},</if>
|
||||
<if test="model != null">#{model},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.Device">
|
||||
update device
|
||||
<set>
|
||||
<if test="deviceCode != null">
|
||||
device_code = #{deviceCode},
|
||||
</if>
|
||||
<if test="deviceName != null">
|
||||
device_name = #{deviceName},
|
||||
</if>
|
||||
<if test="deviceStatus != null">
|
||||
device_status = #{deviceStatus},
|
||||
</if>
|
||||
<if test="model != null">
|
||||
model = #{model},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.Device">
|
||||
update device
|
||||
set
|
||||
device_code = #{deviceCode},
|
||||
device_name = #{deviceName},
|
||||
device_status = #{deviceStatus},
|
||||
model = #{model}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
79
ietmwebbackend/src/main/resources/mapper/ExamPaperMapper.xml
Normal file
79
ietmwebbackend/src/main/resources/mapper/ExamPaperMapper.xml
Normal file
@@ -0,0 +1,79 @@
|
||||
<?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.backend.webbackend.mapper.ExamPaperMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.ExamPaper">
|
||||
<id property="id" column="id" />
|
||||
<result property="paperName" column="paper_name" />
|
||||
<result property="paperCode" column="paper_code" />
|
||||
<result property="paperDesc" column="paper_desc" />
|
||||
<result property="totalScore" column="total_score" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,paper_name,paper_code,paper_desc,total_score
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from exam_paper
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from exam_paper
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.ExamPaper" useGeneratedKeys="true">
|
||||
insert into exam_paper
|
||||
( id,paper_name,paper_code,paper_desc,total_score)
|
||||
values (#{id},#{paperName},#{paperCode},#{paperDesc},#{totalScore})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.ExamPaper" useGeneratedKeys="true">
|
||||
insert into exam_paper
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="paperName != null">paper_name,</if>
|
||||
<if test="paperCode != null">paper_code,</if>
|
||||
<if test="paperDesc != null">paper_desc,</if>
|
||||
<if test="totalScore != null">total_score,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="paperName != null">#{paperName},</if>
|
||||
<if test="paperCode != null">#{paperCode},</if>
|
||||
<if test="paperDesc != null">#{paperDesc},</if>
|
||||
<if test="totalScore != null">#{totalScore},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.ExamPaper">
|
||||
update exam_paper
|
||||
<set>
|
||||
<if test="paperName != null">
|
||||
paper_name = #{paperName},
|
||||
</if>
|
||||
<if test="paperCode != null">
|
||||
paper_code = #{paperCode},
|
||||
</if>
|
||||
<if test="paperDesc != null">
|
||||
paper_desc = #{paperDesc},
|
||||
</if>
|
||||
<if test="totalScore != null">
|
||||
total_score = #{totalScore},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.ExamPaper">
|
||||
update exam_paper
|
||||
set
|
||||
paper_name = #{paperName},
|
||||
paper_code = #{paperCode},
|
||||
paper_desc = #{paperDesc},
|
||||
total_score = #{totalScore}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?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.backend.webbackend.mapper.FaultCategoryMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.FaultCategory">
|
||||
<id property="id" column="id" />
|
||||
<result property="categoryName" column="category_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,category_name
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from fault_category
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectAllFaultCategory" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from fault_category
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
110
ietmwebbackend/src/main/resources/mapper/FaultEventMapper.xml
Normal file
110
ietmwebbackend/src/main/resources/mapper/FaultEventMapper.xml
Normal file
@@ -0,0 +1,110 @@
|
||||
<?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.backend.webbackend.mapper.FaultEventMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.FaultEvent">
|
||||
<id property="id" column="id" />
|
||||
<result property="eventCode" column="event_code" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="partId" column="part_id" />
|
||||
<result property="faultItemId" column="fault_item_id" />
|
||||
<result property="occurTime" column="occur_time" />
|
||||
<result property="phenomenonDesc" column="phenomenon_desc" />
|
||||
<result property="reasonAnalysis" column="reason_analysis" />
|
||||
<result property="processingMeasures" column="processing_measures" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,event_code,device_id,part_id,fault_item_id,occur_time,
|
||||
phenomenon_desc,reason_analysis,processing_measures
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from fault_event
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from fault_event
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.FaultEvent" useGeneratedKeys="true">
|
||||
insert into fault_event
|
||||
( id,event_code,device_id,part_id,fault_item_id,occur_time,
|
||||
phenomenon_desc,reason_analysis,processing_measures)
|
||||
values (#{id},#{eventCode},#{deviceId},#{partId},#{faultItemId},#{occurTime},
|
||||
#{phenomenonDesc},#{reasonAnalysis},#{processingMeasures})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.FaultEvent" useGeneratedKeys="true">
|
||||
insert into fault_event
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="eventCode != null">event_code,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="partId != null">part_id,</if>
|
||||
<if test="faultItemId != null">fault_item_id,</if>
|
||||
<if test="occurTime != null">occur_time,</if>
|
||||
<if test="phenomenonDesc != null">phenomenon_desc,</if>
|
||||
<if test="reasonAnalysis != null">reason_analysis,</if>
|
||||
<if test="processingMeasures != null">processing_measures,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="eventCode != null">#{eventCode},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="partId != null">#{partId},</if>
|
||||
<if test="faultItemId != null">#{faultItemId},</if>
|
||||
<if test="occurTime != null">#{occurTime},</if>
|
||||
<if test="phenomenonDesc != null">#{phenomenonDesc},</if>
|
||||
<if test="reasonAnalysis != null">#{reasonAnalysis},</if>
|
||||
<if test="processingMeasures != null">#{processingMeasures},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.FaultEvent">
|
||||
update fault_event
|
||||
<set>
|
||||
<if test="eventCode != null">
|
||||
event_code = #{eventCode},
|
||||
</if>
|
||||
<if test="deviceId != null">
|
||||
device_id = #{deviceId},
|
||||
</if>
|
||||
<if test="partId != null">
|
||||
part_id = #{partId},
|
||||
</if>
|
||||
<if test="faultItemId != null">
|
||||
fault_item_id = #{faultItemId},
|
||||
</if>
|
||||
<if test="occurTime != null">
|
||||
occur_time = #{occurTime},
|
||||
</if>
|
||||
<if test="phenomenonDesc != null">
|
||||
phenomenon_desc = #{phenomenonDesc},
|
||||
</if>
|
||||
<if test="reasonAnalysis != null">
|
||||
reason_analysis = #{reasonAnalysis},
|
||||
</if>
|
||||
<if test="processingMeasures != null">
|
||||
processing_measures = #{processingMeasures},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.FaultEvent">
|
||||
update fault_event
|
||||
set
|
||||
event_code = #{eventCode},
|
||||
device_id = #{deviceId},
|
||||
part_id = #{partId},
|
||||
fault_item_id = #{faultItemId},
|
||||
occur_time = #{occurTime},
|
||||
phenomenon_desc = #{phenomenonDesc},
|
||||
reason_analysis = #{reasonAnalysis},
|
||||
processing_measures = #{processingMeasures}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
116
ietmwebbackend/src/main/resources/mapper/FaultItemMapper.xml
Normal file
116
ietmwebbackend/src/main/resources/mapper/FaultItemMapper.xml
Normal file
@@ -0,0 +1,116 @@
|
||||
<?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.backend.webbackend.mapper.FaultItemMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.FaultItem">
|
||||
<id property="id" column="id" />
|
||||
<result property="faultCode" column="fault_code" />
|
||||
<result property="faultName" column="fault_name" />
|
||||
<result property="faultDesc" column="fault_desc" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="partId" column="part_id" />
|
||||
<result property="creatorId" column="creator_id" />
|
||||
<result property="creatorId" column="creator_id" />
|
||||
<result property="subCategoryId" column="sub_category_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,fault_code,fault_name,fault_desc,device_id,part_id,
|
||||
creator_id,create_time,sub_category_id
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from fault_item
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="getFaultItemInfoByFaultSubCategoryId" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from fault_item
|
||||
where sub_category_id = #{sub_category_id}
|
||||
</select>
|
||||
|
||||
<select id="getAllFaultItemInfo" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from fault_item
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from fault_item
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.FaultItem" useGeneratedKeys="true">
|
||||
insert into fault_item
|
||||
( id,fault_code,fault_name,fault_desc,device_id,part_id,
|
||||
creator_id,create_time)
|
||||
values (#{id},#{faultCode},#{faultName},#{faultDesc},#{deviceId},#{partId},
|
||||
#{creatorId},#{createTime})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.FaultItem" useGeneratedKeys="true">
|
||||
insert into fault_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="faultCode != null">fault_code,</if>
|
||||
<if test="faultName != null">fault_name,</if>
|
||||
<if test="faultDesc != null">fault_desc,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="partId != null">part_id,</if>
|
||||
<if test="creatorId != null">creator_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="faultCode != null">#{faultCode},</if>
|
||||
<if test="faultName != null">#{faultName},</if>
|
||||
<if test="faultDesc != null">#{faultDesc},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="partId != null">#{partId},</if>
|
||||
<if test="creatorId != null">#{creatorId},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.FaultItem">
|
||||
update fault_item
|
||||
<set>
|
||||
<if test="faultCode != null">
|
||||
fault_code = #{faultCode},
|
||||
</if>
|
||||
<if test="faultName != null">
|
||||
fault_name = #{faultName},
|
||||
</if>
|
||||
<if test="faultDesc != null">
|
||||
fault_desc = #{faultDesc},
|
||||
</if>
|
||||
<if test="deviceId != null">
|
||||
device_id = #{deviceId},
|
||||
</if>
|
||||
<if test="partId != null">
|
||||
part_id = #{partId},
|
||||
</if>
|
||||
<if test="creatorId != null">
|
||||
creator_id = #{creatorId},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.FaultItem">
|
||||
update fault_item
|
||||
set
|
||||
fault_code = #{faultCode},
|
||||
fault_name = #{faultName},
|
||||
fault_desc = #{faultDesc},
|
||||
device_id = #{deviceId},
|
||||
part_id = #{partId},
|
||||
creator_id = #{creatorId},
|
||||
create_time = #{createTime}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?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.backend.webbackend.mapper.FaultSubCategoryMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.FaultSubCategory">
|
||||
<id property="id" column="id" />
|
||||
<id property="categoryId" column="category_id" />
|
||||
<result property="subCategoryName" column="sub_category_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,sub_category_name,category_id
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from fault_sub_category
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectFaultSubCategoryByFaultCategoryId" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from fault_sub_category
|
||||
where category_id = #{category_id}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectAllFaultSubCategory" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from fault_sub_category
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
72
ietmwebbackend/src/main/resources/mapper/ModelFileMapper.xml
Normal file
72
ietmwebbackend/src/main/resources/mapper/ModelFileMapper.xml
Normal file
@@ -0,0 +1,72 @@
|
||||
<?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.backend.webbackend.mapper.ModelFileMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.ModelFile">
|
||||
<id property="id" column="id" />
|
||||
<result property="partId" column="part_id" />
|
||||
<result property="fileName" column="file_name" />
|
||||
<result property="filePath" column="file_path" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,part_id,file_name,file_path
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from model_file
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from model_file
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.ModelFile" useGeneratedKeys="true">
|
||||
insert into model_file
|
||||
( id,part_id,file_name,file_path)
|
||||
values (#{id},#{partId},#{fileName},#{filePath})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.ModelFile" useGeneratedKeys="true">
|
||||
insert into model_file
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="partId != null">part_id,</if>
|
||||
<if test="fileName != null">file_name,</if>
|
||||
<if test="filePath != null">file_path,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="partId != null">#{partId},</if>
|
||||
<if test="fileName != null">#{fileName},</if>
|
||||
<if test="filePath != null">#{filePath},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.ModelFile">
|
||||
update model_file
|
||||
<set>
|
||||
<if test="partId != null">
|
||||
part_id = #{partId},
|
||||
</if>
|
||||
<if test="fileName != null">
|
||||
file_name = #{fileName},
|
||||
</if>
|
||||
<if test="filePath != null">
|
||||
file_path = #{filePath},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.ModelFile">
|
||||
update model_file
|
||||
set
|
||||
part_id = #{partId},
|
||||
file_name = #{fileName},
|
||||
file_path = #{filePath}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
79
ietmwebbackend/src/main/resources/mapper/PartMapper.xml
Normal file
79
ietmwebbackend/src/main/resources/mapper/PartMapper.xml
Normal file
@@ -0,0 +1,79 @@
|
||||
<?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.backend.webbackend.mapper.PartMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.Part">
|
||||
<id property="id" column="id" />
|
||||
<result property="partCode" column="part_code" />
|
||||
<result property="partName" column="part_name" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="partDesc" column="part_desc" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,part_code,part_name,device_id,part_desc
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from part
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from part
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.Part" useGeneratedKeys="true">
|
||||
insert into part
|
||||
( id,part_code,part_name,device_id,part_desc)
|
||||
values (#{id},#{partCode},#{partName},#{deviceId},#{partDesc})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.Part" useGeneratedKeys="true">
|
||||
insert into part
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="partCode != null">part_code,</if>
|
||||
<if test="partName != null">part_name,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="partDesc != null">part_desc,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="partCode != null">#{partCode},</if>
|
||||
<if test="partName != null">#{partName},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="partDesc != null">#{partDesc},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.Part">
|
||||
update part
|
||||
<set>
|
||||
<if test="partCode != null">
|
||||
part_code = #{partCode},
|
||||
</if>
|
||||
<if test="partName != null">
|
||||
part_name = #{partName},
|
||||
</if>
|
||||
<if test="deviceId != null">
|
||||
device_id = #{deviceId},
|
||||
</if>
|
||||
<if test="partDesc != null">
|
||||
part_desc = #{partDesc},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.Part">
|
||||
update part
|
||||
set
|
||||
part_code = #{partCode},
|
||||
part_name = #{partName},
|
||||
device_id = #{deviceId},
|
||||
part_desc = #{partDesc}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?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.backend.webbackend.mapper.ResourseTypeMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.ResourseType">
|
||||
<id property="id" column="id" />
|
||||
<result property="resourseTypeName" column="resourse_type_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,resourse_type_name
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from resourse_type
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from resourse_type
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.ResourseType" useGeneratedKeys="true">
|
||||
insert into resourse_type
|
||||
( id,resourse_type_name)
|
||||
values (#{id},#{resourseTypeName})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.ResourseType" useGeneratedKeys="true">
|
||||
insert into resourse_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="resourseTypeName != null">resourse_type_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="resourseTypeName != null">#{resourseTypeName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.ResourseType">
|
||||
update resourse_type
|
||||
<set>
|
||||
<if test="resourseTypeName != null">
|
||||
resourse_type_name = #{resourseTypeName},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.ResourseType">
|
||||
update resourse_type
|
||||
set
|
||||
resourse_type_name = #{resourseTypeName}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,84 @@
|
||||
<?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.backend.webbackend.mapper.TrainingResourceMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.TrainingResource">
|
||||
<id property="id" column="id" />
|
||||
<result property="resourceName" column="resource_name" />
|
||||
<result property="resourceType" column="resource_type" />
|
||||
<result property="filePath" column="file_path" />
|
||||
<result property="courseId" column="course_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,resource_name,resource_type,file_path,course_id
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from training_resource
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="getAllTraningResources" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from training_resource
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from training_resource
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.TrainingResource" useGeneratedKeys="true">
|
||||
insert into training_resource
|
||||
( id,resource_name,resource_type,file_path,course_id)
|
||||
values (#{id},#{resourceName},#{resourceType},#{filePath},#{courseId})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.TrainingResource" useGeneratedKeys="true">
|
||||
insert into training_resource
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="resourceName != null">resource_name,</if>
|
||||
<if test="resourceType != null">resource_type,</if>
|
||||
<if test="filePath != null">file_path,</if>
|
||||
<if test="courseId != null">course_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="resourceName != null">#{resourceName},</if>
|
||||
<if test="resourceType != null">#{resourceType},</if>
|
||||
<if test="filePath != null">#{filePath},</if>
|
||||
<if test="courseId != null">#{courseId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.TrainingResource">
|
||||
update training_resource
|
||||
<set>
|
||||
<if test="resourceName != null">
|
||||
resource_name = #{resourceName},
|
||||
</if>
|
||||
<if test="resourceType != null">
|
||||
resource_type = #{resourceType},
|
||||
</if>
|
||||
<if test="filePath != null">
|
||||
file_path = #{filePath},
|
||||
</if>
|
||||
<if test="courseId != null">
|
||||
course_id = #{courseId},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.TrainingResource">
|
||||
update training_resource
|
||||
set
|
||||
resource_name = #{resourceName},
|
||||
resource_type = #{resourceType},
|
||||
file_path = #{filePath},
|
||||
course_id = #{courseId}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,124 @@
|
||||
<?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.backend.webbackend.mapper.TroubleshootNodeMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.TroubleshootNode">
|
||||
<id property="id" column="id" />
|
||||
<result property="faultItemId" column="fault_item_id" />
|
||||
<result property="stepOrder" column="step_order" />
|
||||
<result property="stepName" column="step_name" />
|
||||
<result property="stepDesc" column="step_desc" />
|
||||
<result property="checkItems" column="check_items" />
|
||||
<result property="measurementPoint" column="measurement_point" />
|
||||
<result property="judgeStandard" column="judge_standard" />
|
||||
<result property="nextNodeId" column="next_node_id" />
|
||||
<result property="branchCondition" column="branch_condition" />
|
||||
<result property="isLeaf" column="is_leaf" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,fault_item_id,step_order,step_name,step_desc,check_items,
|
||||
measurement_point,judge_standard,next_node_id,branch_condition,is_leaf
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from troubleshoot_node
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from troubleshoot_node
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.TroubleshootNode" useGeneratedKeys="true">
|
||||
insert into troubleshoot_node
|
||||
( id,fault_item_id,step_order,step_name,step_desc,check_items,
|
||||
measurement_point,judge_standard,next_node_id,branch_condition,is_leaf)
|
||||
values (#{id},#{faultItemId},#{stepOrder},#{stepName},#{stepDesc},#{checkItems},
|
||||
#{measurementPoint},#{judgeStandard},#{nextNodeId},#{branchCondition},#{isLeaf})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.TroubleshootNode" useGeneratedKeys="true">
|
||||
insert into troubleshoot_node
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="faultItemId != null">fault_item_id,</if>
|
||||
<if test="stepOrder != null">step_order,</if>
|
||||
<if test="stepName != null">step_name,</if>
|
||||
<if test="stepDesc != null">step_desc,</if>
|
||||
<if test="checkItems != null">check_items,</if>
|
||||
<if test="measurementPoint != null">measurement_point,</if>
|
||||
<if test="judgeStandard != null">judge_standard,</if>
|
||||
<if test="nextNodeId != null">next_node_id,</if>
|
||||
<if test="branchCondition != null">branch_condition,</if>
|
||||
<if test="isLeaf != null">is_leaf,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="faultItemId != null">#{faultItemId},</if>
|
||||
<if test="stepOrder != null">#{stepOrder},</if>
|
||||
<if test="stepName != null">#{stepName},</if>
|
||||
<if test="stepDesc != null">#{stepDesc},</if>
|
||||
<if test="checkItems != null">#{checkItems},</if>
|
||||
<if test="measurementPoint != null">#{measurementPoint},</if>
|
||||
<if test="judgeStandard != null">#{judgeStandard},</if>
|
||||
<if test="nextNodeId != null">#{nextNodeId},</if>
|
||||
<if test="branchCondition != null">#{branchCondition},</if>
|
||||
<if test="isLeaf != null">#{isLeaf},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.TroubleshootNode">
|
||||
update troubleshoot_node
|
||||
<set>
|
||||
<if test="faultItemId != null">
|
||||
fault_item_id = #{faultItemId},
|
||||
</if>
|
||||
<if test="stepOrder != null">
|
||||
step_order = #{stepOrder},
|
||||
</if>
|
||||
<if test="stepName != null">
|
||||
step_name = #{stepName},
|
||||
</if>
|
||||
<if test="stepDesc != null">
|
||||
step_desc = #{stepDesc},
|
||||
</if>
|
||||
<if test="checkItems != null">
|
||||
check_items = #{checkItems},
|
||||
</if>
|
||||
<if test="measurementPoint != null">
|
||||
measurement_point = #{measurementPoint},
|
||||
</if>
|
||||
<if test="judgeStandard != null">
|
||||
judge_standard = #{judgeStandard},
|
||||
</if>
|
||||
<if test="nextNodeId != null">
|
||||
next_node_id = #{nextNodeId},
|
||||
</if>
|
||||
<if test="branchCondition != null">
|
||||
branch_condition = #{branchCondition},
|
||||
</if>
|
||||
<if test="isLeaf != null">
|
||||
is_leaf = #{isLeaf},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.TroubleshootNode">
|
||||
update troubleshoot_node
|
||||
set
|
||||
fault_item_id = #{faultItemId},
|
||||
step_order = #{stepOrder},
|
||||
step_name = #{stepName},
|
||||
step_desc = #{stepDesc},
|
||||
check_items = #{checkItems},
|
||||
measurement_point = #{measurementPoint},
|
||||
judge_standard = #{judgeStandard},
|
||||
next_node_id = #{nextNodeId},
|
||||
branch_condition = #{branchCondition},
|
||||
is_leaf = #{isLeaf}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?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.backend.webbackend.mapper.UserExamScoreMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.UserExamScore">
|
||||
<id property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="paperId" column="paper_id" />
|
||||
<result property="score" column="score" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,user_id,paper_id,score
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user_exam_score
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from user_exam_score
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.UserExamScore" useGeneratedKeys="true">
|
||||
insert into user_exam_score
|
||||
( id,user_id,paper_id,score)
|
||||
values (#{id},#{userId},#{paperId},#{score})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.UserExamScore" useGeneratedKeys="true">
|
||||
insert into user_exam_score
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="paperId != null">paper_id,</if>
|
||||
<if test="score != null">score,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="paperId != null">#{paperId},</if>
|
||||
<if test="score != null">#{score},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.UserExamScore">
|
||||
update user_exam_score
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="paperId != null">
|
||||
paper_id = #{paperId},
|
||||
</if>
|
||||
<if test="score != null">
|
||||
score = #{score},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.UserExamScore">
|
||||
update user_exam_score
|
||||
set
|
||||
user_id = #{userId},
|
||||
paper_id = #{paperId},
|
||||
score = #{score}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,79 @@
|
||||
<?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.backend.webbackend.mapper.UserLearningRecordMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.UserLearningRecord">
|
||||
<id property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="courseId" column="course_id" />
|
||||
<result property="resourceId" column="resource_id" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,user_id,course_id,resource_id,status
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user_learning_record
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from user_learning_record
|
||||
where id = #{id}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.UserLearningRecord" useGeneratedKeys="true">
|
||||
insert into user_learning_record
|
||||
( id,user_id,course_id,resource_id,status)
|
||||
values (#{id},#{userId},#{courseId},#{resourceId},#{status})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.UserLearningRecord" useGeneratedKeys="true">
|
||||
insert into user_learning_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="courseId != null">course_id,</if>
|
||||
<if test="resourceId != null">resource_id,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="courseId != null">#{courseId},</if>
|
||||
<if test="resourceId != null">#{resourceId},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.UserLearningRecord">
|
||||
update user_learning_record
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="courseId != null">
|
||||
course_id = #{courseId},
|
||||
</if>
|
||||
<if test="resourceId != null">
|
||||
resource_id = #{resourceId},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.UserLearningRecord">
|
||||
update user_learning_record
|
||||
set
|
||||
user_id = #{userId},
|
||||
course_id = #{courseId},
|
||||
resource_id = #{resourceId},
|
||||
status = #{status}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
153
ietmwebbackend/src/main/resources/mapper/UserMapper.xml
Normal file
153
ietmwebbackend/src/main/resources/mapper/UserMapper.xml
Normal file
@@ -0,0 +1,153 @@
|
||||
<?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.backend.webbackend.mapper.UserMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.backend.webbackend.domain.User">
|
||||
<id property="id" column="id" />
|
||||
<result property="username" column="username" />
|
||||
<result property="password" column="password" />
|
||||
<result property="realName" column="real_name" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="role" column="role" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="lastLoginTime" column="last_login_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,username,password,real_name,phone,role,
|
||||
status,create_time,last_login_time
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="countByUsername" resultType="java.lang.Integer">
|
||||
select count(*) from user where username = #{username}
|
||||
</select>
|
||||
<select id="selectByUsername" resultType="com.backend.webbackend.domain.User">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user
|
||||
where username = #{username}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from user
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.User" useGeneratedKeys="true">
|
||||
insert into user
|
||||
( id,username,password,real_name,dept_id,phone,role,
|
||||
status,create_time,last_login_time)
|
||||
values (#{id},#{username},#{password},#{realName},#{deptId},#{phone},#{role},
|
||||
#{status},#{createTime},#{lastLoginTime})
|
||||
</insert>
|
||||
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.backend.webbackend.domain.User" useGeneratedKeys="true">
|
||||
insert into user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="username != null">username,</if>
|
||||
<if test="password != null">password,</if>
|
||||
<if test="realName != null">real_name,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="role != null">role,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="lastLoginTime != null">last_login_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="username != null">#{username},</if>
|
||||
<if test="password != null">#{password},</if>
|
||||
<if test="realName != null">#{realName},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="role != null">#{role},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="lastLoginTime != null">#{lastLoginTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.backend.webbackend.domain.User">
|
||||
update user
|
||||
<set>
|
||||
<if test="username != null">
|
||||
username = #{username},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password = #{password},
|
||||
</if>
|
||||
<if test="realName != null">
|
||||
real_name = #{realName},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone = #{phone},
|
||||
</if>
|
||||
<if test="role != null">
|
||||
role = #{role},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="lastLoginTime != null">
|
||||
last_login_time = #{lastLoginTime},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.backend.webbackend.domain.User">
|
||||
update user
|
||||
set
|
||||
username = #{username},
|
||||
password = #{password},
|
||||
real_name = #{realName},
|
||||
phone = #{phone},
|
||||
role = #{role},
|
||||
status = #{status},
|
||||
create_time = #{createTime},
|
||||
last_login_time = #{lastLoginTime}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateById">
|
||||
update user
|
||||
set
|
||||
last_login_time = #{lastLoginTime}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateByName">
|
||||
update user
|
||||
<set>
|
||||
<if test="password != null">
|
||||
password = #{password},
|
||||
</if>
|
||||
<if test="realName != null">
|
||||
real_name = #{realName},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone = #{phone},
|
||||
</if>
|
||||
<if test="deptId != null">
|
||||
dept_id = #{deptId},
|
||||
</if>
|
||||
<if test="role != null">
|
||||
role = #{role},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
</set>
|
||||
where username = #{username}
|
||||
</update>
|
||||
</mapper>
|
||||
6
ietmwebbackend/src/main/resources/static/index.html
Normal file
6
ietmwebbackend/src/main/resources/static/index.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<html>
|
||||
<body>
|
||||
<h1>hello word!!!</h1>
|
||||
<p>this is a html page</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.backend.webbackend;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class ApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user