parent
7b67f71d35
commit
19047b8073
@ -0,0 +1,94 @@
|
||||
package com.foreverwin.mesnac.dataimport.handler;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.foreverwin.mesnac.dataimport.client.ResourceTypeWSClient;
|
||||
import com.foreverwin.mesnac.dataimport.handler.base.BaseHandler;
|
||||
import com.foreverwin.mesnac.dataimport.reader.FileReader;
|
||||
import com.foreverwin.mesnac.dataimport.reader.FileReaderBuilder;
|
||||
import com.foreverwin.mesnac.dataimport.reader.RowVisitor;
|
||||
import com.foreverwin.mesnac.dataimport.service.MasterObjectDefine;
|
||||
import com.foreverwin.modular.core.exception.BusinessException;
|
||||
import com.foreverwin.modular.core.util.I18nUtil;
|
||||
import com.sap.me.plant.ResourceTypeBasicConfiguration;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
public class InspectionItemHandler extends BaseHandler {
|
||||
|
||||
@Override
|
||||
public String importFile(String site, InputStream inputStream, String fileType, String mode) throws Exception {
|
||||
int row = 0;
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
Integer[] failedNumber = new Integer[]{0};
|
||||
|
||||
try {
|
||||
FileReader fileReader = new FileReaderBuilder().build(fileType);
|
||||
RowVisitor<JSONObject> visitor = getRowVisitor(site, mode, buffer, failedNumber);
|
||||
row = fileReader.visitor(visitor).read(inputStream, getHeaders());
|
||||
} catch (Exception e) {
|
||||
buffer.append(e.getMessage() + "\n");
|
||||
}
|
||||
|
||||
if (buffer.length() > 0) {
|
||||
buffer.insert(0, I18nUtil.getI18nText("MaterData.import.Summary", new Object[]{row + failedNumber[0], row, failedNumber[0]}) + "\n");
|
||||
throw BusinessException.build(buffer.toString());
|
||||
}
|
||||
buffer.insert(0, I18nUtil.getI18nText("MaterData.import.Summary", new Object[]{row + failedNumber[0], row, failedNumber[0]}) + "\n");
|
||||
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getHeaders() {
|
||||
return MasterObjectDefine.getHeadsMapping("RESOURCE_TYPE");
|
||||
}
|
||||
|
||||
public RowVisitor<JSONObject> getRowVisitor(String site, String mode, StringBuffer buffer, Integer[] failedNumber) {
|
||||
|
||||
return new RowVisitor<JSONObject>() {
|
||||
@Override
|
||||
public int visit(long index, JSONObject jsonObject) {
|
||||
Object[] params = new Object[10];
|
||||
params[0] = index;
|
||||
params[1] = jsonObject.getString("resourceType");
|
||||
|
||||
String resultMessage = null;
|
||||
try {
|
||||
if (jsonObject.containsKey("resourceType") && jsonObject.getString("resourceType").trim().length() > 0) {
|
||||
jsonObject.put("site", site);
|
||||
Collection<ResourceTypeBasicConfiguration> collection = ResourceTypeWSClient.find(jsonObject);
|
||||
if (collection.size() > 0) {
|
||||
resultMessage = "资源类型主数据已经存在";
|
||||
} else {
|
||||
resultMessage = ResourceTypeWSClient.insert(jsonObject);
|
||||
if (resultMessage == null) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (resultMessage != null) {
|
||||
params[2] = resultMessage;
|
||||
failedNumber[0]++;
|
||||
buffer.append("第" + index + "行:" + I18nUtil.getI18nText("MaterData.import.insert.fail", params) + "\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
} catch (Exception e) {
|
||||
params[2] = e.getMessage();
|
||||
failedNumber[0]++;
|
||||
buffer.append("第" + index + "行:" + I18nUtil.getI18nText("MaterData.import.insert.fail", params) + "\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getHeader() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,137 @@
|
||||
package com.foreverwin.mesnac.production.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.production.model.CutterLog;
|
||||
import com.foreverwin.mesnac.production.service.CutterLogService;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import com.foreverwin.modular.core.util.R;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-07-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/Z-CUTTER-LOG")
|
||||
public class CutterLogController {
|
||||
|
||||
@Autowired
|
||||
public CutterLogService cutterLogService;
|
||||
/**
|
||||
* 添加
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@PostMapping("/doAdd")
|
||||
public R doAdd(@RequestBody Map<String,Object> map){
|
||||
cutterLogService.doAdd(map);
|
||||
return R.ok();
|
||||
}
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/{id:.+}")
|
||||
public R getCutterLogById(@PathVariable String id) {
|
||||
return R.ok( cutterLogService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("")
|
||||
public R getCutterLogList(CutterLog cutterLog){
|
||||
List<CutterLog> result;
|
||||
QueryWrapper<CutterLog> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(cutterLog);
|
||||
result = cutterLogService.list(queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
*
|
||||
* @param frontPage 分页信息
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@GetMapping("/page")
|
||||
public R page(FrontPage<CutterLog> frontPage, CutterLog cutterLog){
|
||||
IPage result;
|
||||
QueryWrapper<CutterLog> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(cutterLog);
|
||||
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
|
||||
//TODO modify global query
|
||||
queryWrapper.lambda().and(wrapper -> wrapper
|
||||
.like(CutterLog::getHandle, frontPage.getGlobalQuery())
|
||||
.or().like(CutterLog::getSite, frontPage.getGlobalQuery())
|
||||
.or().like(CutterLog::getCutter, frontPage.getGlobalQuery())
|
||||
.or().like(CutterLog::getShopOrder, frontPage.getGlobalQuery())
|
||||
.or().like(CutterLog::getWorkCenter, frontPage.getGlobalQuery())
|
||||
.or().like(CutterLog::getSfc, frontPage.getGlobalQuery())
|
||||
.or().like(CutterLog::getType, frontPage.getGlobalQuery())
|
||||
.or().like(CutterLog::getOperation, frontPage.getGlobalQuery())
|
||||
.or().like(CutterLog::getStepId, frontPage.getGlobalQuery())
|
||||
.or().like(CutterLog::getItem, frontPage.getGlobalQuery())
|
||||
.or().like(CutterLog::getResrce, frontPage.getGlobalQuery())
|
||||
.or().like(CutterLog::getCreateUser, frontPage.getGlobalQuery())
|
||||
);
|
||||
}
|
||||
result = cutterLogService.page(frontPage.getPagePlus(), queryWrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param cutterLog 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PostMapping
|
||||
public R save(@RequestBody CutterLog cutterLog) {
|
||||
return R.ok(cutterLogService.save(cutterLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param cutterLog 传递的实体
|
||||
* @return null 失败 实体成功
|
||||
*/
|
||||
@PutMapping
|
||||
public R updateById(@RequestBody CutterLog cutterLog) {
|
||||
return R.ok(cutterLogService.updateById(cutterLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除对象
|
||||
* @param id 实体ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
|
||||
public R removeById(@PathVariable("id") String id){
|
||||
return R.ok(cutterLogService.removeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除对象
|
||||
* @param ids 实体集合ID
|
||||
* @return 0 失败 1 成功
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
|
||||
public R removeByIds(List<String> ids){
|
||||
return R.ok(cutterLogService.removeByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.foreverwin.mesnac.production.mapper;
|
||||
|
||||
import com.foreverwin.mesnac.production.model.CutterLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 刀具记录表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-07-14
|
||||
*/
|
||||
@Repository
|
||||
public interface CutterLogMapper extends BaseMapper<CutterLog> {
|
||||
|
||||
}
|
@ -0,0 +1,264 @@
|
||||
package com.foreverwin.mesnac.production.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 刀具记录表
|
||||
* </p>
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-07-14
|
||||
*/
|
||||
|
||||
@TableName("Z_CUTTER_LOG")
|
||||
|
||||
public class CutterLog extends Model<CutterLog> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "HANDLE", type = IdType.INPUT)
|
||||
private String handle;
|
||||
/**
|
||||
* 站点
|
||||
*/
|
||||
@TableField("SITE")
|
||||
private String site;
|
||||
/**
|
||||
* 刀具
|
||||
*/
|
||||
@TableField("CUTTER")
|
||||
private String cutter;
|
||||
/**
|
||||
* 工单
|
||||
*/
|
||||
@TableField("SHOP_ORDER")
|
||||
private String shopOrder;
|
||||
/**
|
||||
* 车间
|
||||
*/
|
||||
@TableField("WORK_CENTER")
|
||||
private String workCenter;
|
||||
/**
|
||||
* 产品条码
|
||||
*/
|
||||
@TableField("SFC")
|
||||
private String sfc;
|
||||
/**
|
||||
* 类别
|
||||
*/
|
||||
@TableField("TYPE")
|
||||
private String type;
|
||||
/**
|
||||
* 工序
|
||||
*/
|
||||
@TableField("OPERATION")
|
||||
private String operation;
|
||||
/**
|
||||
* 步骤
|
||||
*/
|
||||
@TableField("STEP_ID")
|
||||
private String stepId;
|
||||
/**
|
||||
* 物料
|
||||
*/
|
||||
@TableField("ITEM")
|
||||
private String item;
|
||||
/**
|
||||
* 资源
|
||||
*/
|
||||
@TableField("RESRCE")
|
||||
private String resrce;
|
||||
/**
|
||||
* 使用数量
|
||||
*/
|
||||
@TableField("QTY")
|
||||
private Long qty;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField("CREATE_USER")
|
||||
private String createUser;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("CREATED_DATE_TIME")
|
||||
private LocalDateTime createdDateTime;
|
||||
|
||||
|
||||
public String getHandle() {
|
||||
return handle;
|
||||
}
|
||||
|
||||
public void setHandle(String handle) {
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
public String getSite() {
|
||||
return site;
|
||||
}
|
||||
|
||||
public void setSite(String site) {
|
||||
this.site = site;
|
||||
}
|
||||
|
||||
public String getCutter() {
|
||||
return cutter;
|
||||
}
|
||||
|
||||
public void setCutter(String cutter) {
|
||||
this.cutter = cutter;
|
||||
}
|
||||
|
||||
public String getShopOrder() {
|
||||
return shopOrder;
|
||||
}
|
||||
|
||||
public void setShopOrder(String shopOrder) {
|
||||
this.shopOrder = shopOrder;
|
||||
}
|
||||
|
||||
public String getWorkCenter() {
|
||||
return workCenter;
|
||||
}
|
||||
|
||||
public void setWorkCenter(String workCenter) {
|
||||
this.workCenter = workCenter;
|
||||
}
|
||||
|
||||
public String getSfc() {
|
||||
return sfc;
|
||||
}
|
||||
|
||||
public void setSfc(String sfc) {
|
||||
this.sfc = sfc;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getOperation() {
|
||||
return operation;
|
||||
}
|
||||
|
||||
public void setOperation(String operation) {
|
||||
this.operation = operation;
|
||||
}
|
||||
|
||||
public String getStepId() {
|
||||
return stepId;
|
||||
}
|
||||
|
||||
public void setStepId(String stepId) {
|
||||
this.stepId = stepId;
|
||||
}
|
||||
|
||||
public String getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public void setItem(String item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public String getResrce() {
|
||||
return resrce;
|
||||
}
|
||||
|
||||
public void setResrce(String resrce) {
|
||||
this.resrce = resrce;
|
||||
}
|
||||
|
||||
public Long getQty() {
|
||||
return qty;
|
||||
}
|
||||
|
||||
public void setQty(Long qty) {
|
||||
this.qty = qty;
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public void setCreateUser(String createUser) {
|
||||
this.createUser = createUser;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedDateTime() {
|
||||
return createdDateTime;
|
||||
}
|
||||
|
||||
public void setCreatedDateTime(LocalDateTime createdDateTime) {
|
||||
this.createdDateTime = createdDateTime;
|
||||
}
|
||||
|
||||
public static final String HANDLE = "HANDLE";
|
||||
|
||||
public static final String SITE = "SITE";
|
||||
|
||||
public static final String CUTTER = "CUTTER";
|
||||
|
||||
public static final String SHOP_ORDER = "SHOP_ORDER";
|
||||
|
||||
public static final String WORK_CENTER = "WORK_CENTER";
|
||||
|
||||
public static final String SFC = "SFC";
|
||||
|
||||
public static final String TYPE = "TYPE";
|
||||
|
||||
public static final String OPERATION = "OPERATION";
|
||||
|
||||
public static final String STEP_ID = "STEP_ID";
|
||||
|
||||
public static final String ITEM = "ITEM";
|
||||
|
||||
public static final String RESRCE = "RESRCE";
|
||||
|
||||
public static final String QTY = "QTY";
|
||||
|
||||
public static final String CREATE_USER = "CREATE_USER";
|
||||
|
||||
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
|
||||
|
||||
|
||||
@Override
|
||||
protected Serializable pkVal() {
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CutterLog{" +
|
||||
"handle = " + handle +
|
||||
", site = " + site +
|
||||
", cutter = " + cutter +
|
||||
", shopOrder = " + shopOrder +
|
||||
", workCenter = " + workCenter +
|
||||
", sfc = " + sfc +
|
||||
", type = " + type +
|
||||
", operation = " + operation +
|
||||
", stepId = " + stepId +
|
||||
", item = " + item +
|
||||
", resrce = " + resrce +
|
||||
", qty = " + qty +
|
||||
", createUser = " + createUser +
|
||||
", createdDateTime = " + createdDateTime +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.foreverwin.mesnac.production.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.foreverwin.mesnac.production.model.CutterLog;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 刀具记录表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-07-14
|
||||
*/
|
||||
public interface CutterLogService extends IService<CutterLog> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param frontPage
|
||||
* @return
|
||||
*/
|
||||
IPage<CutterLog> selectPage(FrontPage<CutterLog> frontPage, CutterLog cutterLog);
|
||||
|
||||
List<CutterLog> selectList(CutterLog cutterLog);
|
||||
|
||||
void doAdd(Map<String, Object> map);
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
package com.foreverwin.mesnac.production.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.foreverwin.mesnac.common.constant.Constants;
|
||||
import com.foreverwin.mesnac.common.enums.HandleEnum;
|
||||
import com.foreverwin.mesnac.common.service.CommonService;
|
||||
import com.foreverwin.mesnac.common.util.StringUtil;
|
||||
import com.foreverwin.mesnac.meapi.dto.SfcDto;
|
||||
import com.foreverwin.mesnac.production.mapper.CutterLogMapper;
|
||||
import com.foreverwin.mesnac.production.mapper.SfcCrossMapper;
|
||||
import com.foreverwin.mesnac.production.model.CutterLog;
|
||||
import com.foreverwin.mesnac.production.model.Tool;
|
||||
import com.foreverwin.mesnac.production.service.CutterLogService;
|
||||
import com.foreverwin.mesnac.production.service.ToolService;
|
||||
import com.foreverwin.modular.core.exception.BaseException;
|
||||
import com.foreverwin.modular.core.util.CommonMethods;
|
||||
import com.foreverwin.modular.core.util.FrontPage;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 刀具记录表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Philip
|
||||
* @since 2021-07-14
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class CutterLogServiceImpl extends ServiceImpl<CutterLogMapper, CutterLog> implements CutterLogService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private CutterLogMapper cutterLogMapper;
|
||||
@Autowired
|
||||
private SfcCrossMapper sfcCorssMapper;
|
||||
@Autowired
|
||||
private CommonService commonService;
|
||||
@Autowired
|
||||
private ToolService toolService;
|
||||
@Override
|
||||
public IPage<CutterLog> selectPage(FrontPage<CutterLog> frontPage, CutterLog cutterLog) {
|
||||
QueryWrapper<CutterLog> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(cutterLog);
|
||||
return super.page(frontPage.getPagePlus(), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CutterLog> selectList(CutterLog cutterLog) {
|
||||
QueryWrapper<CutterLog> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.setEntity(cutterLog);
|
||||
return super.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAdd(Map<String, Object> map) {
|
||||
String site = CommonMethods.getSite();
|
||||
String user = CommonMethods.getUser();
|
||||
String sfc = (String)map.get("sfc");
|
||||
String resrce = (String)map.get("resrce");
|
||||
List<CutterLog> list = (List<CutterLog>)map.get("cutterList");
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
list = mapper.convertValue(list, new TypeReference<List<CutterLog>>() {});
|
||||
SfcDto sfcDto = new SfcDto();
|
||||
sfcDto.setSfc(sfc);
|
||||
sfcDto.setResrce(resrce);
|
||||
Map<String, Object> sfcData = sfcCorssMapper.querySfcData(site, LocaleContextHolder.getLocale().getLanguage(), sfcDto);
|
||||
if (sfcData == null) {
|
||||
throw new BaseException("根据当前资源未找到条码[" + sfc + "]的基本信息!");
|
||||
}
|
||||
String operation = (String)sfcData.get("OPERATION");
|
||||
String stepId = (String)sfcData.get("STEP_ID");
|
||||
String shopOrder = (String)sfcData.get("SHOP_ORDER");
|
||||
String item = (String)sfcData.get("ITEM");
|
||||
String workShopBo = commonService.getWorkShopBo(HandleEnum.RESOURCE.getHandle(site, resrce));
|
||||
String workShop = StringUtil.trimHandle(workShopBo);
|
||||
if(list==null||list.size()<1){
|
||||
throw new BaseException("刀具列表不能为空");
|
||||
}
|
||||
list.forEach(cutterLog->{
|
||||
String handle = UUID.randomUUID().toString();
|
||||
cutterLog.setHandle(handle);
|
||||
//校验刀具是否存在
|
||||
String cutter = cutterLog.getCutter();
|
||||
QueryWrapper<Tool> query=new QueryWrapper<>();
|
||||
query.eq(Tool.SITE,site);
|
||||
query.eq(Tool.TOOL,cutter);
|
||||
query.eq(Tool.STATUS, Constants.STATUS_Y);
|
||||
List<Tool> toolList = toolService.list(query);
|
||||
if (toolList.size()<1){
|
||||
throw new BaseException("不存在的刀具");
|
||||
}
|
||||
cutterLog.setSite(site);
|
||||
cutterLog.setShopOrder(shopOrder);
|
||||
cutterLog.setWorkCenter(workShop);
|
||||
cutterLog.setSfc(sfc);
|
||||
cutterLog.setOperation(operation);
|
||||
cutterLog.setStepId(stepId);
|
||||
cutterLog.setItem(item);
|
||||
cutterLog.setResrce(resrce);
|
||||
cutterLog.setCreateUser(user);
|
||||
cutterLog.setCreatedDateTime(LocalDateTime.now());
|
||||
save(cutterLog);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,466 @@
|
||||
<?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.foreverwin.mesnac.production.mapper.CutterLogMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.production.model.CutterLog">
|
||||
<id column="HANDLE" property="handle" />
|
||||
<result column="SITE" property="site" />
|
||||
<result column="CUTTER" property="cutter" />
|
||||
<result column="SHOP_ORDER" property="shopOrder" />
|
||||
<result column="WORK_CENTER" property="workCenter" />
|
||||
<result column="SFC" property="sfc" />
|
||||
<result column="TYPE" property="type" />
|
||||
<result column="OPERATION" property="operation" />
|
||||
<result column="STEP_ID" property="stepId" />
|
||||
<result column="ITEM" property="item" />
|
||||
<result column="RESRCE" property="resrce" />
|
||||
<result column="QTY" property="qty" />
|
||||
<result column="CREATE_USER" property="createUser" />
|
||||
<result column="CREATED_DATE_TIME" property="createdDateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
HANDLE, SITE, CUTTER, SHOP_ORDER, WORK_CENTER, SFC, TYPE, OPERATION, STEP_ID, ITEM, RESRCE, QTY, CREATE_USER, CREATED_DATE_TIME
|
||||
</sql>
|
||||
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_CUTTER_LOG WHERE HANDLE=#{handle}
|
||||
</select>
|
||||
|
||||
<select id="selectByMap" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_CUTTER_LOG
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectBatchIds" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include>
|
||||
FROM Z_CUTTER_LOG WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</select>
|
||||
|
||||
<select id="selectOne" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"></include> FROM Z_CUTTER_LOG
|
||||
<where>
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.cutter!=null"> AND CUTTER=#{ew.entity.cutter}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCount" resultType="Integer">
|
||||
SELECT COUNT(1) FROM Z_CUTTER_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.cutter!=null"> AND CUTTER=#{ew.entity.cutter}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectList" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_CUTTER_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.cutter!=null"> AND CUTTER=#{ew.entity.cutter}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMaps" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_CUTTER_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.cutter!=null"> AND CUTTER=#{ew.entity.cutter}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectObjs" resultType="Object">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_CUTTER_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.cutter!=null"> AND CUTTER=#{ew.entity.cutter}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectPage" resultMap="BaseResultMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_CUTTER_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.cutter!=null"> AND CUTTER=#{ew.entity.cutter}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMapsPage" resultType="HashMap">
|
||||
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_CUTTER_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.cutter!=null"> AND CUTTER=#{ew.entity.cutter}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.foreverwin.mesnac.production.model.CutterLog">
|
||||
INSERT INTO Z_CUTTER_LOG
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
HANDLE,
|
||||
<if test="site!=null">SITE,</if>
|
||||
<if test="cutter!=null">CUTTER,</if>
|
||||
<if test="shopOrder!=null">SHOP_ORDER,</if>
|
||||
<if test="workCenter!=null">WORK_CENTER,</if>
|
||||
<if test="sfc!=null">SFC,</if>
|
||||
<if test="type!=null">TYPE,</if>
|
||||
<if test="operation!=null">OPERATION,</if>
|
||||
<if test="stepId!=null">STEP_ID,</if>
|
||||
<if test="item!=null">ITEM,</if>
|
||||
<if test="resrce!=null">RESRCE,</if>
|
||||
<if test="qty!=null">QTY,</if>
|
||||
<if test="createUser!=null">CREATE_USER,</if>
|
||||
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
<if test="site!=null">#{site},</if>
|
||||
<if test="cutter!=null">#{cutter},</if>
|
||||
<if test="shopOrder!=null">#{shopOrder},</if>
|
||||
<if test="workCenter!=null">#{workCenter},</if>
|
||||
<if test="sfc!=null">#{sfc},</if>
|
||||
<if test="type!=null">#{type},</if>
|
||||
<if test="operation!=null">#{operation},</if>
|
||||
<if test="stepId!=null">#{stepId},</if>
|
||||
<if test="item!=null">#{item},</if>
|
||||
<if test="resrce!=null">#{resrce},</if>
|
||||
<if test="qty!=null">#{qty},</if>
|
||||
<if test="createUser!=null">#{createUser},</if>
|
||||
<if test="createdDateTime!=null">#{createdDateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.production.model.CutterLog">
|
||||
INSERT INTO Z_CUTTER_LOG
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<include refid="Base_Column_List"></include>
|
||||
</trim> VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
#{handle},
|
||||
#{site},
|
||||
#{cutter},
|
||||
#{shopOrder},
|
||||
#{workCenter},
|
||||
#{sfc},
|
||||
#{type},
|
||||
#{operation},
|
||||
#{stepId},
|
||||
#{item},
|
||||
#{resrce},
|
||||
#{qty},
|
||||
#{createUser},
|
||||
#{createdDateTime},
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateById">
|
||||
UPDATE Z_CUTTER_LOG <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.cutter!=null">CUTTER=#{et.cutter},</if>
|
||||
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
|
||||
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
|
||||
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
|
||||
<if test="et.type!=null">TYPE=#{et.type},</if>
|
||||
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
|
||||
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
|
||||
<if test="et.item!=null">ITEM=#{et.item},</if>
|
||||
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
|
||||
<if test="et.qty!=null">QTY=#{et.qty},</if>
|
||||
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateAllColumnById">
|
||||
UPDATE Z_CUTTER_LOG <trim prefix="SET" suffixOverrides=",">
|
||||
SITE=#{et.site},
|
||||
CUTTER=#{et.cutter},
|
||||
SHOP_ORDER=#{et.shopOrder},
|
||||
WORK_CENTER=#{et.workCenter},
|
||||
SFC=#{et.sfc},
|
||||
TYPE=#{et.type},
|
||||
OPERATION=#{et.operation},
|
||||
STEP_ID=#{et.stepId},
|
||||
ITEM=#{et.item},
|
||||
RESRCE=#{et.resrce},
|
||||
QTY=#{et.qty},
|
||||
CREATE_USER=#{et.createUser},
|
||||
CREATED_DATE_TIME=#{et.createdDateTime},
|
||||
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="update">
|
||||
UPDATE Z_CUTTER_LOG <trim prefix="SET" suffixOverrides=",">
|
||||
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||
<if test="et.cutter!=null">CUTTER=#{et.cutter},</if>
|
||||
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
|
||||
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
|
||||
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
|
||||
<if test="et.type!=null">TYPE=#{et.type},</if>
|
||||
<if test="et.operation!=null">OPERATION=#{et.operation},</if>
|
||||
<if test="et.stepId!=null">STEP_ID=#{et.stepId},</if>
|
||||
<if test="et.item!=null">ITEM=#{et.item},</if>
|
||||
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
|
||||
<if test="et.qty!=null">QTY=#{et.qty},</if>
|
||||
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
|
||||
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||
</trim>
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.cutter!=null"> AND CUTTER=#{ew.entity.cutter}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<delete id="deleteById">
|
||||
DELETE FROM Z_CUTTER_LOG WHERE HANDLE=#{handle}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByMap">
|
||||
DELETE FROM Z_CUTTER_LOG
|
||||
<if test="cm!=null and !cm.isEmpty">
|
||||
<where>
|
||||
<foreach collection="cm.keys" item="k" separator="AND">
|
||||
<if test="cm[k] != null">
|
||||
${k} = #{cm[${k}]}
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="delete">
|
||||
DELETE FROM Z_CUTTER_LOG
|
||||
<where>
|
||||
<if test="ew!=null">
|
||||
<if test="ew.entity!=null">
|
||||
<if test="ew.entity.handle!=null">
|
||||
HANDLE=#{ew.entity.handle}
|
||||
</if>
|
||||
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
|
||||
<if test="ew.entity.cutter!=null"> AND CUTTER=#{ew.entity.cutter}</if>
|
||||
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
|
||||
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
|
||||
<if test="ew.entity.operation!=null"> AND OPERATION=#{ew.entity.operation}</if>
|
||||
<if test="ew.entity.stepId!=null"> AND STEP_ID=#{ew.entity.stepId}</if>
|
||||
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
|
||||
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||
</if>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
||||
${ew.sqlSegment}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBatchIds">
|
||||
DELETE FROM Z_CUTTER_LOG WHERE HANDLE IN (
|
||||
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||
</foreach>)
|
||||
</delete>
|
||||
<!-- BaseMapper标准查询/修改/删除 -->
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue