初步完成齐套性检查接口,开放三个大屏查询接口,

This commit is contained in:
汤锦科 2024-10-31 20:50:25 +08:00
parent 9da5ad4228
commit 642c0be972
23 changed files with 2243 additions and 0 deletions

View File

@ -116,6 +116,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.antMatchers("/druid/**").anonymous()
.antMatchers("/websocket/**").anonymous()
.antMatchers("/system/autocode/get/**").permitAll()
.antMatchers("/**/open/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated()
.and()

View File

@ -0,0 +1,271 @@
package com.ktg.mes.md.controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSON;
import com.ktg.mes.md.domain.BomRoute;
import com.ktg.mes.md.domain.MbbProduBom;
import com.ktg.mes.md.domain.MdItem;
import com.ktg.mes.md.service.IBomRouteService;
import com.ktg.mes.md.service.IMdItemService;
import com.ktg.mes.wm.domain.BaseTechnologyBom;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
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.BaseKnife;
import com.ktg.mes.md.service.IBaseKnifeService;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.common.core.page.TableDataInfo;
/**
* 工具台账Controller
*
* @author yinjinlu
* @date 2024-10-31
*/
@RestController
@RequestMapping("/mes/md/baseKnife")
public class BaseKnifeController extends BaseController
{
@Autowired
private IBaseKnifeService baseKnifeService;
@Autowired
private IBomRouteService bomRouteService;
@Autowired
private IMdItemService mdItemService;
/**
* 列表查询
*
* @return
*/
@GetMapping("/open/selectBaseKnife")
public List<Map<String, String>> openList() {
BaseKnife baseKnife = new BaseKnife();
List<BaseKnife> list = baseKnifeService.selectBaseKnifeList(null);
List<Map<String, String>> result = new ArrayList<>();
list.forEach(item -> {
Map<String, String> map = new HashMap<>();
map.put("gid", item.getBaseKnifeId().toString());
map.put("code", item.getKnifeCode());
map.put("name", item.getKnifeName());
map.put("pmbbMeasure", item.getKnifeUnit());
map.put("mbbMrlClass", item.getKnifeType());
map.put("wmsAreaCode", item.getAreaCode());
map.put("knifeLife", "100");
map.put("knifeLifeUser", item.getKnifeLife() == null ? null : String.valueOf(100 - Integer.parseInt(item.getKnifeLife())));
map.put("knifeLifeLeave", item.getKnifeLife() == null ? null : item.getKnifeLife());
map.put("isLocked", item.getIsLocked());
map.put("lockedStartTime", item.getLockedStartTime() == null ? null : item.getLockedStartTime().toString());
map.put("lockedEndTime",item.getLockedEndTime() == null ? null : item.getLockedEndTime().toString());
map.put("planSheet",item.getPlanSheet() == null ? null : item.getPlanSheet());
result.add(map);
});
return result;
}
@PostMapping("/open/checkForAlignment")
@ResponseBody
public AjaxResult checkForAlignment(@RequestBody String json) {
List<BaseTechnologyBom> technologyBomList = JSON.parseArray(json, BaseTechnologyBom.class);
if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null)
return AjaxResult.error("未检测到工艺bom项");
// 记录所需物料数量的map
Map<String, Integer> countMap = new HashMap<>();
BaseKnife baseKnifeWarpper = new BaseKnife();
BomRoute bomRouteTemp = new BomRoute();
MdItem mdItemTemp = new MdItem();
// 遍历工艺bom 所需要的所有材料
for (BaseTechnologyBom techBom : technologyBomList){
// 空则0
countMap.putIfAbsent(techBom.getKnifeCode(), 0);
// 台账表中查询工具 并记录数量
baseKnifeWarpper.setKnifeCode(techBom.getKnifeCode());
List<BaseKnife> tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWarpper);
tempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < techBom.getExpendLife());
AtomicInteger knifeCount = new AtomicInteger(techBom.getKnifeCount().intValue());
// 如果台账表中不存在尝试组刀任务查询
if (tempList.isEmpty()){
// 查询整刀bom项 如果不存在说明 为基础物料或者没有记录此整刀的组装
mdItemTemp = mdItemService.selectMdItemByCode(techBom.getKnifeCode());
if (mdItemTemp == null)
return AjaxResult.error("物料编码查询错误", techBom.getKnifeCode());
bomRouteTemp.setMdItemId(mdItemTemp.getItemId());
bomRouteTemp.setBomVersion("V1.0");
List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp);
if (bomRouteList.size() != 1)
return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode());
BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId());
if (!bomRoute.getMbbProduBomList().isEmpty()) {
// 遍历bom项 从台账表中筛选对应基础物料
for (MbbProduBom bom : bomRoute.getMbbProduBomList()){
// 查询基础物料不包含已锁定的
baseKnifeWarpper.setKnifeCode(bom.getMdItemCode());
baseKnifeWarpper.setKnifeFineState("0");
baseKnifeWarpper.setIsLocked("0");
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWarpper);
sitmTempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < techBom.getExpendLife());
if (sitmTempList.isEmpty()){
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
} else if (countMap.get(sitmTempList.get(0).getKnifeCode()) == null){
if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()){
countMap.put(sitmTempList.get(0).getKnifeCode(), bom.getStandardDosage() * knifeCount.get());
} else {
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
}
} else {
countMap.put(sitmTempList.get(0).getKnifeCode(), countMap.get(sitmTempList.get(0).getKnifeCode()) + bom.getStandardDosage() * knifeCount.get());
}
// 判断基础物料是否充足
if (sitmTempList.size() <= countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()){
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
}
}
} else {
return AjaxResult.error("缺少基础物料或没有记录整刀bom项", techBom.getKnifeCode());
}
} else {
// 将物料填入集合
tempList.forEach(item -> {
if (knifeCount.get() > 0 && Integer.parseInt(item.getKnifeLife()) >= techBom.getExpendLife()) {
knifeCount.getAndDecrement();
countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1);
}
});
if (knifeCount.get() > 0) {
// 查询整刀bom项 如果不存在说明 为基础物料或者没有记录此整刀的组装
mdItemTemp = mdItemService.selectMdItemByCode(techBom.getKnifeCode());
if (mdItemTemp == null)
return AjaxResult.error("编码查询错误", techBom.getKnifeCode());
bomRouteTemp.setMdItemId(mdItemTemp.getItemId());
bomRouteTemp.setBomVersion("V1.0");
List<BomRoute> bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp);
if (bomRouteList.size() != 1)
return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode());
BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId());
if (!bomRoute.getMbbProduBomList().isEmpty()) {
// 遍历bom项 从台账表中筛选对应基础物料
for (MbbProduBom bom : bomRoute.getMbbProduBomList()){
// 查询基础物料不包含已锁定的
baseKnifeWarpper.setKnifeCode(bom.getMdItemCode());
baseKnifeWarpper.setKnifeFineState("0");
baseKnifeWarpper.setIsLocked("0");
List<BaseKnife> sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWarpper);
sitmTempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < techBom.getExpendLife());
if (sitmTempList.isEmpty()){
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
} else if (countMap.get(sitmTempList.get(0).getKnifeCode()) == null){
if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()){
countMap.put(sitmTempList.get(0).getKnifeCode(), bom.getStandardDosage() * knifeCount.get());
} else {
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
}
} else {
countMap.put(sitmTempList.get(0).getKnifeCode(), countMap.get(sitmTempList.get(0).getKnifeCode()) + bom.getStandardDosage() * knifeCount.get());
}
// 判断基础物料是否充足
if (sitmTempList.size() <= countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()){
return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode());
}
}
} else {
return AjaxResult.error("缺少基础物料或没有记录整刀bom项", techBom.getKnifeCode());
}
}
}
}
return AjaxResult.success("齐套性检查成功!");
}
/**
* 查询工具台账列表
*/
@PreAuthorize("@ss.hasPermi('md:baseKnife:list')")
@GetMapping("/list")
public TableDataInfo list(BaseKnife baseKnife)
{
startPage();
List<BaseKnife> list = baseKnifeService.selectBaseKnifeList(baseKnife);
return getDataTable(list);
}
/**
* 导出工具台账列表
*/
@PreAuthorize("@ss.hasPermi('md:baseKnife:export')")
@Log(title = "工具台账", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BaseKnife baseKnife)
{
List<BaseKnife> list = baseKnifeService.selectBaseKnifeList(baseKnife);
ExcelUtil<BaseKnife> util = new ExcelUtil<BaseKnife>(BaseKnife.class);
util.exportExcel(response, list, "工具台账数据");
}
/**
* 获取工具台账详细信息
*/
@PreAuthorize("@ss.hasPermi('md:baseKnife:query')")
@GetMapping(value = "/{baseKnifeId}")
public AjaxResult getInfo(@PathVariable("baseKnifeId") Long baseKnifeId)
{
return AjaxResult.success(baseKnifeService.selectBaseKnifeByBaseKnifeId(baseKnifeId));
}
/**
* 新增工具台账
*/
@PreAuthorize("@ss.hasPermi('md:baseKnife:add')")
@Log(title = "工具台账", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseKnife baseKnife)
{
return toAjax(baseKnifeService.insertBaseKnife(baseKnife));
}
/**
* 修改工具台账
*/
@PreAuthorize("@ss.hasPermi('md:baseKnife:edit')")
@Log(title = "工具台账", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BaseKnife baseKnife)
{
return toAjax(baseKnifeService.updateBaseKnife(baseKnife));
}
/**
* 删除工具台账
*/
@PreAuthorize("@ss.hasPermi('md:baseKnife:remove')")
@Log(title = "工具台账", businessType = BusinessType.DELETE)
@DeleteMapping("/{baseKnifeIds}")
public AjaxResult remove(@PathVariable Long[] baseKnifeIds)
{
return toAjax(baseKnifeService.deleteBaseKnifeByBaseKnifeIds(baseKnifeIds));
}
}

View File

@ -24,7 +24,11 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.Null;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/mes/md/mditem")
@ -42,6 +46,49 @@ public class MdItemController extends BaseController {
@Autowired
private WmBarCodeUtil barcodeUtil;
/**
* 列表查询
*
* @return
*/
@GetMapping("/open/selectItem")
public List<Map<String, String>> selectItem() {
MdItem mdItem = new MdItem();
mdItem.setItemOrProduct("ITEM");
List<MdItem> list = mdItemService.selectMdItemList(mdItem);
List<Map<String, String>> result = new ArrayList<>();
list.forEach(item -> {
Map<String, String> map = new HashMap<>();
map.put("gid", item.getItemId().toString());
map.put("code", item.getItemCode());
map.put("safeInventory", item.getMinStock().toString().split("\\.")[0]);
map.put("pmbbMeasure", item.getItemTypeName());
map.put("name", item.getItemName());
map.put("count", mdItemService.getMdItemCount(item.getItemId()).toString());
result.add(map);
});
return result;
}
@GetMapping("/open/selectProduct")
public List<Map<String, String>> selectProduct() {
MdItem mdItem = new MdItem();
mdItem.setItemOrProduct("PRODUCT");
List<MdItem> list = mdItemService.selectMdItemList(mdItem);
List<Map<String, String>> result = new ArrayList<>();
list.forEach(item -> {
Map<String, String> map = new HashMap<>();
map.put("gid", item.getItemId().toString());
map.put("code", item.getItemCode());
map.put("safeInventory", item.getMinStock().toString().split("\\.")[0]);
map.put("pmbbMeasure", item.getItemTypeName());
map.put("name", item.getItemName());
map.put("count", mdItemService.getMdItemCount(item.getItemId()).toString());
result.add(map);
});
return result;
}
/**
* 列表查询
*

View File

@ -0,0 +1,328 @@
package com.ktg.mes.md.domain;
import java.util.Date;
import java.util.List;
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;
/**
* 工具台账对象 BASE_KNIFE
*
* @author yinjinlu
* @date 2024-10-31
*/
public class BaseKnife extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long baseKnifeId;
/** 物料id */
@Excel(name = "物料id")
private Long mbbBdMrlId;
/** rfid */
@Excel(name = "rfid")
private String rfid;
/** 工具编码 */
@Excel(name = "工具编码")
private String knifeCode;
/** 工具名称 */
@Excel(name = "工具名称")
private String knifeName;
/** 计量单位 */
@Excel(name = "计量单位")
private String knifeUnit;
/** 工具类型(物料分类) */
@Excel(name = "工具类型", readConverterExp = "物料分类")
private String knifeType;
/** 安全库存 */
@Excel(name = "安全库存")
private String safeStock;
/** 标准数量 */
@Excel(name = "标准数量")
private String standardQuantity;
/** 库区编码 */
@Excel(name = "库区编码")
private String areaCode;
/** 工具寿命 */
@Excel(name = "工具寿命")
private String knifeLife;
/** 工具状态 */
@Excel(name = "工具状态")
private String knifeFineState;
/** 库区编码 */
@Excel(name = "是否锁定")
private String isLocked;
/** 库区编码 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date lockedStartTime;
/** 库区编码 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date lockedEndTime;
@Excel(name = "归属计划单")
private String planSheet;
@Excel(name = "重置次数")
private String resetCount;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private String attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
private String attr4;
/** 物料产品信息 */
private List<MdItem> mdItemList;
public void setBaseKnifeId(Long baseKnifeId)
{
this.baseKnifeId = baseKnifeId;
}
public Long getBaseKnifeId()
{
return baseKnifeId;
}
public void setMbbBdMrlId(Long mbbBdMrlId)
{
this.mbbBdMrlId = mbbBdMrlId;
}
public Long getMbbBdMrlId()
{
return mbbBdMrlId;
}
public void setRfid(String rfid)
{
this.rfid = rfid;
}
public String getRfid()
{
return rfid;
}
public void setKnifeCode(String knifeCode)
{
this.knifeCode = knifeCode;
}
public String getIsLocked() {
return isLocked;
}
public void setIsLocked(String isLocked) {
this.isLocked = isLocked;
}
public Date getLockedStartTime() {
return lockedStartTime;
}
public void setLockedStartTime(Date lockedStartTime) {
this.lockedStartTime = lockedStartTime;
}
public Date getLockedEndTime() {
return lockedEndTime;
}
public void setLockedEndTime(Date lockedEndTime) {
this.lockedEndTime = lockedEndTime;
}
public String getPlanSheet() {
return planSheet;
}
public void setPlanSheet(String planSheet) {
this.planSheet = planSheet;
}
public String getResetCount() {
return resetCount;
}
public void setResetCount(String resetCount) {
this.resetCount = resetCount;
}
public String getKnifeCode()
{
return knifeCode;
}
public void setKnifeName(String knifeName)
{
this.knifeName = knifeName;
}
public String getKnifeName()
{
return knifeName;
}
public void setKnifeUnit(String knifeUnit)
{
this.knifeUnit = knifeUnit;
}
public String getKnifeUnit()
{
return knifeUnit;
}
public void setKnifeType(String knifeType)
{
this.knifeType = knifeType;
}
public String getKnifeType()
{
return knifeType;
}
public void setSafeStock(String safeStock)
{
this.safeStock = safeStock;
}
public String getSafeStock()
{
return safeStock;
}
public void setStandardQuantity(String standardQuantity)
{
this.standardQuantity = standardQuantity;
}
public String getStandardQuantity()
{
return standardQuantity;
}
public void setAreaCode(String areaCode)
{
this.areaCode = areaCode;
}
public String getAreaCode()
{
return areaCode;
}
public void setKnifeLife(String knifeLife)
{
this.knifeLife = knifeLife;
}
public String getKnifeLife()
{
return knifeLife;
}
public void setKnifeFineState(String knifeFineState)
{
this.knifeFineState = knifeFineState;
}
public String getKnifeFineState()
{
return knifeFineState;
}
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(String attr3)
{
this.attr3 = attr3;
}
public String getAttr3()
{
return attr3;
}
public void setAttr4(String attr4)
{
this.attr4 = attr4;
}
public String getAttr4()
{
return attr4;
}
public List<MdItem> getMdItemList()
{
return mdItemList;
}
public void setMdItemList(List<MdItem> mdItemList)
{
this.mdItemList = mdItemList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("baseKnifeId", getBaseKnifeId())
.append("mbbBdMrlId", getMbbBdMrlId())
.append("rfid", getRfid())
.append("knifeCode", getKnifeCode())
.append("knifeName", getKnifeName())
.append("knifeUnit", getKnifeUnit())
.append("knifeType", getKnifeType())
.append("safeStock", getSafeStock())
.append("standardQuantity", getStandardQuantity())
.append("areaCode", getAreaCode())
.append("knifeLife", getKnifeLife())
.append("knifeFineState", getKnifeFineState())
.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())
.append("mdItemList", getMdItemList())
.toString();
}
}

View File

@ -0,0 +1,87 @@
package com.ktg.mes.md.mapper;
import java.util.List;
import com.ktg.mes.md.domain.BaseKnife;
import com.ktg.mes.md.domain.MdItem;
/**
* 工具台账Mapper接口
*
* @author yinjinlu
* @date 2024-10-31
*/
public interface BaseKnifeMapper
{
/**
* 查询工具台账
*
* @param baseKnifeId 工具台账主键
* @return 工具台账
*/
public BaseKnife selectBaseKnifeByBaseKnifeId(Long baseKnifeId);
/**
* 查询工具台账列表
*
* @param baseKnife 工具台账
* @return 工具台账集合
*/
public List<BaseKnife> selectBaseKnifeList(BaseKnife baseKnife);
/**
* 新增工具台账
*
* @param baseKnife 工具台账
* @return 结果
*/
public int insertBaseKnife(BaseKnife baseKnife);
/**
* 修改工具台账
*
* @param baseKnife 工具台账
* @return 结果
*/
public int updateBaseKnife(BaseKnife baseKnife);
/**
* 删除工具台账
*
* @param baseKnifeId 工具台账主键
* @return 结果
*/
public int deleteBaseKnifeByBaseKnifeId(Long baseKnifeId);
/**
* 批量删除工具台账
*
* @param baseKnifeIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteBaseKnifeByBaseKnifeIds(Long[] baseKnifeIds);
/**
* 批量删除物料产品
*
* @param baseKnifeIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteMdItemByItemIds(Long[] baseKnifeIds);
/**
* 批量新增物料产品
*
* @param mdItemList 物料产品列表
* @return 结果
*/
public int batchMdItem(List<MdItem> mdItemList);
/**
* 通过工具台账主键删除物料产品信息
*
* @param baseKnifeId 工具台账ID
* @return 结果
*/
public int deleteMdItemByItemId(Long baseKnifeId);
}

View File

@ -71,4 +71,7 @@ public interface MdItemMapper {
*/
public int deleteMdItemByIds(Long[] itemIds);
Integer getMdItemCount(Long itemId);
MdItem selectMdItemByCode(String itemCode);
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.md.service;
import java.util.List;
import com.ktg.mes.md.domain.BaseKnife;
/**
* 工具台账Service接口
*
* @author yinjinlu
* @date 2024-10-31
*/
public interface IBaseKnifeService
{
/**
* 查询工具台账
*
* @param baseKnifeId 工具台账主键
* @return 工具台账
*/
public BaseKnife selectBaseKnifeByBaseKnifeId(Long baseKnifeId);
/**
* 查询工具台账列表
*
* @param baseKnife 工具台账
* @return 工具台账集合
*/
public List<BaseKnife> selectBaseKnifeList(BaseKnife baseKnife);
/**
* 新增工具台账
*
* @param baseKnife 工具台账
* @return 结果
*/
public int insertBaseKnife(BaseKnife baseKnife);
/**
* 修改工具台账
*
* @param baseKnife 工具台账
* @return 结果
*/
public int updateBaseKnife(BaseKnife baseKnife);
/**
* 批量删除工具台账
*
* @param baseKnifeIds 需要删除的工具台账主键集合
* @return 结果
*/
public int deleteBaseKnifeByBaseKnifeIds(Long[] baseKnifeIds);
/**
* 删除工具台账信息
*
* @param baseKnifeId 工具台账主键
* @return 结果
*/
public int deleteBaseKnifeByBaseKnifeId(Long baseKnifeId);
}

View File

@ -45,6 +45,13 @@ public interface IMdItemService {
*/
public MdItem selectMdItemById(Long itemId);
/**
* 根据code查询物料
* @param itemCode
* @return
*/
public MdItem selectMdItemByCode(String itemCode);
/**
* 检查物料编码是否唯一
* @param mdItem
@ -87,5 +94,6 @@ public interface IMdItemService {
*/
public int deleteByItemId(Long itemId);
Integer getMdItemCount(Long itemId);
}

View File

@ -0,0 +1,109 @@
package com.ktg.mes.md.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 java.util.ArrayList;
import com.ktg.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.ktg.mes.md.domain.MdItem;
import com.ktg.mes.md.mapper.BaseKnifeMapper;
import com.ktg.mes.md.domain.BaseKnife;
import com.ktg.mes.md.service.IBaseKnifeService;
/**
* 工具台账Service业务层处理
*
* @author yinjinlu
* @date 2024-10-31
*/
@Service
public class BaseKnifeServiceImpl implements IBaseKnifeService
{
@Autowired
private BaseKnifeMapper baseKnifeMapper;
/**
* 查询工具台账
*
* @param baseKnifeId 工具台账主键
* @return 工具台账
*/
@Override
public BaseKnife selectBaseKnifeByBaseKnifeId(Long baseKnifeId)
{
return baseKnifeMapper.selectBaseKnifeByBaseKnifeId(baseKnifeId);
}
/**
* 查询工具台账列表
*
* @param baseKnife 工具台账
* @return 工具台账
*/
@Override
public List<BaseKnife> selectBaseKnifeList(BaseKnife baseKnife)
{
return baseKnifeMapper.selectBaseKnifeList(baseKnife);
}
/**
* 新增工具台账
*
* @param baseKnife 工具台账
* @return 结果
*/
@Transactional
@Override
public int insertBaseKnife(BaseKnife baseKnife)
{
baseKnife.setCreateTime(DateUtils.getNowDate());
int rows = baseKnifeMapper.insertBaseKnife(baseKnife);
return rows;
}
/**
* 修改工具台账
*
* @param baseKnife 工具台账
* @return 结果
*/
@Transactional
@Override
public int updateBaseKnife(BaseKnife baseKnife)
{
baseKnife.setUpdateTime(DateUtils.getNowDate());
baseKnifeMapper.deleteMdItemByItemId(baseKnife.getBaseKnifeId());
return baseKnifeMapper.updateBaseKnife(baseKnife);
}
/**
* 批量删除工具台账
*
* @param baseKnifeIds 需要删除的工具台账主键
* @return 结果
*/
@Transactional
@Override
public int deleteBaseKnifeByBaseKnifeIds(Long[] baseKnifeIds)
{
baseKnifeMapper.deleteMdItemByItemIds(baseKnifeIds);
return baseKnifeMapper.deleteBaseKnifeByBaseKnifeIds(baseKnifeIds);
}
/**
* 删除工具台账信息
*
* @param baseKnifeId 工具台账主键
* @return 结果
*/
@Transactional
@Override
public int deleteBaseKnifeByBaseKnifeId(Long baseKnifeId)
{
baseKnifeMapper.deleteMdItemByItemId(baseKnifeId);
return baseKnifeMapper.deleteBaseKnifeByBaseKnifeId(baseKnifeId);
}
}

View File

@ -129,6 +129,11 @@ public class MdItemServiceImpl implements IMdItemService {
return mdItemMapper.selectMdItemById(itemId);
}
@Override
public MdItem selectMdItemByCode(String itemCode) {
return mdItemMapper.selectMdItemByCode(itemCode);
}
@Override
public String checkItemCodeUnique(MdItem mdItem) {
MdItem item = mdItemMapper.checkItemCodeUnique(mdItem);
@ -170,4 +175,9 @@ public class MdItemServiceImpl implements IMdItemService {
public int deleteByItemId(Long itemId) {
return mdItemMapper.deleteMdItemById(itemId);
}
@Override
public Integer getMdItemCount(Long itemId) {
return mdItemMapper.getMdItemCount(itemId);
}
}

View File

@ -0,0 +1,106 @@
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.UcmCtBase;
import com.ktg.mes.wm.service.IUcmCtBaseService;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.common.core.page.TableDataInfo;
/**
* 料箱管理Controller
*
* @author yinjinlu
* @date 2024-10-31
*/
@RestController
@RequestMapping("/wm/ctBase")
public class UcmCtBaseController extends BaseController
{
@Autowired
private IUcmCtBaseService ucmCtBaseService;
/**
* 查询料箱管理列表
*/
@PreAuthorize("@ss.hasPermi('wm:ctBase:list')")
@GetMapping("/list")
public TableDataInfo list(UcmCtBase ucmCtBase)
{
startPage();
List<UcmCtBase> list = ucmCtBaseService.selectUcmCtBaseList(ucmCtBase);
return getDataTable(list);
}
/**
* 导出料箱管理列表
*/
@PreAuthorize("@ss.hasPermi('wm:ctBase:export')")
@Log(title = "料箱管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, UcmCtBase ucmCtBase)
{
List<UcmCtBase> list = ucmCtBaseService.selectUcmCtBaseList(ucmCtBase);
ExcelUtil<UcmCtBase> util = new ExcelUtil<UcmCtBase>(UcmCtBase.class);
util.exportExcel(response, list, "料箱管理数据");
}
/**
* 获取料箱管理详细信息
*/
@PreAuthorize("@ss.hasPermi('wm:ctBase:query')")
@GetMapping(value = "/{ctBaseId}")
public AjaxResult getInfo(@PathVariable("ctBaseId") String ctBaseId)
{
return AjaxResult.success(ucmCtBaseService.selectUcmCtBaseByCtBaseId(ctBaseId));
}
/**
* 新增料箱管理
*/
@PreAuthorize("@ss.hasPermi('wm:ctBase:add')")
@Log(title = "料箱管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody UcmCtBase ucmCtBase)
{
ucmCtBase.setCreateBy(getUsername());
return toAjax(ucmCtBaseService.insertUcmCtBase(ucmCtBase));
}
/**
* 修改料箱管理
*/
@PreAuthorize("@ss.hasPermi('wm:ctBase:edit')")
@Log(title = "料箱管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody UcmCtBase ucmCtBase)
{
ucmCtBase.setUpdateBy(getUsername());
return toAjax(ucmCtBaseService.updateUcmCtBase(ucmCtBase));
}
/**
* 删除料箱管理
*/
@PreAuthorize("@ss.hasPermi('wm:ctBase:remove')")
@Log(title = "料箱管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ctBaseIds}")
public AjaxResult remove(@PathVariable String[] ctBaseIds)
{
return toAjax(ucmCtBaseService.deleteUcmCtBaseByCtBaseIds(ctBaseIds));
}
}

View File

@ -0,0 +1,196 @@
package com.ktg.mes.wm.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;
/**
* 工艺bom对象 base_technology_bom
*
* @author yinjinlu
* @date 2024-10-30
*/
public class BaseTechnologyBom extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 工艺bomId */
private Long technologyBomId;
/** 图号 */
@Excel(name = "图号")
private String figureCode;
/** 工序代码 */
@Excel(name = "工序代码")
private String processCode;
/** 工序名称 */
@Excel(name = "工序名称")
private String processName;
/** 刀具代码 */
@Excel(name = "刀具代码")
private String knifeCode;
/** 序内刀具编号 */
@Excel(name = "序内刀具编号")
private String knifeSort;
/** 刀具数量 */
@Excel(name = "刀具数量")
private Long knifeCount;
/** 消耗定额 */
@Excel(name = "消耗定额")
private Long expendLife;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private Long attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
private Long attr4;
public void setTechnologyBomId(Long technologyBomId)
{
this.technologyBomId = technologyBomId;
}
public Long getTechnologyBomId()
{
return technologyBomId;
}
public void setFigureCode(String figureCode)
{
this.figureCode = figureCode;
}
public String getFigureCode()
{
return figureCode;
}
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 setKnifeCode(String knifeCode)
{
this.knifeCode = knifeCode;
}
public String getKnifeCode()
{
return knifeCode;
}
public void setKnifeSort(String knifeSort)
{
this.knifeSort = knifeSort;
}
public String getKnifeSort()
{
return knifeSort;
}
public void setKnifeCount(Long knifeCount)
{
this.knifeCount = knifeCount;
}
public Long getKnifeCount()
{
return knifeCount;
}
public void setExpendLife(Long expendLife)
{
this.expendLife = expendLife;
}
public Long getExpendLife()
{
return expendLife;
}
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("technologyBomId", getTechnologyBomId())
.append("figureCode", getFigureCode())
.append("processCode", getProcessCode())
.append("processName", getProcessName())
.append("knifeCode", getKnifeCode())
.append("knifeSort", getKnifeSort())
.append("knifeCount", getKnifeCount())
.append("expendLife", getExpendLife())
.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();
}
}

View File

@ -0,0 +1,122 @@
package com.ktg.mes.wm.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;
/**
* 料箱管理对象 UCM_CT_BASE
*
* @author yinjinlu
* @date 2024-10-31
*/
public class UcmCtBase extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 料箱id */
private String ctBaseId;
/** 料箱编码 */
@Excel(name = "料箱编码")
private String code;
/** 料箱状态0-正常1-绑定2-解绑 */
@Excel(name = "料箱状态0-正常1-绑定2-解绑")
private String type;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private String attr3;
/** 预留字段4 */
private String attr4;
public void setCtBaseId(String ctBaseId)
{
this.ctBaseId = ctBaseId;
}
public String getCtBaseId()
{
return ctBaseId;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
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(String attr3)
{
this.attr3 = attr3;
}
public String getAttr3()
{
return attr3;
}
public void setAttr4(String attr4)
{
this.attr4 = attr4;
}
public String getAttr4()
{
return attr4;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("ctBaseId", getCtBaseId())
.append("code", getCode())
.append("type", getType())
.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();
}
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.wm.mapper;
import java.util.List;
import com.ktg.mes.wm.domain.BaseTechnologyBom;
/**
* 工艺bomMapper接口
*
* @author yinjinlu
* @date 2024-10-30
*/
public interface BaseTechnologyBomMapper
{
/**
* 查询工艺bom
*
* @param technologyBomId 工艺bom主键
* @return 工艺bom
*/
public BaseTechnologyBom selectBaseTechnologyBomByTechnologyBomId(Long technologyBomId);
/**
* 查询工艺bom列表
*
* @param baseTechnologyBom 工艺bom
* @return 工艺bom集合
*/
public List<BaseTechnologyBom> selectBaseTechnologyBomList(BaseTechnologyBom baseTechnologyBom);
/**
* 新增工艺bom
*
* @param baseTechnologyBom 工艺bom
* @return 结果
*/
public int insertBaseTechnologyBom(BaseTechnologyBom baseTechnologyBom);
/**
* 修改工艺bom
*
* @param baseTechnologyBom 工艺bom
* @return 结果
*/
public int updateBaseTechnologyBom(BaseTechnologyBom baseTechnologyBom);
/**
* 删除工艺bom
*
* @param technologyBomId 工艺bom主键
* @return 结果
*/
public int deleteBaseTechnologyBomByTechnologyBomId(Long technologyBomId);
/**
* 批量删除工艺bom
*
* @param technologyBomIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteBaseTechnologyBomByTechnologyBomIds(Long[] technologyBomIds);
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.wm.mapper;
import java.util.List;
import com.ktg.mes.wm.domain.UcmCtBase;
/**
* 料箱管理Mapper接口
*
* @author yinjinlu
* @date 2024-10-31
*/
public interface UcmCtBaseMapper
{
/**
* 查询料箱管理
*
* @param ctBaseId 料箱管理主键
* @return 料箱管理
*/
public UcmCtBase selectUcmCtBaseByCtBaseId(String ctBaseId);
/**
* 查询料箱管理列表
*
* @param ucmCtBase 料箱管理
* @return 料箱管理集合
*/
public List<UcmCtBase> selectUcmCtBaseList(UcmCtBase ucmCtBase);
/**
* 新增料箱管理
*
* @param ucmCtBase 料箱管理
* @return 结果
*/
public int insertUcmCtBase(UcmCtBase ucmCtBase);
/**
* 修改料箱管理
*
* @param ucmCtBase 料箱管理
* @return 结果
*/
public int updateUcmCtBase(UcmCtBase ucmCtBase);
/**
* 删除料箱管理
*
* @param ctBaseId 料箱管理主键
* @return 结果
*/
public int deleteUcmCtBaseByCtBaseId(String ctBaseId);
/**
* 批量删除料箱管理
*
* @param ctBaseIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteUcmCtBaseByCtBaseIds(String[] ctBaseIds);
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.wm.service;
import java.util.List;
import com.ktg.mes.wm.domain.BaseTechnologyBom;
/**
* 工艺bomService接口
*
* @author yinjinlu
* @date 2024-10-30
*/
public interface IBaseTechnologyBomService
{
/**
* 查询工艺bom
*
* @param technologyBomId 工艺bom主键
* @return 工艺bom
*/
public BaseTechnologyBom selectBaseTechnologyBomByTechnologyBomId(Long technologyBomId);
/**
* 查询工艺bom列表
*
* @param baseTechnologyBom 工艺bom
* @return 工艺bom集合
*/
public List<BaseTechnologyBom> selectBaseTechnologyBomList(BaseTechnologyBom baseTechnologyBom);
/**
* 新增工艺bom
*
* @param baseTechnologyBom 工艺bom
* @return 结果
*/
public int insertBaseTechnologyBom(BaseTechnologyBom baseTechnologyBom);
/**
* 修改工艺bom
*
* @param baseTechnologyBom 工艺bom
* @return 结果
*/
public int updateBaseTechnologyBom(BaseTechnologyBom baseTechnologyBom);
/**
* 批量删除工艺bom
*
* @param technologyBomIds 需要删除的工艺bom主键集合
* @return 结果
*/
public int deleteBaseTechnologyBomByTechnologyBomIds(Long[] technologyBomIds);
/**
* 删除工艺bom信息
*
* @param technologyBomId 工艺bom主键
* @return 结果
*/
public int deleteBaseTechnologyBomByTechnologyBomId(Long technologyBomId);
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.wm.service;
import java.util.List;
import com.ktg.mes.wm.domain.UcmCtBase;
/**
* 料箱管理Service接口
*
* @author yinjinlu
* @date 2024-10-31
*/
public interface IUcmCtBaseService
{
/**
* 查询料箱管理
*
* @param ctBaseId 料箱管理主键
* @return 料箱管理
*/
public UcmCtBase selectUcmCtBaseByCtBaseId(String ctBaseId);
/**
* 查询料箱管理列表
*
* @param ucmCtBase 料箱管理
* @return 料箱管理集合
*/
public List<UcmCtBase> selectUcmCtBaseList(UcmCtBase ucmCtBase);
/**
* 新增料箱管理
*
* @param ucmCtBase 料箱管理
* @return 结果
*/
public int insertUcmCtBase(UcmCtBase ucmCtBase);
/**
* 修改料箱管理
*
* @param ucmCtBase 料箱管理
* @return 结果
*/
public int updateUcmCtBase(UcmCtBase ucmCtBase);
/**
* 批量删除料箱管理
*
* @param ctBaseIds 需要删除的料箱管理主键集合
* @return 结果
*/
public int deleteUcmCtBaseByCtBaseIds(String[] ctBaseIds);
/**
* 删除料箱管理信息
*
* @param ctBaseId 料箱管理主键
* @return 结果
*/
public int deleteUcmCtBaseByCtBaseId(String ctBaseId);
}

View File

@ -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.BaseTechnologyBomMapper;
import com.ktg.mes.wm.domain.BaseTechnologyBom;
import com.ktg.mes.wm.service.IBaseTechnologyBomService;
/**
* 工艺bomService业务层处理
*
* @author yinjinlu
* @date 2024-10-30
*/
@Service
public class BaseTechnologyBomServiceImpl implements IBaseTechnologyBomService
{
@Autowired
private BaseTechnologyBomMapper baseTechnologyBomMapper;
/**
* 查询工艺bom
*
* @param technologyBomId 工艺bom主键
* @return 工艺bom
*/
@Override
public BaseTechnologyBom selectBaseTechnologyBomByTechnologyBomId(Long technologyBomId)
{
return baseTechnologyBomMapper.selectBaseTechnologyBomByTechnologyBomId(technologyBomId);
}
/**
* 查询工艺bom列表
*
* @param baseTechnologyBom 工艺bom
* @return 工艺bom
*/
@Override
public List<BaseTechnologyBom> selectBaseTechnologyBomList(BaseTechnologyBom baseTechnologyBom)
{
return baseTechnologyBomMapper.selectBaseTechnologyBomList(baseTechnologyBom);
}
/**
* 新增工艺bom
*
* @param baseTechnologyBom 工艺bom
* @return 结果
*/
@Override
public int insertBaseTechnologyBom(BaseTechnologyBom baseTechnologyBom)
{
baseTechnologyBom.setCreateTime(DateUtils.getNowDate());
return baseTechnologyBomMapper.insertBaseTechnologyBom(baseTechnologyBom);
}
/**
* 修改工艺bom
*
* @param baseTechnologyBom 工艺bom
* @return 结果
*/
@Override
public int updateBaseTechnologyBom(BaseTechnologyBom baseTechnologyBom)
{
baseTechnologyBom.setUpdateTime(DateUtils.getNowDate());
return baseTechnologyBomMapper.updateBaseTechnologyBom(baseTechnologyBom);
}
/**
* 批量删除工艺bom
*
* @param technologyBomIds 需要删除的工艺bom主键
* @return 结果
*/
@Override
public int deleteBaseTechnologyBomByTechnologyBomIds(Long[] technologyBomIds)
{
return baseTechnologyBomMapper.deleteBaseTechnologyBomByTechnologyBomIds(technologyBomIds);
}
/**
* 删除工艺bom信息
*
* @param technologyBomId 工艺bom主键
* @return 结果
*/
@Override
public int deleteBaseTechnologyBomByTechnologyBomId(Long technologyBomId)
{
return baseTechnologyBomMapper.deleteBaseTechnologyBomByTechnologyBomId(technologyBomId);
}
}

View File

@ -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.UcmCtBaseMapper;
import com.ktg.mes.wm.domain.UcmCtBase;
import com.ktg.mes.wm.service.IUcmCtBaseService;
/**
* 料箱管理Service业务层处理
*
* @author yinjinlu
* @date 2024-10-31
*/
@Service
public class UcmCtBaseServiceImpl implements IUcmCtBaseService
{
@Autowired
private UcmCtBaseMapper ucmCtBaseMapper;
/**
* 查询料箱管理
*
* @param ctBaseId 料箱管理主键
* @return 料箱管理
*/
@Override
public UcmCtBase selectUcmCtBaseByCtBaseId(String ctBaseId)
{
return ucmCtBaseMapper.selectUcmCtBaseByCtBaseId(ctBaseId);
}
/**
* 查询料箱管理列表
*
* @param ucmCtBase 料箱管理
* @return 料箱管理
*/
@Override
public List<UcmCtBase> selectUcmCtBaseList(UcmCtBase ucmCtBase)
{
return ucmCtBaseMapper.selectUcmCtBaseList(ucmCtBase);
}
/**
* 新增料箱管理
*
* @param ucmCtBase 料箱管理
* @return 结果
*/
@Override
public int insertUcmCtBase(UcmCtBase ucmCtBase)
{
ucmCtBase.setCreateTime(DateUtils.getNowDate());
return ucmCtBaseMapper.insertUcmCtBase(ucmCtBase);
}
/**
* 修改料箱管理
*
* @param ucmCtBase 料箱管理
* @return 结果
*/
@Override
public int updateUcmCtBase(UcmCtBase ucmCtBase)
{
ucmCtBase.setUpdateTime(DateUtils.getNowDate());
return ucmCtBaseMapper.updateUcmCtBase(ucmCtBase);
}
/**
* 批量删除料箱管理
*
* @param ctBaseIds 需要删除的料箱管理主键
* @return 结果
*/
@Override
public int deleteUcmCtBaseByCtBaseIds(String[] ctBaseIds)
{
return ucmCtBaseMapper.deleteUcmCtBaseByCtBaseIds(ctBaseIds);
}
/**
* 删除料箱管理信息
*
* @param ctBaseId 料箱管理主键
* @return 结果
*/
@Override
public int deleteUcmCtBaseByCtBaseId(String ctBaseId)
{
return ucmCtBaseMapper.deleteUcmCtBaseByCtBaseId(ctBaseId);
}
}

View File

@ -0,0 +1,216 @@
<?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.BaseKnifeMapper">
<resultMap type="BaseKnife" id="BaseKnifeResult">
<result property="baseKnifeId" column="BASE_KNIFE_ID" />
<result property="mbbBdMrlId" column="MBB_BD_MRL_ID" />
<result property="rfid" column="RFID" />
<result property="knifeCode" column="KNIFE_CODE" />
<result property="knifeName" column="KNIFE_NAME" />
<result property="knifeUnit" column="KNIFE_UNIT" />
<result property="knifeType" column="KNIFE_TYPE" />
<result property="safeStock" column="SAFE_STOCK" />
<result property="standardQuantity" column="STANDARD_QUANTITY" />
<result property="areaCode" column="AREA_CODE" />
<result property="knifeLife" column="KNIFE_LIFE" />
<result property="knifeFineState" column="KNIFE_FINE_STATE" />
<result property="isLocked" column="IS_LOCKED" />
<result property="lockedStartTime" column="LOCKED_START_TIME" />
<result property="lockedEndTime" column="LOCKED_END_TIME" />
<result property="planSheet" column="PLAN_SHEET" />
<result property="resetCount" column="RESET_COUNT" />
<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>
<resultMap id="BaseKnifeMdItemResult" type="BaseKnife" extends="BaseKnifeResult">
<collection property="mdItemList" notNullColumn="sub_ITEM_ID" javaType="java.util.List" resultMap="MdItemResult" />
</resultMap>
<resultMap type="MdItem" id="MdItemResult">
<result property="itemId" column="sub_ITEM_ID" />
<result property="itemCode" column="sub_ITEM_CODE" />
<result property="itemName" column="sub_ITEM_NAME" />
<result property="specification" column="sub_SPECIFICATION" />
<result property="unitOfMeasure" column="sub_UNIT_OF_MEASURE" />
<result property="itemOrProduct" column="sub_ITEM_OR_PRODUCT" />
<result property="itemTypeId" column="sub_ITEM_TYPE_ID" />
<result property="itemTypeCode" column="sub_ITEM_TYPE_CODE" />
<result property="itemTypeName" column="sub_ITEM_TYPE_NAME" />
<result property="enableFlag" column="sub_ENABLE_FLAG" />
<result property="safeStockFlag" column="sub_SAFE_STOCK_FLAG" />
<result property="minStock" column="sub_MIN_STOCK" />
<result property="maxStock" column="sub_MAX_STOCK" />
<result property="remark" column="sub_REMARK" />
<result property="attr1" column="sub_ATTR1" />
<result property="attr2" column="sub_ATTR2" />
<result property="attr3" column="sub_ATTR3" />
<result property="attr4" column="sub_ATTR4" />
<result property="createBy" column="sub_CREATE_BY" />
<result property="createTime" column="sub_CREATE_TIME" />
<result property="updateBy" column="sub_UPDATE_BY" />
<result property="updateTime" column="sub_UPDATE_TIME" />
<result property="highValue" column="sub_HIGH_VALUE" />
<result property="unitName" column="sub_UNIT_NAME" />
<result property="modelNumber" column="sub_MODEL_NUMBER" />
<result property="standardNumber" column="sub_STANDARD_NUMBER" />
</resultMap>
<sql id="selectBaseKnifeVo">
SELECT BK.BASE_KNIFE_ID, BK.MBB_BD_MRL_ID, RFID, MI.ITEM_CODE AS KNIFE_CODE, MI.ITEM_NAME AS KNIFE_NAME, MI.UNIT_NAME AS KNIFE_UNIT,
MIT.ITEM_TYPE_NAME AS KNIFE_TYPE, BK.SAFE_STOCK, BK.STANDARD_QUANTITY, BK.AREA_CODE, BK.KNIFE_LIFE, BK.KNIFE_FINE_STATE,
BK.IS_LOCKED, BK.LOCKED_START_TIME, BK.LOCKED_END_TIME, BK.PLAN_SHEET, BK.RESET_COUNT,
BK.REMARK, BK.ATTR1, BK.ATTR2, BK.ATTR3, BK.ATTR4, BK.CREATE_BY, BK.CREATE_TIME, BK.UPDATE_BY, BK.UPDATE_TIME from BASE_KNIFE BK
LEFT JOIN MD_ITEM MI on BK.MBB_BD_MRL_ID = MI.ITEM_ID
LEFT JOIN MD_ITEM_TYPE MIT ON MI.ITEM_TYPE_ID = MIT.ITEM_TYPE_ID
</sql>
<select id="selectBaseKnifeList" parameterType="BaseKnife" resultMap="BaseKnifeResult">
<include refid="selectBaseKnifeVo"/>
<where>
<if test="mbbBdMrlId != null and mbbBdMrlId != ''"> and MBB_BD_MRL_ID = #{mbbBdMrlId}</if>
<if test="rfid != null and rfid != ''"> and RFID = #{rfid}</if>
<if test="knifeCode != null and knifeCode != ''"> and KNIFE_CODE = #{knifeCode}</if>
<if test="knifeName != null and knifeName != ''"> and KNIFE_NAME like concat('%', #{knifeName}, '%')</if>
<if test="knifeUnit != null and knifeUnit != ''"> and KNIFE_UNIT = #{knifeUnit}</if>
<if test="knifeType != null and knifeType != ''"> and KNIFE_TYPE = #{knifeType}</if>
<if test="safeStock != null and safeStock != ''"> and SAFE_STOCK = #{safeStock}</if>
<if test="standardQuantity != null and standardQuantity != ''"> and STANDARD_QUANTITY = #{standardQuantity}</if>
<if test="areaCode != null and areaCode != ''"> and AREA_CODE = #{areaCode}</if>
<if test="knifeLife != null and knifeLife != ''"> and KNIFE_LIFE = #{knifeLife}</if>
<if test="knifeFineState != null and knifeFineState != ''"> and KNIFE_FINE_STATE = #{knifeFineState}</if>
<if test="isLocked != null and isLocked != ''"> and IS_LOCKED = #{isLocked}</if>
<if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
<if test="attr1 != null and attr1 != ''"> and ATTR1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and ATTR2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and ATTR3 = #{attr3}</if>
<if test="attr4 != null and attr4 != ''"> and ATTR4 = #{attr4}</if>
<if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if>
<if test="createTime != null and createTime != ''"> and CREATE_TIME = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
<if test="updateTime != null and updateTime != ''"> and UPDATE_TIME = #{updateTime}</if>
</where>
</select>
<select id="selectBaseKnifeByBaseKnifeId" parameterType="String" resultMap="BaseKnifeMdItemResult">
select a.BASE_KNIFE_ID, a.MBB_BD_MRL_ID, a.RFID, a.KNIFE_CODE, a.KNIFE_NAME, a.KNIFE_UNIT, a.KNIFE_TYPE, a.SAFE_STOCK, a.STANDARD_QUANTITY, a.AREA_CODE, a.KNIFE_LIFE, a.KNIFE_FINE_STATE, a.REMARK, a.ATTR1, a.ATTR2, a.ATTR3, a.ATTR4, a.CREATE_BY, a.CREATE_TIME, a.UPDATE_BY, a.UPDATE_TIME, a.IS_LOCKED, a.LOCKED_START_TIME, a.LOCKED_END_TIME
b.ITEM_ID as sub_ITEM_ID, b.ITEM_CODE as sub_ITEM_CODE, b.ITEM_NAME as sub_ITEM_NAME, b.SPECIFICATION as sub_SPECIFICATION, b.UNIT_OF_MEASURE as sub_UNIT_OF_MEASURE, b.ITEM_OR_PRODUCT as sub_ITEM_OR_PRODUCT, b.ITEM_TYPE_ID as sub_ITEM_TYPE_ID, b.ITEM_TYPE_CODE as sub_ITEM_TYPE_CODE, b.ITEM_TYPE_NAME as sub_ITEM_TYPE_NAME, b.ENABLE_FLAG as sub_ENABLE_FLAG, b.SAFE_STOCK_FLAG as sub_SAFE_STOCK_FLAG, b.MIN_STOCK as sub_MIN_STOCK, b.MAX_STOCK as sub_MAX_STOCK, b.REMARK as sub_REMARK, b.ATTR1 as sub_ATTR1, b.ATTR2 as sub_ATTR2, b.ATTR3 as sub_ATTR3, b.ATTR4 as sub_ATTR4, b.CREATE_BY as sub_CREATE_BY, b.CREATE_TIME as sub_CREATE_TIME, b.UPDATE_BY as sub_UPDATE_BY, b.UPDATE_TIME as sub_UPDATE_TIME, b.HIGH_VALUE as sub_HIGH_VALUE, b.UNIT_NAME as sub_UNIT_NAME, b.MODEL_NUMBER as sub_MODEL_NUMBER, b.STANDARD_NUMBER as sub_STANDARD_NUMBER
from BASE_KNIFE a
left join MD_ITEM b on b.ITEM_ID = a.BASE_KNIFE_ID
where a.BASE_KNIFE_ID = #{baseKnifeId}
</select>
<insert id="insertBaseKnife" parameterType="BaseKnife" useGeneratedKeys="true" keyProperty="baseKnifeId">
insert into BASE_KNIFE
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mbbBdMrlId != null">MBB_BD_MRL_ID,</if>
<if test="rfid != null">RFID,</if>
<if test="knifeCode != null">KNIFE_CODE,</if>
<if test="knifeName != null">KNIFE_NAME,</if>
<if test="knifeUnit != null">KNIFE_UNIT,</if>
<if test="knifeType != null">KNIFE_TYPE,</if>
<if test="safeStock != null">SAFE_STOCK,</if>
<if test="standardQuantity != null">STANDARD_QUANTITY,</if>
<if test="areaCode != null">AREA_CODE,</if>
<if test="knifeLife != null">KNIFE_LIFE,</if>
<if test="knifeFineState != null">KNIFE_FINE_STATE,</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="mbbBdMrlId != null">#{mbbBdMrlId},</if>
<if test="rfid != null">#{rfid},</if>
<if test="knifeCode != null">#{knifeCode},</if>
<if test="knifeName != null">#{knifeName},</if>
<if test="knifeUnit != null">#{knifeUnit},</if>
<if test="knifeType != null">#{knifeType},</if>
<if test="safeStock != null">#{safeStock},</if>
<if test="standardQuantity != null">#{standardQuantity},</if>
<if test="areaCode != null">#{areaCode},</if>
<if test="knifeLife != null">#{knifeLife},</if>
<if test="knifeFineState != null">#{knifeFineState},</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="updateBaseKnife" parameterType="BaseKnife">
update BASE_KNIFE
<trim prefix="SET" suffixOverrides=",">
<if test="mbbBdMrlId != null">MBB_BD_MRL_ID = #{mbbBdMrlId},</if>
<if test="rfid != null">RFID = #{rfid},</if>
<if test="knifeCode != null">KNIFE_CODE = #{knifeCode},</if>
<if test="knifeName != null">KNIFE_NAME = #{knifeName},</if>
<if test="knifeUnit != null">KNIFE_UNIT = #{knifeUnit},</if>
<if test="knifeType != null">KNIFE_TYPE = #{knifeType},</if>
<if test="safeStock != null">SAFE_STOCK = #{safeStock},</if>
<if test="standardQuantity != null">STANDARD_QUANTITY = #{standardQuantity},</if>
<if test="areaCode != null">AREA_CODE = #{areaCode},</if>
<if test="knifeLife != null">KNIFE_LIFE = #{knifeLife},</if>
<if test="knifeFineState != null">KNIFE_FINE_STATE = #{knifeFineState},</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 BASE_KNIFE_ID = #{baseKnifeId}
</update>
<delete id="deleteBaseKnifeByBaseKnifeId" parameterType="String">
delete from BASE_KNIFE where BASE_KNIFE_ID = #{baseKnifeId}
</delete>
<delete id="deleteBaseKnifeByBaseKnifeIds" parameterType="String">
delete from BASE_KNIFE where BASE_KNIFE_ID in
<foreach item="baseKnifeId" collection="array" open="(" separator="," close=")">
#{baseKnifeId}
</foreach>
</delete>
<delete id="deleteMdItemByItemIds" parameterType="String">
delete from MD_ITEM where ITEM_ID in
<foreach item="itemId" collection="array" open="(" separator="," close=")">
#{itemId}
</foreach>
</delete>
<delete id="deleteMdItemByItemId" parameterType="String">
delete from MD_ITEM where ITEM_ID = #{itemId}
</delete>
<insert id="batchMdItem">
insert into MD_ITEM( ITEM_ID, ITEM_CODE, ITEM_NAME, SPECIFICATION, UNIT_OF_MEASURE, ITEM_OR_PRODUCT, ITEM_TYPE_ID, ITEM_TYPE_CODE, ITEM_TYPE_NAME, ENABLE_FLAG, SAFE_STOCK_FLAG, MIN_STOCK, MAX_STOCK, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, HIGH_VALUE, UNIT_NAME, MODEL_NUMBER, STANDARD_NUMBER) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.itemId}, #{item.itemCode}, #{item.itemName}, #{item.specification}, #{item.unitOfMeasure}, #{item.itemOrProduct}, #{item.itemTypeId}, #{item.itemTypeCode}, #{item.itemTypeName}, #{item.enableFlag}, #{item.safeStockFlag}, #{item.minStock}, #{item.maxStock}, #{item.remark}, #{item.attr1}, #{item.attr2}, #{item.attr3}, #{item.attr4}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.highValue}, #{item.unitName}, #{item.modelNumber}, #{item.standardNumber})
</foreach>
</insert>
</mapper>

View File

@ -70,6 +70,9 @@
<if test="itemName != null and itemName != ''">
AND item_name like concat('%', #{itemName}, '%')
</if>
<if test="itemOrProduct != null and itemOrProduct != ''">
AND item_or_product = #{itemOrProduct}
</if>
<if test="enableFlag != null and enableFlag != ''">
AND enable_flag = #{enableFlag}
</if>
@ -131,6 +134,12 @@
where item_id = #{itemId}
</select>
<select id="selectMdItemByCode" resultMap="MdItemResult">
<include refid="selectMdItemVo">
</include>
where item_code = #{itemCode}
</select>
<select id="checkItemCodeUnique" parameterType="MdItem" resultMap="MdItemResult">
<include refid="selectMdItemVo"/>
where item_code = #{itemCode} limit 1
@ -141,6 +150,10 @@
where item_code = #{itemName} limit 1
</select>
<select id="getMdItemCount" resultType="java.lang.Integer">
select count(*) from base_knife where mbb_bd_mrl_id = #{itemId}
</select>
<insert id="insertMdItem" parameterType="MdItem" useGeneratedKeys="true" keyProperty="itemId">
insert into md_item(item_code,
item_name,

View File

@ -0,0 +1,128 @@
<?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.BaseTechnologyBomMapper">
<resultMap type="BaseTechnologyBom" id="BaseTechnologyBomResult">
<result property="technologyBomId" column="technology_bom_id" />
<result property="figureCode" column="figure_code" />
<result property="processCode" column="process_code" />
<result property="processName" column="process_name" />
<result property="knifeCode" column="knife_code" />
<result property="knifeSort" column="knife_sort" />
<result property="knifeCount" column="knife_count" />
<result property="expendLife" column="expend_life" />
<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="selectBaseTechnologyBomVo">
select technology_bom_id, figure_code, process_code, process_name, knife_code, knife_sort, knife_count, expend_life, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from base_technology_bom
</sql>
<select id="selectBaseTechnologyBomList" parameterType="BaseTechnologyBom" resultMap="BaseTechnologyBomResult">
<include refid="selectBaseTechnologyBomVo"/>
<where>
<if test="figureCode != null and figureCode != ''"> and figure_code = #{figureCode}</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="knifeCode != null and knifeCode != ''"> and knife_code = #{knifeCode}</if>
<if test="knifeSort != null and knifeSort != ''"> and knife_sort = #{knifeSort}</if>
<if test="knifeCount != null "> and knife_count = #{knifeCount}</if>
<if test="expendLife != null "> and expend_life = #{expendLife}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null "> and attr3 = #{attr3}</if>
<if test="attr4 != null "> and attr4 = #{attr4}</if>
</where>
</select>
<select id="selectBaseTechnologyBomByTechnologyBomId" parameterType="Long" resultMap="BaseTechnologyBomResult">
<include refid="selectBaseTechnologyBomVo"/>
where technology_bom_id = #{technologyBomId}
</select>
<insert id="insertBaseTechnologyBom" parameterType="BaseTechnologyBom">
insert into base_technology_bom
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="technologyBomId != null">technology_bom_id,</if>
<if test="figureCode != null and figureCode != ''">figure_code,</if>
<if test="processCode != null and processCode != ''">process_code,</if>
<if test="processName != null and processName != ''">process_name,</if>
<if test="knifeCode != null and knifeCode != ''">knife_code,</if>
<if test="knifeSort != null and knifeSort != ''">knife_sort,</if>
<if test="knifeCount != null">knife_count,</if>
<if test="expendLife != null">expend_life,</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="technologyBomId != null">#{technologyBomId},</if>
<if test="figureCode != null and figureCode != ''">#{figureCode},</if>
<if test="processCode != null and processCode != ''">#{processCode},</if>
<if test="processName != null and processName != ''">#{processName},</if>
<if test="knifeCode != null and knifeCode != ''">#{knifeCode},</if>
<if test="knifeSort != null and knifeSort != ''">#{knifeSort},</if>
<if test="knifeCount != null">#{knifeCount},</if>
<if test="expendLife != null">#{expendLife},</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="updateBaseTechnologyBom" parameterType="BaseTechnologyBom">
update base_technology_bom
<trim prefix="SET" suffixOverrides=",">
<if test="figureCode != null and figureCode != ''">figure_code = #{figureCode},</if>
<if test="processCode != null and processCode != ''">process_code = #{processCode},</if>
<if test="processName != null and processName != ''">process_name = #{processName},</if>
<if test="knifeCode != null and knifeCode != ''">knife_code = #{knifeCode},</if>
<if test="knifeSort != null and knifeSort != ''">knife_sort = #{knifeSort},</if>
<if test="knifeCount != null">knife_count = #{knifeCount},</if>
<if test="expendLife != null">expend_life = #{expendLife},</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 technology_bom_id = #{technologyBomId}
</update>
<delete id="deleteBaseTechnologyBomByTechnologyBomId" parameterType="Long">
delete from base_technology_bom where technology_bom_id = #{technologyBomId}
</delete>
<delete id="deleteBaseTechnologyBomByTechnologyBomIds" parameterType="String">
delete from base_technology_bom where technology_bom_id in
<foreach item="technologyBomId" collection="array" open="(" separator="," close=")">
#{technologyBomId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,101 @@
<?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.UcmCtBaseMapper">
<resultMap type="UcmCtBase" id="UcmCtBaseResult">
<result property="ctBaseId" column="CT_BASE_ID" />
<result property="code" column="CODE" />
<result property="type" column="TYPE" />
<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="selectUcmCtBaseVo">
select CT_BASE_ID, CODE, TYPE, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME from UCM_CT_BASE
</sql>
<select id="selectUcmCtBaseList" parameterType="UcmCtBase" resultMap="UcmCtBaseResult">
<include refid="selectUcmCtBaseVo"/>
<where>
<if test="code != null and code != ''"> and CODE = #{code}</if>
<if test="type != null and type != ''"> and TYPE = #{type}</if>
<if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if>
<if test="createTime != null and createTime != ''"> and CREATE_TIME = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
<if test="updateTime != null and updateTime != ''"> and UPDATE_TIME = #{updateTime}</if>
</where>
</select>
<select id="selectUcmCtBaseByCtBaseId" parameterType="String" resultMap="UcmCtBaseResult">
<include refid="selectUcmCtBaseVo"/>
where CT_BASE_ID = #{ctBaseId}
</select>
<insert id="insertUcmCtBase" parameterType="UcmCtBase" useGeneratedKeys="true" keyProperty="ctBaseId">
insert into UCM_CT_BASE
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null">CODE,</if>
<if test="type != null">TYPE,</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="code != null">#{code},</if>
<if test="type != null">#{type},</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="updateUcmCtBase" parameterType="UcmCtBase">
update UCM_CT_BASE
<trim prefix="SET" suffixOverrides=",">
<if test="code != null">CODE = #{code},</if>
<if test="type != null">TYPE = #{type},</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 CT_BASE_ID = #{ctBaseId}
</update>
<delete id="deleteUcmCtBaseByCtBaseId" parameterType="String">
delete from UCM_CT_BASE where CT_BASE_ID = #{ctBaseId}
</delete>
<delete id="deleteUcmCtBaseByCtBaseIds" parameterType="String">
delete from UCM_CT_BASE where CT_BASE_ID in
<foreach item="ctBaseId" collection="array" open="(" separator="," close=")">
#{ctBaseId}
</foreach>
</delete>
</mapper>