change - add统计单元信息、统计计量信息
parent
5e573e9c04
commit
8beb4adab0
@ -0,0 +1,100 @@
|
|||||||
|
package com.os.ems.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.ems.base.domain.EmsBaseMonitorWorkUnit;
|
||||||
|
import com.os.ems.base.service.IEmsBaseMonitorWorkUnitService;
|
||||||
|
import com.os.common.utils.poi.ExcelUtil;
|
||||||
|
import com.os.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计计量信息Controller
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-09
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ems/base/baseMonitorWorkUnit")
|
||||||
|
public class EmsBaseMonitorWorkUnitController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private IEmsBaseMonitorWorkUnitService emsBaseMonitorWorkUnitService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询统计计量信息列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseMonitorWorkUnit:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(EmsBaseMonitorWorkUnit emsBaseMonitorWorkUnit) {
|
||||||
|
startPage();
|
||||||
|
List<EmsBaseMonitorWorkUnit> list = emsBaseMonitorWorkUnitService.selectEmsBaseMonitorWorkUnitList(emsBaseMonitorWorkUnit);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出统计计量信息列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseMonitorWorkUnit:export')")
|
||||||
|
@Log(title = "统计计量信息" , businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, EmsBaseMonitorWorkUnit emsBaseMonitorWorkUnit) {
|
||||||
|
List<EmsBaseMonitorWorkUnit> list = emsBaseMonitorWorkUnitService.selectEmsBaseMonitorWorkUnitList(emsBaseMonitorWorkUnit);
|
||||||
|
ExcelUtil<EmsBaseMonitorWorkUnit> util = new ExcelUtil<EmsBaseMonitorWorkUnit>(EmsBaseMonitorWorkUnit.class);
|
||||||
|
util.exportExcel(response, list, "统计计量信息数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取统计计量信息详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseMonitorWorkUnit:query')")
|
||||||
|
@GetMapping(value = "/{objId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
|
||||||
|
return success(emsBaseMonitorWorkUnitService.selectEmsBaseMonitorWorkUnitByObjId(objId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增统计计量信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseMonitorWorkUnit:add')")
|
||||||
|
@Log(title = "统计计量信息" , businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody EmsBaseMonitorWorkUnit emsBaseMonitorWorkUnit) {
|
||||||
|
emsBaseMonitorWorkUnit.setCreateBy(getUsername());
|
||||||
|
return toAjax(emsBaseMonitorWorkUnitService.insertEmsBaseMonitorWorkUnit(emsBaseMonitorWorkUnit));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改统计计量信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseMonitorWorkUnit:edit')")
|
||||||
|
@Log(title = "统计计量信息" , businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody EmsBaseMonitorWorkUnit emsBaseMonitorWorkUnit) {
|
||||||
|
emsBaseMonitorWorkUnit.setUpdateBy(getUsername());
|
||||||
|
return toAjax(emsBaseMonitorWorkUnitService.updateEmsBaseMonitorWorkUnit(emsBaseMonitorWorkUnit));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除统计计量信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseMonitorWorkUnit:remove')")
|
||||||
|
@Log(title = "统计计量信息" , businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{objIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] objIds) {
|
||||||
|
return toAjax(emsBaseMonitorWorkUnitService.deleteEmsBaseMonitorWorkUnitByObjIds(objIds));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,115 @@
|
|||||||
|
package com.os.ems.base.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.os.ems.base.domain.TreeSelects;
|
||||||
|
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.ems.base.domain.EmsBaseWorkUnit;
|
||||||
|
import com.os.ems.base.service.IEmsBaseWorkUnitService;
|
||||||
|
import com.os.common.utils.poi.ExcelUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计单元信息Controller
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-09
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ems/base/baseWorkUnit")
|
||||||
|
public class EmsBaseWorkUnitController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IEmsBaseWorkUnitService emsBaseWorkUnitService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询统计单元信息列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseWorkUnit:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public AjaxResult list(EmsBaseWorkUnit emsBaseWorkUnit)
|
||||||
|
{
|
||||||
|
List<EmsBaseWorkUnit> list = emsBaseWorkUnitService.selectEmsBaseWorkUnitList(emsBaseWorkUnit);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询计量设备信息下拉树结构
|
||||||
|
*/
|
||||||
|
@PostMapping("/workUnitTree")
|
||||||
|
public AjaxResult getMonitorInfoTree(EmsBaseWorkUnit baseWorkUnit) {
|
||||||
|
List<TreeSelects> list = emsBaseWorkUnitService.selectBaseWorkUnitTreeList(baseWorkUnit);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出统计单元信息列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseWorkUnit:export')")
|
||||||
|
@Log(title = "统计单元信息", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, EmsBaseWorkUnit emsBaseWorkUnit)
|
||||||
|
{
|
||||||
|
List<EmsBaseWorkUnit> list = emsBaseWorkUnitService.selectEmsBaseWorkUnitList(emsBaseWorkUnit);
|
||||||
|
ExcelUtil<EmsBaseWorkUnit> util = new ExcelUtil<EmsBaseWorkUnit>(EmsBaseWorkUnit.class);
|
||||||
|
util.exportExcel(response, list, "统计单元信息数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取统计单元信息详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseWorkUnit:query')")
|
||||||
|
@GetMapping(value = "/{objId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("objId") Long objId)
|
||||||
|
{
|
||||||
|
return success(emsBaseWorkUnitService.selectEmsBaseWorkUnitByObjId(objId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增统计单元信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseWorkUnit:add')")
|
||||||
|
@Log(title = "统计单元信息", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody EmsBaseWorkUnit emsBaseWorkUnit)
|
||||||
|
{
|
||||||
|
emsBaseWorkUnit.setCreateBy(getUsername());
|
||||||
|
return toAjax(emsBaseWorkUnitService.insertEmsBaseWorkUnit(emsBaseWorkUnit));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改统计单元信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseWorkUnit:edit')")
|
||||||
|
@Log(title = "统计单元信息", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody EmsBaseWorkUnit emsBaseWorkUnit)
|
||||||
|
{
|
||||||
|
emsBaseWorkUnit.setUpdateBy(getUsername());
|
||||||
|
return toAjax(emsBaseWorkUnitService.updateEmsBaseWorkUnit(emsBaseWorkUnit));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除统计单元信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseWorkUnit:remove')")
|
||||||
|
@Log(title = "统计单元信息", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{objIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] objIds)
|
||||||
|
{
|
||||||
|
return toAjax(emsBaseWorkUnitService.deleteEmsBaseWorkUnitByObjIds(objIds));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,102 @@
|
|||||||
|
package com.os.ems.base.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.os.common.core.domain.entity.SysDept;
|
||||||
|
import com.os.common.core.domain.entity.SysMenu;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Treeselect树结构实体类
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class TreeSelects implements Serializable
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 节点ID */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 节点名称 */
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/** 子节点 */
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||||
|
private List<TreeSelects> children;
|
||||||
|
|
||||||
|
public TreeSelects()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public TreeSelects(SysDept dept)
|
||||||
|
{
|
||||||
|
this.id = dept.getDeptId();
|
||||||
|
this.label = dept.getDeptName();
|
||||||
|
this.children = dept.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public TreeSelects(EmsBaseMonitorInfo baseMonitorInfo){
|
||||||
|
this.id = baseMonitorInfo.getObjId();
|
||||||
|
this.label = baseMonitorInfo.getMonitorName();
|
||||||
|
this.code = baseMonitorInfo.getMonitorCode();
|
||||||
|
this.children = baseMonitorInfo.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public TreeSelects(EmsBaseWorkUnit baseWorkUnit){
|
||||||
|
this.id = baseWorkUnit.getObjId();
|
||||||
|
this.label = baseWorkUnit.getWorkUnitName();
|
||||||
|
this.code = baseWorkUnit.getWorkUnitCode();
|
||||||
|
this.children = baseWorkUnit.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public TreeSelects(SysMenu menu)
|
||||||
|
{
|
||||||
|
this.id = menu.getMenuId();
|
||||||
|
this.label = menu.getMenuName();
|
||||||
|
this.children = menu.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel()
|
||||||
|
{
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel(String label)
|
||||||
|
{
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TreeSelects> getChildren()
|
||||||
|
{
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildren(List<TreeSelects> children)
|
||||||
|
{
|
||||||
|
this.children = children;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.os.ems.base.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.os.ems.base.domain.EmsBaseMonitorWorkUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计计量信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-09
|
||||||
|
*/
|
||||||
|
public interface EmsBaseMonitorWorkUnitMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询统计计量信息
|
||||||
|
*
|
||||||
|
* @param objId 统计计量信息主键
|
||||||
|
* @return 统计计量信息
|
||||||
|
*/
|
||||||
|
public EmsBaseMonitorWorkUnit selectEmsBaseMonitorWorkUnitByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询统计计量信息列表
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorWorkUnit 统计计量信息
|
||||||
|
* @return 统计计量信息集合
|
||||||
|
*/
|
||||||
|
public List<EmsBaseMonitorWorkUnit> selectEmsBaseMonitorWorkUnitList(EmsBaseMonitorWorkUnit emsBaseMonitorWorkUnit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增统计计量信息
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorWorkUnit 统计计量信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEmsBaseMonitorWorkUnit(EmsBaseMonitorWorkUnit emsBaseMonitorWorkUnit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改统计计量信息
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorWorkUnit 统计计量信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateEmsBaseMonitorWorkUnit(EmsBaseMonitorWorkUnit emsBaseMonitorWorkUnit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除统计计量信息
|
||||||
|
*
|
||||||
|
* @param objId 统计计量信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseMonitorWorkUnitByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除统计计量信息
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseMonitorWorkUnitByObjIds(Long[] objIds);
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.os.ems.base.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.os.ems.base.domain.EmsBaseWorkUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计单元信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-09
|
||||||
|
*/
|
||||||
|
public interface EmsBaseWorkUnitMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询统计单元信息
|
||||||
|
*
|
||||||
|
* @param objId 统计单元信息主键
|
||||||
|
* @return 统计单元信息
|
||||||
|
*/
|
||||||
|
public EmsBaseWorkUnit selectEmsBaseWorkUnitByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询统计单元信息列表
|
||||||
|
*
|
||||||
|
* @param emsBaseWorkUnit 统计单元信息
|
||||||
|
* @return 统计单元信息集合
|
||||||
|
*/
|
||||||
|
public List<EmsBaseWorkUnit> selectEmsBaseWorkUnitList(EmsBaseWorkUnit emsBaseWorkUnit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增统计单元信息
|
||||||
|
*
|
||||||
|
* @param emsBaseWorkUnit 统计单元信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEmsBaseWorkUnit(EmsBaseWorkUnit emsBaseWorkUnit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改统计单元信息
|
||||||
|
*
|
||||||
|
* @param emsBaseWorkUnit 统计单元信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateEmsBaseWorkUnit(EmsBaseWorkUnit emsBaseWorkUnit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除统计单元信息
|
||||||
|
*
|
||||||
|
* @param objId 统计单元信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseWorkUnitByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除统计单元信息
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseWorkUnitByObjIds(Long[] objIds);
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.os.ems.base.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.os.ems.base.domain.EmsBaseMonitorWorkUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计计量信息Service接口
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-09
|
||||||
|
*/
|
||||||
|
public interface IEmsBaseMonitorWorkUnitService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询统计计量信息
|
||||||
|
*
|
||||||
|
* @param objId 统计计量信息主键
|
||||||
|
* @return 统计计量信息
|
||||||
|
*/
|
||||||
|
public EmsBaseMonitorWorkUnit selectEmsBaseMonitorWorkUnitByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询统计计量信息列表
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorWorkUnit 统计计量信息
|
||||||
|
* @return 统计计量信息集合
|
||||||
|
*/
|
||||||
|
public List<EmsBaseMonitorWorkUnit> selectEmsBaseMonitorWorkUnitList(EmsBaseMonitorWorkUnit emsBaseMonitorWorkUnit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增统计计量信息
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorWorkUnit 统计计量信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEmsBaseMonitorWorkUnit(EmsBaseMonitorWorkUnit emsBaseMonitorWorkUnit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改统计计量信息
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorWorkUnit 统计计量信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateEmsBaseMonitorWorkUnit(EmsBaseMonitorWorkUnit emsBaseMonitorWorkUnit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除统计计量信息
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的统计计量信息主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseMonitorWorkUnitByObjIds(Long[] objIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除统计计量信息信息
|
||||||
|
*
|
||||||
|
* @param objId 统计计量信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseMonitorWorkUnitByObjId(Long objId);
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.os.ems.base.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.os.ems.base.domain.EmsBaseWorkUnit;
|
||||||
|
import com.os.ems.base.domain.TreeSelects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计单元信息Service接口
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-09
|
||||||
|
*/
|
||||||
|
public interface IEmsBaseWorkUnitService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询统计单元信息
|
||||||
|
*
|
||||||
|
* @param objId 统计单元信息主键
|
||||||
|
* @return 统计单元信息
|
||||||
|
*/
|
||||||
|
public EmsBaseWorkUnit selectEmsBaseWorkUnitByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询统计单元信息列表
|
||||||
|
*
|
||||||
|
* @param emsBaseWorkUnit 统计单元信息
|
||||||
|
* @return 统计单元信息集合
|
||||||
|
*/
|
||||||
|
public List<EmsBaseWorkUnit> selectEmsBaseWorkUnitList(EmsBaseWorkUnit emsBaseWorkUnit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增统计单元信息
|
||||||
|
*
|
||||||
|
* @param emsBaseWorkUnit 统计单元信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEmsBaseWorkUnit(EmsBaseWorkUnit emsBaseWorkUnit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改统计单元信息
|
||||||
|
*
|
||||||
|
* @param emsBaseWorkUnit 统计单元信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateEmsBaseWorkUnit(EmsBaseWorkUnit emsBaseWorkUnit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除统计单元信息
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的统计单元信息主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseWorkUnitByObjIds(Long[] objIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除统计单元信息信息
|
||||||
|
*
|
||||||
|
* @param objId 统计单元信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseWorkUnitByObjId(Long objId);
|
||||||
|
|
||||||
|
List<TreeSelects> selectBaseWorkUnitTreeList(EmsBaseWorkUnit baseWorkUnit);
|
||||||
|
|
||||||
|
public List<TreeSelects> buildWorkUnitTreeSelect(List<EmsBaseWorkUnit> baseWorkUnits);
|
||||||
|
|
||||||
|
public List<EmsBaseWorkUnit> buildWorkUnitTree(List<EmsBaseWorkUnit> baseWorkUnits);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,97 @@
|
|||||||
|
package com.os.ems.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.ems.base.mapper.EmsBaseMonitorWorkUnitMapper;
|
||||||
|
import com.os.ems.base.domain.EmsBaseMonitorWorkUnit;
|
||||||
|
import com.os.ems.base.service.IEmsBaseMonitorWorkUnitService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计计量信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-09
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class EmsBaseMonitorWorkUnitServiceImpl implements IEmsBaseMonitorWorkUnitService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private EmsBaseMonitorWorkUnitMapper emsBaseMonitorWorkUnitMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询统计计量信息
|
||||||
|
*
|
||||||
|
* @param objId 统计计量信息主键
|
||||||
|
* @return 统计计量信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EmsBaseMonitorWorkUnit selectEmsBaseMonitorWorkUnitByObjId(Long objId)
|
||||||
|
{
|
||||||
|
return emsBaseMonitorWorkUnitMapper.selectEmsBaseMonitorWorkUnitByObjId(objId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询统计计量信息列表
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorWorkUnit 统计计量信息
|
||||||
|
* @return 统计计量信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<EmsBaseMonitorWorkUnit> selectEmsBaseMonitorWorkUnitList(EmsBaseMonitorWorkUnit emsBaseMonitorWorkUnit)
|
||||||
|
{
|
||||||
|
emsBaseMonitorWorkUnit.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return emsBaseMonitorWorkUnitMapper.selectEmsBaseMonitorWorkUnitList(emsBaseMonitorWorkUnit);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增统计计量信息
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorWorkUnit 统计计量信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertEmsBaseMonitorWorkUnit(EmsBaseMonitorWorkUnit emsBaseMonitorWorkUnit)
|
||||||
|
{
|
||||||
|
emsBaseMonitorWorkUnit.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return emsBaseMonitorWorkUnitMapper.insertEmsBaseMonitorWorkUnit(emsBaseMonitorWorkUnit);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改统计计量信息
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorWorkUnit 统计计量信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateEmsBaseMonitorWorkUnit(EmsBaseMonitorWorkUnit emsBaseMonitorWorkUnit)
|
||||||
|
{
|
||||||
|
return emsBaseMonitorWorkUnitMapper.updateEmsBaseMonitorWorkUnit(emsBaseMonitorWorkUnit);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除统计计量信息
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的统计计量信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteEmsBaseMonitorWorkUnitByObjIds(Long[] objIds)
|
||||||
|
{
|
||||||
|
return emsBaseMonitorWorkUnitMapper.deleteEmsBaseMonitorWorkUnitByObjIds(objIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除统计计量信息信息
|
||||||
|
*
|
||||||
|
* @param objId 统计计量信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteEmsBaseMonitorWorkUnitByObjId(Long objId)
|
||||||
|
{
|
||||||
|
return emsBaseMonitorWorkUnitMapper.deleteEmsBaseMonitorWorkUnitByObjId(objId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,177 @@
|
|||||||
|
package com.os.ems.base.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.os.common.utils.DateUtils;
|
||||||
|
import com.os.common.utils.StringUtils;
|
||||||
|
import com.os.ems.base.domain.TreeSelects;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.os.ems.base.mapper.EmsBaseWorkUnitMapper;
|
||||||
|
import com.os.ems.base.domain.EmsBaseWorkUnit;
|
||||||
|
import com.os.ems.base.service.IEmsBaseWorkUnitService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计单元信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-09
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class EmsBaseWorkUnitServiceImpl implements IEmsBaseWorkUnitService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private EmsBaseWorkUnitMapper emsBaseWorkUnitMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询统计单元信息
|
||||||
|
*
|
||||||
|
* @param objId 统计单元信息主键
|
||||||
|
* @return 统计单元信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EmsBaseWorkUnit selectEmsBaseWorkUnitByObjId(Long objId)
|
||||||
|
{
|
||||||
|
return emsBaseWorkUnitMapper.selectEmsBaseWorkUnitByObjId(objId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询统计单元信息列表
|
||||||
|
*
|
||||||
|
* @param emsBaseWorkUnit 统计单元信息
|
||||||
|
* @return 统计单元信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<EmsBaseWorkUnit> selectEmsBaseWorkUnitList(EmsBaseWorkUnit emsBaseWorkUnit)
|
||||||
|
{
|
||||||
|
return emsBaseWorkUnitMapper.selectEmsBaseWorkUnitList(emsBaseWorkUnit);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增统计单元信息
|
||||||
|
*
|
||||||
|
* @param emsBaseWorkUnit 统计单元信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertEmsBaseWorkUnit(EmsBaseWorkUnit emsBaseWorkUnit)
|
||||||
|
{
|
||||||
|
emsBaseWorkUnit.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return emsBaseWorkUnitMapper.insertEmsBaseWorkUnit(emsBaseWorkUnit);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改统计单元信息
|
||||||
|
*
|
||||||
|
* @param emsBaseWorkUnit 统计单元信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateEmsBaseWorkUnit(EmsBaseWorkUnit emsBaseWorkUnit)
|
||||||
|
{
|
||||||
|
emsBaseWorkUnit.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return emsBaseWorkUnitMapper.updateEmsBaseWorkUnit(emsBaseWorkUnit);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除统计单元信息
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的统计单元信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteEmsBaseWorkUnitByObjIds(Long[] objIds)
|
||||||
|
{
|
||||||
|
return emsBaseWorkUnitMapper.deleteEmsBaseWorkUnitByObjIds(objIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除统计单元信息信息
|
||||||
|
*
|
||||||
|
* @param objId 统计单元信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteEmsBaseWorkUnitByObjId(Long objId)
|
||||||
|
{
|
||||||
|
return emsBaseWorkUnitMapper.deleteEmsBaseWorkUnitByObjId(objId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TreeSelects> selectBaseWorkUnitTreeList(EmsBaseWorkUnit baseWorkUnit) {
|
||||||
|
List<EmsBaseWorkUnit> baseWorkUnits = selectEmsBaseWorkUnitList(baseWorkUnit);
|
||||||
|
return buildWorkUnitTreeSelect(baseWorkUnits);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TreeSelects> buildWorkUnitTreeSelect(List<EmsBaseWorkUnit> baseWorkUnits) {
|
||||||
|
List<EmsBaseWorkUnit> baseWorkUnitsTrees = buildWorkUnitTree(baseWorkUnits);
|
||||||
|
return baseWorkUnitsTrees.stream().map(TreeSelects::new).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmsBaseWorkUnit> buildWorkUnitTree(List<EmsBaseWorkUnit> baseWorkUnits) {
|
||||||
|
List<EmsBaseWorkUnit> returnList = new ArrayList<EmsBaseWorkUnit>();
|
||||||
|
List<Long> tempList = baseWorkUnits.stream().map(EmsBaseWorkUnit::getObjId).collect(Collectors.toList());
|
||||||
|
for (EmsBaseWorkUnit baseWorkUnit : baseWorkUnits)
|
||||||
|
{
|
||||||
|
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||||
|
if (!tempList.contains(baseWorkUnit.getParentId()))
|
||||||
|
{
|
||||||
|
recursionFn(baseWorkUnits, baseWorkUnit);
|
||||||
|
returnList.add(baseWorkUnit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (returnList.isEmpty())
|
||||||
|
{
|
||||||
|
returnList = baseWorkUnits;
|
||||||
|
}
|
||||||
|
return returnList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归列表
|
||||||
|
*/
|
||||||
|
private void recursionFn(List<EmsBaseWorkUnit> list, EmsBaseWorkUnit t)
|
||||||
|
{
|
||||||
|
// 得到子节点列表
|
||||||
|
List<EmsBaseWorkUnit> childList = getChildList(list, t);
|
||||||
|
t.setChildren(childList);
|
||||||
|
for (EmsBaseWorkUnit tChild : childList)
|
||||||
|
{
|
||||||
|
if (hasChild(list, tChild))
|
||||||
|
{
|
||||||
|
recursionFn(list, tChild);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 得到子节点列表
|
||||||
|
*/
|
||||||
|
private List<EmsBaseWorkUnit> getChildList(List<EmsBaseWorkUnit> list, EmsBaseWorkUnit t)
|
||||||
|
{
|
||||||
|
List<EmsBaseWorkUnit> tlist = new ArrayList<EmsBaseWorkUnit>();
|
||||||
|
Iterator<EmsBaseWorkUnit> it = list.iterator();
|
||||||
|
while (it.hasNext())
|
||||||
|
{
|
||||||
|
EmsBaseWorkUnit n = (EmsBaseWorkUnit) it.next();
|
||||||
|
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getObjId().longValue())
|
||||||
|
{
|
||||||
|
tlist.add(n);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tlist;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否有子节点
|
||||||
|
*/
|
||||||
|
private boolean hasChild(List<EmsBaseWorkUnit> list, EmsBaseWorkUnit t)
|
||||||
|
{
|
||||||
|
return getChildList(list, t).size() > 0;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,133 @@
|
|||||||
|
<?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.ems.base.mapper.EmsBaseMonitorWorkUnitMapper">
|
||||||
|
|
||||||
|
<resultMap type="EmsBaseMonitorWorkUnit" id="EmsBaseMonitorWorkUnitResult">
|
||||||
|
<result property="objId" column="obj_id"/>
|
||||||
|
<result property="monitorCode" column="monitor_code"/>
|
||||||
|
<result property="monitorName" column="monitor_code"/>
|
||||||
|
<result property="workUnitCode" column="work_unit_code"/>
|
||||||
|
<result property="workUnitName" column="work_unit_name"/>
|
||||||
|
<result property="monitorStatus" column="monitor_status"/>
|
||||||
|
<result property="monitorType" column="monitor_type"/>
|
||||||
|
<result property="formulaMode" column="formula_mode"/>
|
||||||
|
<result property="proportion" column="proportion"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="isFlag" column="is_flag"/>
|
||||||
|
<result property="createdBy" column="created_by"/>
|
||||||
|
<result property="createdTime" column="created_time"/>
|
||||||
|
<result property="updatedBy" column="updated_by"/>
|
||||||
|
<result property="updatedTime" column="updated_time"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectEmsBaseMonitorWorkUnitVo">
|
||||||
|
select ebmwu.obj_id,
|
||||||
|
ebmwu.monitor_code,
|
||||||
|
ebmi.monitor_name,
|
||||||
|
ebmwu.work_unit_code,
|
||||||
|
ebwu.work_unit_name,
|
||||||
|
ebmwu.monitor_status,
|
||||||
|
ebmwu.monitor_type,
|
||||||
|
ebmwu.formula_mode,
|
||||||
|
ebmwu.proportion,
|
||||||
|
ebmwu.remark,
|
||||||
|
ebmwu.is_flag,
|
||||||
|
ebmwu.created_by,
|
||||||
|
ebmwu.created_time,
|
||||||
|
ebmwu.updated_by,
|
||||||
|
ebmwu.updated_time
|
||||||
|
from ems_base_monitor_work_unit ebmwu
|
||||||
|
left join ems_base_monitor_info ebmi on ebmi.monitor_code = ebmwu.monitor_code
|
||||||
|
left join ems_base_work_unit ebwu on ebwu.work_unit_code = ebmwu.work_unit_code
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectEmsBaseMonitorWorkUnitList" parameterType="EmsBaseMonitorWorkUnit"
|
||||||
|
resultMap="EmsBaseMonitorWorkUnitResult">
|
||||||
|
<include refid="selectEmsBaseMonitorWorkUnitVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="monitorCode != null and monitorCode != ''">and ebmwu.monitor_code = #{monitorCode}</if>
|
||||||
|
<if test="workUnitCode != null and workUnitCode != ''">and ebmwu.work_unit_code = #{workUnitCode}</if>
|
||||||
|
<if test="monitorStatus != null ">and ebmwu.monitor_status = #{monitorStatus}</if>
|
||||||
|
<if test="monitorType != null ">and ebmwu.monitor_type = #{monitorType}</if>
|
||||||
|
<if test="formulaMode != null ">and ebmwu.formula_mode = #{formulaMode}</if>
|
||||||
|
<if test="proportion != null ">and ebmwu.proportion = #{proportion}</if>
|
||||||
|
<if test="isFlag != null and isFlag != ''">and ebmwu.is_flag = #{isFlag}</if>
|
||||||
|
<if test="createdBy != null and createdBy != ''">and ebmwu.created_by = #{createdBy}</if>
|
||||||
|
<if test="createdTime != null ">and ebmwu.created_time = #{createdTime}</if>
|
||||||
|
<if test="updatedBy != null and updatedBy != ''">and ebmwu.updated_by = #{updatedBy}</if>
|
||||||
|
<if test="updatedTime != null ">and ebmwu.updated_time = #{updatedTime}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectEmsBaseMonitorWorkUnitByObjId" parameterType="Long" resultMap="EmsBaseMonitorWorkUnitResult">
|
||||||
|
<include refid="selectEmsBaseMonitorWorkUnitVo"/>
|
||||||
|
where ebmwu.obj_id = #{objId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertEmsBaseMonitorWorkUnit" parameterType="EmsBaseMonitorWorkUnit" useGeneratedKeys="true"
|
||||||
|
keyProperty="objId">
|
||||||
|
insert into ems_base_monitor_work_unit
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="monitorCode != null and monitorCode != ''">monitor_code,</if>
|
||||||
|
<if test="workUnitCode != null">work_unit_code,</if>
|
||||||
|
<if test="monitorStatus != null">monitor_status,</if>
|
||||||
|
<if test="monitorType != null">monitor_type,</if>
|
||||||
|
<if test="formulaMode != null">formula_mode,</if>
|
||||||
|
<if test="proportion != null">proportion,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="isFlag != null">is_flag,</if>
|
||||||
|
<if test="createdBy != null">created_by,</if>
|
||||||
|
<if test="createdTime != null">created_time,</if>
|
||||||
|
<if test="updatedBy != null">updated_by,</if>
|
||||||
|
<if test="updatedTime != null">updated_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="monitorCode != null and monitorCode != ''">#{monitorCode},</if>
|
||||||
|
<if test="workUnitCode != null">#{workUnitCode},</if>
|
||||||
|
<if test="monitorStatus != null">#{monitorStatus},</if>
|
||||||
|
<if test="monitorType != null">#{monitorType},</if>
|
||||||
|
<if test="formulaMode != null">#{formulaMode},</if>
|
||||||
|
<if test="proportion != null">#{proportion},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="isFlag != null">#{isFlag},</if>
|
||||||
|
<if test="createdBy != null">#{createdBy},</if>
|
||||||
|
<if test="createdTime != null">#{createdTime},</if>
|
||||||
|
<if test="updatedBy != null">#{updatedBy},</if>
|
||||||
|
<if test="updatedTime != null">#{updatedTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateEmsBaseMonitorWorkUnit" parameterType="EmsBaseMonitorWorkUnit">
|
||||||
|
update ems_base_monitor_work_unit
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="monitorCode != null and monitorCode != ''">monitor_code = #{monitorCode},</if>
|
||||||
|
<if test="workUnitCode != null">work_unit_code = #{workUnitCode},</if>
|
||||||
|
<if test="monitorStatus != null">monitor_status = #{monitorStatus},</if>
|
||||||
|
<if test="monitorType != null">monitor_type = #{monitorType},</if>
|
||||||
|
<if test="formulaMode != null">formula_mode = #{formulaMode},</if>
|
||||||
|
<if test="proportion != null">proportion = #{proportion},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
||||||
|
<if test="createdBy != null">created_by = #{createdBy},</if>
|
||||||
|
<if test="createdTime != null">created_time = #{createdTime},</if>
|
||||||
|
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
||||||
|
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
||||||
|
</trim>
|
||||||
|
where obj_id = #{objId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteEmsBaseMonitorWorkUnitByObjId" parameterType="Long">
|
||||||
|
delete
|
||||||
|
from ems_base_monitor_work_unit
|
||||||
|
where obj_id = #{objId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteEmsBaseMonitorWorkUnitByObjIds" parameterType="String">
|
||||||
|
delete from ems_base_monitor_work_unit where obj_id in
|
||||||
|
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{objId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,116 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.os.ems.base.mapper.EmsBaseWorkUnitMapper">
|
||||||
|
|
||||||
|
<resultMap type="EmsBaseWorkUnit" id="EmsBaseWorkUnitResult">
|
||||||
|
<result property="objId" column="obj_id" />
|
||||||
|
<result property="workUnitCode" column="work_unit_code" />
|
||||||
|
<result property="parentId" column="parent_id" />
|
||||||
|
<result property="workUnitName" column="work_unit_name" />
|
||||||
|
<result property="workUnitAddress" column="work_unit_address" />
|
||||||
|
<result property="ancestors" column="ancestors" />
|
||||||
|
<result property="workUnitSort" column="work_unit_sort" />
|
||||||
|
<result property="productLineCode" column="product_line_code" />
|
||||||
|
<result property="workUnitType" column="work_unit_type" />
|
||||||
|
<result property="isFlag" column="is_flag" />
|
||||||
|
<result property="createdBy" column="created_by" />
|
||||||
|
<result property="createdTime" column="created_time" />
|
||||||
|
<result property="updatedBy" column="updated_by" />
|
||||||
|
<result property="updatedTime" column="updated_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectEmsBaseWorkUnitVo">
|
||||||
|
select obj_id, work_unit_code, parent_id, work_unit_name, work_unit_address, ancestors, work_unit_sort, product_line_code, work_unit_type, is_flag, created_by, created_time, updated_by, updated_time from ems_base_work_unit
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectEmsBaseWorkUnitList" parameterType="EmsBaseWorkUnit" resultMap="EmsBaseWorkUnitResult">
|
||||||
|
<include refid="selectEmsBaseWorkUnitVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="workUnitCode != null and workUnitCode != ''"> and work_unit_code = #{workUnitCode}</if>
|
||||||
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
||||||
|
<if test="workUnitName != null and workUnitName != ''"> and work_unit_name like concat('%', #{workUnitName}, '%')</if>
|
||||||
|
<if test="workUnitAddress != null and workUnitAddress != ''"> and work_unit_address = #{workUnitAddress}</if>
|
||||||
|
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
|
||||||
|
<if test="workUnitSort != null "> and work_unit_sort = #{workUnitSort}</if>
|
||||||
|
<if test="productLineCode != null and productLineCode != ''"> and product_line_code = #{productLineCode}</if>
|
||||||
|
<if test="workUnitType != null "> and work_unit_type = #{workUnitType}</if>
|
||||||
|
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
|
||||||
|
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
|
||||||
|
<if test="createdTime != null "> and created_time = #{createdTime}</if>
|
||||||
|
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
|
||||||
|
<if test="updatedTime != null "> and updated_time = #{updatedTime}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectEmsBaseWorkUnitByObjId" parameterType="Long" resultMap="EmsBaseWorkUnitResult">
|
||||||
|
<include refid="selectEmsBaseWorkUnitVo"/>
|
||||||
|
where obj_id = #{objId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertEmsBaseWorkUnit" parameterType="EmsBaseWorkUnit" useGeneratedKeys="true" keyProperty="objId">
|
||||||
|
insert into ems_base_work_unit
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="workUnitCode != null and workUnitCode != ''">work_unit_code,</if>
|
||||||
|
<if test="parentId != null">parent_id,</if>
|
||||||
|
<if test="workUnitName != null">work_unit_name,</if>
|
||||||
|
<if test="workUnitAddress != null">work_unit_address,</if>
|
||||||
|
<if test="ancestors != null">ancestors,</if>
|
||||||
|
<if test="workUnitSort != null">work_unit_sort,</if>
|
||||||
|
<if test="productLineCode != null">product_line_code,</if>
|
||||||
|
<if test="workUnitType != null">work_unit_type,</if>
|
||||||
|
<if test="isFlag != null">is_flag,</if>
|
||||||
|
<if test="createdBy != null">created_by,</if>
|
||||||
|
<if test="createdTime != null">created_time,</if>
|
||||||
|
<if test="updatedBy != null">updated_by,</if>
|
||||||
|
<if test="updatedTime != null">updated_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="workUnitCode != null and workUnitCode != ''">#{workUnitCode},</if>
|
||||||
|
<if test="parentId != null">#{parentId},</if>
|
||||||
|
<if test="workUnitName != null">#{workUnitName},</if>
|
||||||
|
<if test="workUnitAddress != null">#{workUnitAddress},</if>
|
||||||
|
<if test="ancestors != null">#{ancestors},</if>
|
||||||
|
<if test="workUnitSort != null">#{workUnitSort},</if>
|
||||||
|
<if test="productLineCode != null">#{productLineCode},</if>
|
||||||
|
<if test="workUnitType != null">#{workUnitType},</if>
|
||||||
|
<if test="isFlag != null">#{isFlag},</if>
|
||||||
|
<if test="createdBy != null">#{createdBy},</if>
|
||||||
|
<if test="createdTime != null">#{createdTime},</if>
|
||||||
|
<if test="updatedBy != null">#{updatedBy},</if>
|
||||||
|
<if test="updatedTime != null">#{updatedTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateEmsBaseWorkUnit" parameterType="EmsBaseWorkUnit">
|
||||||
|
update ems_base_work_unit
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="workUnitCode != null and workUnitCode != ''">work_unit_code = #{workUnitCode},</if>
|
||||||
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||||
|
<if test="workUnitName != null">work_unit_name = #{workUnitName},</if>
|
||||||
|
<if test="workUnitAddress != null">work_unit_address = #{workUnitAddress},</if>
|
||||||
|
<if test="ancestors != null">ancestors = #{ancestors},</if>
|
||||||
|
<if test="workUnitSort != null">work_unit_sort = #{workUnitSort},</if>
|
||||||
|
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
|
||||||
|
<if test="workUnitType != null">work_unit_type = #{workUnitType},</if>
|
||||||
|
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
||||||
|
<if test="createdBy != null">created_by = #{createdBy},</if>
|
||||||
|
<if test="createdTime != null">created_time = #{createdTime},</if>
|
||||||
|
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
||||||
|
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
||||||
|
</trim>
|
||||||
|
where obj_id = #{objId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteEmsBaseWorkUnitByObjId" parameterType="Long">
|
||||||
|
delete from ems_base_work_unit where obj_id = #{objId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteEmsBaseWorkUnitByObjIds" parameterType="String">
|
||||||
|
delete from ems_base_work_unit where obj_id in
|
||||||
|
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{objId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue