add - 传感器类型信息
parent
b8b35d5c4b
commit
fd473ccf0a
@ -0,0 +1,133 @@
|
||||
package com.ruoyi.web.controller.base;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.BaseSensorType;
|
||||
import com.ruoyi.system.service.IBaseSensorTypeService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 传感器类型Controller
|
||||
*
|
||||
* @author wenjy
|
||||
* @date 2022-02-07
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/base/sensorType")
|
||||
public class BaseSensorTypeController extends BaseController
|
||||
{
|
||||
private String prefix = "base/sensorType";
|
||||
|
||||
@Autowired
|
||||
private IBaseSensorTypeService baseSensorTypeService;
|
||||
|
||||
@RequiresPermissions("base:sensorType:view")
|
||||
@GetMapping()
|
||||
public String sensorType()
|
||||
{
|
||||
return prefix + "/sensorType";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询传感器类型列表
|
||||
*/
|
||||
@RequiresPermissions("base:sensorType:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BaseSensorType baseSensorType)
|
||||
{
|
||||
startPage();
|
||||
List<BaseSensorType> list = baseSensorTypeService.selectBaseSensorTypeList(baseSensorType);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出传感器类型列表
|
||||
*/
|
||||
@RequiresPermissions("base:sensorType:export")
|
||||
@Log(title = "传感器类型", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BaseSensorType baseSensorType)
|
||||
{
|
||||
List<BaseSensorType> list = baseSensorTypeService.selectBaseSensorTypeList(baseSensorType);
|
||||
ExcelUtil<BaseSensorType> util = new ExcelUtil<BaseSensorType>(BaseSensorType.class);
|
||||
return util.exportExcel(list, "传感器类型数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增传感器类型
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存传感器类型
|
||||
*/
|
||||
@RequiresPermissions("base:sensorType:add")
|
||||
@Log(title = "传感器类型", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BaseSensorType baseSensorType)
|
||||
{
|
||||
baseSensorType.setCreateBy(ShiroUtils.getLoginName());
|
||||
baseSensorType.setCreateTime(new Date());
|
||||
return toAjax(baseSensorTypeService.insertBaseSensorType(baseSensorType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改传感器类型
|
||||
*/
|
||||
@GetMapping("/edit/{ObjId}")
|
||||
public String edit(@PathVariable("ObjId") Long ObjId, ModelMap mmap)
|
||||
{
|
||||
BaseSensorType baseSensorType = baseSensorTypeService.selectBaseSensorTypeByObjId(ObjId);
|
||||
mmap.put("baseSensorType", baseSensorType);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存传感器类型
|
||||
*/
|
||||
@RequiresPermissions("base:sensorType:edit")
|
||||
@Log(title = "传感器类型", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BaseSensorType baseSensorType)
|
||||
{
|
||||
baseSensorType.setUpdateBy(ShiroUtils.getLoginName());
|
||||
baseSensorType.setUpdateTime(new Date());
|
||||
return toAjax(baseSensorTypeService.updateBaseSensorType(baseSensorType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除传感器类型
|
||||
*/
|
||||
@RequiresPermissions("base:sensorType:remove")
|
||||
@Log(title = "传感器类型", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(baseSensorTypeService.deleteBaseSensorTypeByObjIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增传感器类型')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-sensorType-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">类型编号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="sensortypeId" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">类型名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="sensortypeName" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否启用:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="enableFlag" class="form-control m-b" th:with="type=${@dict.getType('enable_flag')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "base/sensorType"
|
||||
$("#form-sensorType-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-sensorType-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改传感器类型')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-sensorType-edit" th:object="${baseSensorType}">
|
||||
<input name="ObjId" th:field="*{ObjId}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">类型编号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="sensortypeId" th:field="*{sensortypeId}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">类型名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="sensortypeName" th:field="*{sensortypeName}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否启用:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="enableFlag" class="form-control m-b" th:with="type=${@dict.getType('enable_flag')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{enableFlag}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "base/sensorType";
|
||||
$("#form-sensorType-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-sensorType-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,125 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('传感器类型列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<!--<li>
|
||||
<label>类型编号:</label>
|
||||
<input type="text" name="sensortypeId"/>
|
||||
</li>-->
|
||||
<li>
|
||||
<label>类型名称:</label>
|
||||
<input type="text" name="sensortypeName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>是否启用:</label>
|
||||
<select name="enableFlag" th:with="type=${@dict.getType('enable_flag')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="base:sensorType:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="base:sensorType:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="base:sensorType:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="base:sensorType:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('base:sensorType:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('base:sensorType:remove')}]];
|
||||
var enableFlagDatas = [[${@dict.getType('enable_flag')}]];
|
||||
var prefix = ctx + "base/sensorType";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "传感器类型",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'objId',
|
||||
title: '主键标识',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'sensortypeId',
|
||||
title: '类型编号'
|
||||
},
|
||||
{
|
||||
field: 'sensortypeName',
|
||||
title: '类型名称'
|
||||
},
|
||||
{
|
||||
field: 'enableFlag',
|
||||
title: '是否启用',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(enableFlagDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createBy',
|
||||
title: '创建人'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间'
|
||||
},
|
||||
{
|
||||
field: 'updateBy',
|
||||
title: '更新人'
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '更新时间'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.objId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.objId + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,83 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 传感器类型对象 base_sensor_type
|
||||
*
|
||||
* @author wenjy
|
||||
* @date 2022-02-07
|
||||
*/
|
||||
public class BaseSensorType extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键标识 */
|
||||
private Long ObjId;
|
||||
|
||||
/** 类型编号 */
|
||||
@Excel(name = "类型编号")
|
||||
private String sensortypeId;
|
||||
|
||||
/** 类型名称 */
|
||||
@Excel(name = "类型名称")
|
||||
private String sensortypeName;
|
||||
|
||||
/** 是否启用 */
|
||||
@Excel(name = "是否启用")
|
||||
private Long enableFlag;
|
||||
|
||||
public void setObjId(Long ObjId)
|
||||
{
|
||||
this.ObjId = ObjId;
|
||||
}
|
||||
|
||||
public Long getObjId()
|
||||
{
|
||||
return ObjId;
|
||||
}
|
||||
public void setSensortypeId(String sensortypeId)
|
||||
{
|
||||
this.sensortypeId = sensortypeId;
|
||||
}
|
||||
|
||||
public String getSensortypeId()
|
||||
{
|
||||
return sensortypeId;
|
||||
}
|
||||
public void setSensortypeName(String sensortypeName)
|
||||
{
|
||||
this.sensortypeName = sensortypeName;
|
||||
}
|
||||
|
||||
public String getSensortypeName()
|
||||
{
|
||||
return sensortypeName;
|
||||
}
|
||||
public void setEnableFlag(Long enableFlag)
|
||||
{
|
||||
this.enableFlag = enableFlag;
|
||||
}
|
||||
|
||||
public Long getEnableFlag()
|
||||
{
|
||||
return enableFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("ObjId", getObjId())
|
||||
.append("sensortypeId", getSensortypeId())
|
||||
.append("sensortypeName", getSensortypeName())
|
||||
.append("enableFlag", getEnableFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BaseSensorType;
|
||||
|
||||
/**
|
||||
* 传感器类型Mapper接口
|
||||
*
|
||||
* @author wenjy
|
||||
* @date 2022-02-07
|
||||
*/
|
||||
public interface BaseSensorTypeMapper
|
||||
{
|
||||
/**
|
||||
* 查询传感器类型
|
||||
*
|
||||
* @param ObjId 传感器类型主键
|
||||
* @return 传感器类型
|
||||
*/
|
||||
public BaseSensorType selectBaseSensorTypeByObjId(Long ObjId);
|
||||
|
||||
/**
|
||||
* 查询传感器类型列表
|
||||
*
|
||||
* @param baseSensorType 传感器类型
|
||||
* @return 传感器类型集合
|
||||
*/
|
||||
public List<BaseSensorType> selectBaseSensorTypeList(BaseSensorType baseSensorType);
|
||||
|
||||
/**
|
||||
* 新增传感器类型
|
||||
*
|
||||
* @param baseSensorType 传感器类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseSensorType(BaseSensorType baseSensorType);
|
||||
|
||||
/**
|
||||
* 修改传感器类型
|
||||
*
|
||||
* @param baseSensorType 传感器类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseSensorType(BaseSensorType baseSensorType);
|
||||
|
||||
/**
|
||||
* 删除传感器类型
|
||||
*
|
||||
* @param ObjId 传感器类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseSensorTypeByObjId(Long ObjId);
|
||||
|
||||
/**
|
||||
* 批量删除传感器类型
|
||||
*
|
||||
* @param ObjIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseSensorTypeByObjIds(String[] ObjIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.BaseSensorType;
|
||||
|
||||
/**
|
||||
* 传感器类型Service接口
|
||||
*
|
||||
* @author wenjy
|
||||
* @date 2022-02-07
|
||||
*/
|
||||
public interface IBaseSensorTypeService
|
||||
{
|
||||
/**
|
||||
* 查询传感器类型
|
||||
*
|
||||
* @param ObjId 传感器类型主键
|
||||
* @return 传感器类型
|
||||
*/
|
||||
public BaseSensorType selectBaseSensorTypeByObjId(Long ObjId);
|
||||
|
||||
/**
|
||||
* 查询传感器类型列表
|
||||
*
|
||||
* @param baseSensorType 传感器类型
|
||||
* @return 传感器类型集合
|
||||
*/
|
||||
public List<BaseSensorType> selectBaseSensorTypeList(BaseSensorType baseSensorType);
|
||||
|
||||
/**
|
||||
* 新增传感器类型
|
||||
*
|
||||
* @param baseSensorType 传感器类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseSensorType(BaseSensorType baseSensorType);
|
||||
|
||||
/**
|
||||
* 修改传感器类型
|
||||
*
|
||||
* @param baseSensorType 传感器类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseSensorType(BaseSensorType baseSensorType);
|
||||
|
||||
/**
|
||||
* 批量删除传感器类型
|
||||
*
|
||||
* @param ObjIds 需要删除的传感器类型主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseSensorTypeByObjIds(String ObjIds);
|
||||
|
||||
/**
|
||||
* 删除传感器类型信息
|
||||
*
|
||||
* @param ObjId 传感器类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseSensorTypeByObjId(Long ObjId);
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.BaseSensorTypeMapper;
|
||||
import com.ruoyi.system.domain.BaseSensorType;
|
||||
import com.ruoyi.system.service.IBaseSensorTypeService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 传感器类型Service业务层处理
|
||||
*
|
||||
* @author wenjy
|
||||
* @date 2022-02-07
|
||||
*/
|
||||
@Service
|
||||
public class BaseSensorTypeServiceImpl implements IBaseSensorTypeService
|
||||
{
|
||||
@Autowired
|
||||
private BaseSensorTypeMapper baseSensorTypeMapper;
|
||||
|
||||
/**
|
||||
* 查询传感器类型
|
||||
*
|
||||
* @param ObjId 传感器类型主键
|
||||
* @return 传感器类型
|
||||
*/
|
||||
@Override
|
||||
public BaseSensorType selectBaseSensorTypeByObjId(Long ObjId)
|
||||
{
|
||||
return baseSensorTypeMapper.selectBaseSensorTypeByObjId(ObjId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询传感器类型列表
|
||||
*
|
||||
* @param baseSensorType 传感器类型
|
||||
* @return 传感器类型
|
||||
*/
|
||||
@Override
|
||||
public List<BaseSensorType> selectBaseSensorTypeList(BaseSensorType baseSensorType)
|
||||
{
|
||||
return baseSensorTypeMapper.selectBaseSensorTypeList(baseSensorType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增传感器类型
|
||||
*
|
||||
* @param baseSensorType 传感器类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseSensorType(BaseSensorType baseSensorType)
|
||||
{
|
||||
baseSensorType.setCreateTime(DateUtils.getNowDate());
|
||||
return baseSensorTypeMapper.insertBaseSensorType(baseSensorType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改传感器类型
|
||||
*
|
||||
* @param baseSensorType 传感器类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseSensorType(BaseSensorType baseSensorType)
|
||||
{
|
||||
baseSensorType.setUpdateTime(DateUtils.getNowDate());
|
||||
return baseSensorTypeMapper.updateBaseSensorType(baseSensorType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除传感器类型
|
||||
*
|
||||
* @param ObjIds 需要删除的传感器类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseSensorTypeByObjIds(String ObjIds)
|
||||
{
|
||||
return baseSensorTypeMapper.deleteBaseSensorTypeByObjIds(Convert.toStrArray(ObjIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除传感器类型信息
|
||||
*
|
||||
* @param ObjId 传感器类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseSensorTypeByObjId(Long ObjId)
|
||||
{
|
||||
return baseSensorTypeMapper.deleteBaseSensorTypeByObjId(ObjId);
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
<?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.system.mapper.BaseSensorTypeMapper">
|
||||
|
||||
<resultMap type="BaseSensorType" id="BaseSensorTypeResult">
|
||||
<result property="ObjId" column="ObjId" />
|
||||
<result property="sensortypeId" column="SensorType_Id" />
|
||||
<result property="sensortypeName" column="SensorType_Name" />
|
||||
<result property="enableFlag" column="Enable_Flag" />
|
||||
<result property="createBy" column="Create_By" />
|
||||
<result property="createTime" column="Create_Time" />
|
||||
<result property="updateBy" column="Update_By" />
|
||||
<result property="updateTime" column="Update_Time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseSensorTypeVo">
|
||||
select ObjId, SensorType_Id, SensorType_Name, Enable_Flag, Create_By, Create_Time, Update_By, Update_Time from base_sensor_type
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseSensorTypeList" parameterType="BaseSensorType" resultMap="BaseSensorTypeResult">
|
||||
<include refid="selectBaseSensorTypeVo"/>
|
||||
<where>
|
||||
<if test="sensortypeId != null and sensortypeId != ''"> and SensorType_Id = #{sensortypeId}</if>
|
||||
<if test="sensortypeName != null and sensortypeName != ''"> and SensorType_Name like concat('%', #{sensortypeName}, '%')</if>
|
||||
<if test="enableFlag != null "> and Enable_Flag = #{enableFlag}</if>
|
||||
<if test="createBy != null and createBy != ''"> and Create_By = #{createBy}</if>
|
||||
<if test="createTime != null "> and Create_Time = #{createTime}</if>
|
||||
<if test="updateBy != null and updateBy != ''"> and Update_By = #{updateBy}</if>
|
||||
<if test="updateTime != null "> and Update_Time = #{updateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseSensorTypeByObjId" parameterType="Long" resultMap="BaseSensorTypeResult">
|
||||
<include refid="selectBaseSensorTypeVo"/>
|
||||
where ObjId = #{ObjId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseSensorType" parameterType="BaseSensorType" useGeneratedKeys="true" keyProperty="ObjId">
|
||||
insert into base_sensor_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="sensortypeId != null">SensorType_Id,</if>
|
||||
<if test="sensortypeName != null">SensorType_Name,</if>
|
||||
<if test="enableFlag != null">Enable_Flag,</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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sensortypeId != null">#{sensortypeId},</if>
|
||||
<if test="sensortypeName != null">#{sensortypeName},</if>
|
||||
<if test="enableFlag != null">#{enableFlag},</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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBaseSensorType" parameterType="BaseSensorType">
|
||||
update base_sensor_type
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="sensortypeId != null">SensorType_Id = #{sensortypeId},</if>
|
||||
<if test="sensortypeName != null">SensorType_Name = #{sensortypeName},</if>
|
||||
<if test="enableFlag != null">Enable_Flag = #{enableFlag},</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>
|
||||
</trim>
|
||||
where ObjId = #{ObjId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseSensorTypeByObjId" parameterType="Long">
|
||||
delete from base_sensor_type where ObjId = #{ObjId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseSensorTypeByObjIds" parameterType="String">
|
||||
delete from base_sensor_type where ObjId in
|
||||
<foreach item="ObjId" collection="array" open="(" separator="," close=")">
|
||||
#{ObjId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue