change - add设备台账、设备参数
parent
72f5419739
commit
ca32fb9b7e
@ -0,0 +1,106 @@
|
||||
package com.os.mes.base.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.os.common.annotation.Log;
|
||||
import com.os.common.core.controller.BaseController;
|
||||
import com.os.common.core.domain.AjaxResult;
|
||||
import com.os.common.enums.BusinessType;
|
||||
import com.os.mes.base.domain.BaseDeviceLedger;
|
||||
import com.os.mes.base.service.IBaseDeviceLedgerService;
|
||||
import com.os.common.utils.poi.ExcelUtil;
|
||||
import com.os.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 设备台账Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/base/baseDeviceLedger")
|
||||
public class BaseDeviceLedgerController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBaseDeviceLedgerService baseDeviceLedgerService;
|
||||
|
||||
/**
|
||||
* 查询设备台账列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseDeviceLedger:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BaseDeviceLedger baseDeviceLedger)
|
||||
{
|
||||
startPage();
|
||||
List<BaseDeviceLedger> list = baseDeviceLedgerService.selectBaseDeviceLedgerList(baseDeviceLedger);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备台账列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseDeviceLedger:export')")
|
||||
@Log(title = "设备台账", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseDeviceLedger baseDeviceLedger)
|
||||
{
|
||||
List<BaseDeviceLedger> list = baseDeviceLedgerService.selectBaseDeviceLedgerList(baseDeviceLedger);
|
||||
ExcelUtil<BaseDeviceLedger> util = new ExcelUtil<BaseDeviceLedger>(BaseDeviceLedger.class);
|
||||
util.exportExcel(response, list, "设备台账数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备台账详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseDeviceLedger:query')")
|
||||
@GetMapping(value = "/{objId}")
|
||||
public AjaxResult getInfo(@PathVariable("objId") Long objId)
|
||||
{
|
||||
return success(baseDeviceLedgerService.selectBaseDeviceLedgerByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备台账
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseDeviceLedger:add')")
|
||||
@Log(title = "设备台账", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseDeviceLedger baseDeviceLedger)
|
||||
{
|
||||
baseDeviceLedger.setCreateBy(getUsername());
|
||||
return toAjax(baseDeviceLedgerService.insertBaseDeviceLedger(baseDeviceLedger));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备台账
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseDeviceLedger:edit')")
|
||||
@Log(title = "设备台账", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseDeviceLedger baseDeviceLedger)
|
||||
{
|
||||
baseDeviceLedger.setUpdateBy(getUsername());
|
||||
return toAjax(baseDeviceLedgerService.updateBaseDeviceLedger(baseDeviceLedger));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备台账
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseDeviceLedger:remove')")
|
||||
@Log(title = "设备台账", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] objIds)
|
||||
{
|
||||
return toAjax(baseDeviceLedgerService.deleteBaseDeviceLedgerByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
package com.os.mes.base.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.os.common.annotation.Log;
|
||||
import com.os.common.core.controller.BaseController;
|
||||
import com.os.common.core.domain.AjaxResult;
|
||||
import com.os.common.enums.BusinessType;
|
||||
import com.os.mes.base.domain.BaseDeviceParam;
|
||||
import com.os.mes.base.service.IBaseDeviceParamService;
|
||||
import com.os.common.utils.poi.ExcelUtil;
|
||||
import com.os.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 设备参数Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/base/baseDeviceParam")
|
||||
public class BaseDeviceParamController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBaseDeviceParamService baseDeviceParamService;
|
||||
|
||||
/**
|
||||
* 查询设备参数列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseDeviceParam:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BaseDeviceParam baseDeviceParam)
|
||||
{
|
||||
startPage();
|
||||
List<BaseDeviceParam> list = baseDeviceParamService.selectBaseDeviceParamList(baseDeviceParam);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备参数列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseDeviceParam:export')")
|
||||
@Log(title = "设备参数", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseDeviceParam baseDeviceParam)
|
||||
{
|
||||
List<BaseDeviceParam> list = baseDeviceParamService.selectBaseDeviceParamList(baseDeviceParam);
|
||||
ExcelUtil<BaseDeviceParam> util = new ExcelUtil<BaseDeviceParam>(BaseDeviceParam.class);
|
||||
util.exportExcel(response, list, "设备参数数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备参数详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseDeviceParam:query')")
|
||||
@GetMapping(value = "/{objId}")
|
||||
public AjaxResult getInfo(@PathVariable("objId") Long objId)
|
||||
{
|
||||
return success(baseDeviceParamService.selectBaseDeviceParamByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备参数
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseDeviceParam:add')")
|
||||
@Log(title = "设备参数", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseDeviceParam baseDeviceParam)
|
||||
{
|
||||
baseDeviceParam.setCreateBy(getUsername());
|
||||
return toAjax(baseDeviceParamService.insertBaseDeviceParam(baseDeviceParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备参数
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseDeviceParam:edit')")
|
||||
@Log(title = "设备参数", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseDeviceParam baseDeviceParam)
|
||||
{
|
||||
baseDeviceParam.setUpdateBy(getUsername());
|
||||
return toAjax(baseDeviceParamService.updateBaseDeviceParam(baseDeviceParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备参数
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes/base:baseDeviceParam:remove')")
|
||||
@Log(title = "设备参数", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] objIds)
|
||||
{
|
||||
return toAjax(baseDeviceParamService.deleteBaseDeviceParamByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.mes.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.mes.base.domain.BaseDeviceLedger;
|
||||
|
||||
/**
|
||||
* 设备台账Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
public interface BaseDeviceLedgerMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备台账
|
||||
*
|
||||
* @param objId 设备台账主键
|
||||
* @return 设备台账
|
||||
*/
|
||||
public BaseDeviceLedger selectBaseDeviceLedgerByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询设备台账列表
|
||||
*
|
||||
* @param baseDeviceLedger 设备台账
|
||||
* @return 设备台账集合
|
||||
*/
|
||||
public List<BaseDeviceLedger> selectBaseDeviceLedgerList(BaseDeviceLedger baseDeviceLedger);
|
||||
|
||||
/**
|
||||
* 新增设备台账
|
||||
*
|
||||
* @param baseDeviceLedger 设备台账
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseDeviceLedger(BaseDeviceLedger baseDeviceLedger);
|
||||
|
||||
/**
|
||||
* 修改设备台账
|
||||
*
|
||||
* @param baseDeviceLedger 设备台账
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseDeviceLedger(BaseDeviceLedger baseDeviceLedger);
|
||||
|
||||
/**
|
||||
* 删除设备台账
|
||||
*
|
||||
* @param objId 设备台账主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseDeviceLedgerByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除设备台账
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseDeviceLedgerByObjIds(Long[] objIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.mes.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.os.mes.base.domain.BaseDeviceParam;
|
||||
|
||||
/**
|
||||
* 设备参数Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
public interface BaseDeviceParamMapper {
|
||||
/**
|
||||
* 查询设备参数
|
||||
*
|
||||
* @param objId 设备参数主键
|
||||
* @return 设备参数
|
||||
*/
|
||||
public BaseDeviceParam selectBaseDeviceParamByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询设备参数列表
|
||||
*
|
||||
* @param baseDeviceParam 设备参数
|
||||
* @return 设备参数集合
|
||||
*/
|
||||
public List<BaseDeviceParam> selectBaseDeviceParamList(BaseDeviceParam baseDeviceParam);
|
||||
|
||||
/**
|
||||
* 新增设备参数
|
||||
*
|
||||
* @param baseDeviceParam 设备参数
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseDeviceParam(BaseDeviceParam baseDeviceParam);
|
||||
|
||||
/**
|
||||
* 修改设备参数
|
||||
*
|
||||
* @param baseDeviceParam 设备参数
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseDeviceParam(BaseDeviceParam baseDeviceParam);
|
||||
|
||||
/**
|
||||
* 删除设备参数
|
||||
*
|
||||
* @param objId 设备参数主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseDeviceParamByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除设备参数
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseDeviceParamByObjIds(Long[] objIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.mes.base.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.mes.base.domain.BaseDeviceLedger;
|
||||
|
||||
/**
|
||||
* 设备台账Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
public interface IBaseDeviceLedgerService
|
||||
{
|
||||
/**
|
||||
* 查询设备台账
|
||||
*
|
||||
* @param objId 设备台账主键
|
||||
* @return 设备台账
|
||||
*/
|
||||
public BaseDeviceLedger selectBaseDeviceLedgerByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询设备台账列表
|
||||
*
|
||||
* @param baseDeviceLedger 设备台账
|
||||
* @return 设备台账集合
|
||||
*/
|
||||
public List<BaseDeviceLedger> selectBaseDeviceLedgerList(BaseDeviceLedger baseDeviceLedger);
|
||||
|
||||
/**
|
||||
* 新增设备台账
|
||||
*
|
||||
* @param baseDeviceLedger 设备台账
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseDeviceLedger(BaseDeviceLedger baseDeviceLedger);
|
||||
|
||||
/**
|
||||
* 修改设备台账
|
||||
*
|
||||
* @param baseDeviceLedger 设备台账
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseDeviceLedger(BaseDeviceLedger baseDeviceLedger);
|
||||
|
||||
/**
|
||||
* 批量删除设备台账
|
||||
*
|
||||
* @param objIds 需要删除的设备台账主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseDeviceLedgerByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除设备台账信息
|
||||
*
|
||||
* @param objId 设备台账主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseDeviceLedgerByObjId(Long objId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.mes.base.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.mes.base.domain.BaseDeviceParam;
|
||||
|
||||
/**
|
||||
* 设备参数Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
public interface IBaseDeviceParamService
|
||||
{
|
||||
/**
|
||||
* 查询设备参数
|
||||
*
|
||||
* @param objId 设备参数主键
|
||||
* @return 设备参数
|
||||
*/
|
||||
public BaseDeviceParam selectBaseDeviceParamByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询设备参数列表
|
||||
*
|
||||
* @param baseDeviceParam 设备参数
|
||||
* @return 设备参数集合
|
||||
*/
|
||||
public List<BaseDeviceParam> selectBaseDeviceParamList(BaseDeviceParam baseDeviceParam);
|
||||
|
||||
/**
|
||||
* 新增设备参数
|
||||
*
|
||||
* @param baseDeviceParam 设备参数
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseDeviceParam(BaseDeviceParam baseDeviceParam);
|
||||
|
||||
/**
|
||||
* 修改设备参数
|
||||
*
|
||||
* @param baseDeviceParam 设备参数
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseDeviceParam(BaseDeviceParam baseDeviceParam);
|
||||
|
||||
/**
|
||||
* 批量删除设备参数
|
||||
*
|
||||
* @param objIds 需要删除的设备参数主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseDeviceParamByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除设备参数信息
|
||||
*
|
||||
* @param objId 设备参数主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseDeviceParamByObjId(Long objId);
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.os.mes.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.os.mes.base.mapper.BaseDeviceLedgerMapper;
|
||||
import com.os.mes.base.domain.BaseDeviceLedger;
|
||||
import com.os.mes.base.service.IBaseDeviceLedgerService;
|
||||
|
||||
/**
|
||||
* 设备台账Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
@Service
|
||||
public class BaseDeviceLedgerServiceImpl implements IBaseDeviceLedgerService
|
||||
{
|
||||
@Autowired
|
||||
private BaseDeviceLedgerMapper baseDeviceLedgerMapper;
|
||||
|
||||
/**
|
||||
* 查询设备台账
|
||||
*
|
||||
* @param objId 设备台账主键
|
||||
* @return 设备台账
|
||||
*/
|
||||
@Override
|
||||
public BaseDeviceLedger selectBaseDeviceLedgerByObjId(Long objId)
|
||||
{
|
||||
return baseDeviceLedgerMapper.selectBaseDeviceLedgerByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备台账列表
|
||||
*
|
||||
* @param baseDeviceLedger 设备台账
|
||||
* @return 设备台账
|
||||
*/
|
||||
@Override
|
||||
public List<BaseDeviceLedger> selectBaseDeviceLedgerList(BaseDeviceLedger baseDeviceLedger)
|
||||
{
|
||||
return baseDeviceLedgerMapper.selectBaseDeviceLedgerList(baseDeviceLedger);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备台账
|
||||
*
|
||||
* @param baseDeviceLedger 设备台账
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseDeviceLedger(BaseDeviceLedger baseDeviceLedger)
|
||||
{
|
||||
baseDeviceLedger.setCreateTime(DateUtils.getNowDate());
|
||||
return baseDeviceLedgerMapper.insertBaseDeviceLedger(baseDeviceLedger);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备台账
|
||||
*
|
||||
* @param baseDeviceLedger 设备台账
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseDeviceLedger(BaseDeviceLedger baseDeviceLedger)
|
||||
{
|
||||
baseDeviceLedger.setUpdateTime(DateUtils.getNowDate());
|
||||
return baseDeviceLedgerMapper.updateBaseDeviceLedger(baseDeviceLedger);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备台账
|
||||
*
|
||||
* @param objIds 需要删除的设备台账主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseDeviceLedgerByObjIds(Long[] objIds)
|
||||
{
|
||||
return baseDeviceLedgerMapper.deleteBaseDeviceLedgerByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备台账信息
|
||||
*
|
||||
* @param objId 设备台账主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseDeviceLedgerByObjId(Long objId)
|
||||
{
|
||||
return baseDeviceLedgerMapper.deleteBaseDeviceLedgerByObjId(objId);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.os.mes.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.os.mes.base.mapper.BaseDeviceParamMapper;
|
||||
import com.os.mes.base.domain.BaseDeviceParam;
|
||||
import com.os.mes.base.service.IBaseDeviceParamService;
|
||||
|
||||
/**
|
||||
* 设备参数Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-10
|
||||
*/
|
||||
@Service
|
||||
public class BaseDeviceParamServiceImpl implements IBaseDeviceParamService
|
||||
{
|
||||
@Autowired
|
||||
private BaseDeviceParamMapper baseDeviceParamMapper;
|
||||
|
||||
/**
|
||||
* 查询设备参数
|
||||
*
|
||||
* @param objId 设备参数主键
|
||||
* @return 设备参数
|
||||
*/
|
||||
@Override
|
||||
public BaseDeviceParam selectBaseDeviceParamByObjId(Long objId)
|
||||
{
|
||||
return baseDeviceParamMapper.selectBaseDeviceParamByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备参数列表
|
||||
*
|
||||
* @param baseDeviceParam 设备参数
|
||||
* @return 设备参数
|
||||
*/
|
||||
@Override
|
||||
public List<BaseDeviceParam> selectBaseDeviceParamList(BaseDeviceParam baseDeviceParam)
|
||||
{
|
||||
return baseDeviceParamMapper.selectBaseDeviceParamList(baseDeviceParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备参数
|
||||
*
|
||||
* @param baseDeviceParam 设备参数
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseDeviceParam(BaseDeviceParam baseDeviceParam)
|
||||
{
|
||||
baseDeviceParam.setCreateTime(DateUtils.getNowDate());
|
||||
return baseDeviceParamMapper.insertBaseDeviceParam(baseDeviceParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备参数
|
||||
*
|
||||
* @param baseDeviceParam 设备参数
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseDeviceParam(BaseDeviceParam baseDeviceParam)
|
||||
{
|
||||
baseDeviceParam.setUpdateTime(DateUtils.getNowDate());
|
||||
return baseDeviceParamMapper.updateBaseDeviceParam(baseDeviceParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备参数
|
||||
*
|
||||
* @param objIds 需要删除的设备参数主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseDeviceParamByObjIds(Long[] objIds)
|
||||
{
|
||||
return baseDeviceParamMapper.deleteBaseDeviceParamByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备参数信息
|
||||
*
|
||||
* @param objId 设备参数主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseDeviceParamByObjId(Long objId)
|
||||
{
|
||||
return baseDeviceParamMapper.deleteBaseDeviceParamByObjId(objId);
|
||||
}
|
||||
}
|
@ -0,0 +1,142 @@
|
||||
<?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.os.mes.base.mapper.BaseDeviceLedgerMapper">
|
||||
|
||||
<resultMap type="BaseDeviceLedger" id="BaseDeviceLedgerResult">
|
||||
<result property="objId" column="obj_id" />
|
||||
<result property="deviceCode" column="device_code" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
<result property="deviceModel" column="device_model" />
|
||||
<result property="deviceType" column="device_type" />
|
||||
<result property="deviceAddress" column="device_address" />
|
||||
<result property="deviceStatus" column="device_status" />
|
||||
<result property="usedDepartment" column="used_department" />
|
||||
<result property="costCenter" column="cost_center" />
|
||||
<result property="manufacturer" column="manufacturer" />
|
||||
<result property="enableDate" column="enable_date" />
|
||||
<result property="productLineCode" column="product_line_code" />
|
||||
<result property="isFlag" column="is_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" />
|
||||
<result property="factoryCode" column="factory_code" />
|
||||
<result property="teamCode" column="team_code" />
|
||||
<result property="assetCode" column="asset_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseDeviceLedgerVo">
|
||||
select obj_id, device_code, device_name, device_model, device_type, device_address, device_status, used_department, cost_center, manufacturer, enable_date, product_line_code, is_flag, create_by, create_time, update_by, update_time, factory_code, team_code, asset_code from base_device_ledger
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseDeviceLedgerList" parameterType="BaseDeviceLedger" resultMap="BaseDeviceLedgerResult">
|
||||
<include refid="selectBaseDeviceLedgerVo"/>
|
||||
<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="deviceModel != null and deviceModel != ''"> and device_model = #{deviceModel}</if>
|
||||
<if test="deviceType != null and deviceType != ''"> and device_type = #{deviceType}</if>
|
||||
<if test="deviceAddress != null and deviceAddress != ''"> and device_address = #{deviceAddress}</if>
|
||||
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if>
|
||||
<if test="usedDepartment != null and usedDepartment != ''"> and used_department = #{usedDepartment}</if>
|
||||
<if test="costCenter != null and costCenter != ''"> and cost_center = #{costCenter}</if>
|
||||
<if test="manufacturer != null and manufacturer != ''"> and manufacturer = #{manufacturer}</if>
|
||||
<if test="enableDate != null "> and enable_date = #{enableDate}</if>
|
||||
<if test="productLineCode != null and productLineCode != ''"> and product_line_code = #{productLineCode}</if>
|
||||
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
|
||||
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
||||
<if test="teamCode != null and teamCode != ''"> and team_code = #{teamCode}</if>
|
||||
<if test="assetCode != null and assetCode != ''"> and asset_code = #{assetCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseDeviceLedgerByObjId" parameterType="Long" resultMap="BaseDeviceLedgerResult">
|
||||
<include refid="selectBaseDeviceLedgerVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseDeviceLedger" parameterType="BaseDeviceLedger" useGeneratedKeys="true" keyProperty="objId">
|
||||
insert into base_device_ledger
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceCode != null and deviceCode != ''">device_code,</if>
|
||||
<if test="deviceName != null">device_name,</if>
|
||||
<if test="deviceModel != null">device_model,</if>
|
||||
<if test="deviceType != null">device_type,</if>
|
||||
<if test="deviceAddress != null">device_address,</if>
|
||||
<if test="deviceStatus != null">device_status,</if>
|
||||
<if test="usedDepartment != null">used_department,</if>
|
||||
<if test="costCenter != null">cost_center,</if>
|
||||
<if test="manufacturer != null">manufacturer,</if>
|
||||
<if test="enableDate != null">enable_date,</if>
|
||||
<if test="productLineCode != null">product_line_code,</if>
|
||||
<if test="isFlag != null">is_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>
|
||||
<if test="factoryCode != null">factory_code,</if>
|
||||
<if test="teamCode != null">team_code,</if>
|
||||
<if test="assetCode != null">asset_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceCode != null and deviceCode != ''">#{deviceCode},</if>
|
||||
<if test="deviceName != null">#{deviceName},</if>
|
||||
<if test="deviceModel != null">#{deviceModel},</if>
|
||||
<if test="deviceType != null">#{deviceType},</if>
|
||||
<if test="deviceAddress != null">#{deviceAddress},</if>
|
||||
<if test="deviceStatus != null">#{deviceStatus},</if>
|
||||
<if test="usedDepartment != null">#{usedDepartment},</if>
|
||||
<if test="costCenter != null">#{costCenter},</if>
|
||||
<if test="manufacturer != null">#{manufacturer},</if>
|
||||
<if test="enableDate != null">#{enableDate},</if>
|
||||
<if test="productLineCode != null">#{productLineCode},</if>
|
||||
<if test="isFlag != null">#{isFlag},</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="factoryCode != null">#{factoryCode},</if>
|
||||
<if test="teamCode != null">#{teamCode},</if>
|
||||
<if test="assetCode != null">#{assetCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBaseDeviceLedger" parameterType="BaseDeviceLedger">
|
||||
update base_device_ledger
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deviceCode != null and deviceCode != ''">device_code = #{deviceCode},</if>
|
||||
<if test="deviceName != null">device_name = #{deviceName},</if>
|
||||
<if test="deviceModel != null">device_model = #{deviceModel},</if>
|
||||
<if test="deviceType != null">device_type = #{deviceType},</if>
|
||||
<if test="deviceAddress != null">device_address = #{deviceAddress},</if>
|
||||
<if test="deviceStatus != null">device_status = #{deviceStatus},</if>
|
||||
<if test="usedDepartment != null">used_department = #{usedDepartment},</if>
|
||||
<if test="costCenter != null">cost_center = #{costCenter},</if>
|
||||
<if test="manufacturer != null">manufacturer = #{manufacturer},</if>
|
||||
<if test="enableDate != null">enable_date = #{enableDate},</if>
|
||||
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
|
||||
<if test="isFlag != null">is_flag = #{isFlag},</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="factoryCode != null">factory_code = #{factoryCode},</if>
|
||||
<if test="teamCode != null">team_code = #{teamCode},</if>
|
||||
<if test="assetCode != null">asset_code = #{assetCode},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseDeviceLedgerByObjId" parameterType="Long">
|
||||
delete from base_device_ledger where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseDeviceLedgerByObjIds" parameterType="String">
|
||||
delete from base_device_ledger where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,132 @@
|
||||
<?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.os.mes.base.mapper.BaseDeviceParamMapper">
|
||||
|
||||
<resultMap type="BaseDeviceParam" id="BaseDeviceParamResult">
|
||||
<result property="objId" column="obj_id"/>
|
||||
<result property="paramCode" column="param_code"/>
|
||||
<result property="paramName" column="param_name"/>
|
||||
<result property="paramNetwork" column="param_network"/>
|
||||
<result property="paramAddress" column="param_address"/>
|
||||
<result property="paramType" column="param_type"/>
|
||||
<result property="deviceCode" column="device_code"/>
|
||||
<result property="deviceName" column="device_name"/>
|
||||
<result property="productLineName" column="product_line_name"/>
|
||||
<result property="readFrequency" column="read_frequency"/>
|
||||
<result property="isFlag" column="is_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="selectBaseDeviceParamVo">
|
||||
select dp.obj_id,
|
||||
dp.param_code,
|
||||
dp.param_name,
|
||||
dp.param_network,
|
||||
dp.param_address,
|
||||
dp.param_type,
|
||||
dp.device_code,
|
||||
dp.read_frequency,
|
||||
dp.is_flag,
|
||||
dp.create_by,
|
||||
dp.create_time,
|
||||
dp.update_by,
|
||||
dp.update_time,
|
||||
dl.device_name,
|
||||
pl.product_line_name
|
||||
from base_device_param dp
|
||||
left join base_device_ledger dl on dl.device_code = dp.device_code
|
||||
left join base_product_line pl on pl.product_line_code = dl.product_line_code
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseDeviceParamList" parameterType="BaseDeviceParam" resultMap="BaseDeviceParamResult">
|
||||
<include refid="selectBaseDeviceParamVo"/>
|
||||
<where>
|
||||
<if test="paramCode != null and paramCode != ''">and dp.param_code = #{paramCode}</if>
|
||||
<if test="paramName != null and paramName != ''">and dp.param_name like concat('%', #{paramName}, '%')</if>
|
||||
<if test="paramNetwork != null and paramNetwork != ''">and dp.param_network = #{paramNetwork}</if>
|
||||
<if test="paramAddress != null and paramAddress != ''">and dp.param_address = #{paramAddress}</if>
|
||||
<if test="paramType != null and paramType != ''">and dp.param_type = #{paramType}</if>
|
||||
<if test="deviceCode != null and deviceCode != ''">and dp.device_code = #{deviceCode}</if>
|
||||
<if test="readFrequency != null ">and dp.read_frequency = #{readFrequency}</if>
|
||||
<if test="isFlag != null and isFlag != ''">and dp.is_flag = #{isFlag}</if>
|
||||
<if test="createBy != null and createBy != ''">and dp.create_by = #{createBy}</if>
|
||||
<if test="createTime != null ">and dp.create_time = #{createTime}</if>
|
||||
<if test="updateBy != null and updateBy != ''">and dp.update_by = #{updateBy}</if>
|
||||
<if test="updateTime != null ">and dp.update_time = #{updateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseDeviceParamByObjId" parameterType="Long" resultMap="BaseDeviceParamResult">
|
||||
<include refid="selectBaseDeviceParamVo"/>
|
||||
where dp.obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseDeviceParam" parameterType="BaseDeviceParam" useGeneratedKeys="true" keyProperty="objId">
|
||||
insert into base_device_param
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="paramCode != null">param_code,</if>
|
||||
<if test="paramName != null">param_name,</if>
|
||||
<if test="paramNetwork != null">param_network,</if>
|
||||
<if test="paramAddress != null">param_address,</if>
|
||||
<if test="paramType != null">param_type,</if>
|
||||
<if test="deviceCode != null">device_code,</if>
|
||||
<if test="readFrequency != null">read_frequency,</if>
|
||||
<if test="isFlag != null">is_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="paramCode != null">#{paramCode},</if>
|
||||
<if test="paramName != null">#{paramName},</if>
|
||||
<if test="paramNetwork != null">#{paramNetwork},</if>
|
||||
<if test="paramAddress != null">#{paramAddress},</if>
|
||||
<if test="paramType != null">#{paramType},</if>
|
||||
<if test="deviceCode != null">#{deviceCode},</if>
|
||||
<if test="readFrequency != null">#{readFrequency},</if>
|
||||
<if test="isFlag != null">#{isFlag},</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="updateBaseDeviceParam" parameterType="BaseDeviceParam">
|
||||
update base_device_param
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="paramCode != null">param_code = #{paramCode},</if>
|
||||
<if test="paramName != null">param_name = #{paramName},</if>
|
||||
<if test="paramNetwork != null">param_network = #{paramNetwork},</if>
|
||||
<if test="paramAddress != null">param_address = #{paramAddress},</if>
|
||||
<if test="paramType != null">param_type = #{paramType},</if>
|
||||
<if test="deviceCode != null">device_code = #{deviceCode},</if>
|
||||
<if test="readFrequency != null">read_frequency = #{readFrequency},</if>
|
||||
<if test="isFlag != null">is_flag = #{isFlag},</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 obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseDeviceParamByObjId" parameterType="Long">
|
||||
delete
|
||||
from base_device_param
|
||||
where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseDeviceParamByObjIds" parameterType="String">
|
||||
delete from base_device_param where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue