parent
f80251884e
commit
894389c8a2
@ -0,0 +1,38 @@
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
@ -0,0 +1,34 @@
|
||||
package com.ruoyi.basic;
|
||||
|
||||
import com.ruoyi.common.security.annotation.EnableCustomConfig;
|
||||
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||
import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
public class HwBasicApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SpringApplication.run(HwBasicApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 物联网平台基本模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
" .-------. ____ __ \n" +
|
||||
" | _ _ \\ \\ \\ / / \n" +
|
||||
" | ( ' ) | \\ _. / ' \n" +
|
||||
" |(_ o _) / _( )_ .' \n" +
|
||||
" | (_,_).' __ ___(_ o _)' \n" +
|
||||
" | |\\ \\ | || |(_,_)' \n" +
|
||||
" | | \\ `' /| `-' / \n" +
|
||||
" | | \\ / \\ / \n" +
|
||||
" ''-' `'-' `-..-' ");
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.ruoyi.basic.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.basic.domain.HwLanguage;
|
||||
import com.ruoyi.basic.service.IHwLanguageService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 语言信息Controller
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/language")
|
||||
public class HwLanguageController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IHwLanguageService hwLanguageService;
|
||||
|
||||
/**
|
||||
* 查询语言信息列表
|
||||
*/
|
||||
@RequiresPermissions("basic:language:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HwLanguage hwLanguage)
|
||||
{
|
||||
startPage();
|
||||
List<HwLanguage> list = hwLanguageService.selectHwLanguageList(hwLanguage);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出语言信息列表
|
||||
*/
|
||||
@RequiresPermissions("basic:language:export")
|
||||
@Log(title = "语言信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HwLanguage hwLanguage)
|
||||
{
|
||||
List<HwLanguage> list = hwLanguageService.selectHwLanguageList(hwLanguage);
|
||||
ExcelUtil<HwLanguage> util = new ExcelUtil<HwLanguage>(HwLanguage.class);
|
||||
util.exportExcel(response, list, "语言信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取语言信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("basic:language:query")
|
||||
@GetMapping(value = "/{languageId}")
|
||||
public AjaxResult getInfo(@PathVariable("languageId") Long languageId)
|
||||
{
|
||||
return success(hwLanguageService.selectHwLanguageByLanguageId(languageId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增语言信息
|
||||
*/
|
||||
@RequiresPermissions("basic:language:add")
|
||||
@Log(title = "语言信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody HwLanguage hwLanguage)
|
||||
{
|
||||
return toAjax(hwLanguageService.insertHwLanguage(hwLanguage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改语言信息
|
||||
*/
|
||||
@RequiresPermissions("basic:language:edit")
|
||||
@Log(title = "语言信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody HwLanguage hwLanguage)
|
||||
{
|
||||
return toAjax(hwLanguageService.updateHwLanguage(hwLanguage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除语言信息
|
||||
*/
|
||||
@RequiresPermissions("basic:language:remove")
|
||||
@Log(title = "语言信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{languageIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] languageIds)
|
||||
{
|
||||
return toAjax(hwLanguageService.deleteHwLanguageByLanguageIds(languageIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.basic.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.basic.domain.HwLanguage;
|
||||
|
||||
/**
|
||||
* 语言信息Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
public interface HwLanguageMapper
|
||||
{
|
||||
/**
|
||||
* 查询语言信息
|
||||
*
|
||||
* @param languageId 语言信息主键
|
||||
* @return 语言信息
|
||||
*/
|
||||
public HwLanguage selectHwLanguageByLanguageId(Long languageId);
|
||||
|
||||
/**
|
||||
* 查询语言信息列表
|
||||
*
|
||||
* @param hwLanguage 语言信息
|
||||
* @return 语言信息集合
|
||||
*/
|
||||
public List<HwLanguage> selectHwLanguageList(HwLanguage hwLanguage);
|
||||
|
||||
/**
|
||||
* 新增语言信息
|
||||
*
|
||||
* @param hwLanguage 语言信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwLanguage(HwLanguage hwLanguage);
|
||||
|
||||
/**
|
||||
* 修改语言信息
|
||||
*
|
||||
* @param hwLanguage 语言信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwLanguage(HwLanguage hwLanguage);
|
||||
|
||||
/**
|
||||
* 删除语言信息
|
||||
*
|
||||
* @param languageId 语言信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwLanguageByLanguageId(Long languageId);
|
||||
|
||||
/**
|
||||
* 批量删除语言信息
|
||||
*
|
||||
* @param languageIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwLanguageByLanguageIds(Long[] languageIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.basic.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.basic.domain.HwLanguage;
|
||||
|
||||
/**
|
||||
* 语言信息Service接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
public interface IHwLanguageService
|
||||
{
|
||||
/**
|
||||
* 查询语言信息
|
||||
*
|
||||
* @param languageId 语言信息主键
|
||||
* @return 语言信息
|
||||
*/
|
||||
public HwLanguage selectHwLanguageByLanguageId(Long languageId);
|
||||
|
||||
/**
|
||||
* 查询语言信息列表
|
||||
*
|
||||
* @param hwLanguage 语言信息
|
||||
* @return 语言信息集合
|
||||
*/
|
||||
public List<HwLanguage> selectHwLanguageList(HwLanguage hwLanguage);
|
||||
|
||||
/**
|
||||
* 新增语言信息
|
||||
*
|
||||
* @param hwLanguage 语言信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwLanguage(HwLanguage hwLanguage);
|
||||
|
||||
/**
|
||||
* 修改语言信息
|
||||
*
|
||||
* @param hwLanguage 语言信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwLanguage(HwLanguage hwLanguage);
|
||||
|
||||
/**
|
||||
* 批量删除语言信息
|
||||
*
|
||||
* @param languageIds 需要删除的语言信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwLanguageByLanguageIds(Long[] languageIds);
|
||||
|
||||
/**
|
||||
* 删除语言信息信息
|
||||
*
|
||||
* @param languageId 语言信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwLanguageByLanguageId(Long languageId);
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.ruoyi.basic.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.basic.mapper.HwLanguageMapper;
|
||||
import com.ruoyi.basic.domain.HwLanguage;
|
||||
import com.ruoyi.basic.service.IHwLanguageService;
|
||||
|
||||
/**
|
||||
* 语言信息Service业务层处理
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
@Service
|
||||
public class HwLanguageServiceImpl implements IHwLanguageService
|
||||
{
|
||||
@Autowired
|
||||
private HwLanguageMapper hwLanguageMapper;
|
||||
|
||||
/**
|
||||
* 查询语言信息
|
||||
*
|
||||
* @param languageId 语言信息主键
|
||||
* @return 语言信息
|
||||
*/
|
||||
@Override
|
||||
public HwLanguage selectHwLanguageByLanguageId(Long languageId)
|
||||
{
|
||||
return hwLanguageMapper.selectHwLanguageByLanguageId(languageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询语言信息列表
|
||||
*
|
||||
* @param hwLanguage 语言信息
|
||||
* @return 语言信息
|
||||
*/
|
||||
@Override
|
||||
public List<HwLanguage> selectHwLanguageList(HwLanguage hwLanguage)
|
||||
{
|
||||
return hwLanguageMapper.selectHwLanguageList(hwLanguage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增语言信息
|
||||
*
|
||||
* @param hwLanguage 语言信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertHwLanguage(HwLanguage hwLanguage)
|
||||
{
|
||||
return hwLanguageMapper.insertHwLanguage(hwLanguage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改语言信息
|
||||
*
|
||||
* @param hwLanguage 语言信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateHwLanguage(HwLanguage hwLanguage)
|
||||
{
|
||||
return hwLanguageMapper.updateHwLanguage(hwLanguage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除语言信息
|
||||
*
|
||||
* @param languageIds 需要删除的语言信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHwLanguageByLanguageIds(Long[] languageIds)
|
||||
{
|
||||
return hwLanguageMapper.deleteHwLanguageByLanguageIds(languageIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除语言信息信息
|
||||
*
|
||||
* @param languageId 语言信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHwLanguageByLanguageId(Long languageId)
|
||||
{
|
||||
return hwLanguageMapper.deleteHwLanguageByLanguageId(languageId);
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
||||
_ _
|
||||
(_) | |
|
||||
_ __ _ _ ___ _ _ _ ______ ___ _ _ ___ | |_ ___ _ __ ___
|
||||
| '__|| | | | / _ \ | | | || ||______|/ __|| | | |/ __|| __| / _ \| '_ ` _ \
|
||||
| | | |_| || (_) || |_| || | \__ \| |_| |\__ \| |_ | __/| | | | | |
|
||||
|_| \__,_| \___/ \__, ||_| |___/ \__, ||___/ \__| \___||_| |_| |_|
|
||||
__/ | __/ |
|
||||
|___/ |___/
|
@ -0,0 +1,25 @@
|
||||
# Tomcat
|
||||
server:
|
||||
port: 9600
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: hw-basic
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/hw-basic" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.ruoyi" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
</configuration>
|
@ -0,0 +1,66 @@
|
||||
<?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.ruoyi.basic.mapper.HwDictDataLanguageMapper">
|
||||
|
||||
<resultMap type="HwDictDataLanguage" id="HwDictDataLanguageResult">
|
||||
<result property="dataLanguageId" column="data_language_id" />
|
||||
<result property="dictCode" column="dict_code" />
|
||||
<result property="dictLabel" column="dict_label" />
|
||||
<result property="languageCode" column="language_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHwDictDataLanguageVo">
|
||||
select data_language_id, dict_code, dict_label, language_code from hw_dict_data_language
|
||||
</sql>
|
||||
|
||||
<select id="selectHwDictDataLanguageList" parameterType="HwDictDataLanguage" resultMap="HwDictDataLanguageResult">
|
||||
<include refid="selectHwDictDataLanguageVo"/>
|
||||
<where>
|
||||
<if test="dictCode != null "> and dict_code = #{dictCode}</if>
|
||||
<if test="dictLabel != null and dictLabel != ''"> and dict_label = #{dictLabel}</if>
|
||||
<if test="languageCode != null and languageCode != ''"> and language_code = #{languageCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHwDictDataLanguageByDataLanguageId" parameterType="Long" resultMap="HwDictDataLanguageResult">
|
||||
<include refid="selectHwDictDataLanguageVo"/>
|
||||
where data_language_id = #{dataLanguageId}
|
||||
</select>
|
||||
|
||||
<insert id="insertHwDictDataLanguage" parameterType="HwDictDataLanguage" useGeneratedKeys="true" keyProperty="dataLanguageId">
|
||||
insert into hw_dict_data_language
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="dictCode != null">dict_code,</if>
|
||||
<if test="dictLabel != null">dict_label,</if>
|
||||
<if test="languageCode != null and languageCode != ''">language_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dictCode != null">#{dictCode},</if>
|
||||
<if test="dictLabel != null">#{dictLabel},</if>
|
||||
<if test="languageCode != null and languageCode != ''">#{languageCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHwDictDataLanguage" parameterType="HwDictDataLanguage">
|
||||
update hw_dict_data_language
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="dictCode != null">dict_code = #{dictCode},</if>
|
||||
<if test="dictLabel != null">dict_label = #{dictLabel},</if>
|
||||
<if test="languageCode != null and languageCode != ''">language_code = #{languageCode},</if>
|
||||
</trim>
|
||||
where data_language_id = #{dataLanguageId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHwDictDataLanguageByDataLanguageId" parameterType="Long">
|
||||
delete from hw_dict_data_language where data_language_id = #{dataLanguageId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHwDictDataLanguageByDataLanguageIds" parameterType="String">
|
||||
delete from hw_dict_data_language where data_language_id in
|
||||
<foreach item="dataLanguageId" collection="array" open="(" separator="," close=")">
|
||||
#{dataLanguageId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,118 @@
|
||||
<?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.ruoyi.basic.mapper.HwDictDataMapper">
|
||||
|
||||
<resultMap type="HwDictData" id="HwDictDataResult">
|
||||
<result property="dictCode" column="dict_code" />
|
||||
<result property="dictSort" column="dict_sort" />
|
||||
<result property="dictLabel" column="dict_label" />
|
||||
<result property="dictValue" column="dict_value" />
|
||||
<result property="dictType" column="dict_type" />
|
||||
<result property="cssClass" column="css_class" />
|
||||
<result property="listClass" column="list_class" />
|
||||
<result property="isDefault" column="is_default" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHwDictDataVo">
|
||||
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark from hw_dict_data
|
||||
</sql>
|
||||
|
||||
<select id="selectHwDictDataByType" parameterType="HwDictData" resultMap="HwDictDataResult">
|
||||
<include refid="selectHwDictDataVo"/>
|
||||
where status = '1' and dict_type = #{dictType} order by dict_sort asc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectHwDictDataList" parameterType="HwDictData" resultMap="HwDictDataResult">
|
||||
<include refid="selectHwDictDataVo"/>
|
||||
<where>
|
||||
<if test="dictSort != null "> and dict_sort = #{dictSort}</if>
|
||||
<if test="dictLabel != null and dictLabel != ''"> and dict_label = #{dictLabel}</if>
|
||||
<if test="dictValue != null and dictValue != ''"> and dict_value = #{dictValue}</if>
|
||||
<if test="dictType != null and dictType != ''"> and dict_type = #{dictType}</if>
|
||||
<if test="cssClass != null and cssClass != ''"> and css_class = #{cssClass}</if>
|
||||
<if test="listClass != null and listClass != ''"> and list_class = #{listClass}</if>
|
||||
<if test="isDefault != null and isDefault != ''"> and is_default = #{isDefault}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHwDictDataByDictCode" parameterType="Long" resultMap="HwDictDataResult">
|
||||
<include refid="selectHwDictDataVo"/>
|
||||
where dict_code = #{dictCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertHwDictData" parameterType="HwDictData" useGeneratedKeys="true" keyProperty="dictCode">
|
||||
insert into hw_dict_data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="dictSort != null">dict_sort,</if>
|
||||
<if test="dictLabel != null">dict_label,</if>
|
||||
<if test="dictValue != null">dict_value,</if>
|
||||
<if test="dictType != null">dict_type,</if>
|
||||
<if test="cssClass != null">css_class,</if>
|
||||
<if test="listClass != null">list_class,</if>
|
||||
<if test="isDefault != null">is_default,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dictSort != null">#{dictSort},</if>
|
||||
<if test="dictLabel != null">#{dictLabel},</if>
|
||||
<if test="dictValue != null">#{dictValue},</if>
|
||||
<if test="dictType != null">#{dictType},</if>
|
||||
<if test="cssClass != null">#{cssClass},</if>
|
||||
<if test="listClass != null">#{listClass},</if>
|
||||
<if test="isDefault != null">#{isDefault},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHwDictData" parameterType="HwDictData">
|
||||
update hw_dict_data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="dictSort != null">dict_sort = #{dictSort},</if>
|
||||
<if test="dictLabel != null">dict_label = #{dictLabel},</if>
|
||||
<if test="dictValue != null">dict_value = #{dictValue},</if>
|
||||
<if test="dictType != null">dict_type = #{dictType},</if>
|
||||
<if test="cssClass != null">css_class = #{cssClass},</if>
|
||||
<if test="listClass != null">list_class = #{listClass},</if>
|
||||
<if test="isDefault != null">is_default = #{isDefault},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where dict_code = #{dictCode}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHwDictDataByDictCode" parameterType="Long">
|
||||
delete from hw_dict_data where dict_code = #{dictCode}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHwDictDataByDictCodes" parameterType="String">
|
||||
delete from hw_dict_data where dict_code in
|
||||
<foreach item="dictCode" collection="array" open="(" separator="," close=")">
|
||||
#{dictCode}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,86 @@
|
||||
<?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.ruoyi.basic.mapper.HwDictTypeMapper">
|
||||
|
||||
<resultMap type="HwDictType" id="HwDictTypeResult">
|
||||
<result property="dictId" column="dict_id" />
|
||||
<result property="dictName" column="dict_name" />
|
||||
<result property="dictType" column="dict_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHwDictTypeVo">
|
||||
select dict_id, dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark from hw_dict_type
|
||||
</sql>
|
||||
|
||||
<select id="selectHwDictTypeList" parameterType="HwDictType" resultMap="HwDictTypeResult">
|
||||
<include refid="selectHwDictTypeVo"/>
|
||||
<where>
|
||||
<if test="dictName != null and dictName != ''"> and dict_name like concat('%', #{dictName}, '%')</if>
|
||||
<if test="dictType != null and dictType != ''"> and dict_type = #{dictType}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHwDictTypeByDictId" parameterType="Long" resultMap="HwDictTypeResult">
|
||||
<include refid="selectHwDictTypeVo"/>
|
||||
where dict_id = #{dictId}
|
||||
</select>
|
||||
|
||||
<insert id="insertHwDictType" parameterType="HwDictType" useGeneratedKeys="true" keyProperty="dictId">
|
||||
insert into hw_dict_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="dictName != null">dict_name,</if>
|
||||
<if test="dictType != null">dict_type,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dictName != null">#{dictName},</if>
|
||||
<if test="dictType != null">#{dictType},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHwDictType" parameterType="HwDictType">
|
||||
update hw_dict_type
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="dictName != null">dict_name = #{dictName},</if>
|
||||
<if test="dictType != null">dict_type = #{dictType},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where dict_id = #{dictId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHwDictTypeByDictId" parameterType="Long">
|
||||
delete from hw_dict_type where dict_id = #{dictId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHwDictTypeByDictIds" parameterType="String">
|
||||
delete from hw_dict_type where dict_id in
|
||||
<foreach item="dictId" collection="array" open="(" separator="," close=")">
|
||||
#{dictId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,76 @@
|
||||
<?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.ruoyi.basic.mapper.HwLanguageMapper">
|
||||
|
||||
<resultMap type="HwLanguage" id="HwLanguageResult">
|
||||
<result property="languageId" column="language_id" />
|
||||
<result property="languageCode" column="language_code" />
|
||||
<result property="languageName" column="language_name" />
|
||||
<result property="languageLang" column="language_lang" />
|
||||
<result property="languageCountry" column="language_country" />
|
||||
<result property="defaultFlag" column="default_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHwLanguageVo">
|
||||
select language_id, language_code, language_name, language_lang, language_country, default_flag from hw_language
|
||||
</sql>
|
||||
|
||||
<select id="selectHwLanguageList" parameterType="HwLanguage" resultMap="HwLanguageResult">
|
||||
<include refid="selectHwLanguageVo"/>
|
||||
<where>
|
||||
<if test="languageCode != null and languageCode != ''"> and language_code = #{languageCode}</if>
|
||||
<if test="languageName != null and languageName != ''"> and language_name like concat('%', #{languageName}, '%')</if>
|
||||
<if test="languageLang != null and languageLang != ''"> and language_lang = #{languageLang}</if>
|
||||
<if test="languageCountry != null and languageCountry != ''"> and language_country = #{languageCountry}</if>
|
||||
<if test="defaultFlag != null and defaultFlag != ''"> and default_flag = #{defaultFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHwLanguageByLanguageId" parameterType="Long" resultMap="HwLanguageResult">
|
||||
<include refid="selectHwLanguageVo"/>
|
||||
where language_id = #{languageId}
|
||||
</select>
|
||||
|
||||
<insert id="insertHwLanguage" parameterType="HwLanguage" useGeneratedKeys="true" keyProperty="languageId">
|
||||
insert into hw_language
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="languageCode != null and languageCode != ''">language_code,</if>
|
||||
<if test="languageName != null and languageName != ''">language_name,</if>
|
||||
<if test="languageLang != null">language_lang,</if>
|
||||
<if test="languageCountry != null">language_country,</if>
|
||||
<if test="defaultFlag != null and defaultFlag != ''">default_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="languageCode != null and languageCode != ''">#{languageCode},</if>
|
||||
<if test="languageName != null and languageName != ''">#{languageName},</if>
|
||||
<if test="languageLang != null">#{languageLang},</if>
|
||||
<if test="languageCountry != null">#{languageCountry},</if>
|
||||
<if test="defaultFlag != null and defaultFlag != ''">#{defaultFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHwLanguage" parameterType="HwLanguage">
|
||||
update hw_language
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="languageCode != null and languageCode != ''">language_code = #{languageCode},</if>
|
||||
<if test="languageName != null and languageName != ''">language_name = #{languageName},</if>
|
||||
<if test="languageLang != null">language_lang = #{languageLang},</if>
|
||||
<if test="languageCountry != null">language_country = #{languageCountry},</if>
|
||||
<if test="defaultFlag != null and defaultFlag != ''">default_flag = #{defaultFlag},</if>
|
||||
</trim>
|
||||
where language_id = #{languageId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHwLanguageByLanguageId" parameterType="Long">
|
||||
delete from hw_language where language_id = #{languageId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHwLanguageByLanguageIds" parameterType="String">
|
||||
delete from hw_language where language_id in
|
||||
<foreach item="languageId" collection="array" open="(" separator="," close=")">
|
||||
#{languageId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,105 @@
|
||||
package com.ruoyi.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.business.domain.HwDevice;
|
||||
import com.ruoyi.business.service.IHwDeviceService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 设备信息Controller
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/device")
|
||||
public class HwDeviceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IHwDeviceService hwDeviceService;
|
||||
|
||||
/**
|
||||
* 查询设备信息列表
|
||||
*/
|
||||
@RequiresPermissions("business:device:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HwDevice hwDevice)
|
||||
{
|
||||
startPage();
|
||||
List<HwDevice> list = hwDeviceService.selectHwDeviceList(hwDevice);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备信息列表
|
||||
*/
|
||||
@RequiresPermissions("business:device:export")
|
||||
@Log(title = "设备信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HwDevice hwDevice)
|
||||
{
|
||||
List<HwDevice> list = hwDeviceService.selectHwDeviceList(hwDevice);
|
||||
ExcelUtil<HwDevice> util = new ExcelUtil<HwDevice>(HwDevice.class);
|
||||
util.exportExcel(response, list, "设备信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("business:device:query")
|
||||
@GetMapping(value = "/{deviceId}")
|
||||
public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId)
|
||||
{
|
||||
return success(hwDeviceService.selectHwDeviceByDeviceId(deviceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备信息
|
||||
*/
|
||||
@RequiresPermissions("business:device:add")
|
||||
@Log(title = "设备信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody HwDevice hwDevice)
|
||||
{
|
||||
return toAjax(hwDeviceService.insertHwDevice(hwDevice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备信息
|
||||
*/
|
||||
@RequiresPermissions("business:device:edit")
|
||||
@Log(title = "设备信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody HwDevice hwDevice)
|
||||
{
|
||||
return toAjax(hwDeviceService.updateHwDevice(hwDevice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备信息
|
||||
*/
|
||||
@RequiresPermissions("business:device:remove")
|
||||
@Log(title = "设备信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{deviceIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] deviceIds)
|
||||
{
|
||||
return toAjax(hwDeviceService.deleteHwDeviceByDeviceIds(deviceIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package com.ruoyi.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import java.util.Locale;
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.i18n.utils.MessageUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.business.domain.HwScene;
|
||||
import com.ruoyi.business.service.IHwSceneService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 场景信息Controller
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-08-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/scene")
|
||||
public class HwSceneController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IHwSceneService hwSceneService;
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping("getLanDemo")
|
||||
public String getLanDemo(HttpServletResponse response) {
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
System.out.println(locale.getLanguage()+"---"+locale.getCountry());
|
||||
return MessageUtils.getMessage("user.login.username");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询场景信息列表
|
||||
*/
|
||||
@RequiresPermissions("business:scene:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HwScene hwScene)
|
||||
{
|
||||
startPage();
|
||||
List<HwScene> list = hwSceneService.selectHwSceneList(hwScene);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出场景信息列表
|
||||
*/
|
||||
@RequiresPermissions("business:scene:export")
|
||||
@Log(title = "场景信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HwScene hwScene)
|
||||
{
|
||||
List<HwScene> list = hwSceneService.selectHwSceneList(hwScene);
|
||||
ExcelUtil<HwScene> util = new ExcelUtil<HwScene>(HwScene.class);
|
||||
util.exportExcel(response, list, "场景信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取场景信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("business:scene:query")
|
||||
@GetMapping(value = "/{sceneId}")
|
||||
public AjaxResult getInfo(@PathVariable("sceneId") Long sceneId)
|
||||
{
|
||||
return success(hwSceneService.selectHwSceneBySceneId(sceneId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增场景信息
|
||||
*/
|
||||
@RequiresPermissions("business:scene:add")
|
||||
@Log(title = "场景信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody @Validated HwScene hwScene)
|
||||
{
|
||||
return toAjax(hwSceneService.insertHwScene(hwScene));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改场景信息
|
||||
*/
|
||||
@RequiresPermissions("business:scene:edit")
|
||||
@Log(title = "场景信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody HwScene hwScene)
|
||||
{
|
||||
return toAjax(hwSceneService.updateHwScene(hwScene));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除场景信息
|
||||
*/
|
||||
@RequiresPermissions("business:scene:remove")
|
||||
@Log(title = "场景信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{sceneIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] sceneIds)
|
||||
{
|
||||
return toAjax(hwSceneService.deleteHwSceneBySceneIds(sceneIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.HwDevice;
|
||||
|
||||
/**
|
||||
* 设备信息Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
public interface HwDeviceMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备信息
|
||||
*
|
||||
* @param deviceId 设备信息主键
|
||||
* @return 设备信息
|
||||
*/
|
||||
public HwDevice selectHwDeviceByDeviceId(Long deviceId);
|
||||
|
||||
/**
|
||||
* 查询设备信息列表
|
||||
*
|
||||
* @param hwDevice 设备信息
|
||||
* @return 设备信息集合
|
||||
*/
|
||||
public List<HwDevice> selectHwDeviceList(HwDevice hwDevice);
|
||||
|
||||
/**
|
||||
* 新增设备信息
|
||||
*
|
||||
* @param hwDevice 设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwDevice(HwDevice hwDevice);
|
||||
|
||||
/**
|
||||
* 修改设备信息
|
||||
*
|
||||
* @param hwDevice 设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwDevice(HwDevice hwDevice);
|
||||
|
||||
/**
|
||||
* 删除设备信息
|
||||
*
|
||||
* @param deviceId 设备信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwDeviceByDeviceId(Long deviceId);
|
||||
|
||||
/**
|
||||
* 批量删除设备信息
|
||||
*
|
||||
* @param deviceIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwDeviceByDeviceIds(Long[] deviceIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.HwScene;
|
||||
|
||||
/**
|
||||
* 场景信息Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-08-23
|
||||
*/
|
||||
public interface HwSceneMapper
|
||||
{
|
||||
/**
|
||||
* 查询场景信息
|
||||
*
|
||||
* @param sceneId 场景信息主键
|
||||
* @return 场景信息
|
||||
*/
|
||||
public HwScene selectHwSceneBySceneId(Long sceneId);
|
||||
|
||||
/**
|
||||
* 查询场景信息列表
|
||||
*
|
||||
* @param hwScene 场景信息
|
||||
* @return 场景信息集合
|
||||
*/
|
||||
public List<HwScene> selectHwSceneList(HwScene hwScene);
|
||||
|
||||
/**
|
||||
* 新增场景信息
|
||||
*
|
||||
* @param hwScene 场景信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwScene(HwScene hwScene);
|
||||
|
||||
/**
|
||||
* 修改场景信息
|
||||
*
|
||||
* @param hwScene 场景信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwScene(HwScene hwScene);
|
||||
|
||||
/**
|
||||
* 删除场景信息
|
||||
*
|
||||
* @param sceneId 场景信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwSceneBySceneId(Long sceneId);
|
||||
|
||||
/**
|
||||
* 批量删除场景信息
|
||||
*
|
||||
* @param sceneIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwSceneBySceneIds(Long[] sceneIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.HwDevice;
|
||||
|
||||
/**
|
||||
* 设备信息Service接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
public interface IHwDeviceService
|
||||
{
|
||||
/**
|
||||
* 查询设备信息
|
||||
*
|
||||
* @param deviceId 设备信息主键
|
||||
* @return 设备信息
|
||||
*/
|
||||
public HwDevice selectHwDeviceByDeviceId(Long deviceId);
|
||||
|
||||
/**
|
||||
* 查询设备信息列表
|
||||
*
|
||||
* @param hwDevice 设备信息
|
||||
* @return 设备信息集合
|
||||
*/
|
||||
public List<HwDevice> selectHwDeviceList(HwDevice hwDevice);
|
||||
|
||||
/**
|
||||
* 新增设备信息
|
||||
*
|
||||
* @param hwDevice 设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwDevice(HwDevice hwDevice);
|
||||
|
||||
/**
|
||||
* 修改设备信息
|
||||
*
|
||||
* @param hwDevice 设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwDevice(HwDevice hwDevice);
|
||||
|
||||
/**
|
||||
* 批量删除设备信息
|
||||
*
|
||||
* @param deviceIds 需要删除的设备信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwDeviceByDeviceIds(Long[] deviceIds);
|
||||
|
||||
/**
|
||||
* 删除设备信息信息
|
||||
*
|
||||
* @param deviceId 设备信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwDeviceByDeviceId(Long deviceId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.HwScene;
|
||||
|
||||
/**
|
||||
* 场景信息Service接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-08-23
|
||||
*/
|
||||
public interface IHwSceneService
|
||||
{
|
||||
/**
|
||||
* 查询场景信息
|
||||
*
|
||||
* @param sceneId 场景信息主键
|
||||
* @return 场景信息
|
||||
*/
|
||||
public HwScene selectHwSceneBySceneId(Long sceneId);
|
||||
|
||||
/**
|
||||
* 查询场景信息列表
|
||||
*
|
||||
* @param hwScene 场景信息
|
||||
* @return 场景信息集合
|
||||
*/
|
||||
public List<HwScene> selectHwSceneList(HwScene hwScene);
|
||||
|
||||
/**
|
||||
* 新增场景信息
|
||||
*
|
||||
* @param hwScene 场景信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwScene(HwScene hwScene);
|
||||
|
||||
/**
|
||||
* 修改场景信息
|
||||
*
|
||||
* @param hwScene 场景信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwScene(HwScene hwScene);
|
||||
|
||||
/**
|
||||
* 批量删除场景信息
|
||||
*
|
||||
* @param sceneIds 需要删除的场景信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwSceneBySceneIds(Long[] sceneIds);
|
||||
|
||||
/**
|
||||
* 删除场景信息信息
|
||||
*
|
||||
* @param sceneId 场景信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwSceneBySceneId(Long sceneId);
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.ruoyi.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.business.mapper.HwDeviceMapper;
|
||||
import com.ruoyi.business.domain.HwDevice;
|
||||
import com.ruoyi.business.service.IHwDeviceService;
|
||||
|
||||
/**
|
||||
* 设备信息Service业务层处理
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-08-24
|
||||
*/
|
||||
@Service
|
||||
public class HwDeviceServiceImpl implements IHwDeviceService
|
||||
{
|
||||
@Autowired
|
||||
private HwDeviceMapper hwDeviceMapper;
|
||||
|
||||
/**
|
||||
* 查询设备信息
|
||||
*
|
||||
* @param deviceId 设备信息主键
|
||||
* @return 设备信息
|
||||
*/
|
||||
@Override
|
||||
public HwDevice selectHwDeviceByDeviceId(Long deviceId)
|
||||
{
|
||||
return hwDeviceMapper.selectHwDeviceByDeviceId(deviceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备信息列表
|
||||
*
|
||||
* @param hwDevice 设备信息
|
||||
* @return 设备信息
|
||||
*/
|
||||
@Override
|
||||
public List<HwDevice> selectHwDeviceList(HwDevice hwDevice)
|
||||
{
|
||||
return hwDeviceMapper.selectHwDeviceList(hwDevice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备信息
|
||||
*
|
||||
* @param hwDevice 设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertHwDevice(HwDevice hwDevice)
|
||||
{
|
||||
hwDevice.setCreateTime(DateUtils.getNowDate());
|
||||
return hwDeviceMapper.insertHwDevice(hwDevice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备信息
|
||||
*
|
||||
* @param hwDevice 设备信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateHwDevice(HwDevice hwDevice)
|
||||
{
|
||||
hwDevice.setUpdateTime(DateUtils.getNowDate());
|
||||
return hwDeviceMapper.updateHwDevice(hwDevice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备信息
|
||||
*
|
||||
* @param deviceIds 需要删除的设备信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHwDeviceByDeviceIds(Long[] deviceIds)
|
||||
{
|
||||
return hwDeviceMapper.deleteHwDeviceByDeviceIds(deviceIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备信息信息
|
||||
*
|
||||
* @param deviceId 设备信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHwDeviceByDeviceId(Long deviceId)
|
||||
{
|
||||
return hwDeviceMapper.deleteHwDeviceByDeviceId(deviceId);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.ruoyi.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.business.mapper.HwSceneMapper;
|
||||
import com.ruoyi.business.domain.HwScene;
|
||||
import com.ruoyi.business.service.IHwSceneService;
|
||||
|
||||
/**
|
||||
* 场景信息Service业务层处理
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-08-23
|
||||
*/
|
||||
@Service
|
||||
public class HwSceneServiceImpl implements IHwSceneService
|
||||
{
|
||||
@Autowired
|
||||
private HwSceneMapper hwSceneMapper;
|
||||
|
||||
/**
|
||||
* 查询场景信息
|
||||
*
|
||||
* @param sceneId 场景信息主键
|
||||
* @return 场景信息
|
||||
*/
|
||||
@Override
|
||||
public HwScene selectHwSceneBySceneId(Long sceneId)
|
||||
{
|
||||
return hwSceneMapper.selectHwSceneBySceneId(sceneId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询场景信息列表
|
||||
*
|
||||
* @param hwScene 场景信息
|
||||
* @return 场景信息
|
||||
*/
|
||||
@Override
|
||||
public List<HwScene> selectHwSceneList(HwScene hwScene)
|
||||
{
|
||||
return hwSceneMapper.selectHwSceneList(hwScene);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增场景信息
|
||||
*
|
||||
* @param hwScene 场景信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertHwScene(HwScene hwScene)
|
||||
{
|
||||
hwScene.setCreateTime(DateUtils.getNowDate());
|
||||
return hwSceneMapper.insertHwScene(hwScene);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改场景信息
|
||||
*
|
||||
* @param hwScene 场景信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateHwScene(HwScene hwScene)
|
||||
{
|
||||
hwScene.setUpdateTime(DateUtils.getNowDate());
|
||||
return hwSceneMapper.updateHwScene(hwScene);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除场景信息
|
||||
*
|
||||
* @param sceneIds 需要删除的场景信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHwSceneBySceneIds(Long[] sceneIds)
|
||||
{
|
||||
return hwSceneMapper.deleteHwSceneBySceneIds(sceneIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除场景信息信息
|
||||
*
|
||||
* @param sceneId 场景信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHwSceneBySceneId(Long sceneId)
|
||||
{
|
||||
return hwSceneMapper.deleteHwSceneBySceneId(sceneId);
|
||||
}
|
||||
}
|
@ -0,0 +1,176 @@
|
||||
<?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.ruoyi.business.mapper.HwDeviceMapper">
|
||||
|
||||
<resultMap type="HwDevice" id="HwDeviceResult">
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="deviceCode" column="device_code" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
<result property="sceneId" column="scene_id" />
|
||||
<result property="monitorUnitId" column="monitor_unit_id" />
|
||||
<result property="deviceType" column="device_type" />
|
||||
<result property="networkingMode" column="networking_mode" />
|
||||
<result property="accessProtocol" column="access_protocol" />
|
||||
<result property="dataFormat" column="data_format" />
|
||||
<result property="releatedDeviceId" column="releated_device_id" />
|
||||
<result property="deviceModeId" column="device_mode_id" />
|
||||
<result property="accessGwProtocol" column="access_gw_protocol" />
|
||||
<result property="activeStatus" column="active_status" />
|
||||
<result property="deviceStatus" column="device_status" />
|
||||
<result property="activeTime" column="active_time" />
|
||||
<result property="devicePic" column="device_pic" />
|
||||
<result property="ipAddress" column="ip_address" />
|
||||
<result property="areaId" column="area_id" />
|
||||
<result property="deviceLocation" column="device_location" />
|
||||
<result property="currentModuleVersion" column="current_module_version" />
|
||||
<result property="currentSinglechipVersion" column="current_singlechip_version" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="deviceField" column="device_field" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHwDeviceVo">
|
||||
select device_id, device_code, device_name, scene_id, monitor_unit_id, device_type, networking_mode, access_protocol, data_format, releated_device_id, device_mode_id, access_gw_protocol, active_status, device_status, active_time, device_pic, ip_address, area_id, device_location, current_module_version, current_singlechip_version, remark, create_by, create_time, update_by, update_time, device_field from hw_device
|
||||
</sql>
|
||||
|
||||
<select id="selectHwDeviceList" parameterType="HwDevice" resultMap="HwDeviceResult">
|
||||
<include refid="selectHwDeviceVo"/>
|
||||
<where>
|
||||
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
|
||||
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
|
||||
<if test="sceneId != null "> and scene_id = #{sceneId}</if>
|
||||
<if test="monitorUnitId != null "> and monitor_unit_id = #{monitorUnitId}</if>
|
||||
<if test="deviceType != null and deviceType != ''"> and device_type = #{deviceType}</if>
|
||||
<if test="networkingMode != null and networkingMode != ''"> and networking_mode = #{networkingMode}</if>
|
||||
<if test="accessProtocol != null "> and access_protocol = #{accessProtocol}</if>
|
||||
<if test="dataFormat != null "> and data_format = #{dataFormat}</if>
|
||||
<if test="releatedDeviceId != null "> and releated_device_id = #{releatedDeviceId}</if>
|
||||
<if test="deviceModeId != null "> and device_mode_id = #{deviceModeId}</if>
|
||||
<if test="accessGwProtocol != null "> and access_gw_protocol = #{accessGwProtocol}</if>
|
||||
<if test="activeStatus != null and activeStatus != ''"> and active_status = #{activeStatus}</if>
|
||||
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if>
|
||||
<if test="activeTime != null "> and active_time = #{activeTime}</if>
|
||||
<if test="devicePic != null and devicePic != ''"> and device_pic = #{devicePic}</if>
|
||||
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
|
||||
<if test="areaId != null "> and area_id = #{areaId}</if>
|
||||
<if test="deviceLocation != null and deviceLocation != ''"> and device_location = #{deviceLocation}</if>
|
||||
<if test="currentModuleVersion != null and currentModuleVersion != ''"> and current_module_version = #{currentModuleVersion}</if>
|
||||
<if test="currentSinglechipVersion != null and currentSinglechipVersion != ''"> and current_singlechip_version = #{currentSinglechipVersion}</if>
|
||||
<if test="deviceField != null and deviceField != ''"> and device_field = #{deviceField}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHwDeviceByDeviceId" parameterType="Long" resultMap="HwDeviceResult">
|
||||
<include refid="selectHwDeviceVo"/>
|
||||
where device_id = #{deviceId}
|
||||
</select>
|
||||
|
||||
<insert id="insertHwDevice" parameterType="HwDevice" useGeneratedKeys="true" keyProperty="deviceId">
|
||||
insert into hw_device
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceCode != null and deviceCode != ''">device_code,</if>
|
||||
<if test="deviceName != null and deviceName != ''">device_name,</if>
|
||||
<if test="sceneId != null">scene_id,</if>
|
||||
<if test="monitorUnitId != null">monitor_unit_id,</if>
|
||||
<if test="deviceType != null and deviceType != ''">device_type,</if>
|
||||
<if test="networkingMode != null and networkingMode != ''">networking_mode,</if>
|
||||
<if test="accessProtocol != null">access_protocol,</if>
|
||||
<if test="dataFormat != null">data_format,</if>
|
||||
<if test="releatedDeviceId != null">releated_device_id,</if>
|
||||
<if test="deviceModeId != null">device_mode_id,</if>
|
||||
<if test="accessGwProtocol != null">access_gw_protocol,</if>
|
||||
<if test="activeStatus != null and activeStatus != ''">active_status,</if>
|
||||
<if test="deviceStatus != null and deviceStatus != ''">device_status,</if>
|
||||
<if test="activeTime != null">active_time,</if>
|
||||
<if test="devicePic != null">device_pic,</if>
|
||||
<if test="ipAddress != null">ip_address,</if>
|
||||
<if test="areaId != null">area_id,</if>
|
||||
<if test="deviceLocation != null">device_location,</if>
|
||||
<if test="currentModuleVersion != null">current_module_version,</if>
|
||||
<if test="currentSinglechipVersion != null">current_singlechip_version,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="deviceField != null">device_field,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceCode != null and deviceCode != ''">#{deviceCode},</if>
|
||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||
<if test="sceneId != null">#{sceneId},</if>
|
||||
<if test="monitorUnitId != null">#{monitorUnitId},</if>
|
||||
<if test="deviceType != null and deviceType != ''">#{deviceType},</if>
|
||||
<if test="networkingMode != null and networkingMode != ''">#{networkingMode},</if>
|
||||
<if test="accessProtocol != null">#{accessProtocol},</if>
|
||||
<if test="dataFormat != null">#{dataFormat},</if>
|
||||
<if test="releatedDeviceId != null">#{releatedDeviceId},</if>
|
||||
<if test="deviceModeId != null">#{deviceModeId},</if>
|
||||
<if test="accessGwProtocol != null">#{accessGwProtocol},</if>
|
||||
<if test="activeStatus != null and activeStatus != ''">#{activeStatus},</if>
|
||||
<if test="deviceStatus != null and deviceStatus != ''">#{deviceStatus},</if>
|
||||
<if test="activeTime != null">#{activeTime},</if>
|
||||
<if test="devicePic != null">#{devicePic},</if>
|
||||
<if test="ipAddress != null">#{ipAddress},</if>
|
||||
<if test="areaId != null">#{areaId},</if>
|
||||
<if test="deviceLocation != null">#{deviceLocation},</if>
|
||||
<if test="currentModuleVersion != null">#{currentModuleVersion},</if>
|
||||
<if test="currentSinglechipVersion != null">#{currentSinglechipVersion},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="deviceField != null">#{deviceField},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHwDevice" parameterType="HwDevice">
|
||||
update hw_device
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deviceCode != null and deviceCode != ''">device_code = #{deviceCode},</if>
|
||||
<if test="deviceName != null and deviceName != ''">device_name = #{deviceName},</if>
|
||||
<if test="sceneId != null">scene_id = #{sceneId},</if>
|
||||
<if test="monitorUnitId != null">monitor_unit_id = #{monitorUnitId},</if>
|
||||
<if test="deviceType != null and deviceType != ''">device_type = #{deviceType},</if>
|
||||
<if test="networkingMode != null and networkingMode != ''">networking_mode = #{networkingMode},</if>
|
||||
<if test="accessProtocol != null">access_protocol = #{accessProtocol},</if>
|
||||
<if test="dataFormat != null">data_format = #{dataFormat},</if>
|
||||
<if test="releatedDeviceId != null">releated_device_id = #{releatedDeviceId},</if>
|
||||
<if test="deviceModeId != null">device_mode_id = #{deviceModeId},</if>
|
||||
<if test="accessGwProtocol != null">access_gw_protocol = #{accessGwProtocol},</if>
|
||||
<if test="activeStatus != null and activeStatus != ''">active_status = #{activeStatus},</if>
|
||||
<if test="deviceStatus != null and deviceStatus != ''">device_status = #{deviceStatus},</if>
|
||||
<if test="activeTime != null">active_time = #{activeTime},</if>
|
||||
<if test="devicePic != null">device_pic = #{devicePic},</if>
|
||||
<if test="ipAddress != null">ip_address = #{ipAddress},</if>
|
||||
<if test="areaId != null">area_id = #{areaId},</if>
|
||||
<if test="deviceLocation != null">device_location = #{deviceLocation},</if>
|
||||
<if test="currentModuleVersion != null">current_module_version = #{currentModuleVersion},</if>
|
||||
<if test="currentSinglechipVersion != null">current_singlechip_version = #{currentSinglechipVersion},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="deviceField != null">device_field = #{deviceField},</if>
|
||||
</trim>
|
||||
where device_id = #{deviceId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHwDeviceByDeviceId" parameterType="Long">
|
||||
delete from hw_device where device_id = #{deviceId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHwDeviceByDeviceIds" parameterType="String">
|
||||
delete from hw_device where device_id in
|
||||
<foreach item="deviceId" collection="array" open="(" separator="," close=")">
|
||||
#{deviceId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<el-dropdown trigger="click" class="international" @command="handleSetLanguage">
|
||||
<div>
|
||||
<svg-icon class-name="international-icon" icon-class="language" />
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :disabled="language==='zh_CN'" command="zh_CN">
|
||||
中文
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :disabled="language==='en_US'" command="en_US">
|
||||
English
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
computed: {
|
||||
language() {
|
||||
return this.$store.getters.language
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSetLanguage(lang) {
|
||||
this.$i18n.locale = lang
|
||||
this.$store.dispatch('app/setLanguage', lang)
|
||||
this.$message({
|
||||
message: '设置语言成功',
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,22 @@
|
||||
// en.js
|
||||
export default {
|
||||
login: {
|
||||
title: 'RuoYi Login Form',
|
||||
logIn: 'Log in',
|
||||
username: 'Username',
|
||||
password: 'Password'
|
||||
},
|
||||
tagsView: {
|
||||
refresh: 'Refresh',
|
||||
close: 'Close',
|
||||
closeOthers: 'Close Others',
|
||||
closeAll: 'Close All'
|
||||
},
|
||||
settings: {
|
||||
title: 'Page style setting',
|
||||
theme: 'Theme Color',
|
||||
tagsView: 'Open Tags-View',
|
||||
fixedHeader: 'Fixed Header',
|
||||
sidebarLogo: 'Sidebar Logo'
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
// index.js
|
||||
import Vue from 'vue'
|
||||
import VueI18n from 'vue-i18n'
|
||||
import Cookies from 'js-cookie'
|
||||
import elementEnLocale from 'element-ui/lib/locale/lang/en' // element-ui lang
|
||||
import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN'// element-ui lang
|
||||
import enLocale from './en_US'
|
||||
import zhLocale from './zh_CN'
|
||||
|
||||
Vue.use(VueI18n)
|
||||
|
||||
const messages = {
|
||||
en_US: {
|
||||
...enLocale,
|
||||
...elementEnLocale
|
||||
},
|
||||
zh_CN: {
|
||||
...zhLocale,
|
||||
...elementZhLocale
|
||||
}
|
||||
}
|
||||
|
||||
const i18n = new VueI18n({
|
||||
// 设置语言 选项 en_US | zh_CN
|
||||
locale: Cookies.get('language') || 'en_US',
|
||||
// 设置文本内容
|
||||
messages
|
||||
})
|
||||
|
||||
export default i18n
|
@ -0,0 +1,22 @@
|
||||
// zh.js
|
||||
export default {
|
||||
login: {
|
||||
title: '若依后台管理系统',
|
||||
logIn: '登录',
|
||||
username: '账号',
|
||||
password: '密码'
|
||||
},
|
||||
tagsView: {
|
||||
refresh: '刷新',
|
||||
close: '关闭',
|
||||
closeOthers: '关闭其它',
|
||||
closeAll: '关闭所有'
|
||||
},
|
||||
settings: {
|
||||
title: '系统布局配置',
|
||||
theme: '主题色',
|
||||
tagsView: '开启 Tags-View',
|
||||
fixedHeader: '固定 Header',
|
||||
sidebarLogo: '侧边栏 Logo'
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue