统计计量信息/统计单元信息/获取数据修改
parent
c7b35364d7
commit
403a9daec7
@ -0,0 +1,58 @@
|
||||
package com.aucma.api.domain.vo;
|
||||
|
||||
import com.aucma.api.domain.dto.WERKSDto;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料主数据
|
||||
*
|
||||
* @Author YinQ
|
||||
* @create 2023-09-27 13:37
|
||||
*/
|
||||
public class SAPResultOrderInfoVo {
|
||||
|
||||
@JsonProperty(value = "O_TAB")
|
||||
private HashMap<String, List<HashMap<String, String>>> O_TAB;
|
||||
|
||||
@JsonProperty(value = "WERKS")
|
||||
private WERKSDto WERKS;
|
||||
|
||||
@JsonProperty(value = "O_RETURN")
|
||||
private WERKSDto O_RETURN;
|
||||
|
||||
public HashMap<String, List<HashMap<String, String>>> getO_TAB() {
|
||||
return O_TAB;
|
||||
}
|
||||
|
||||
public void setO_TAB(HashMap<String, List<HashMap<String, String>>> o_TAB) {
|
||||
O_TAB = o_TAB;
|
||||
}
|
||||
|
||||
public WERKSDto getWERKS() {
|
||||
return WERKS;
|
||||
}
|
||||
|
||||
public void setWERKS(WERKSDto WERKS) {
|
||||
this.WERKS = WERKS;
|
||||
}
|
||||
|
||||
public WERKSDto getO_RETURN() {
|
||||
return O_RETURN;
|
||||
}
|
||||
|
||||
public void setO_RETURN(WERKSDto o_RETURN) {
|
||||
O_RETURN = o_RETURN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SAPResultVo{" +
|
||||
"O_TAB=" + O_TAB +
|
||||
", WERKS='" + WERKS + '\'' +
|
||||
", O_RETURN=" + O_RETURN +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package com.aucma.base.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.aucma.common.utils.DateUtils;
|
||||
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.aucma.common.annotation.Log;
|
||||
import com.aucma.common.core.controller.BaseController;
|
||||
import com.aucma.common.core.domain.AjaxResult;
|
||||
import com.aucma.common.enums.BusinessType;
|
||||
import com.aucma.base.domain.BaseMonitorWorkUnit;
|
||||
import com.aucma.base.service.IBaseMonitorWorkUnitService;
|
||||
import com.aucma.common.utils.poi.ExcelUtil;
|
||||
import com.aucma.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 统计计量信息Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-10-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/monitorWorkUnit" )
|
||||
public class BaseMonitorWorkUnitController extends BaseController {
|
||||
@Autowired
|
||||
private IBaseMonitorWorkUnitService baseMonitorWorkUnitService;
|
||||
|
||||
/**
|
||||
* 查询统计计量信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:monitorWorkUnit:list')" )
|
||||
@GetMapping("/list" )
|
||||
public TableDataInfo list(BaseMonitorWorkUnit baseMonitorWorkUnit) {
|
||||
startPage();
|
||||
List<BaseMonitorWorkUnit> list = baseMonitorWorkUnitService.selectBaseMonitorWorkUnitList(baseMonitorWorkUnit);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出统计计量信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:monitorWorkUnit:export')" )
|
||||
@Log(title = "统计计量信息" , businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export" )
|
||||
public void export(HttpServletResponse response, BaseMonitorWorkUnit baseMonitorWorkUnit) {
|
||||
List<BaseMonitorWorkUnit> list = baseMonitorWorkUnitService.selectBaseMonitorWorkUnitList(baseMonitorWorkUnit);
|
||||
ExcelUtil<BaseMonitorWorkUnit> util = new ExcelUtil<BaseMonitorWorkUnit>(BaseMonitorWorkUnit. class);
|
||||
util.exportExcel(response, list, "统计计量信息数据" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取统计计量信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:monitorWorkUnit:query')" )
|
||||
@GetMapping(value = "/{objId}" )
|
||||
public AjaxResult getInfo(@PathVariable("objId" ) Long objId) {
|
||||
return success(baseMonitorWorkUnitService.selectBaseMonitorWorkUnitByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增统计计量信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:monitorWorkUnit:add')" )
|
||||
@Log(title = "统计计量信息" , businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseMonitorWorkUnit baseMonitorWorkUnit) {
|
||||
baseMonitorWorkUnit.setCreatedBy(getUsername());
|
||||
baseMonitorWorkUnit.setCreatedTime(DateUtils.getNowDate());
|
||||
return toAjax(baseMonitorWorkUnitService.insertBaseMonitorWorkUnit(baseMonitorWorkUnit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改统计计量信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:monitorWorkUnit:edit')" )
|
||||
@Log(title = "统计计量信息" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseMonitorWorkUnit baseMonitorWorkUnit) {
|
||||
baseMonitorWorkUnit.setUpdatedBy(getUsername());
|
||||
baseMonitorWorkUnit.setUpdatedTime(DateUtils.getNowDate());
|
||||
return toAjax(baseMonitorWorkUnitService.updateBaseMonitorWorkUnit(baseMonitorWorkUnit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除统计计量信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:monitorWorkUnit:remove')" )
|
||||
@Log(title = "统计计量信息" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}" )
|
||||
public AjaxResult remove(@PathVariable Long[] objIds) {
|
||||
return toAjax(baseMonitorWorkUnitService.deleteBaseMonitorWorkUnitByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
package com.aucma.base.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.aucma.base.domain.BaseMonitorInfo;
|
||||
import com.aucma.base.domain.TreeSelects;
|
||||
import com.aucma.common.utils.DateUtils;
|
||||
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.aucma.common.annotation.Log;
|
||||
import com.aucma.common.core.controller.BaseController;
|
||||
import com.aucma.common.core.domain.AjaxResult;
|
||||
import com.aucma.common.enums.BusinessType;
|
||||
import com.aucma.base.domain.BaseWorkUnit;
|
||||
import com.aucma.base.service.IBaseWorkUnitService;
|
||||
import com.aucma.common.utils.poi.ExcelUtil;
|
||||
|
||||
/**
|
||||
* 统计单元信息Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-10-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/workUnit" )
|
||||
public class BaseWorkUnitController extends BaseController {
|
||||
@Autowired
|
||||
private IBaseWorkUnitService baseWorkUnitService;
|
||||
|
||||
/**
|
||||
* 查询统计单元信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:workUnit:list')" )
|
||||
@GetMapping("/list" )
|
||||
public AjaxResult list(BaseWorkUnit baseWorkUnit) {
|
||||
List<BaseWorkUnit> list = baseWorkUnitService.selectBaseWorkUnitList(baseWorkUnit);
|
||||
return success(list);
|
||||
}
|
||||
/**
|
||||
* 查询计量设备信息下拉树结构
|
||||
* */
|
||||
@PostMapping("/workUnitTree")
|
||||
public AjaxResult getMonitorInfoTree(BaseWorkUnit baseWorkUnit) {
|
||||
List<TreeSelects> list = baseWorkUnitService.selectBaseWorkUnitTreeList(baseWorkUnit);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出统计单元信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:workUnit:export')" )
|
||||
@Log(title = "统计单元信息" , businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export" )
|
||||
public void export(HttpServletResponse response, BaseWorkUnit baseWorkUnit) {
|
||||
List<BaseWorkUnit> list = baseWorkUnitService.selectBaseWorkUnitList(baseWorkUnit);
|
||||
ExcelUtil<BaseWorkUnit> util = new ExcelUtil<BaseWorkUnit>(BaseWorkUnit. class);
|
||||
util.exportExcel(response, list, "统计单元信息数据" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取统计单元信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:workUnit:query')" )
|
||||
@GetMapping(value = "/{objId}" )
|
||||
public AjaxResult getInfo(@PathVariable("objId" ) Long objId) {
|
||||
return success(baseWorkUnitService.selectBaseWorkUnitByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增统计单元信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:workUnit:add')" )
|
||||
@Log(title = "统计单元信息" , businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseWorkUnit baseWorkUnit) {
|
||||
baseWorkUnit.setCreatedBy(getUsername());
|
||||
baseWorkUnit.setCreatedTime(DateUtils.getNowDate());
|
||||
return toAjax(baseWorkUnitService.insertBaseWorkUnit(baseWorkUnit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改统计单元信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:workUnit:edit')" )
|
||||
@Log(title = "统计单元信息" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseWorkUnit baseWorkUnit) {
|
||||
baseWorkUnit.setUpdatedBy(getUsername());
|
||||
baseWorkUnit.setUpdatedTime(DateUtils.getNowDate());
|
||||
return toAjax(baseWorkUnitService.updateBaseWorkUnit(baseWorkUnit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除统计单元信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('base:workUnit:remove')" )
|
||||
@Log(title = "统计单元信息" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}" )
|
||||
public AjaxResult remove(@PathVariable Long[] objIds) {
|
||||
return toAjax(baseWorkUnitService.deleteBaseWorkUnitByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,251 @@
|
||||
package com.aucma.base.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.aucma.common.core.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.aucma.common.annotation.Excel;
|
||||
import com.aucma.common.core.domain.TreeEntity;
|
||||
|
||||
/**
|
||||
* 统计单元信息对象 base_work_unit
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-10-12
|
||||
*/
|
||||
public class BaseWorkUnit extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/** 主键标识 */
|
||||
@Excel(name = "主键标识")
|
||||
private Long objId;
|
||||
|
||||
/** 统计单元编号 */
|
||||
@Excel(name = "统计单元编号")
|
||||
private String workUnitCode;
|
||||
|
||||
/** 统计单元名称 */
|
||||
@Excel(name = "统计单元名称")
|
||||
private String workUnitName;
|
||||
|
||||
/** 统计区域 */
|
||||
@Excel(name = "统计区域")
|
||||
private String workUnitAddress;
|
||||
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
private Long workUnitSort;
|
||||
|
||||
/** 产线/工位 */
|
||||
@Excel(name = "产线/工位")
|
||||
private String productLineCode;
|
||||
|
||||
/** 统计单元类型 */
|
||||
@Excel(name = "统计单元类型")
|
||||
private Long workUnitType;
|
||||
|
||||
/** 启用标识 */
|
||||
@Excel(name = "启用标识")
|
||||
private Long isFlag;
|
||||
|
||||
/** 创建人 */
|
||||
@Excel(name = "创建人")
|
||||
private String createdBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdTime;
|
||||
|
||||
/** 更新人 */
|
||||
@Excel(name = "更新人")
|
||||
private String updatedBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedTime;
|
||||
private List<BaseWorkUnit> children = new ArrayList<BaseWorkUnit>();
|
||||
|
||||
private String parentName;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
private Integer orderNum;
|
||||
|
||||
private String ancestors;
|
||||
|
||||
public List<BaseWorkUnit> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<BaseWorkUnit> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public String getParentName() {
|
||||
return parentName;
|
||||
}
|
||||
|
||||
public void setParentName(String parentName) {
|
||||
this.parentName = parentName;
|
||||
}
|
||||
|
||||
public Long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public Integer getOrderNum() {
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(Integer orderNum) {
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
public String getAncestors() {
|
||||
return ancestors;
|
||||
}
|
||||
|
||||
public void setAncestors(String ancestors) {
|
||||
this.ancestors = ancestors;
|
||||
}
|
||||
|
||||
public void setObjId(Long objId)
|
||||
{
|
||||
this.objId = objId;
|
||||
}
|
||||
|
||||
public Long getObjId()
|
||||
{
|
||||
return objId;
|
||||
}
|
||||
public void setWorkUnitCode(String workUnitCode)
|
||||
{
|
||||
this.workUnitCode = workUnitCode;
|
||||
}
|
||||
|
||||
public String getWorkUnitCode()
|
||||
{
|
||||
return workUnitCode;
|
||||
}
|
||||
public void setWorkUnitName(String workUnitName)
|
||||
{
|
||||
this.workUnitName = workUnitName;
|
||||
}
|
||||
|
||||
public String getWorkUnitName()
|
||||
{
|
||||
return workUnitName;
|
||||
}
|
||||
public void setWorkUnitAddress(String workUnitAddress)
|
||||
{
|
||||
this.workUnitAddress = workUnitAddress;
|
||||
}
|
||||
|
||||
public String getWorkUnitAddress()
|
||||
{
|
||||
return workUnitAddress;
|
||||
}
|
||||
public void setWorkUnitSort(Long workUnitSort)
|
||||
{
|
||||
this.workUnitSort = workUnitSort;
|
||||
}
|
||||
|
||||
public Long getWorkUnitSort()
|
||||
{
|
||||
return workUnitSort;
|
||||
}
|
||||
public void setProductLineCode(String productLineCode)
|
||||
{
|
||||
this.productLineCode = productLineCode;
|
||||
}
|
||||
|
||||
public String getProductLineCode()
|
||||
{
|
||||
return productLineCode;
|
||||
}
|
||||
public void setWorkUnitType(Long workUnitType)
|
||||
{
|
||||
this.workUnitType = workUnitType;
|
||||
}
|
||||
|
||||
public Long getWorkUnitType()
|
||||
{
|
||||
return workUnitType;
|
||||
}
|
||||
public void setIsFlag(Long isFlag)
|
||||
{
|
||||
this.isFlag = isFlag;
|
||||
}
|
||||
|
||||
public Long getIsFlag()
|
||||
{
|
||||
return isFlag;
|
||||
}
|
||||
public void setCreatedBy(String createdBy)
|
||||
{
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public String getCreatedBy()
|
||||
{
|
||||
return createdBy;
|
||||
}
|
||||
public void setCreatedTime(Date createdTime)
|
||||
{
|
||||
this.createdTime = createdTime;
|
||||
}
|
||||
|
||||
public Date getCreatedTime()
|
||||
{
|
||||
return createdTime;
|
||||
}
|
||||
public void setUpdatedBy(String updatedBy)
|
||||
{
|
||||
this.updatedBy = updatedBy;
|
||||
}
|
||||
|
||||
public String getUpdatedBy()
|
||||
{
|
||||
return updatedBy;
|
||||
}
|
||||
public void setUpdatedTime(Date updatedTime)
|
||||
{
|
||||
this.updatedTime = updatedTime;
|
||||
}
|
||||
|
||||
public Date getUpdatedTime()
|
||||
{
|
||||
return updatedTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("objId",getObjId())
|
||||
.append("workUnitCode",getWorkUnitCode())
|
||||
.append("parentId",getParentId())
|
||||
.append("workUnitName",getWorkUnitName())
|
||||
.append("workUnitAddress",getWorkUnitAddress())
|
||||
.append("ancestors",getAncestors())
|
||||
.append("workUnitSort",getWorkUnitSort())
|
||||
.append("productLineCode",getProductLineCode())
|
||||
.append("workUnitType",getWorkUnitType())
|
||||
.append("isFlag",getIsFlag())
|
||||
.append("createdBy",getCreatedBy())
|
||||
.append("createdTime",getCreatedTime())
|
||||
.append("updatedBy",getUpdatedBy())
|
||||
.append("updatedTime",getUpdatedTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.aucma.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.base.domain.BaseMonitorWorkUnit;
|
||||
|
||||
/**
|
||||
* 统计计量信息Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-10-12
|
||||
*/
|
||||
public interface BaseMonitorWorkUnitMapper
|
||||
{
|
||||
/**
|
||||
* 查询统计计量信息
|
||||
*
|
||||
* @param objId 统计计量信息主键
|
||||
* @return 统计计量信息
|
||||
*/
|
||||
public BaseMonitorWorkUnit selectBaseMonitorWorkUnitByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询统计计量信息列表
|
||||
*
|
||||
* @param baseMonitorWorkUnit 统计计量信息
|
||||
* @return 统计计量信息集合
|
||||
*/
|
||||
public List<BaseMonitorWorkUnit> selectBaseMonitorWorkUnitList(BaseMonitorWorkUnit baseMonitorWorkUnit);
|
||||
|
||||
/**
|
||||
* 新增统计计量信息
|
||||
*
|
||||
* @param baseMonitorWorkUnit 统计计量信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseMonitorWorkUnit(BaseMonitorWorkUnit baseMonitorWorkUnit);
|
||||
|
||||
/**
|
||||
* 修改统计计量信息
|
||||
*
|
||||
* @param baseMonitorWorkUnit 统计计量信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseMonitorWorkUnit(BaseMonitorWorkUnit baseMonitorWorkUnit);
|
||||
|
||||
/**
|
||||
* 删除统计计量信息
|
||||
*
|
||||
* @param objId 统计计量信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseMonitorWorkUnitByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除统计计量信息
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseMonitorWorkUnitByObjIds(Long[] objIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.aucma.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.base.domain.BaseWorkUnit;
|
||||
|
||||
/**
|
||||
* 统计单元信息Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-10-12
|
||||
*/
|
||||
public interface BaseWorkUnitMapper
|
||||
{
|
||||
/**
|
||||
* 查询统计单元信息
|
||||
*
|
||||
* @param objId 统计单元信息主键
|
||||
* @return 统计单元信息
|
||||
*/
|
||||
public BaseWorkUnit selectBaseWorkUnitByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询统计单元信息列表
|
||||
*
|
||||
* @param baseWorkUnit 统计单元信息
|
||||
* @return 统计单元信息集合
|
||||
*/
|
||||
public List<BaseWorkUnit> selectBaseWorkUnitList(BaseWorkUnit baseWorkUnit);
|
||||
|
||||
/**
|
||||
* 新增统计单元信息
|
||||
*
|
||||
* @param baseWorkUnit 统计单元信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseWorkUnit(BaseWorkUnit baseWorkUnit);
|
||||
|
||||
/**
|
||||
* 修改统计单元信息
|
||||
*
|
||||
* @param baseWorkUnit 统计单元信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseWorkUnit(BaseWorkUnit baseWorkUnit);
|
||||
|
||||
/**
|
||||
* 删除统计单元信息
|
||||
*
|
||||
* @param objId 统计单元信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseWorkUnitByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除统计单元信息
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseWorkUnitByObjIds(Long[] objIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.aucma.base.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.base.domain.BaseMonitorWorkUnit;
|
||||
|
||||
/**
|
||||
* 统计计量信息Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-10-12
|
||||
*/
|
||||
public interface IBaseMonitorWorkUnitService
|
||||
{
|
||||
/**
|
||||
* 查询统计计量信息
|
||||
*
|
||||
* @param objId 统计计量信息主键
|
||||
* @return 统计计量信息
|
||||
*/
|
||||
public BaseMonitorWorkUnit selectBaseMonitorWorkUnitByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询统计计量信息列表
|
||||
*
|
||||
* @param baseMonitorWorkUnit 统计计量信息
|
||||
* @return 统计计量信息集合
|
||||
*/
|
||||
public List<BaseMonitorWorkUnit> selectBaseMonitorWorkUnitList(BaseMonitorWorkUnit baseMonitorWorkUnit);
|
||||
|
||||
/**
|
||||
* 新增统计计量信息
|
||||
*
|
||||
* @param baseMonitorWorkUnit 统计计量信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseMonitorWorkUnit(BaseMonitorWorkUnit baseMonitorWorkUnit);
|
||||
|
||||
/**
|
||||
* 修改统计计量信息
|
||||
*
|
||||
* @param baseMonitorWorkUnit 统计计量信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseMonitorWorkUnit(BaseMonitorWorkUnit baseMonitorWorkUnit);
|
||||
|
||||
/**
|
||||
* 批量删除统计计量信息
|
||||
*
|
||||
* @param objIds 需要删除的统计计量信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseMonitorWorkUnitByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除统计计量信息信息
|
||||
*
|
||||
* @param objId 统计计量信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseMonitorWorkUnitByObjId(Long objId);
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.aucma.base.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.aucma.base.domain.BaseMonitorInfo;
|
||||
import com.aucma.base.domain.BaseWorkUnit;
|
||||
import com.aucma.base.domain.TreeSelects;
|
||||
|
||||
/**
|
||||
* 统计单元信息Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-10-12
|
||||
*/
|
||||
public interface IBaseWorkUnitService
|
||||
{
|
||||
/**
|
||||
* 查询统计单元信息
|
||||
*
|
||||
* @param objId 统计单元信息主键
|
||||
* @return 统计单元信息
|
||||
*/
|
||||
public BaseWorkUnit selectBaseWorkUnitByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询统计单元信息列表
|
||||
*
|
||||
* @param baseWorkUnit 统计单元信息
|
||||
* @return 统计单元信息集合
|
||||
*/
|
||||
public List<BaseWorkUnit> selectBaseWorkUnitList(BaseWorkUnit baseWorkUnit);
|
||||
|
||||
/**
|
||||
* 新增统计单元信息
|
||||
*
|
||||
* @param baseWorkUnit 统计单元信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseWorkUnit(BaseWorkUnit baseWorkUnit);
|
||||
|
||||
/**
|
||||
* 修改统计单元信息
|
||||
*
|
||||
* @param baseWorkUnit 统计单元信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseWorkUnit(BaseWorkUnit baseWorkUnit);
|
||||
|
||||
/**
|
||||
* 批量删除统计单元信息
|
||||
*
|
||||
* @param objIds 需要删除的统计单元信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseWorkUnitByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除统计单元信息信息
|
||||
*
|
||||
* @param objId 统计单元信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseWorkUnitByObjId(Long objId);
|
||||
|
||||
List<TreeSelects> selectBaseWorkUnitTreeList(BaseWorkUnit baseWorkUnit);
|
||||
|
||||
public List<TreeSelects> buildWorkUnitTreeSelect(List<BaseWorkUnit> baseWorkUnits);
|
||||
|
||||
public List<BaseWorkUnit> buildWorkUnitTree(List<BaseWorkUnit> baseWorkUnits);
|
||||
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.aucma.base.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.aucma.base.mapper.BaseMonitorWorkUnitMapper;
|
||||
import com.aucma.base.domain.BaseMonitorWorkUnit;
|
||||
import com.aucma.base.service.IBaseMonitorWorkUnitService;
|
||||
|
||||
/**
|
||||
* 统计计量信息Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-10-12
|
||||
*/
|
||||
@Service
|
||||
public class BaseMonitorWorkUnitServiceImpl implements IBaseMonitorWorkUnitService
|
||||
{
|
||||
@Autowired
|
||||
private BaseMonitorWorkUnitMapper baseMonitorWorkUnitMapper;
|
||||
|
||||
/**
|
||||
* 查询统计计量信息
|
||||
*
|
||||
* @param objId 统计计量信息主键
|
||||
* @return 统计计量信息
|
||||
*/
|
||||
@Override
|
||||
public BaseMonitorWorkUnit selectBaseMonitorWorkUnitByObjId(Long objId)
|
||||
{
|
||||
return baseMonitorWorkUnitMapper.selectBaseMonitorWorkUnitByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询统计计量信息列表
|
||||
*
|
||||
* @param baseMonitorWorkUnit 统计计量信息
|
||||
* @return 统计计量信息
|
||||
*/
|
||||
@Override
|
||||
public List<BaseMonitorWorkUnit> selectBaseMonitorWorkUnitList(BaseMonitorWorkUnit baseMonitorWorkUnit)
|
||||
{
|
||||
return baseMonitorWorkUnitMapper.selectBaseMonitorWorkUnitList(baseMonitorWorkUnit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增统计计量信息
|
||||
*
|
||||
* @param baseMonitorWorkUnit 统计计量信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseMonitorWorkUnit(BaseMonitorWorkUnit baseMonitorWorkUnit)
|
||||
{
|
||||
return baseMonitorWorkUnitMapper.insertBaseMonitorWorkUnit(baseMonitorWorkUnit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改统计计量信息
|
||||
*
|
||||
* @param baseMonitorWorkUnit 统计计量信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseMonitorWorkUnit(BaseMonitorWorkUnit baseMonitorWorkUnit)
|
||||
{
|
||||
return baseMonitorWorkUnitMapper.updateBaseMonitorWorkUnit(baseMonitorWorkUnit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除统计计量信息
|
||||
*
|
||||
* @param objIds 需要删除的统计计量信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseMonitorWorkUnitByObjIds(Long[] objIds)
|
||||
{
|
||||
return baseMonitorWorkUnitMapper.deleteBaseMonitorWorkUnitByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除统计计量信息信息
|
||||
*
|
||||
* @param objId 统计计量信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseMonitorWorkUnitByObjId(Long objId)
|
||||
{
|
||||
return baseMonitorWorkUnitMapper.deleteBaseMonitorWorkUnitByObjId(objId);
|
||||
}
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
package com.aucma.base.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.aucma.base.domain.BaseMonitorInfo;
|
||||
import com.aucma.base.domain.TreeSelects;
|
||||
import com.aucma.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.aucma.base.mapper.BaseWorkUnitMapper;
|
||||
import com.aucma.base.domain.BaseWorkUnit;
|
||||
import com.aucma.base.service.IBaseWorkUnitService;
|
||||
|
||||
/**
|
||||
* 统计单元信息Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2023-10-12
|
||||
*/
|
||||
@Service
|
||||
public class BaseWorkUnitServiceImpl implements IBaseWorkUnitService
|
||||
{
|
||||
@Autowired
|
||||
private BaseWorkUnitMapper baseWorkUnitMapper;
|
||||
|
||||
/**
|
||||
* 查询统计单元信息
|
||||
*
|
||||
* @param objId 统计单元信息主键
|
||||
* @return 统计单元信息
|
||||
*/
|
||||
@Override
|
||||
public BaseWorkUnit selectBaseWorkUnitByObjId(Long objId)
|
||||
{
|
||||
return baseWorkUnitMapper.selectBaseWorkUnitByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询统计单元信息列表
|
||||
*
|
||||
* @param baseWorkUnit 统计单元信息
|
||||
* @return 统计单元信息
|
||||
*/
|
||||
@Override
|
||||
public List<BaseWorkUnit> selectBaseWorkUnitList(BaseWorkUnit baseWorkUnit)
|
||||
{
|
||||
return baseWorkUnitMapper.selectBaseWorkUnitList(baseWorkUnit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增统计单元信息
|
||||
*
|
||||
* @param baseWorkUnit 统计单元信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseWorkUnit(BaseWorkUnit baseWorkUnit)
|
||||
{
|
||||
return baseWorkUnitMapper.insertBaseWorkUnit(baseWorkUnit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改统计单元信息
|
||||
*
|
||||
* @param baseWorkUnit 统计单元信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseWorkUnit(BaseWorkUnit baseWorkUnit)
|
||||
{
|
||||
return baseWorkUnitMapper.updateBaseWorkUnit(baseWorkUnit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除统计单元信息
|
||||
*
|
||||
* @param objIds 需要删除的统计单元信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseWorkUnitByObjIds(Long[] objIds)
|
||||
{
|
||||
return baseWorkUnitMapper.deleteBaseWorkUnitByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除统计单元信息信息
|
||||
*
|
||||
* @param objId 统计单元信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseWorkUnitByObjId(Long objId)
|
||||
{
|
||||
return baseWorkUnitMapper.deleteBaseWorkUnitByObjId(objId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TreeSelects> selectBaseWorkUnitTreeList(BaseWorkUnit baseWorkUnit) {
|
||||
List<BaseWorkUnit> baseWorkUnits = selectBaseWorkUnitList(baseWorkUnit);
|
||||
return buildWorkUnitTreeSelect(baseWorkUnits);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TreeSelects> buildWorkUnitTreeSelect(List<BaseWorkUnit> baseWorkUnits) {
|
||||
List<BaseWorkUnit> baseWorkUnitsTrees = buildWorkUnitTree(baseWorkUnits);
|
||||
return baseWorkUnitsTrees.stream().map(TreeSelects::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BaseWorkUnit> buildWorkUnitTree(List<BaseWorkUnit> baseWorkUnits) {
|
||||
List<BaseWorkUnit> returnList = new ArrayList<BaseWorkUnit>();
|
||||
List<Long> tempList = baseWorkUnits.stream().map(BaseWorkUnit::getObjId).collect(Collectors.toList());
|
||||
for (BaseWorkUnit baseWorkUnit : baseWorkUnits)
|
||||
{
|
||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||
if (!tempList.contains(baseWorkUnit.getParentId()))
|
||||
{
|
||||
recursionFn(baseWorkUnits, baseWorkUnit);
|
||||
returnList.add(baseWorkUnit);
|
||||
}
|
||||
}
|
||||
if (returnList.isEmpty())
|
||||
{
|
||||
returnList = baseWorkUnits;
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
/**
|
||||
* 递归列表
|
||||
*/
|
||||
private void recursionFn(List<BaseWorkUnit> list, BaseWorkUnit t)
|
||||
{
|
||||
// 得到子节点列表
|
||||
List<BaseWorkUnit> childList = getChildList(list, t);
|
||||
t.setChildren(childList);
|
||||
for (BaseWorkUnit tChild : childList)
|
||||
{
|
||||
if (hasChild(list, tChild))
|
||||
{
|
||||
recursionFn(list, tChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 得到子节点列表
|
||||
*/
|
||||
private List<BaseWorkUnit> getChildList(List<BaseWorkUnit> list, BaseWorkUnit t)
|
||||
{
|
||||
List<BaseWorkUnit> tlist = new ArrayList<BaseWorkUnit>();
|
||||
Iterator<BaseWorkUnit> it = list.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
BaseWorkUnit n = (BaseWorkUnit) it.next();
|
||||
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getObjId().longValue())
|
||||
{
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
return tlist;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否有子节点
|
||||
*/
|
||||
private boolean hasChild(List<BaseWorkUnit> list, BaseWorkUnit t)
|
||||
{
|
||||
return getChildList(list, t).size() > 0;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
<?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.aucma.base.mapper.BaseMonitorWorkUnitMapper">
|
||||
|
||||
<resultMap type="BaseMonitorWorkUnit" id="BaseMonitorWorkUnitResult">
|
||||
<result property="objId" column="obj_id" />
|
||||
<result property="monitorCode" column="monitor_code" />
|
||||
<result property="workUnitCode" column="work_unit_code" />
|
||||
<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="selectBaseMonitorWorkUnitVo">
|
||||
select obj_id, monitor_code, work_unit_code, monitor_status, monitor_type, formula_mode, proportion, remark, is_flag, created_by, created_time, updated_by, updated_time from base_monitor_work_unit
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseMonitorWorkUnitList" parameterType="BaseMonitorWorkUnit" resultMap="BaseMonitorWorkUnitResult">
|
||||
<include refid="selectBaseMonitorWorkUnitVo"/>
|
||||
<where>
|
||||
<if test="objId != null "> and obj_id = #{objId}</if>
|
||||
<if test="monitorCode != null and monitorCode != ''"> and monitor_code = #{monitorCode}</if>
|
||||
<if test="workUnitCode != null and workUnitCode != ''"> and work_unit_code = #{workUnitCode}</if>
|
||||
<if test="monitorStatus != null "> and monitor_status = #{monitorStatus}</if>
|
||||
<if test="monitorType != null "> and monitor_type = #{monitorType}</if>
|
||||
<if test="formulaMode != null "> and formula_mode = #{formulaMode}</if>
|
||||
<if test="proportion != null "> and proportion = #{proportion}</if>
|
||||
<if test="isFlag != null "> 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="selectBaseMonitorWorkUnitByObjId" parameterType="Long" resultMap="BaseMonitorWorkUnitResult">
|
||||
<include refid="selectBaseMonitorWorkUnitVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseMonitorWorkUnit" parameterType="BaseMonitorWorkUnit">
|
||||
insert into base_monitor_work_unit
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="objId != null">obj_id,</if>
|
||||
<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="objId != null">#{objId},</if>
|
||||
<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="updateBaseMonitorWorkUnit" parameterType="BaseMonitorWorkUnit">
|
||||
update 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="deleteBaseMonitorWorkUnitByObjId" parameterType="Long">
|
||||
delete from base_monitor_work_unit where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseMonitorWorkUnitByObjIds" parameterType="String">
|
||||
delete from base_monitor_work_unit where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,122 @@
|
||||
<?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.aucma.base.mapper.BaseWorkUnitMapper">
|
||||
|
||||
<resultMap type="BaseWorkUnit" id="BaseWorkUnitResult">
|
||||
<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="selectBaseWorkUnitVo">
|
||||
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 base_work_unit
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseWorkUnitList" parameterType="BaseWorkUnit" resultMap="BaseWorkUnitResult">
|
||||
<include refid="selectBaseWorkUnitVo"/>
|
||||
<where>
|
||||
<if test="objId != null "> and obj_id = #{objId}</if>
|
||||
<if test="workUnitCode != null and workUnitCode != ''"> and work_unit_code = #{workUnitCode}</if>
|
||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
|
||||
<if test="workUnitName != null and workUnitName != ''"> and work_unit_name like concat(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 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="selectBaseWorkUnitByObjId" parameterType="Long" resultMap="BaseWorkUnitResult">
|
||||
<include refid="selectBaseWorkUnitVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseWorkUnit" parameterType="BaseWorkUnit">
|
||||
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
|
||||
SELECT seq_report_day_dnb.NEXTVAL as objId FROM DUAL
|
||||
</selectKey>
|
||||
insert into base_work_unit
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="objId != null">obj_id,</if>
|
||||
<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="objId != null">#{objId},</if>
|
||||
<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="updateBaseWorkUnit" parameterType="BaseWorkUnit">
|
||||
update 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="deleteBaseWorkUnitByObjId" parameterType="Long">
|
||||
delete from base_work_unit where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseWorkUnitByObjIds" parameterType="String">
|
||||
delete from base_work_unit where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue