生产物料消耗记录
This commit is contained in:
parent
b03dd0d13a
commit
5d5898f595
@ -0,0 +1,104 @@
|
||||
package com.ktg.mes.wm.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.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.wm.domain.WmItemConsume;
|
||||
import com.ktg.mes.wm.service.IWmItemConsumeService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 物料消耗记录Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-09-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/wm/itemconsume")
|
||||
public class WmItemConsumeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWmItemConsumeService wmItemConsumeService;
|
||||
|
||||
/**
|
||||
* 查询物料消耗记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:wm:itemconsume:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WmItemConsume wmItemConsume)
|
||||
{
|
||||
startPage();
|
||||
List<WmItemConsume> list = wmItemConsumeService.selectWmItemConsumeList(wmItemConsume);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物料消耗记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:wm:itemconsume:export')")
|
||||
@Log(title = "物料消耗记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WmItemConsume wmItemConsume)
|
||||
{
|
||||
List<WmItemConsume> list = wmItemConsumeService.selectWmItemConsumeList(wmItemConsume);
|
||||
ExcelUtil<WmItemConsume> util = new ExcelUtil<WmItemConsume>(WmItemConsume.class);
|
||||
util.exportExcel(response, list, "物料消耗记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物料消耗记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:wm:itemconsume:query')")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return AjaxResult.success(wmItemConsumeService.selectWmItemConsumeByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料消耗记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:wm:itemconsume:add')")
|
||||
@Log(title = "物料消耗记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WmItemConsume wmItemConsume)
|
||||
{
|
||||
return toAjax(wmItemConsumeService.insertWmItemConsume(wmItemConsume));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料消耗记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:wm:itemconsume:edit')")
|
||||
@Log(title = "物料消耗记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WmItemConsume wmItemConsume)
|
||||
{
|
||||
return toAjax(wmItemConsumeService.updateWmItemConsume(wmItemConsume));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料消耗记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:wm:itemconsume:remove')")
|
||||
@Log(title = "物料消耗记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
return toAjax(wmItemConsumeService.deleteWmItemConsumeByRecordIds(recordIds));
|
||||
}
|
||||
}
|
293
ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmItemConsume.java
Normal file
293
ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmItemConsume.java
Normal file
@ -0,0 +1,293 @@
|
||||
package com.ktg.mes.wm.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 物料消耗记录对象 wm_item_consume
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-09-19
|
||||
*/
|
||||
public class WmItemConsume extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录ID */
|
||||
private Long recordId;
|
||||
|
||||
/** 生产工单ID */
|
||||
@Excel(name = "生产工单ID")
|
||||
private Long workorderId;
|
||||
|
||||
/** 生产工单编码 */
|
||||
@Excel(name = "生产工单编码")
|
||||
private String workorderCode;
|
||||
|
||||
/** 生产工单名称 */
|
||||
@Excel(name = "生产工单名称")
|
||||
private String workorderName;
|
||||
|
||||
/** 生产任务ID */
|
||||
@Excel(name = "生产任务ID")
|
||||
private Long taskId;
|
||||
|
||||
/** 生产任务编号 */
|
||||
@Excel(name = "生产任务编号")
|
||||
private String taskCode;
|
||||
|
||||
/** 生产任务名称 */
|
||||
@Excel(name = "生产任务名称")
|
||||
private String taskName;
|
||||
|
||||
/** 工作站ID */
|
||||
@Excel(name = "工作站ID")
|
||||
private Long workstationId;
|
||||
|
||||
/** 工作站编号 */
|
||||
@Excel(name = "工作站编号")
|
||||
private String workstationCode;
|
||||
|
||||
/** 工作站名称 */
|
||||
@Excel(name = "工作站名称")
|
||||
private String workstationName;
|
||||
|
||||
/** 工序ID */
|
||||
@Excel(name = "工序ID")
|
||||
private Long processId;
|
||||
|
||||
/** 工序编号 */
|
||||
@Excel(name = "工序编号")
|
||||
private String processCode;
|
||||
|
||||
/** 工序名称 */
|
||||
@Excel(name = "工序名称")
|
||||
private String processName;
|
||||
|
||||
/** 消耗日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "消耗日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date consumeDate;
|
||||
|
||||
/** 单据状态 */
|
||||
@Excel(name = "单据状态")
|
||||
private String status;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setRecordId(Long recordId)
|
||||
{
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public Long getRecordId()
|
||||
{
|
||||
return recordId;
|
||||
}
|
||||
public void setWorkorderId(Long workorderId)
|
||||
{
|
||||
this.workorderId = workorderId;
|
||||
}
|
||||
|
||||
public Long getWorkorderId()
|
||||
{
|
||||
return workorderId;
|
||||
}
|
||||
public void setWorkorderCode(String workorderCode)
|
||||
{
|
||||
this.workorderCode = workorderCode;
|
||||
}
|
||||
|
||||
public String getWorkorderCode()
|
||||
{
|
||||
return workorderCode;
|
||||
}
|
||||
public void setWorkorderName(String workorderName)
|
||||
{
|
||||
this.workorderName = workorderName;
|
||||
}
|
||||
|
||||
public String getWorkorderName()
|
||||
{
|
||||
return workorderName;
|
||||
}
|
||||
public void setTaskId(Long taskId)
|
||||
{
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public Long getTaskId()
|
||||
{
|
||||
return taskId;
|
||||
}
|
||||
public void setTaskCode(String taskCode)
|
||||
{
|
||||
this.taskCode = taskCode;
|
||||
}
|
||||
|
||||
public String getTaskCode()
|
||||
{
|
||||
return taskCode;
|
||||
}
|
||||
public void setTaskName(String taskName)
|
||||
{
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public String getTaskName()
|
||||
{
|
||||
return taskName;
|
||||
}
|
||||
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 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 setConsumeDate(Date consumeDate)
|
||||
{
|
||||
this.consumeDate = consumeDate;
|
||||
}
|
||||
|
||||
public Date getConsumeDate()
|
||||
{
|
||||
return consumeDate;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
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("recordId", getRecordId())
|
||||
.append("workorderId", getWorkorderId())
|
||||
.append("workorderCode", getWorkorderCode())
|
||||
.append("workorderName", getWorkorderName())
|
||||
.append("taskId", getTaskId())
|
||||
.append("taskCode", getTaskCode())
|
||||
.append("taskName", getTaskName())
|
||||
.append("workstationId", getWorkstationId())
|
||||
.append("workstationCode", getWorkstationCode())
|
||||
.append("workstationName", getWorkstationName())
|
||||
.append("processId", getProcessId())
|
||||
.append("processCode", getProcessCode())
|
||||
.append("processName", getProcessName())
|
||||
.append("consumeDate", getConsumeDate())
|
||||
.append("status", getStatus())
|
||||
.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,61 @@
|
||||
package com.ktg.mes.wm.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.wm.domain.WmItemConsume;
|
||||
|
||||
/**
|
||||
* 物料消耗记录Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-09-19
|
||||
*/
|
||||
public interface WmItemConsumeMapper
|
||||
{
|
||||
/**
|
||||
* 查询物料消耗记录
|
||||
*
|
||||
* @param recordId 物料消耗记录主键
|
||||
* @return 物料消耗记录
|
||||
*/
|
||||
public WmItemConsume selectWmItemConsumeByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询物料消耗记录列表
|
||||
*
|
||||
* @param wmItemConsume 物料消耗记录
|
||||
* @return 物料消耗记录集合
|
||||
*/
|
||||
public List<WmItemConsume> selectWmItemConsumeList(WmItemConsume wmItemConsume);
|
||||
|
||||
/**
|
||||
* 新增物料消耗记录
|
||||
*
|
||||
* @param wmItemConsume 物料消耗记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWmItemConsume(WmItemConsume wmItemConsume);
|
||||
|
||||
/**
|
||||
* 修改物料消耗记录
|
||||
*
|
||||
* @param wmItemConsume 物料消耗记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWmItemConsume(WmItemConsume wmItemConsume);
|
||||
|
||||
/**
|
||||
* 删除物料消耗记录
|
||||
*
|
||||
* @param recordId 物料消耗记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmItemConsumeByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除物料消耗记录
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmItemConsumeByRecordIds(Long[] recordIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.wm.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.wm.domain.WmItemConsume;
|
||||
|
||||
/**
|
||||
* 物料消耗记录Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-09-19
|
||||
*/
|
||||
public interface IWmItemConsumeService
|
||||
{
|
||||
/**
|
||||
* 查询物料消耗记录
|
||||
*
|
||||
* @param recordId 物料消耗记录主键
|
||||
* @return 物料消耗记录
|
||||
*/
|
||||
public WmItemConsume selectWmItemConsumeByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询物料消耗记录列表
|
||||
*
|
||||
* @param wmItemConsume 物料消耗记录
|
||||
* @return 物料消耗记录集合
|
||||
*/
|
||||
public List<WmItemConsume> selectWmItemConsumeList(WmItemConsume wmItemConsume);
|
||||
|
||||
/**
|
||||
* 新增物料消耗记录
|
||||
*
|
||||
* @param wmItemConsume 物料消耗记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWmItemConsume(WmItemConsume wmItemConsume);
|
||||
|
||||
/**
|
||||
* 修改物料消耗记录
|
||||
*
|
||||
* @param wmItemConsume 物料消耗记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWmItemConsume(WmItemConsume wmItemConsume);
|
||||
|
||||
/**
|
||||
* 批量删除物料消耗记录
|
||||
*
|
||||
* @param recordIds 需要删除的物料消耗记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmItemConsumeByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除物料消耗记录信息
|
||||
*
|
||||
* @param recordId 物料消耗记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmItemConsumeByRecordId(Long recordId);
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.ktg.mes.wm.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.wm.mapper.WmItemConsumeMapper;
|
||||
import com.ktg.mes.wm.domain.WmItemConsume;
|
||||
import com.ktg.mes.wm.service.IWmItemConsumeService;
|
||||
|
||||
/**
|
||||
* 物料消耗记录Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-09-19
|
||||
*/
|
||||
@Service
|
||||
public class WmItemConsumeServiceImpl implements IWmItemConsumeService
|
||||
{
|
||||
@Autowired
|
||||
private WmItemConsumeMapper wmItemConsumeMapper;
|
||||
|
||||
/**
|
||||
* 查询物料消耗记录
|
||||
*
|
||||
* @param recordId 物料消耗记录主键
|
||||
* @return 物料消耗记录
|
||||
*/
|
||||
@Override
|
||||
public WmItemConsume selectWmItemConsumeByRecordId(Long recordId)
|
||||
{
|
||||
return wmItemConsumeMapper.selectWmItemConsumeByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料消耗记录列表
|
||||
*
|
||||
* @param wmItemConsume 物料消耗记录
|
||||
* @return 物料消耗记录
|
||||
*/
|
||||
@Override
|
||||
public List<WmItemConsume> selectWmItemConsumeList(WmItemConsume wmItemConsume)
|
||||
{
|
||||
return wmItemConsumeMapper.selectWmItemConsumeList(wmItemConsume);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料消耗记录
|
||||
*
|
||||
* @param wmItemConsume 物料消耗记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWmItemConsume(WmItemConsume wmItemConsume)
|
||||
{
|
||||
wmItemConsume.setCreateTime(DateUtils.getNowDate());
|
||||
return wmItemConsumeMapper.insertWmItemConsume(wmItemConsume);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料消耗记录
|
||||
*
|
||||
* @param wmItemConsume 物料消耗记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWmItemConsume(WmItemConsume wmItemConsume)
|
||||
{
|
||||
wmItemConsume.setUpdateTime(DateUtils.getNowDate());
|
||||
return wmItemConsumeMapper.updateWmItemConsume(wmItemConsume);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物料消耗记录
|
||||
*
|
||||
* @param recordIds 需要删除的物料消耗记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWmItemConsumeByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return wmItemConsumeMapper.deleteWmItemConsumeByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料消耗记录信息
|
||||
*
|
||||
* @param recordId 物料消耗记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWmItemConsumeByRecordId(Long recordId)
|
||||
{
|
||||
return wmItemConsumeMapper.deleteWmItemConsumeByRecordId(recordId);
|
||||
}
|
||||
}
|
157
ktg-mes/src/main/resources/mapper/wm/WmItemConsumeMapper.xml
Normal file
157
ktg-mes/src/main/resources/mapper/wm/WmItemConsumeMapper.xml
Normal file
@ -0,0 +1,157 @@
|
||||
<?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.wm.mapper.WmItemConsumeMapper">
|
||||
|
||||
<resultMap type="WmItemConsume" id="WmItemConsumeResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="workorderId" column="workorder_id" />
|
||||
<result property="workorderCode" column="workorder_code" />
|
||||
<result property="workorderName" column="workorder_name" />
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="taskCode" column="task_code" />
|
||||
<result property="taskName" column="task_name" />
|
||||
<result property="workstationId" column="workstation_id" />
|
||||
<result property="workstationCode" column="workstation_code" />
|
||||
<result property="workstationName" column="workstation_name" />
|
||||
<result property="processId" column="process_id" />
|
||||
<result property="processCode" column="process_code" />
|
||||
<result property="processName" column="process_name" />
|
||||
<result property="consumeDate" column="consume_date" />
|
||||
<result property="status" column="status" />
|
||||
<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="selectWmItemConsumeVo">
|
||||
select record_id, workorder_id, workorder_code, workorder_name, task_id, task_code, task_name, workstation_id, workstation_code, workstation_name, process_id, process_code, process_name, consume_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_item_consume
|
||||
</sql>
|
||||
|
||||
<select id="selectWmItemConsumeList" parameterType="WmItemConsume" resultMap="WmItemConsumeResult">
|
||||
<include refid="selectWmItemConsumeVo"/>
|
||||
<where>
|
||||
<if test="workorderId != null "> and workorder_id = #{workorderId}</if>
|
||||
<if test="workorderCode != null and workorderCode != ''"> and workorder_code = #{workorderCode}</if>
|
||||
<if test="workorderName != null and workorderName != ''"> and workorder_name like concat('%', #{workorderName}, '%')</if>
|
||||
<if test="taskId != null "> and task_id = #{taskId}</if>
|
||||
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode}</if>
|
||||
<if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
|
||||
<if test="workstationId != null "> and workstation_id = #{workstationId}</if>
|
||||
<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="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="consumeDate != null "> and consume_date = #{consumeDate}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWmItemConsumeByRecordId" parameterType="Long" resultMap="WmItemConsumeResult">
|
||||
<include refid="selectWmItemConsumeVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWmItemConsume" parameterType="WmItemConsume" useGeneratedKeys="true" keyProperty="recordId">
|
||||
insert into wm_item_consume
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="workorderId != null">workorder_id,</if>
|
||||
<if test="workorderCode != null">workorder_code,</if>
|
||||
<if test="workorderName != null">workorder_name,</if>
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="taskCode != null">task_code,</if>
|
||||
<if test="taskName != null">task_name,</if>
|
||||
<if test="workstationId != null">workstation_id,</if>
|
||||
<if test="workstationCode != null">workstation_code,</if>
|
||||
<if test="workstationName != null">workstation_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="consumeDate != null">consume_date,</if>
|
||||
<if test="status != null">status,</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="workorderId != null">#{workorderId},</if>
|
||||
<if test="workorderCode != null">#{workorderCode},</if>
|
||||
<if test="workorderName != null">#{workorderName},</if>
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="taskCode != null">#{taskCode},</if>
|
||||
<if test="taskName != null">#{taskName},</if>
|
||||
<if test="workstationId != null">#{workstationId},</if>
|
||||
<if test="workstationCode != null">#{workstationCode},</if>
|
||||
<if test="workstationName != null">#{workstationName},</if>
|
||||
<if test="processId != null">#{processId},</if>
|
||||
<if test="processCode != null">#{processCode},</if>
|
||||
<if test="processName != null">#{processName},</if>
|
||||
<if test="consumeDate != null">#{consumeDate},</if>
|
||||
<if test="status != null">#{status},</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="updateWmItemConsume" parameterType="WmItemConsume">
|
||||
update wm_item_consume
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="workorderId != null">workorder_id = #{workorderId},</if>
|
||||
<if test="workorderCode != null">workorder_code = #{workorderCode},</if>
|
||||
<if test="workorderName != null">workorder_name = #{workorderName},</if>
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="taskCode != null">task_code = #{taskCode},</if>
|
||||
<if test="taskName != null">task_name = #{taskName},</if>
|
||||
<if test="workstationId != null">workstation_id = #{workstationId},</if>
|
||||
<if test="workstationCode != null">workstation_code = #{workstationCode},</if>
|
||||
<if test="workstationName != null">workstation_name = #{workstationName},</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="consumeDate != null">consume_date = #{consumeDate},</if>
|
||||
<if test="status != null">status = #{status},</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 record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWmItemConsumeByRecordId" parameterType="Long">
|
||||
delete from wm_item_consume where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWmItemConsumeByRecordIds" parameterType="String">
|
||||
delete from wm_item_consume where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user