工作站设置功能
This commit is contained in:
parent
2ad2dfa881
commit
dc2b7d4070
@ -0,0 +1,118 @@
|
||||
package com.ktg.mes.md.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
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.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.md.domain.MdWorkstation;
|
||||
import com.ktg.mes.md.service.IMdWorkstationService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 工作站Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/md/workstation")
|
||||
public class MdWorkstationController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMdWorkstationService mdWorkstationService;
|
||||
|
||||
/**
|
||||
* 查询工作站列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:workstation:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MdWorkstation mdWorkstation)
|
||||
{
|
||||
startPage();
|
||||
List<MdWorkstation> list = mdWorkstationService.selectMdWorkstationList(mdWorkstation);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出工作站列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:workstation:export')")
|
||||
@Log(title = "工作站", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MdWorkstation mdWorkstation)
|
||||
{
|
||||
List<MdWorkstation> list = mdWorkstationService.selectMdWorkstationList(mdWorkstation);
|
||||
ExcelUtil<MdWorkstation> util = new ExcelUtil<MdWorkstation>(MdWorkstation.class);
|
||||
util.exportExcel(response, list, "工作站数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工作站详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:workstation:query')")
|
||||
@GetMapping(value = "/{workstationId}")
|
||||
public AjaxResult getInfo(@PathVariable("workstationId") Long workstationId)
|
||||
{
|
||||
return AjaxResult.success(mdWorkstationService.selectMdWorkstationByWorkstationId(workstationId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工作站
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:workstation:add')")
|
||||
@Log(title = "工作站", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MdWorkstation mdWorkstation)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdWorkstationService.checkWorkStationCodeUnique(mdWorkstation))){
|
||||
return AjaxResult.error("工作站编码已存在!");
|
||||
}
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdWorkstationService.checkWorkStationNameUnique(mdWorkstation))){
|
||||
return AjaxResult.error("工作站名称已存在!");
|
||||
}
|
||||
return toAjax(mdWorkstationService.insertMdWorkstation(mdWorkstation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工作站
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:workstation:edit')")
|
||||
@Log(title = "工作站", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MdWorkstation mdWorkstation)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdWorkstationService.checkWorkStationCodeUnique(mdWorkstation))){
|
||||
return AjaxResult.error("工作站编码已存在!");
|
||||
}
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdWorkstationService.checkWorkStationNameUnique(mdWorkstation))){
|
||||
return AjaxResult.error("工作站名称已存在!");
|
||||
}
|
||||
return toAjax(mdWorkstationService.updateMdWorkstation(mdWorkstation));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工作站
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:workstation:remove')")
|
||||
@Log(title = "工作站", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{workstationIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] workstationIds)
|
||||
{
|
||||
return toAjax(mdWorkstationService.deleteMdWorkstationByWorkstationIds(workstationIds));
|
||||
}
|
||||
}
|
234
ktg-mes/src/main/java/com/ktg/mes/md/domain/MdWorkstation.java
Normal file
234
ktg-mes/src/main/java/com/ktg/mes/md/domain/MdWorkstation.java
Normal file
@ -0,0 +1,234 @@
|
||||
package com.ktg.mes.md.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 工作站对象 md_workstation
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-10
|
||||
*/
|
||||
public class MdWorkstation extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 工作站ID */
|
||||
private Long workstationId;
|
||||
|
||||
/** 工作站编码 */
|
||||
@Excel(name = "工作站编码")
|
||||
private String workstationCode;
|
||||
|
||||
/** 工作站名称 */
|
||||
@Excel(name = "工作站名称")
|
||||
private String workstationName;
|
||||
|
||||
/** 工作站地点 */
|
||||
@Excel(name = "工作站地点")
|
||||
private String workstationAddress;
|
||||
|
||||
/** 所在车间ID */
|
||||
@Excel(name = "所在车间ID")
|
||||
private Long workshopId;
|
||||
|
||||
/** 所在车间编码 */
|
||||
@Excel(name = "所在车间编码")
|
||||
private String workshopCode;
|
||||
|
||||
/** 所在车间名称 */
|
||||
@Excel(name = "所在车间名称")
|
||||
private String workshopName;
|
||||
|
||||
/** 工序ID */
|
||||
@Excel(name = "工序ID")
|
||||
private Long processId;
|
||||
|
||||
/** 工序编码 */
|
||||
@Excel(name = "工序编码")
|
||||
private String processCode;
|
||||
|
||||
/** 工序名称 */
|
||||
@Excel(name = "工序名称")
|
||||
private String processName;
|
||||
|
||||
/** 是否启用 */
|
||||
@Excel(name = "是否启用")
|
||||
private String enableFlag;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setWorkstationId(Long workstationId)
|
||||
{
|
||||
this.workstationId = workstationId;
|
||||
}
|
||||
|
||||
public Long getWorkstationId()
|
||||
{
|
||||
return workstationId;
|
||||
}
|
||||
public void setWorkstationCode(String workstationCode)
|
||||
{
|
||||
this.workstationCode = workstationCode;
|
||||
}
|
||||
|
||||
public String getWorkstationCode()
|
||||
{
|
||||
return workstationCode;
|
||||
}
|
||||
public void setWorkstationName(String workstationName)
|
||||
{
|
||||
this.workstationName = workstationName;
|
||||
}
|
||||
|
||||
public String getWorkstationName()
|
||||
{
|
||||
return workstationName;
|
||||
}
|
||||
public void setWorkstationAddress(String workstationAddress)
|
||||
{
|
||||
this.workstationAddress = workstationAddress;
|
||||
}
|
||||
|
||||
public String getWorkstationAddress()
|
||||
{
|
||||
return workstationAddress;
|
||||
}
|
||||
public void setWorkshopId(Long workshopId)
|
||||
{
|
||||
this.workshopId = workshopId;
|
||||
}
|
||||
|
||||
public Long getWorkshopId()
|
||||
{
|
||||
return workshopId;
|
||||
}
|
||||
public void setWorkshopCode(String workshopCode)
|
||||
{
|
||||
this.workshopCode = workshopCode;
|
||||
}
|
||||
|
||||
public String getWorkshopCode()
|
||||
{
|
||||
return workshopCode;
|
||||
}
|
||||
public void setWorkshopName(String workshopName)
|
||||
{
|
||||
this.workshopName = workshopName;
|
||||
}
|
||||
|
||||
public String getWorkshopName()
|
||||
{
|
||||
return workshopName;
|
||||
}
|
||||
public void setProcessId(Long processId)
|
||||
{
|
||||
this.processId = processId;
|
||||
}
|
||||
|
||||
public Long getProcessId()
|
||||
{
|
||||
return processId;
|
||||
}
|
||||
public void setProcessCode(String processCode)
|
||||
{
|
||||
this.processCode = processCode;
|
||||
}
|
||||
|
||||
public String getProcessCode()
|
||||
{
|
||||
return processCode;
|
||||
}
|
||||
public void setProcessName(String processName)
|
||||
{
|
||||
this.processName = processName;
|
||||
}
|
||||
|
||||
public String getProcessName()
|
||||
{
|
||||
return processName;
|
||||
}
|
||||
public void setEnableFlag(String enableFlag)
|
||||
{
|
||||
this.enableFlag = enableFlag;
|
||||
}
|
||||
|
||||
public String getEnableFlag()
|
||||
{
|
||||
return enableFlag;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("workstationId", getWorkstationId())
|
||||
.append("workstationCode", getWorkstationCode())
|
||||
.append("workstationName", getWorkstationName())
|
||||
.append("workstationAddress", getWorkstationAddress())
|
||||
.append("workshopId", getWorkshopId())
|
||||
.append("workshopCode", getWorkshopCode())
|
||||
.append("workshopName", getWorkshopName())
|
||||
.append("processId", getProcessId())
|
||||
.append("processCode", getProcessCode())
|
||||
.append("processName", getProcessName())
|
||||
.append("enableFlag", getEnableFlag())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.ktg.mes.md.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.md.domain.MdWorkstation;
|
||||
|
||||
/**
|
||||
* 工作站Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-10
|
||||
*/
|
||||
public interface MdWorkstationMapper
|
||||
{
|
||||
/**
|
||||
* 查询工作站
|
||||
*
|
||||
* @param workstationId 工作站主键
|
||||
* @return 工作站
|
||||
*/
|
||||
public MdWorkstation selectMdWorkstationByWorkstationId(Long workstationId);
|
||||
|
||||
/**
|
||||
* 查询工作站列表
|
||||
*
|
||||
* @param mdWorkstation 工作站
|
||||
* @return 工作站集合
|
||||
*/
|
||||
public List<MdWorkstation> selectMdWorkstationList(MdWorkstation mdWorkstation);
|
||||
|
||||
public MdWorkstation checkWorkStationCodeUnique(MdWorkstation mdWorkstation);
|
||||
public MdWorkstation checkWorkStationNameUnique(MdWorkstation mdWorkstation);
|
||||
|
||||
|
||||
/**
|
||||
* 新增工作站
|
||||
*
|
||||
* @param mdWorkstation 工作站
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMdWorkstation(MdWorkstation mdWorkstation);
|
||||
|
||||
/**
|
||||
* 修改工作站
|
||||
*
|
||||
* @param mdWorkstation 工作站
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMdWorkstation(MdWorkstation mdWorkstation);
|
||||
|
||||
/**
|
||||
* 删除工作站
|
||||
*
|
||||
* @param workstationId 工作站主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdWorkstationByWorkstationId(Long workstationId);
|
||||
|
||||
/**
|
||||
* 批量删除工作站
|
||||
*
|
||||
* @param workstationIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdWorkstationByWorkstationIds(Long[] workstationIds);
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package com.ktg.mes.md.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.md.domain.MdWorkstation;
|
||||
|
||||
/**
|
||||
* 工作站Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-10
|
||||
*/
|
||||
public interface IMdWorkstationService
|
||||
{
|
||||
/**
|
||||
* 查询工作站
|
||||
*
|
||||
* @param workstationId 工作站主键
|
||||
* @return 工作站
|
||||
*/
|
||||
public MdWorkstation selectMdWorkstationByWorkstationId(Long workstationId);
|
||||
|
||||
/**
|
||||
* 查询工作站列表
|
||||
*
|
||||
* @param mdWorkstation 工作站
|
||||
* @return 工作站集合
|
||||
*/
|
||||
public List<MdWorkstation> selectMdWorkstationList(MdWorkstation mdWorkstation);
|
||||
|
||||
/**
|
||||
* 检查编码是否存在
|
||||
* @param mdWorkstation
|
||||
* @return
|
||||
*/
|
||||
public String checkWorkStationCodeUnique(MdWorkstation mdWorkstation);
|
||||
|
||||
/**
|
||||
* 检查名称是否存在
|
||||
* @param mdWorkstation
|
||||
* @return
|
||||
*/
|
||||
public String checkWorkStationNameUnique(MdWorkstation mdWorkstation);
|
||||
|
||||
/**
|
||||
* 新增工作站
|
||||
*
|
||||
* @param mdWorkstation 工作站
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMdWorkstation(MdWorkstation mdWorkstation);
|
||||
|
||||
/**
|
||||
* 修改工作站
|
||||
*
|
||||
* @param mdWorkstation 工作站
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMdWorkstation(MdWorkstation mdWorkstation);
|
||||
|
||||
/**
|
||||
* 批量删除工作站
|
||||
*
|
||||
* @param workstationIds 需要删除的工作站主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdWorkstationByWorkstationIds(Long[] workstationIds);
|
||||
|
||||
/**
|
||||
* 删除工作站信息
|
||||
*
|
||||
* @param workstationId 工作站主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdWorkstationByWorkstationId(Long workstationId);
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
package com.ktg.mes.md.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import org.apache.catalina.User;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.md.mapper.MdWorkstationMapper;
|
||||
import com.ktg.mes.md.domain.MdWorkstation;
|
||||
import com.ktg.mes.md.service.IMdWorkstationService;
|
||||
|
||||
/**
|
||||
* 工作站Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-10
|
||||
*/
|
||||
@Service
|
||||
public class MdWorkstationServiceImpl implements IMdWorkstationService
|
||||
{
|
||||
@Autowired
|
||||
private MdWorkstationMapper mdWorkstationMapper;
|
||||
|
||||
/**
|
||||
* 查询工作站
|
||||
*
|
||||
* @param workstationId 工作站主键
|
||||
* @return 工作站
|
||||
*/
|
||||
@Override
|
||||
public MdWorkstation selectMdWorkstationByWorkstationId(Long workstationId)
|
||||
{
|
||||
return mdWorkstationMapper.selectMdWorkstationByWorkstationId(workstationId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询工作站列表
|
||||
*
|
||||
* @param mdWorkstation 工作站
|
||||
* @return 工作站
|
||||
*/
|
||||
@Override
|
||||
public List<MdWorkstation> selectMdWorkstationList(MdWorkstation mdWorkstation)
|
||||
{
|
||||
return mdWorkstationMapper.selectMdWorkstationList(mdWorkstation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkWorkStationCodeUnique(MdWorkstation mdWorkstation) {
|
||||
MdWorkstation workstation = mdWorkstationMapper.checkWorkStationCodeUnique(mdWorkstation);
|
||||
Long workstationId = mdWorkstation.getWorkstationId()==null? -1L:mdWorkstation.getWorkstationId();
|
||||
if(StringUtils.isNotNull(workstation) && workstation.getWorkstationId().longValue() != workstationId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkWorkStationNameUnique(MdWorkstation mdWorkstation) {
|
||||
MdWorkstation workstation = mdWorkstationMapper.checkWorkStationNameUnique(mdWorkstation);
|
||||
Long workstationId = mdWorkstation.getWorkstationId()==null? -1L:mdWorkstation.getWorkstationId();
|
||||
if(StringUtils.isNotNull(workstation) && workstation.getWorkstationId().longValue() != workstationId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工作站
|
||||
*
|
||||
* @param mdWorkstation 工作站
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMdWorkstation(MdWorkstation mdWorkstation)
|
||||
{
|
||||
mdWorkstation.setCreateTime(DateUtils.getNowDate());
|
||||
return mdWorkstationMapper.insertMdWorkstation(mdWorkstation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工作站
|
||||
*
|
||||
* @param mdWorkstation 工作站
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMdWorkstation(MdWorkstation mdWorkstation)
|
||||
{
|
||||
mdWorkstation.setUpdateTime(DateUtils.getNowDate());
|
||||
return mdWorkstationMapper.updateMdWorkstation(mdWorkstation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除工作站
|
||||
*
|
||||
* @param workstationIds 需要删除的工作站主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMdWorkstationByWorkstationIds(Long[] workstationIds)
|
||||
{
|
||||
return mdWorkstationMapper.deleteMdWorkstationByWorkstationIds(workstationIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工作站信息
|
||||
*
|
||||
* @param workstationId 工作站主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMdWorkstationByWorkstationId(Long workstationId)
|
||||
{
|
||||
return mdWorkstationMapper.deleteMdWorkstationByWorkstationId(workstationId);
|
||||
}
|
||||
}
|
147
ktg-mes/src/main/resources/mapper/md/MdWorkstationMapper.xml
Normal file
147
ktg-mes/src/main/resources/mapper/md/MdWorkstationMapper.xml
Normal file
@ -0,0 +1,147 @@
|
||||
<?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.ktg.mes.md.mapper.MdWorkstationMapper">
|
||||
|
||||
<resultMap type="MdWorkstation" id="MdWorkstationResult">
|
||||
<result property="workstationId" column="workstation_id" />
|
||||
<result property="workstationCode" column="workstation_code" />
|
||||
<result property="workstationName" column="workstation_name" />
|
||||
<result property="workstationAddress" column="workstation_address" />
|
||||
<result property="workshopId" column="workshop_id" />
|
||||
<result property="workshopCode" column="workshop_code" />
|
||||
<result property="workshopName" column="workshop_name" />
|
||||
<result property="processId" column="process_id" />
|
||||
<result property="processCode" column="process_code" />
|
||||
<result property="processName" column="process_name" />
|
||||
<result property="enableFlag" column="enable_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="selectMdWorkstationVo">
|
||||
select workstation_id, workstation_code, workstation_name, workstation_address, workshop_id, workshop_code, workshop_name, process_id, process_code, process_name, enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from md_workstation
|
||||
</sql>
|
||||
|
||||
<select id="selectMdWorkstationList" parameterType="MdWorkstation" resultMap="MdWorkstationResult">
|
||||
<include refid="selectMdWorkstationVo"/>
|
||||
<where>
|
||||
<if test="workstationCode != null and workstationCode != ''"> and workstation_code = #{workstationCode}</if>
|
||||
<if test="workstationName != null and workstationName != ''"> and workstation_name like concat('%', #{workstationName}, '%')</if>
|
||||
<if test="workstationAddress != null and workstationAddress != ''"> and workstation_address = #{workstationAddress}</if>
|
||||
<if test="workshopId != null "> and workshop_id = #{workshopId}</if>
|
||||
<if test="workshopCode != null and workshopCode != ''"> and workshop_code = #{workshopCode}</if>
|
||||
<if test="workshopName != null and workshopName != ''"> and workshop_name like concat('%', #{workshopName}, '%')</if>
|
||||
<if test="processId != null "> and process_id = #{processId}</if>
|
||||
<if test="processCode != null and processCode != ''"> and process_code = #{processCode}</if>
|
||||
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
|
||||
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMdWorkstationByWorkstationId" parameterType="Long" resultMap="MdWorkstationResult">
|
||||
<include refid="selectMdWorkstationVo"/>
|
||||
where workstation_id = #{workstationId}
|
||||
</select>
|
||||
|
||||
<select id="checkWorkStationCodeUnique" parameterType="MdWorkstation" resultMap="MdWorkstationResult">
|
||||
<include refid="selectMdWorkstationVo"/>
|
||||
where workstation_code = #{workstationCode} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkWorkStationNameUnique" parameterType="MdWorkstation" resultMap="MdWorkstationResult">
|
||||
<include refid="selectMdWorkstationVo"/>
|
||||
where workstation_name = #{workstationName} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertMdWorkstation" parameterType="MdWorkstation" useGeneratedKeys="true" keyProperty="workstationId">
|
||||
insert into md_workstation
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="workstationCode != null and workstationCode != ''">workstation_code,</if>
|
||||
<if test="workstationName != null and workstationName != ''">workstation_name,</if>
|
||||
<if test="workstationAddress != null">workstation_address,</if>
|
||||
<if test="workshopId != null">workshop_id,</if>
|
||||
<if test="workshopCode != null">workshop_code,</if>
|
||||
<if test="workshopName != null">workshop_name,</if>
|
||||
<if test="processId != null">process_id,</if>
|
||||
<if test="processCode != null">process_code,</if>
|
||||
<if test="processName != null">process_name,</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</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="workstationCode != null and workstationCode != ''">#{workstationCode},</if>
|
||||
<if test="workstationName != null and workstationName != ''">#{workstationName},</if>
|
||||
<if test="workstationAddress != null">#{workstationAddress},</if>
|
||||
<if test="workshopId != null">#{workshopId},</if>
|
||||
<if test="workshopCode != null">#{workshopCode},</if>
|
||||
<if test="workshopName != null">#{workshopName},</if>
|
||||
<if test="processId != null">#{processId},</if>
|
||||
<if test="processCode != null">#{processCode},</if>
|
||||
<if test="processName != null">#{processName},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">#{enableFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</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="updateMdWorkstation" parameterType="MdWorkstation">
|
||||
update md_workstation
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="workstationCode != null and workstationCode != ''">workstation_code = #{workstationCode},</if>
|
||||
<if test="workstationName != null and workstationName != ''">workstation_name = #{workstationName},</if>
|
||||
<if test="workstationAddress != null">workstation_address = #{workstationAddress},</if>
|
||||
<if test="workshopId != null">workshop_id = #{workshopId},</if>
|
||||
<if test="workshopCode != null">workshop_code = #{workshopCode},</if>
|
||||
<if test="workshopName != null">workshop_name = #{workshopName},</if>
|
||||
<if test="processId != null">process_id = #{processId},</if>
|
||||
<if test="processCode != null">process_code = #{processCode},</if>
|
||||
<if test="processName != null">process_name = #{processName},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag = #{enableFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</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 workstation_id = #{workstationId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMdWorkstationByWorkstationId" parameterType="Long">
|
||||
delete from md_workstation where workstation_id = #{workstationId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMdWorkstationByWorkstationIds" parameterType="String">
|
||||
delete from md_workstation where workstation_id in
|
||||
<foreach item="workstationId" collection="array" open="(" separator="," close=")">
|
||||
#{workstationId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user