change - add物料类型信息
parent
2020b03be6
commit
34b414eeaf
@ -0,0 +1,103 @@
|
|||||||
|
package com.hw.mes.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.io.IOException;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
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.hw.common.log.annotation.Log;
|
||||||
|
import com.hw.common.log.enums.BusinessType;
|
||||||
|
import com.hw.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.hw.mes.domain.MesBaseMaterialType;
|
||||||
|
import com.hw.mes.service.IMesBaseMaterialTypeService;
|
||||||
|
import com.hw.common.core.web.controller.BaseController;
|
||||||
|
import com.hw.common.core.web.domain.AjaxResult;
|
||||||
|
import com.hw.common.core.utils.poi.ExcelUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料类型信息Controller
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-01-23
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/baseMaterialType")
|
||||||
|
public class MesBaseMaterialTypeController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IMesBaseMaterialTypeService mesBaseMaterialTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询物料类型信息列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("mes:baseMaterialType:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public AjaxResult list(MesBaseMaterialType mesBaseMaterialType)
|
||||||
|
{
|
||||||
|
List<MesBaseMaterialType> list = mesBaseMaterialTypeService.selectMesBaseMaterialTypeList(mesBaseMaterialType);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出物料类型信息列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("mes:baseMaterialType:export")
|
||||||
|
@Log(title = "物料类型信息", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, MesBaseMaterialType mesBaseMaterialType)
|
||||||
|
{
|
||||||
|
List<MesBaseMaterialType> list = mesBaseMaterialTypeService.selectMesBaseMaterialTypeList(mesBaseMaterialType);
|
||||||
|
ExcelUtil<MesBaseMaterialType> util = new ExcelUtil<MesBaseMaterialType>(MesBaseMaterialType.class);
|
||||||
|
util.exportExcel(response, list, "物料类型信息数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取物料类型信息详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("mes:baseMaterialType:query")
|
||||||
|
@GetMapping(value = "/{matrialTypeId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("matrialTypeId") Long matrialTypeId)
|
||||||
|
{
|
||||||
|
return success(mesBaseMaterialTypeService.selectMesBaseMaterialTypeByMatrialTypeId(matrialTypeId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增物料类型信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("mes:baseMaterialType:add")
|
||||||
|
@Log(title = "物料类型信息", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody MesBaseMaterialType mesBaseMaterialType)
|
||||||
|
{
|
||||||
|
return toAjax(mesBaseMaterialTypeService.insertMesBaseMaterialType(mesBaseMaterialType));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改物料类型信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("mes:baseMaterialType:edit")
|
||||||
|
@Log(title = "物料类型信息", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody MesBaseMaterialType mesBaseMaterialType)
|
||||||
|
{
|
||||||
|
return toAjax(mesBaseMaterialTypeService.updateMesBaseMaterialType(mesBaseMaterialType));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除物料类型信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("mes:baseMaterialType:remove")
|
||||||
|
@Log(title = "物料类型信息", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{matrialTypeIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] matrialTypeIds)
|
||||||
|
{
|
||||||
|
return toAjax(mesBaseMaterialTypeService.deleteMesBaseMaterialTypeByMatrialTypeIds(matrialTypeIds));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
package com.hw.mes.domain;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.hw.common.core.annotation.Excel;
|
||||||
|
import com.hw.common.core.web.domain.TreeEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料类型信息对象 mes_base_material_type
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-01-23
|
||||||
|
*/
|
||||||
|
public class MesBaseMaterialType extends TreeEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键标识
|
||||||
|
*/
|
||||||
|
private Long matrialTypeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型编号
|
||||||
|
*/
|
||||||
|
@Excel(name = "类型编号")
|
||||||
|
private String typeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "类型名称")
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 激活标识
|
||||||
|
*/
|
||||||
|
@Excel(name = "激活标识")
|
||||||
|
private String activeFlag;
|
||||||
|
|
||||||
|
public void setMatrialTypeId(Long matrialTypeId) {
|
||||||
|
this.matrialTypeId = matrialTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMatrialTypeId() {
|
||||||
|
return matrialTypeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTypeCode(String typeCode) {
|
||||||
|
this.typeCode = typeCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTypeCode() {
|
||||||
|
return typeCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTypeName(String typeName) {
|
||||||
|
this.typeName = typeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTypeName() {
|
||||||
|
return typeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActiveFlag(String activeFlag) {
|
||||||
|
this.activeFlag = activeFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getActiveFlag() {
|
||||||
|
return activeFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("matrialTypeId", getMatrialTypeId())
|
||||||
|
.append("parentId", getParentId())
|
||||||
|
.append("typeCode", getTypeCode())
|
||||||
|
.append("typeName", getTypeName())
|
||||||
|
.append("activeFlag", getActiveFlag())
|
||||||
|
.append("ancestors", getAncestors())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.hw.mes.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.hw.mes.domain.MesBaseMaterialType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料类型信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-01-23
|
||||||
|
*/
|
||||||
|
public interface MesBaseMaterialTypeMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询物料类型信息
|
||||||
|
*
|
||||||
|
* @param matrialTypeId 物料类型信息主键
|
||||||
|
* @return 物料类型信息
|
||||||
|
*/
|
||||||
|
public MesBaseMaterialType selectMesBaseMaterialTypeByMatrialTypeId(Long matrialTypeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询物料类型信息列表
|
||||||
|
*
|
||||||
|
* @param mesBaseMaterialType 物料类型信息
|
||||||
|
* @return 物料类型信息集合
|
||||||
|
*/
|
||||||
|
public List<MesBaseMaterialType> selectMesBaseMaterialTypeList(MesBaseMaterialType mesBaseMaterialType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增物料类型信息
|
||||||
|
*
|
||||||
|
* @param mesBaseMaterialType 物料类型信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改物料类型信息
|
||||||
|
*
|
||||||
|
* @param mesBaseMaterialType 物料类型信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除物料类型信息
|
||||||
|
*
|
||||||
|
* @param matrialTypeId 物料类型信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesBaseMaterialTypeByMatrialTypeId(Long matrialTypeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除物料类型信息
|
||||||
|
*
|
||||||
|
* @param matrialTypeIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesBaseMaterialTypeByMatrialTypeIds(Long[] matrialTypeIds);
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.hw.mes.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.hw.mes.domain.MesBaseMaterialType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料类型信息Service接口
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-01-23
|
||||||
|
*/
|
||||||
|
public interface IMesBaseMaterialTypeService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询物料类型信息
|
||||||
|
*
|
||||||
|
* @param matrialTypeId 物料类型信息主键
|
||||||
|
* @return 物料类型信息
|
||||||
|
*/
|
||||||
|
public MesBaseMaterialType selectMesBaseMaterialTypeByMatrialTypeId(Long matrialTypeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询物料类型信息列表
|
||||||
|
*
|
||||||
|
* @param mesBaseMaterialType 物料类型信息
|
||||||
|
* @return 物料类型信息集合
|
||||||
|
*/
|
||||||
|
public List<MesBaseMaterialType> selectMesBaseMaterialTypeList(MesBaseMaterialType mesBaseMaterialType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增物料类型信息
|
||||||
|
*
|
||||||
|
* @param mesBaseMaterialType 物料类型信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改物料类型信息
|
||||||
|
*
|
||||||
|
* @param mesBaseMaterialType 物料类型信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除物料类型信息
|
||||||
|
*
|
||||||
|
* @param matrialTypeIds 需要删除的物料类型信息主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesBaseMaterialTypeByMatrialTypeIds(Long[] matrialTypeIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除物料类型信息信息
|
||||||
|
*
|
||||||
|
* @param matrialTypeId 物料类型信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteMesBaseMaterialTypeByMatrialTypeId(Long matrialTypeId);
|
||||||
|
}
|
@ -0,0 +1,96 @@
|
|||||||
|
package com.hw.mes.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.hw.common.core.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.hw.mes.mapper.MesBaseMaterialTypeMapper;
|
||||||
|
import com.hw.mes.domain.MesBaseMaterialType;
|
||||||
|
import com.hw.mes.service.IMesBaseMaterialTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料类型信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-01-23
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MesBaseMaterialTypeServiceImpl implements IMesBaseMaterialTypeService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private MesBaseMaterialTypeMapper mesBaseMaterialTypeMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询物料类型信息
|
||||||
|
*
|
||||||
|
* @param matrialTypeId 物料类型信息主键
|
||||||
|
* @return 物料类型信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public MesBaseMaterialType selectMesBaseMaterialTypeByMatrialTypeId(Long matrialTypeId)
|
||||||
|
{
|
||||||
|
return mesBaseMaterialTypeMapper.selectMesBaseMaterialTypeByMatrialTypeId(matrialTypeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询物料类型信息列表
|
||||||
|
*
|
||||||
|
* @param mesBaseMaterialType 物料类型信息
|
||||||
|
* @return 物料类型信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<MesBaseMaterialType> selectMesBaseMaterialTypeList(MesBaseMaterialType mesBaseMaterialType)
|
||||||
|
{
|
||||||
|
return mesBaseMaterialTypeMapper.selectMesBaseMaterialTypeList(mesBaseMaterialType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增物料类型信息
|
||||||
|
*
|
||||||
|
* @param mesBaseMaterialType 物料类型信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType)
|
||||||
|
{
|
||||||
|
mesBaseMaterialType.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return mesBaseMaterialTypeMapper.insertMesBaseMaterialType(mesBaseMaterialType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改物料类型信息
|
||||||
|
*
|
||||||
|
* @param mesBaseMaterialType 物料类型信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateMesBaseMaterialType(MesBaseMaterialType mesBaseMaterialType)
|
||||||
|
{
|
||||||
|
mesBaseMaterialType.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return mesBaseMaterialTypeMapper.updateMesBaseMaterialType(mesBaseMaterialType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除物料类型信息
|
||||||
|
*
|
||||||
|
* @param matrialTypeIds 需要删除的物料类型信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteMesBaseMaterialTypeByMatrialTypeIds(Long[] matrialTypeIds)
|
||||||
|
{
|
||||||
|
return mesBaseMaterialTypeMapper.deleteMesBaseMaterialTypeByMatrialTypeIds(matrialTypeIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除物料类型信息信息
|
||||||
|
*
|
||||||
|
* @param matrialTypeId 物料类型信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteMesBaseMaterialTypeByMatrialTypeId(Long matrialTypeId)
|
||||||
|
{
|
||||||
|
return mesBaseMaterialTypeMapper.deleteMesBaseMaterialTypeByMatrialTypeId(matrialTypeId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,96 @@
|
|||||||
|
<?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.hw.mes.mapper.MesBaseMaterialTypeMapper">
|
||||||
|
|
||||||
|
<resultMap type="MesBaseMaterialType" id="MesBaseMaterialTypeResult">
|
||||||
|
<result property="matrialTypeId" column="matrial_type_id" />
|
||||||
|
<result property="parentId" column="parent_id" />
|
||||||
|
<result property="typeCode" column="type_code" />
|
||||||
|
<result property="typeName" column="type_name" />
|
||||||
|
<result property="activeFlag" column="active_flag" />
|
||||||
|
<result property="ancestors" column="ancestors" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<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="selectMesBaseMaterialTypeVo">
|
||||||
|
select matrial_type_id, parent_id, type_code, type_name, active_flag, ancestors, remark, create_by, create_time, update_by, update_time from mes_base_material_type
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectMesBaseMaterialTypeList" parameterType="MesBaseMaterialType" resultMap="MesBaseMaterialTypeResult">
|
||||||
|
<include refid="selectMesBaseMaterialTypeVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
||||||
|
<if test="typeCode != null and typeCode != ''"> and type_code = #{typeCode}</if>
|
||||||
|
<if test="typeName != null and typeName != ''"> and type_name like concat('%', #{typeName}, '%')</if>
|
||||||
|
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
|
||||||
|
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMesBaseMaterialTypeByMatrialTypeId" parameterType="Long" resultMap="MesBaseMaterialTypeResult">
|
||||||
|
<include refid="selectMesBaseMaterialTypeVo"/>
|
||||||
|
where matrial_type_id = #{matrialTypeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertMesBaseMaterialType" parameterType="MesBaseMaterialType" useGeneratedKeys="true" keyProperty="matrialTypeId">
|
||||||
|
insert into mes_base_material_type
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="parentId != null">parent_id,</if>
|
||||||
|
<if test="typeCode != null and typeCode != ''">type_code,</if>
|
||||||
|
<if test="typeName != null and typeName != ''">type_name,</if>
|
||||||
|
<if test="activeFlag != null">active_flag,</if>
|
||||||
|
<if test="ancestors != null">ancestors,</if>
|
||||||
|
<if test="remark != null">remark,</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="parentId != null">#{parentId},</if>
|
||||||
|
<if test="typeCode != null and typeCode != ''">#{typeCode},</if>
|
||||||
|
<if test="typeName != null and typeName != ''">#{typeName},</if>
|
||||||
|
<if test="activeFlag != null">#{activeFlag},</if>
|
||||||
|
<if test="ancestors != null">#{ancestors},</if>
|
||||||
|
<if test="remark != null">#{remark},</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="updateMesBaseMaterialType" parameterType="MesBaseMaterialType">
|
||||||
|
update mes_base_material_type
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||||
|
<if test="typeCode != null and typeCode != ''">type_code = #{typeCode},</if>
|
||||||
|
<if test="typeName != null and typeName != ''">type_name = #{typeName},</if>
|
||||||
|
<if test="activeFlag != null">active_flag = #{activeFlag},</if>
|
||||||
|
<if test="ancestors != null">ancestors = #{ancestors},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</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 matrial_type_id = #{matrialTypeId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteMesBaseMaterialTypeByMatrialTypeId" parameterType="Long">
|
||||||
|
delete from mes_base_material_type where matrial_type_id = #{matrialTypeId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteMesBaseMaterialTypeByMatrialTypeIds" parameterType="String">
|
||||||
|
delete from mes_base_material_type where matrial_type_id in
|
||||||
|
<foreach item="matrialTypeId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{matrialTypeId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询物料类型信息列表
|
||||||
|
export function listBaseMaterialType(query) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/baseMaterialType/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询物料类型信息详细
|
||||||
|
export function getBaseMaterialType(matrialTypeId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/baseMaterialType/' + matrialTypeId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增物料类型信息
|
||||||
|
export function addBaseMaterialType(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/baseMaterialType',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改物料类型信息
|
||||||
|
export function updateBaseMaterialType(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/baseMaterialType',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除物料类型信息
|
||||||
|
export function delBaseMaterialType(matrialTypeId) {
|
||||||
|
return request({
|
||||||
|
url: '/mes/baseMaterialType/' + matrialTypeId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
Loading…
Reference in New Issue