上/卸料

philip 4 years ago
parent bac78a3dff
commit 9dce721751

@ -32,14 +32,14 @@ public class InspectionTaskController {
@ResponseBody
@PostMapping("/save")
public R getInspectionTaskList(@RequestBody Map<String, Object> paramMap){
inspectionTaskService.save(paramMap);
inspectionTaskService.saveTask(paramMap);
return R.ok("保存成功");
}
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/createTask")
public R createTask(@RequestBody Map<String, Object> paramMap) {
inspectionTaskService.createTask(paramMap);
return R.ok("创建任务成功!");
Map<String, Object> map = inspectionTaskService.createTask(paramMap);
return R.ok(map);
}
/**

@ -27,9 +27,9 @@ public interface InspectionTaskService extends IService<InspectionTask> {
List<InspectionTask> selectList(InspectionTask inspectionTask);
void save(Map<String, Object> paramMap);
void saveTask(Map<String, Object> paramMap);
void createTask(Map<String, Object> paramMap);
Map<String, Object> createTask(Map<String, Object> paramMap);
InspectionTask isCreateTask(String site, String category, String sfc, String operation, String stepId);
}

@ -86,6 +86,7 @@ public class InspectionItemServiceImpl extends ServiceImpl<InspectionItemMapper,
public String inspectItemNoGenerationRules(InspectionItem inspectionItem) {
List<InspectionItemAddition> inspectionItemAdditionList = inspectionItem.getInspectionItemAdditionList();
StringBuilder inspectionItemNo = new StringBuilder();
inspectionItemNo.append(inspectionItem.getInspectionType());
inspectionItemAdditionList.forEach(inspectionItemAddition -> inspectionItemNo.append(inspectionItemAddition.getAdditionalObject()));
return inspectionItemNo.toString();
}
@ -178,8 +179,9 @@ public class InspectionItemServiceImpl extends ServiceImpl<InspectionItemMapper,
updateWrapper.eq(InspectionItem.INSPECTION_ITEM_NO, inspectionItemNo);
updateWrapper.eq(InspectionItem.SITE, inspectionItem.getSite());
updateWrapper.ne(InspectionItem.REVISION, inspectionItem.getRevision());
updateWrapper.set(InspectionItem.CURRENT_REVISION, Constants.BOOL_FALSE);
update(updateWrapper);
InspectionItem entity=new InspectionItem();
entity.setCurrentRevision(Constants.BOOL_FALSE);
update(entity,updateWrapper);
}
if (inspectionItem.selectById(inspectionItem.getHandle()) == null) {
inspectionItem.setCreatedDateTime(LocalDateTime.now());

@ -1,6 +1,7 @@
package com.foreverwin.mesnac.common.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.common.constant.Constants;
@ -9,6 +10,7 @@ import com.foreverwin.mesnac.common.mapper.InspectionTaskMapper;
import com.foreverwin.mesnac.common.model.InspectionItemDetail;
import com.foreverwin.mesnac.common.model.InspectionTask;
import com.foreverwin.mesnac.common.model.InspectionTaskDetail;
import com.foreverwin.mesnac.common.service.InspectionItemDetailService;
import com.foreverwin.mesnac.common.service.InspectionItemService;
import com.foreverwin.mesnac.common.service.InspectionTaskDetailService;
import com.foreverwin.mesnac.common.service.InspectionTaskService;
@ -36,13 +38,15 @@ import java.util.*;
@Transactional(rollbackFor = Exception.class)
public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper, InspectionTask> implements InspectionTaskService {
@Autowired
private InspectionTaskMapper inspectionTaskMapper;
@Autowired
private InspectionTaskDetailService inspectionTaskDetailService;
@Autowired
private InspectionItemService inspectionItemService;
@Autowired
private InspectionItemDetailService inspectionItemDetailService;
@Autowired
private InspectionTaskDetailService inspectionTaskDetailService;
@Override
public IPage<InspectionTask> selectPage(FrontPage<InspectionTask> frontPage, InspectionTask inspectionTask) {
@ -59,26 +63,27 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper,
}
@Override
public void save(Map<String, Object> paramMap) {
public void saveTask(Map<String, Object> paramMap) {
String site = CommonMethods.getSite();
String user = CommonMethods.getUser();
//类型(首检|S/巡检|X/专检|Y/FQC|F/尾检|W/自检|Z/互检|H)
String category = (String) paramMap.get("CATEGORY");
//获取检验项目
List<Map<String, Object>> taskList = (List<Map<String, Object>>) paramMap.get("TASK_LIST");
List<Map<String, Object>> taskList = (List<Map<String, Object>>) paramMap.get("taskList");
//更新任务表
InspectionTask task = new InspectionTask();
String taskHandle = (String) paramMap.get("TASK_HANDLE");
if(StringUtil.isEmpty(taskHandle)){
throw new BaseException("保存失败,请先进行检索数据!");
}
task.setHandle(taskHandle);
task.setComments((String) paramMap.get("COMMENTS"));
task.setStatus("COMPLETE");
task.setStatus(Constants.INSPECTION_TASK_STATUS_COMPLETE);
task.setModifyUser(user);
task.setModifiedDateTime(LocalDateTime.now());
task.setResult((String) paramMap.get("RESULT"));
updateById(task);
task.setResult((String) paramMap.get("result"));
UpdateWrapper<InspectionTask> updateWrapper=new UpdateWrapper<>();
updateWrapper.eq(InspectionTask.HANDLE,taskHandle);
update(task,updateWrapper);
//新增任务从表
if (taskList != null && taskList.size() != 0) {
List<InspectionTaskDetail> detailList = new ArrayList<>();
@ -87,10 +92,10 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper,
InspectionTaskDetail inspectionTaskDetail = new InspectionTaskDetail();
inspectionTaskDetail.setHandle(taskListHandle);
inspectionTaskDetail.setSite(site);
inspectionTaskDetail.setTaskBo((String) paramMap.get("TASK_HANDLE"));
inspectionTaskDetail.setInspectionItemDetailBo((String) taskList.get(i).get("HANDLE"));
inspectionTaskDetail.setCheckUser((String) paramMap.get("CHECK_USER"));
String paramType = (String) taskList.get(i).get("PARAM_TYPE");
inspectionTaskDetail.setTaskBo(taskHandle);
inspectionTaskDetail.setInspectionItemDetailBo((String) taskList.get(i).get("handle"));
inspectionTaskDetail.setCheckUser(user);
String paramType = (String) taskList.get(i).get("paramType");
String checkValue = "";
if (paramType.equals("布尔")) {
checkValue = (String) taskList.get(i).get("CHECK_VALUE1");
@ -98,23 +103,23 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper,
checkValue = (String) taskList.get(i).get("CHECK_VALUE2");
}
inspectionTaskDetail.setCheckValues(checkValue);
inspectionTaskDetail.setResult((String) taskList.get(i).get("RESULT"));
inspectionTaskDetail.setResult((String) taskList.get(i).get("result"));
String remark = (String) taskList.get(i).get("REMARK");
String remark = (String) taskList.get(i).get("remark");
if (StringUtil.isBlank(remark)) {
inspectionTaskDetail.setRemark("");
} else {
inspectionTaskDetail.setRemark(remark);
}
String pictureNo = (String) taskList.get(i).get("PICTURE_NO");
String pictureNo = (String) taskList.get(i).get("pictureNo");
if (StringUtil.isBlank(pictureNo)) {
inspectionTaskDetail.setPictureNo("");
} else {
inspectionTaskDetail.setPictureNo(pictureNo);
}
String pictureQty = (String) taskList.get(i).get("PICTURE_QTY");
String pictureQty = (String) taskList.get(i).get("pictureQty");
if ("".equals(pictureQty) || null == pictureQty || "NULL".equals(pictureQty)) {
inspectionTaskDetail.setPictureQty("0");
} else {
@ -128,7 +133,8 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper,
}
@Override
public void createTask(Map<String, Object> paramMap) {
public Map<String, Object> createTask(Map<String, Object> paramMap) {
Map<String,Object>map=new HashMap<>();
//站点
String site = CommonMethods.getSite();
@ -142,62 +148,73 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper,
String operation = (String) paramMap.get("OPERATION");
//工序标识
String stepId = (String) paramMap.get("STEP_ID");
List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, category);
if (inspectionItemDetails.size() == 0||inspectionItemDetails.get(0)==null) {
throw new BaseException("创建任务失败,未维护数据收集组!");
}
//自检/互检/包装 校验是否在当前工序+工序标识 做过检验任务
InspectionTask createTask = isCreateTask(site, category, sfc, operation, stepId);
if (createTask!=null&&createTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)) {
throw new BaseException("当前产品批次[" + sfc + "]已做完检验任务");
}
List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, category);
if (inspectionItemDetails.size() == 0||StringUtil.isBlank(inspectionItemDetails.get(0).getInspectionItemBo())) {
throw new BaseException("创建任务失败,未维护数据收集组!");
}
String handle = "InspectionTaskBO:" + site + "," + UUID.randomUUID().toString();
Date date = new Date(System.currentTimeMillis());
SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyyMMddHHmmss");
String taskNo = "";
String itemNumber = (String) paramMap.get("ITEM_NUMBER");
String description = "";
if (category.equals(Constants.INSPECTION_TYPE_Z)) {
if (StringUtil.isBlank(itemNumber) ) {
taskNo = "Z_" + dateFormat1.format(date);
} else{
taskNo = "Z_" + itemNumber + "_" + dateFormat1.format(date);
}
description = "自检检验任务";
} else if (category.equals(Constants.INSPECTION_TYPE_H)) {
if (StringUtil.isBlank(itemNumber)) {
taskNo = "H_" + dateFormat1.format(date);
String inspectionItemBo = inspectionItemDetails.get(0).getInspectionItemBo();
if (createTask!=null){
map.put("taskHandle",createTask.getHandle());
}else {
String handle = "InspectionTaskBO:" + site + "," + UUID.randomUUID().toString();
Date date = new Date(System.currentTimeMillis());
SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyyMMddHHmmss");
String taskNo = "";
String itemNumber = (String) paramMap.get("ITEM_NUMBER");
String description = "";
if (category.equals(Constants.INSPECTION_TYPE_Z)) {
if (StringUtil.isBlank(itemNumber) ) {
taskNo = "Z_" + dateFormat1.format(date);
} else{
taskNo = "Z_" + itemNumber + "_" + dateFormat1.format(date);
}
description = "自检检验任务";
} else if (category.equals(Constants.INSPECTION_TYPE_H)) {
if (StringUtil.isBlank(itemNumber)) {
taskNo = "H_" + dateFormat1.format(date);
} else {
taskNo = "H_" + itemNumber + "_" + dateFormat1.format(date);
}
description = "互检检验任务";
} else {
taskNo = "H_" + itemNumber + "_" + dateFormat1.format(date);
throw new BaseException("生成任务号失败,请传入检验类型!");
}
description = "互检检验任务";
} else {
throw new BaseException("生成任务号失败,请传入检验类型!");
InspectionTask task = new InspectionTask();
task.setHandle(handle);
task.setSite(site);
task.setCategory(category);
task.setTaskNo(taskNo);
task.setStatus(Constants.INSPECTION_TASK_STATUS_NEW);
task.setDescription(description);
task.setInspectionItemBo( inspectionItemBo);
task.setShopOrder(shopOrder);
task.setWorkCenter((String) paramMap.get("WORK_CENTER"));
task.setSfc(sfc);
task.setOperation(operation);
task.setStepId(stepId);
task.setResrce((String) paramMap.get("RESRCE"));
task.setCreateUser((String) paramMap.get("CREATE_USER"));
task.setCreatedDateTime(LocalDateTime.now());
task.setModifyUser((String) paramMap.get("CREATE_USER"));
task.setModifiedDateTime(LocalDateTime.now());
task.setSfcDispatchBo((String) paramMap.get("SFC_DISPATCH_DETAIL_BO"));
task.setSfc(sfc);
save(task);
map.put("taskHandle",handle);
}
InspectionTask task = new InspectionTask();
task.setHandle(handle);
task.setSite(site);
task.setCategory(category);
task.setTaskNo(taskNo);
task.setStatus(Constants.INSPECTION_TASK_STATUS_NEW);
task.setDescription(description);
task.setInspectionItemBo( inspectionItemDetails.get(0).getInspectionItemBo());
task.setShopOrder(shopOrder);
task.setWorkCenter((String) paramMap.get("WORK_CENTER"));
task.setSfc(sfc);
task.setOperation(operation);
task.setStepId(stepId);
task.setResrce((String) paramMap.get("RESRCE"));
task.setCreateUser((String) paramMap.get("CREATE_USER"));
task.setCreatedDateTime(LocalDateTime.now());
task.setModifyUser((String) paramMap.get("CREATE_USER"));
task.setModifiedDateTime(LocalDateTime.now());
task.setSfcDispatchBo((String) paramMap.get("SFC_DISPATCH_DETAIL_BO"));
task.setSfc(sfc);
save(task);
QueryWrapper<InspectionItemDetail> queryWrapper=new QueryWrapper<>();
queryWrapper.eq(InspectionItemDetail.INSPECTION_ITEM_BO,inspectionItemBo);
queryWrapper.orderByAsc(InspectionItemDetail.SEQ);
List<InspectionItemDetail> list = inspectionItemDetailService.list(queryWrapper);
map.put("inspectionItemList",list);
map.put("inspectItemNo",StringUtil.trimHandle(inspectionItemBo));
return map;
}
@Override
public InspectionTask isCreateTask(String site,String category,String sfc,String operation ,String stepId) {

@ -51,10 +51,10 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
public static final String P01="P01";
public static final String P02="P02";
public static final String P03="P03";
public static final String STATUS_WAITING="W";
public static final String STATUS_DOING="I";
public static final String STATUS_FINSH="F";
public static final String STATUS_CANCEL="C";
public static final String STATUS_NEW="NEW";
public static final String STATUS_DOING="DOING";
public static final String STATUS_FINISH="FINISH";
public static final String STATUS_CANCEL="CANCEL";
@Autowired
private ProdReadyTaskMapper prodReadyTaskMapper;
@ -172,10 +172,11 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
}
}
if (prodReadyTaskDetailList.size()>0){
prodReadyTask.setStatus(STATUS_WAITING);
prodReadyTask.setStatus(STATUS_NEW);
prodReadyTaskDetailService.saveBatch(prodReadyTaskDetailList);
}else {
prodReadyTask.setStatus(STATUS_FINSH);
prodReadyTask.setStatus(STATUS_FINISH);
prodReadyTask.setResult(Constants.RSESULT_OK);
prodReadyTask.setCompleteUser(user);
prodReadyTask.setCompleteDateTime(LocalDateTime.now());
}
@ -209,7 +210,7 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
@Override
public ProdReadyTask loadProExecute(String taskBo) {
ProdReadyTask prodReadyTask = prodReadyTaskMapper.selectById(taskBo);
if (prodReadyTask.getStatus().equals(STATUS_WAITING)){
if (prodReadyTask.getStatus().equals(STATUS_NEW)){
prodReadyTask.setReadyUser(CommonMethods.getUser());
prodReadyTask.setReadyDateTime(LocalDateTime.now());
prodReadyTask.setModifyUser(CommonMethods.getUser());
@ -255,11 +256,11 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl<ProdReadyTaskMapper, P
if (byId.getStatus().equals(STATUS_CANCEL)){
throw new BaseException("产前准备任务任务已取消");
}
if (byId.getStatus().equals(STATUS_FINSH)){
if (byId.getStatus().equals(STATUS_FINISH)){
throw new BaseException("产前准备任务任务已完成");
}
List<ProdReadyTaskDetail> prodReadyTaskDetailList = prodReadyTask.getProdReadyTaskDetailList();
prodReadyTask.setStatus(STATUS_FINSH);
prodReadyTask.setStatus(STATUS_FINISH);
prodReadyTask.setCompleteUser(user);
prodReadyTask.setCompleteDateTime(LocalDateTime.now());
prodReadyTask.setModifyUser(user);

@ -1,6 +1,6 @@
<?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.common.model.InspectionItemDetailMapper">
<mapper namespace="com.foreverwin.mesnac.common.mapper.InspectionItemDetailMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.common.model.InspectionItemDetail">

@ -1,6 +1,6 @@
<?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.common.model.InspectionItemMapper">
<mapper namespace="com.foreverwin.mesnac.common.mapper.InspectionItemMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.common.model.InspectionItem">
@ -448,7 +448,7 @@
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectQualityInspection" resultType="com.foreverwin.mesnac.common.model.InspectionItemDetail">
SELECT ziid.* FROM Z_INSPECTION_ITEM zii
SELECT DISTINCT ziid.* FROM Z_INSPECTION_ITEM zii
JOIN Z_INSPECTION_ITEM_ADDITION ziia ON zii.HANDLE=ZIIA.INSPECTION_ITEM_BO
LEFT JOIN Z_INSPECTION_ITEM_DETAIL ziid ON ZIID.INSPECTION_ITEM_BO=zii.HANDLE
JOIN Z_INSPECTION_ITEM_ADDITION ziiao ON zii.HANDLE=ziiao.INSPECTION_ITEM_BO
@ -469,10 +469,10 @@
WHERE op.SITE=#{site} AND rs.STEP_ID=#{stepId} AND op.OPERATION=#{operation}
</select>
<select id="selectWidestQualityInspection" resultType="com.foreverwin.mesnac.common.model.InspectionItemDetail">
SELECT ziid.* FROM Z_INSPECTION_ITEM zii
SELECT DISTINCT ziid.* FROM Z_INSPECTION_ITEM zii
JOIN Z_INSPECTION_ITEM_ADDITION ziia ON zii.HANDLE=ZIIA.INSPECTION_ITEM_BO
LEFT JOIN Z_INSPECTION_ITEM_DETAIL ziid ON ZIID.INSPECTION_ITEM_BO=zii.HANDLE
WHERE (ziia.ADDITIONAL_OBJECT_TYPE='ITEM' OR ziia.ADDITIONAL_OBJECT_TYPE='OPERATION') AND zii.STATUS='Y' AND zii.INSPECTION_TYPE=#{inspectionType}
AND ziia.ADDITIONAL_OBJECT=#{additionalObject} AND zii.SITE=#{site};
AND ziia.ADDITIONAL_OBJECT=#{additionalObject} AND zii.SITE=#{site}
</select>
</mapper>

@ -37,5 +37,5 @@ public interface SfcDispatchMapper extends BaseMapper<SfcDispatch> {
@Param("dispatchNo") String dispatchNo,
@Param("dispatchStatus") String dispatchStatus,
@Param("modifyUser") String modifyUser,
@Param("modifyDateTime") LocalDateTime modifiedDateTime);
@Param("modifiedDateTime") LocalDateTime modifiedDateTime);
}

@ -0,0 +1,139 @@
package com.foreverwin.mesnac.meapi.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.meapi.service.InventoryService;
import com.foreverwin.mesnac.meapi.model.Inventory;
import java.util.List;
/**
*
* @author Philip
* @since 2021-07-09
*/
@RestController
@RequestMapping("/INVENTORY")
public class InventoryController {
@Autowired
public InventoryService inventoryService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getInventoryById(@PathVariable String id) {
return R.ok( inventoryService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getInventoryList(Inventory inventory){
List<Inventory> result;
QueryWrapper<Inventory> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inventory);
result = inventoryService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<Inventory> frontPage, Inventory inventory){
IPage result;
QueryWrapper<Inventory> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inventory);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(Inventory::getHandle, frontPage.getGlobalQuery())
.or().like(Inventory::getSite, frontPage.getGlobalQuery())
.or().like(Inventory::getInventoryId, frontPage.getGlobalQuery())
.or().like(Inventory::getItemBo, frontPage.getGlobalQuery())
.or().like(Inventory::getInventoryContextGbo, frontPage.getGlobalQuery())
.or().like(Inventory::getDescription, frontPage.getGlobalQuery())
.or().like(Inventory::getAssyDataTypeBo, frontPage.getGlobalQuery())
.or().like(Inventory::getStatusBo, frontPage.getGlobalQuery())
.or().like(Inventory::getWorkCenterLocBo, frontPage.getGlobalQuery())
.or().like(Inventory::getWorkCenterLocRes, frontPage.getGlobalQuery())
.or().like(Inventory::getOperationLocBo, frontPage.getGlobalQuery())
.or().like(Inventory::getOperationLocRes, frontPage.getGlobalQuery())
.or().like(Inventory::getResourceLocBo, frontPage.getGlobalQuery())
.or().like(Inventory::getResourceLocRes, frontPage.getGlobalQuery())
.or().like(Inventory::getShopOrderLocBo, frontPage.getGlobalQuery())
.or().like(Inventory::getShopOrderLocRes, frontPage.getGlobalQuery())
.or().like(Inventory::getShopOrderSetByErp, frontPage.getGlobalQuery())
.or().like(Inventory::getOriginalUserBo, frontPage.getGlobalQuery())
.or().like(Inventory::getStorageLocationBo, frontPage.getGlobalQuery())
.or().like(Inventory::getHasBeenUsed, frontPage.getGlobalQuery())
.or().like(Inventory::getParentInventoryBo, frontPage.getGlobalQuery())
.or().like(Inventory::getErpInventory, frontPage.getGlobalQuery())
);
}
result = inventoryService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param inventory
* @return null
*/
@PostMapping
public R save(@RequestBody Inventory inventory) {
return R.ok(inventoryService.save(inventory));
}
/**
*
* @param inventory
* @return null
*/
@PutMapping
public R updateById(@RequestBody Inventory inventory) {
return R.ok(inventoryService.updateById(inventory));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(inventoryService.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(inventoryService.removeByIds(ids));
}
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.meapi.mapper;
import com.foreverwin.mesnac.meapi.model.Inventory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author Philip
* @since 2021-07-09
*/
@Repository
public interface InventoryMapper extends BaseMapper<Inventory> {
}

@ -0,0 +1,444 @@
package com.foreverwin.mesnac.meapi.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.math.BigDecimal;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-07-09
*/
@TableName("INVENTORY")
public class Inventory extends Model<Inventory> {
private static final long serialVersionUID = 1L;
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
@TableField("CHANGE_STAMP")
private Long changeStamp;
@TableField("SITE")
private String site;
@TableField("INVENTORY_ID")
private String inventoryId;
@TableField("ITEM_BO")
private String itemBo;
@TableField("INVENTORY_CONTEXT_GBO")
private String inventoryContextGbo;
@TableField("DESCRIPTION")
private String description;
@TableField("QTY_ON_HAND")
private BigDecimal qtyOnHand;
@TableField("ASSY_DATA_TYPE_BO")
private String assyDataTypeBo;
@TableField("USAGE_COUNT")
private Long usageCount;
@TableField("MAXIMUM_USAGE")
private Long maximumUsage;
@TableField("STATUS_BO")
private String statusBo;
@TableField("ORIGINAL_QTY")
private BigDecimal originalQty;
@TableField("WORK_CENTER_LOC_BO")
private String workCenterLocBo;
@TableField("WORK_CENTER_LOC_RES")
private String workCenterLocRes;
@TableField("OPERATION_LOC_BO")
private String operationLocBo;
@TableField("OPERATION_LOC_RES")
private String operationLocRes;
@TableField("RESOURCE_LOC_BO")
private String resourceLocBo;
@TableField("RESOURCE_LOC_RES")
private String resourceLocRes;
@TableField("SHOP_ORDER_LOC_BO")
private String shopOrderLocBo;
@TableField("SHOP_ORDER_LOC_RES")
private String shopOrderLocRes;
@TableField("SHOP_ORDER_SET_BY_ERP")
private String shopOrderSetByErp;
@TableField("ORIGINAL_USER_BO")
private String originalUserBo;
@TableField("STORAGE_LOCATION_BO")
private String storageLocationBo;
@TableField("HAS_BEEN_USED")
private String hasBeenUsed;
@TableField("RECEIVE_DATE_TIME")
private LocalDateTime receiveDateTime;
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
@TableField("PARTITION_DATE")
private LocalDateTime partitionDate;
@TableField("PARENT_INVENTORY_BO")
private String parentInventoryBo;
@TableField("ERP_INVENTORY")
private String erpInventory;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public Long getChangeStamp() {
return changeStamp;
}
public void setChangeStamp(Long changeStamp) {
this.changeStamp = changeStamp;
}
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getInventoryId() {
return inventoryId;
}
public void setInventoryId(String inventoryId) {
this.inventoryId = inventoryId;
}
public String getItemBo() {
return itemBo;
}
public void setItemBo(String itemBo) {
this.itemBo = itemBo;
}
public String getInventoryContextGbo() {
return inventoryContextGbo;
}
public void setInventoryContextGbo(String inventoryContextGbo) {
this.inventoryContextGbo = inventoryContextGbo;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public BigDecimal getQtyOnHand() {
return qtyOnHand;
}
public void setQtyOnHand(BigDecimal qtyOnHand) {
this.qtyOnHand = qtyOnHand;
}
public String getAssyDataTypeBo() {
return assyDataTypeBo;
}
public void setAssyDataTypeBo(String assyDataTypeBo) {
this.assyDataTypeBo = assyDataTypeBo;
}
public Long getUsageCount() {
return usageCount;
}
public void setUsageCount(Long usageCount) {
this.usageCount = usageCount;
}
public Long getMaximumUsage() {
return maximumUsage;
}
public void setMaximumUsage(Long maximumUsage) {
this.maximumUsage = maximumUsage;
}
public String getStatusBo() {
return statusBo;
}
public void setStatusBo(String statusBo) {
this.statusBo = statusBo;
}
public BigDecimal getOriginalQty() {
return originalQty;
}
public void setOriginalQty(BigDecimal originalQty) {
this.originalQty = originalQty;
}
public String getWorkCenterLocBo() {
return workCenterLocBo;
}
public void setWorkCenterLocBo(String workCenterLocBo) {
this.workCenterLocBo = workCenterLocBo;
}
public String getWorkCenterLocRes() {
return workCenterLocRes;
}
public void setWorkCenterLocRes(String workCenterLocRes) {
this.workCenterLocRes = workCenterLocRes;
}
public String getOperationLocBo() {
return operationLocBo;
}
public void setOperationLocBo(String operationLocBo) {
this.operationLocBo = operationLocBo;
}
public String getOperationLocRes() {
return operationLocRes;
}
public void setOperationLocRes(String operationLocRes) {
this.operationLocRes = operationLocRes;
}
public String getResourceLocBo() {
return resourceLocBo;
}
public void setResourceLocBo(String resourceLocBo) {
this.resourceLocBo = resourceLocBo;
}
public String getResourceLocRes() {
return resourceLocRes;
}
public void setResourceLocRes(String resourceLocRes) {
this.resourceLocRes = resourceLocRes;
}
public String getShopOrderLocBo() {
return shopOrderLocBo;
}
public void setShopOrderLocBo(String shopOrderLocBo) {
this.shopOrderLocBo = shopOrderLocBo;
}
public String getShopOrderLocRes() {
return shopOrderLocRes;
}
public void setShopOrderLocRes(String shopOrderLocRes) {
this.shopOrderLocRes = shopOrderLocRes;
}
public String getShopOrderSetByErp() {
return shopOrderSetByErp;
}
public void setShopOrderSetByErp(String shopOrderSetByErp) {
this.shopOrderSetByErp = shopOrderSetByErp;
}
public String getOriginalUserBo() {
return originalUserBo;
}
public void setOriginalUserBo(String originalUserBo) {
this.originalUserBo = originalUserBo;
}
public String getStorageLocationBo() {
return storageLocationBo;
}
public void setStorageLocationBo(String storageLocationBo) {
this.storageLocationBo = storageLocationBo;
}
public String getHasBeenUsed() {
return hasBeenUsed;
}
public void setHasBeenUsed(String hasBeenUsed) {
this.hasBeenUsed = hasBeenUsed;
}
public LocalDateTime getReceiveDateTime() {
return receiveDateTime;
}
public void setReceiveDateTime(LocalDateTime receiveDateTime) {
this.receiveDateTime = receiveDateTime;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public LocalDateTime getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
public LocalDateTime getPartitionDate() {
return partitionDate;
}
public void setPartitionDate(LocalDateTime partitionDate) {
this.partitionDate = partitionDate;
}
public String getParentInventoryBo() {
return parentInventoryBo;
}
public void setParentInventoryBo(String parentInventoryBo) {
this.parentInventoryBo = parentInventoryBo;
}
public String getErpInventory() {
return erpInventory;
}
public void setErpInventory(String erpInventory) {
this.erpInventory = erpInventory;
}
public static final String HANDLE = "HANDLE";
public static final String CHANGE_STAMP = "CHANGE_STAMP";
public static final String SITE = "SITE";
public static final String INVENTORY_ID = "INVENTORY_ID";
public static final String ITEM_BO = "ITEM_BO";
public static final String INVENTORY_CONTEXT_GBO = "INVENTORY_CONTEXT_GBO";
public static final String DESCRIPTION = "DESCRIPTION";
public static final String QTY_ON_HAND = "QTY_ON_HAND";
public static final String ASSY_DATA_TYPE_BO = "ASSY_DATA_TYPE_BO";
public static final String USAGE_COUNT = "USAGE_COUNT";
public static final String MAXIMUM_USAGE = "MAXIMUM_USAGE";
public static final String STATUS_BO = "STATUS_BO";
public static final String ORIGINAL_QTY = "ORIGINAL_QTY";
public static final String WORK_CENTER_LOC_BO = "WORK_CENTER_LOC_BO";
public static final String WORK_CENTER_LOC_RES = "WORK_CENTER_LOC_RES";
public static final String OPERATION_LOC_BO = "OPERATION_LOC_BO";
public static final String OPERATION_LOC_RES = "OPERATION_LOC_RES";
public static final String RESOURCE_LOC_BO = "RESOURCE_LOC_BO";
public static final String RESOURCE_LOC_RES = "RESOURCE_LOC_RES";
public static final String SHOP_ORDER_LOC_BO = "SHOP_ORDER_LOC_BO";
public static final String SHOP_ORDER_LOC_RES = "SHOP_ORDER_LOC_RES";
public static final String SHOP_ORDER_SET_BY_ERP = "SHOP_ORDER_SET_BY_ERP";
public static final String ORIGINAL_USER_BO = "ORIGINAL_USER_BO";
public static final String STORAGE_LOCATION_BO = "STORAGE_LOCATION_BO";
public static final String HAS_BEEN_USED = "HAS_BEEN_USED";
public static final String RECEIVE_DATE_TIME = "RECEIVE_DATE_TIME";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
public static final String PARTITION_DATE = "PARTITION_DATE";
public static final String PARENT_INVENTORY_BO = "PARENT_INVENTORY_BO";
public static final String ERP_INVENTORY = "ERP_INVENTORY";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "Inventory{" +
"handle = " + handle +
", changeStamp = " + changeStamp +
", site = " + site +
", inventoryId = " + inventoryId +
", itemBo = " + itemBo +
", inventoryContextGbo = " + inventoryContextGbo +
", description = " + description +
", qtyOnHand = " + qtyOnHand +
", assyDataTypeBo = " + assyDataTypeBo +
", usageCount = " + usageCount +
", maximumUsage = " + maximumUsage +
", statusBo = " + statusBo +
", originalQty = " + originalQty +
", workCenterLocBo = " + workCenterLocBo +
", workCenterLocRes = " + workCenterLocRes +
", operationLocBo = " + operationLocBo +
", operationLocRes = " + operationLocRes +
", resourceLocBo = " + resourceLocBo +
", resourceLocRes = " + resourceLocRes +
", shopOrderLocBo = " + shopOrderLocBo +
", shopOrderLocRes = " + shopOrderLocRes +
", shopOrderSetByErp = " + shopOrderSetByErp +
", originalUserBo = " + originalUserBo +
", storageLocationBo = " + storageLocationBo +
", hasBeenUsed = " + hasBeenUsed +
", receiveDateTime = " + receiveDateTime +
", createdDateTime = " + createdDateTime +
", modifiedDateTime = " + modifiedDateTime +
", partitionDate = " + partitionDate +
", parentInventoryBo = " + parentInventoryBo +
", erpInventory = " + erpInventory +
"}";
}
}

@ -0,0 +1,28 @@
package com.foreverwin.mesnac.meapi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.Inventory;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-07-09
*/
public interface InventoryService extends IService<Inventory> {
/**
*
* @param frontPage
* @return
*/
IPage<Inventory> selectPage(FrontPage<Inventory> frontPage, Inventory inventory);
List<Inventory> selectList(Inventory inventory);
}

@ -0,0 +1,46 @@
package com.foreverwin.mesnac.meapi.service.impl;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.Inventory;
import com.foreverwin.mesnac.meapi.mapper.InventoryMapper;
import com.foreverwin.mesnac.meapi.service.InventoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-07-09
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory> implements InventoryService {
@Autowired
private InventoryMapper inventoryMapper;
@Override
public IPage<Inventory> selectPage(FrontPage<Inventory> frontPage, Inventory inventory) {
QueryWrapper<Inventory> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inventory);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<Inventory> selectList(Inventory inventory) {
QueryWrapper<Inventory> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(inventory);
return super.list(queryWrapper);
}
}

@ -0,0 +1,654 @@
<?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.meapi.mapper.InventoryMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.Inventory">
<result column="HANDLE" property="handle" />
<result column="CHANGE_STAMP" property="changeStamp" />
<result column="SITE" property="site" />
<result column="INVENTORY_ID" property="inventoryId" />
<result column="ITEM_BO" property="itemBo" />
<result column="INVENTORY_CONTEXT_GBO" property="inventoryContextGbo" />
<result column="DESCRIPTION" property="description" />
<result column="QTY_ON_HAND" property="qtyOnHand" />
<result column="ASSY_DATA_TYPE_BO" property="assyDataTypeBo" />
<result column="USAGE_COUNT" property="usageCount" />
<result column="MAXIMUM_USAGE" property="maximumUsage" />
<result column="STATUS_BO" property="statusBo" />
<result column="ORIGINAL_QTY" property="originalQty" />
<result column="WORK_CENTER_LOC_BO" property="workCenterLocBo" />
<result column="WORK_CENTER_LOC_RES" property="workCenterLocRes" />
<result column="OPERATION_LOC_BO" property="operationLocBo" />
<result column="OPERATION_LOC_RES" property="operationLocRes" />
<result column="RESOURCE_LOC_BO" property="resourceLocBo" />
<result column="RESOURCE_LOC_RES" property="resourceLocRes" />
<result column="SHOP_ORDER_LOC_BO" property="shopOrderLocBo" />
<result column="SHOP_ORDER_LOC_RES" property="shopOrderLocRes" />
<result column="SHOP_ORDER_SET_BY_ERP" property="shopOrderSetByErp" />
<result column="ORIGINAL_USER_BO" property="originalUserBo" />
<result column="STORAGE_LOCATION_BO" property="storageLocationBo" />
<result column="HAS_BEEN_USED" property="hasBeenUsed" />
<result column="RECEIVE_DATE_TIME" property="receiveDateTime" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
<result column="PARTITION_DATE" property="partitionDate" />
<result column="PARENT_INVENTORY_BO" property="parentInventoryBo" />
<result column="ERP_INVENTORY" property="erpInventory" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, CHANGE_STAMP, SITE, INVENTORY_ID, ITEM_BO, INVENTORY_CONTEXT_GBO, DESCRIPTION, QTY_ON_HAND, ASSY_DATA_TYPE_BO, USAGE_COUNT, MAXIMUM_USAGE, STATUS_BO, ORIGINAL_QTY, WORK_CENTER_LOC_BO, WORK_CENTER_LOC_RES, OPERATION_LOC_BO, OPERATION_LOC_RES, RESOURCE_LOC_BO, RESOURCE_LOC_RES, SHOP_ORDER_LOC_BO, SHOP_ORDER_LOC_RES, SHOP_ORDER_SET_BY_ERP, ORIGINAL_USER_BO, STORAGE_LOCATION_BO, HAS_BEEN_USED, RECEIVE_DATE_TIME, CREATED_DATE_TIME, MODIFIED_DATE_TIME, PARTITION_DATE, PARENT_INVENTORY_BO, ERP_INVENTORY
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM INVENTORY
<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="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM INVENTORY
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.inventoryContextGbo!=null"> AND INVENTORY_CONTEXT_GBO=#{ew.entity.inventoryContextGbo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.assyDataTypeBo!=null"> AND ASSY_DATA_TYPE_BO=#{ew.entity.assyDataTypeBo}</if>
<if test="ew.entity.usageCount!=null"> AND USAGE_COUNT=#{ew.entity.usageCount}</if>
<if test="ew.entity.maximumUsage!=null"> AND MAXIMUM_USAGE=#{ew.entity.maximumUsage}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.originalQty!=null"> AND ORIGINAL_QTY=#{ew.entity.originalQty}</if>
<if test="ew.entity.workCenterLocBo!=null"> AND WORK_CENTER_LOC_BO=#{ew.entity.workCenterLocBo}</if>
<if test="ew.entity.workCenterLocRes!=null"> AND WORK_CENTER_LOC_RES=#{ew.entity.workCenterLocRes}</if>
<if test="ew.entity.operationLocBo!=null"> AND OPERATION_LOC_BO=#{ew.entity.operationLocBo}</if>
<if test="ew.entity.operationLocRes!=null"> AND OPERATION_LOC_RES=#{ew.entity.operationLocRes}</if>
<if test="ew.entity.resourceLocBo!=null"> AND RESOURCE_LOC_BO=#{ew.entity.resourceLocBo}</if>
<if test="ew.entity.resourceLocRes!=null"> AND RESOURCE_LOC_RES=#{ew.entity.resourceLocRes}</if>
<if test="ew.entity.shopOrderLocBo!=null"> AND SHOP_ORDER_LOC_BO=#{ew.entity.shopOrderLocBo}</if>
<if test="ew.entity.shopOrderLocRes!=null"> AND SHOP_ORDER_LOC_RES=#{ew.entity.shopOrderLocRes}</if>
<if test="ew.entity.shopOrderSetByErp!=null"> AND SHOP_ORDER_SET_BY_ERP=#{ew.entity.shopOrderSetByErp}</if>
<if test="ew.entity.originalUserBo!=null"> AND ORIGINAL_USER_BO=#{ew.entity.originalUserBo}</if>
<if test="ew.entity.storageLocationBo!=null"> AND STORAGE_LOCATION_BO=#{ew.entity.storageLocationBo}</if>
<if test="ew.entity.hasBeenUsed!=null"> AND HAS_BEEN_USED=#{ew.entity.hasBeenUsed}</if>
<if test="ew.entity.receiveDateTime!=null"> AND RECEIVE_DATE_TIME=#{ew.entity.receiveDateTime}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.parentInventoryBo!=null"> AND PARENT_INVENTORY_BO=#{ew.entity.parentInventoryBo}</if>
<if test="ew.entity.erpInventory!=null"> AND ERP_INVENTORY=#{ew.entity.erpInventory}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM INVENTORY
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.inventoryContextGbo!=null"> AND INVENTORY_CONTEXT_GBO=#{ew.entity.inventoryContextGbo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.assyDataTypeBo!=null"> AND ASSY_DATA_TYPE_BO=#{ew.entity.assyDataTypeBo}</if>
<if test="ew.entity.usageCount!=null"> AND USAGE_COUNT=#{ew.entity.usageCount}</if>
<if test="ew.entity.maximumUsage!=null"> AND MAXIMUM_USAGE=#{ew.entity.maximumUsage}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.originalQty!=null"> AND ORIGINAL_QTY=#{ew.entity.originalQty}</if>
<if test="ew.entity.workCenterLocBo!=null"> AND WORK_CENTER_LOC_BO=#{ew.entity.workCenterLocBo}</if>
<if test="ew.entity.workCenterLocRes!=null"> AND WORK_CENTER_LOC_RES=#{ew.entity.workCenterLocRes}</if>
<if test="ew.entity.operationLocBo!=null"> AND OPERATION_LOC_BO=#{ew.entity.operationLocBo}</if>
<if test="ew.entity.operationLocRes!=null"> AND OPERATION_LOC_RES=#{ew.entity.operationLocRes}</if>
<if test="ew.entity.resourceLocBo!=null"> AND RESOURCE_LOC_BO=#{ew.entity.resourceLocBo}</if>
<if test="ew.entity.resourceLocRes!=null"> AND RESOURCE_LOC_RES=#{ew.entity.resourceLocRes}</if>
<if test="ew.entity.shopOrderLocBo!=null"> AND SHOP_ORDER_LOC_BO=#{ew.entity.shopOrderLocBo}</if>
<if test="ew.entity.shopOrderLocRes!=null"> AND SHOP_ORDER_LOC_RES=#{ew.entity.shopOrderLocRes}</if>
<if test="ew.entity.shopOrderSetByErp!=null"> AND SHOP_ORDER_SET_BY_ERP=#{ew.entity.shopOrderSetByErp}</if>
<if test="ew.entity.originalUserBo!=null"> AND ORIGINAL_USER_BO=#{ew.entity.originalUserBo}</if>
<if test="ew.entity.storageLocationBo!=null"> AND STORAGE_LOCATION_BO=#{ew.entity.storageLocationBo}</if>
<if test="ew.entity.hasBeenUsed!=null"> AND HAS_BEEN_USED=#{ew.entity.hasBeenUsed}</if>
<if test="ew.entity.receiveDateTime!=null"> AND RECEIVE_DATE_TIME=#{ew.entity.receiveDateTime}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.parentInventoryBo!=null"> AND PARENT_INVENTORY_BO=#{ew.entity.parentInventoryBo}</if>
<if test="ew.entity.erpInventory!=null"> AND ERP_INVENTORY=#{ew.entity.erpInventory}</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 INVENTORY
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.inventoryContextGbo!=null"> AND INVENTORY_CONTEXT_GBO=#{ew.entity.inventoryContextGbo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.assyDataTypeBo!=null"> AND ASSY_DATA_TYPE_BO=#{ew.entity.assyDataTypeBo}</if>
<if test="ew.entity.usageCount!=null"> AND USAGE_COUNT=#{ew.entity.usageCount}</if>
<if test="ew.entity.maximumUsage!=null"> AND MAXIMUM_USAGE=#{ew.entity.maximumUsage}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.originalQty!=null"> AND ORIGINAL_QTY=#{ew.entity.originalQty}</if>
<if test="ew.entity.workCenterLocBo!=null"> AND WORK_CENTER_LOC_BO=#{ew.entity.workCenterLocBo}</if>
<if test="ew.entity.workCenterLocRes!=null"> AND WORK_CENTER_LOC_RES=#{ew.entity.workCenterLocRes}</if>
<if test="ew.entity.operationLocBo!=null"> AND OPERATION_LOC_BO=#{ew.entity.operationLocBo}</if>
<if test="ew.entity.operationLocRes!=null"> AND OPERATION_LOC_RES=#{ew.entity.operationLocRes}</if>
<if test="ew.entity.resourceLocBo!=null"> AND RESOURCE_LOC_BO=#{ew.entity.resourceLocBo}</if>
<if test="ew.entity.resourceLocRes!=null"> AND RESOURCE_LOC_RES=#{ew.entity.resourceLocRes}</if>
<if test="ew.entity.shopOrderLocBo!=null"> AND SHOP_ORDER_LOC_BO=#{ew.entity.shopOrderLocBo}</if>
<if test="ew.entity.shopOrderLocRes!=null"> AND SHOP_ORDER_LOC_RES=#{ew.entity.shopOrderLocRes}</if>
<if test="ew.entity.shopOrderSetByErp!=null"> AND SHOP_ORDER_SET_BY_ERP=#{ew.entity.shopOrderSetByErp}</if>
<if test="ew.entity.originalUserBo!=null"> AND ORIGINAL_USER_BO=#{ew.entity.originalUserBo}</if>
<if test="ew.entity.storageLocationBo!=null"> AND STORAGE_LOCATION_BO=#{ew.entity.storageLocationBo}</if>
<if test="ew.entity.hasBeenUsed!=null"> AND HAS_BEEN_USED=#{ew.entity.hasBeenUsed}</if>
<if test="ew.entity.receiveDateTime!=null"> AND RECEIVE_DATE_TIME=#{ew.entity.receiveDateTime}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.parentInventoryBo!=null"> AND PARENT_INVENTORY_BO=#{ew.entity.parentInventoryBo}</if>
<if test="ew.entity.erpInventory!=null"> AND ERP_INVENTORY=#{ew.entity.erpInventory}</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 INVENTORY
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.inventoryContextGbo!=null"> AND INVENTORY_CONTEXT_GBO=#{ew.entity.inventoryContextGbo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.assyDataTypeBo!=null"> AND ASSY_DATA_TYPE_BO=#{ew.entity.assyDataTypeBo}</if>
<if test="ew.entity.usageCount!=null"> AND USAGE_COUNT=#{ew.entity.usageCount}</if>
<if test="ew.entity.maximumUsage!=null"> AND MAXIMUM_USAGE=#{ew.entity.maximumUsage}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.originalQty!=null"> AND ORIGINAL_QTY=#{ew.entity.originalQty}</if>
<if test="ew.entity.workCenterLocBo!=null"> AND WORK_CENTER_LOC_BO=#{ew.entity.workCenterLocBo}</if>
<if test="ew.entity.workCenterLocRes!=null"> AND WORK_CENTER_LOC_RES=#{ew.entity.workCenterLocRes}</if>
<if test="ew.entity.operationLocBo!=null"> AND OPERATION_LOC_BO=#{ew.entity.operationLocBo}</if>
<if test="ew.entity.operationLocRes!=null"> AND OPERATION_LOC_RES=#{ew.entity.operationLocRes}</if>
<if test="ew.entity.resourceLocBo!=null"> AND RESOURCE_LOC_BO=#{ew.entity.resourceLocBo}</if>
<if test="ew.entity.resourceLocRes!=null"> AND RESOURCE_LOC_RES=#{ew.entity.resourceLocRes}</if>
<if test="ew.entity.shopOrderLocBo!=null"> AND SHOP_ORDER_LOC_BO=#{ew.entity.shopOrderLocBo}</if>
<if test="ew.entity.shopOrderLocRes!=null"> AND SHOP_ORDER_LOC_RES=#{ew.entity.shopOrderLocRes}</if>
<if test="ew.entity.shopOrderSetByErp!=null"> AND SHOP_ORDER_SET_BY_ERP=#{ew.entity.shopOrderSetByErp}</if>
<if test="ew.entity.originalUserBo!=null"> AND ORIGINAL_USER_BO=#{ew.entity.originalUserBo}</if>
<if test="ew.entity.storageLocationBo!=null"> AND STORAGE_LOCATION_BO=#{ew.entity.storageLocationBo}</if>
<if test="ew.entity.hasBeenUsed!=null"> AND HAS_BEEN_USED=#{ew.entity.hasBeenUsed}</if>
<if test="ew.entity.receiveDateTime!=null"> AND RECEIVE_DATE_TIME=#{ew.entity.receiveDateTime}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.parentInventoryBo!=null"> AND PARENT_INVENTORY_BO=#{ew.entity.parentInventoryBo}</if>
<if test="ew.entity.erpInventory!=null"> AND ERP_INVENTORY=#{ew.entity.erpInventory}</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 INVENTORY
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.inventoryContextGbo!=null"> AND INVENTORY_CONTEXT_GBO=#{ew.entity.inventoryContextGbo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.assyDataTypeBo!=null"> AND ASSY_DATA_TYPE_BO=#{ew.entity.assyDataTypeBo}</if>
<if test="ew.entity.usageCount!=null"> AND USAGE_COUNT=#{ew.entity.usageCount}</if>
<if test="ew.entity.maximumUsage!=null"> AND MAXIMUM_USAGE=#{ew.entity.maximumUsage}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.originalQty!=null"> AND ORIGINAL_QTY=#{ew.entity.originalQty}</if>
<if test="ew.entity.workCenterLocBo!=null"> AND WORK_CENTER_LOC_BO=#{ew.entity.workCenterLocBo}</if>
<if test="ew.entity.workCenterLocRes!=null"> AND WORK_CENTER_LOC_RES=#{ew.entity.workCenterLocRes}</if>
<if test="ew.entity.operationLocBo!=null"> AND OPERATION_LOC_BO=#{ew.entity.operationLocBo}</if>
<if test="ew.entity.operationLocRes!=null"> AND OPERATION_LOC_RES=#{ew.entity.operationLocRes}</if>
<if test="ew.entity.resourceLocBo!=null"> AND RESOURCE_LOC_BO=#{ew.entity.resourceLocBo}</if>
<if test="ew.entity.resourceLocRes!=null"> AND RESOURCE_LOC_RES=#{ew.entity.resourceLocRes}</if>
<if test="ew.entity.shopOrderLocBo!=null"> AND SHOP_ORDER_LOC_BO=#{ew.entity.shopOrderLocBo}</if>
<if test="ew.entity.shopOrderLocRes!=null"> AND SHOP_ORDER_LOC_RES=#{ew.entity.shopOrderLocRes}</if>
<if test="ew.entity.shopOrderSetByErp!=null"> AND SHOP_ORDER_SET_BY_ERP=#{ew.entity.shopOrderSetByErp}</if>
<if test="ew.entity.originalUserBo!=null"> AND ORIGINAL_USER_BO=#{ew.entity.originalUserBo}</if>
<if test="ew.entity.storageLocationBo!=null"> AND STORAGE_LOCATION_BO=#{ew.entity.storageLocationBo}</if>
<if test="ew.entity.hasBeenUsed!=null"> AND HAS_BEEN_USED=#{ew.entity.hasBeenUsed}</if>
<if test="ew.entity.receiveDateTime!=null"> AND RECEIVE_DATE_TIME=#{ew.entity.receiveDateTime}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.parentInventoryBo!=null"> AND PARENT_INVENTORY_BO=#{ew.entity.parentInventoryBo}</if>
<if test="ew.entity.erpInventory!=null"> AND ERP_INVENTORY=#{ew.entity.erpInventory}</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 INVENTORY
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.inventoryContextGbo!=null"> AND INVENTORY_CONTEXT_GBO=#{ew.entity.inventoryContextGbo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.assyDataTypeBo!=null"> AND ASSY_DATA_TYPE_BO=#{ew.entity.assyDataTypeBo}</if>
<if test="ew.entity.usageCount!=null"> AND USAGE_COUNT=#{ew.entity.usageCount}</if>
<if test="ew.entity.maximumUsage!=null"> AND MAXIMUM_USAGE=#{ew.entity.maximumUsage}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.originalQty!=null"> AND ORIGINAL_QTY=#{ew.entity.originalQty}</if>
<if test="ew.entity.workCenterLocBo!=null"> AND WORK_CENTER_LOC_BO=#{ew.entity.workCenterLocBo}</if>
<if test="ew.entity.workCenterLocRes!=null"> AND WORK_CENTER_LOC_RES=#{ew.entity.workCenterLocRes}</if>
<if test="ew.entity.operationLocBo!=null"> AND OPERATION_LOC_BO=#{ew.entity.operationLocBo}</if>
<if test="ew.entity.operationLocRes!=null"> AND OPERATION_LOC_RES=#{ew.entity.operationLocRes}</if>
<if test="ew.entity.resourceLocBo!=null"> AND RESOURCE_LOC_BO=#{ew.entity.resourceLocBo}</if>
<if test="ew.entity.resourceLocRes!=null"> AND RESOURCE_LOC_RES=#{ew.entity.resourceLocRes}</if>
<if test="ew.entity.shopOrderLocBo!=null"> AND SHOP_ORDER_LOC_BO=#{ew.entity.shopOrderLocBo}</if>
<if test="ew.entity.shopOrderLocRes!=null"> AND SHOP_ORDER_LOC_RES=#{ew.entity.shopOrderLocRes}</if>
<if test="ew.entity.shopOrderSetByErp!=null"> AND SHOP_ORDER_SET_BY_ERP=#{ew.entity.shopOrderSetByErp}</if>
<if test="ew.entity.originalUserBo!=null"> AND ORIGINAL_USER_BO=#{ew.entity.originalUserBo}</if>
<if test="ew.entity.storageLocationBo!=null"> AND STORAGE_LOCATION_BO=#{ew.entity.storageLocationBo}</if>
<if test="ew.entity.hasBeenUsed!=null"> AND HAS_BEEN_USED=#{ew.entity.hasBeenUsed}</if>
<if test="ew.entity.receiveDateTime!=null"> AND RECEIVE_DATE_TIME=#{ew.entity.receiveDateTime}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.parentInventoryBo!=null"> AND PARENT_INVENTORY_BO=#{ew.entity.parentInventoryBo}</if>
<if test="ew.entity.erpInventory!=null"> AND ERP_INVENTORY=#{ew.entity.erpInventory}</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 INVENTORY
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.inventoryContextGbo!=null"> AND INVENTORY_CONTEXT_GBO=#{ew.entity.inventoryContextGbo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.assyDataTypeBo!=null"> AND ASSY_DATA_TYPE_BO=#{ew.entity.assyDataTypeBo}</if>
<if test="ew.entity.usageCount!=null"> AND USAGE_COUNT=#{ew.entity.usageCount}</if>
<if test="ew.entity.maximumUsage!=null"> AND MAXIMUM_USAGE=#{ew.entity.maximumUsage}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.originalQty!=null"> AND ORIGINAL_QTY=#{ew.entity.originalQty}</if>
<if test="ew.entity.workCenterLocBo!=null"> AND WORK_CENTER_LOC_BO=#{ew.entity.workCenterLocBo}</if>
<if test="ew.entity.workCenterLocRes!=null"> AND WORK_CENTER_LOC_RES=#{ew.entity.workCenterLocRes}</if>
<if test="ew.entity.operationLocBo!=null"> AND OPERATION_LOC_BO=#{ew.entity.operationLocBo}</if>
<if test="ew.entity.operationLocRes!=null"> AND OPERATION_LOC_RES=#{ew.entity.operationLocRes}</if>
<if test="ew.entity.resourceLocBo!=null"> AND RESOURCE_LOC_BO=#{ew.entity.resourceLocBo}</if>
<if test="ew.entity.resourceLocRes!=null"> AND RESOURCE_LOC_RES=#{ew.entity.resourceLocRes}</if>
<if test="ew.entity.shopOrderLocBo!=null"> AND SHOP_ORDER_LOC_BO=#{ew.entity.shopOrderLocBo}</if>
<if test="ew.entity.shopOrderLocRes!=null"> AND SHOP_ORDER_LOC_RES=#{ew.entity.shopOrderLocRes}</if>
<if test="ew.entity.shopOrderSetByErp!=null"> AND SHOP_ORDER_SET_BY_ERP=#{ew.entity.shopOrderSetByErp}</if>
<if test="ew.entity.originalUserBo!=null"> AND ORIGINAL_USER_BO=#{ew.entity.originalUserBo}</if>
<if test="ew.entity.storageLocationBo!=null"> AND STORAGE_LOCATION_BO=#{ew.entity.storageLocationBo}</if>
<if test="ew.entity.hasBeenUsed!=null"> AND HAS_BEEN_USED=#{ew.entity.hasBeenUsed}</if>
<if test="ew.entity.receiveDateTime!=null"> AND RECEIVE_DATE_TIME=#{ew.entity.receiveDateTime}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.parentInventoryBo!=null"> AND PARENT_INVENTORY_BO=#{ew.entity.parentInventoryBo}</if>
<if test="ew.entity.erpInventory!=null"> AND ERP_INVENTORY=#{ew.entity.erpInventory}</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.meapi.model.Inventory">
INSERT INTO INVENTORY
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="changeStamp!=null">CHANGE_STAMP,</if>
<if test="site!=null">SITE,</if>
<if test="inventoryId!=null">INVENTORY_ID,</if>
<if test="itemBo!=null">ITEM_BO,</if>
<if test="inventoryContextGbo!=null">INVENTORY_CONTEXT_GBO,</if>
<if test="description!=null">DESCRIPTION,</if>
<if test="qtyOnHand!=null">QTY_ON_HAND,</if>
<if test="assyDataTypeBo!=null">ASSY_DATA_TYPE_BO,</if>
<if test="usageCount!=null">USAGE_COUNT,</if>
<if test="maximumUsage!=null">MAXIMUM_USAGE,</if>
<if test="statusBo!=null">STATUS_BO,</if>
<if test="originalQty!=null">ORIGINAL_QTY,</if>
<if test="workCenterLocBo!=null">WORK_CENTER_LOC_BO,</if>
<if test="workCenterLocRes!=null">WORK_CENTER_LOC_RES,</if>
<if test="operationLocBo!=null">OPERATION_LOC_BO,</if>
<if test="operationLocRes!=null">OPERATION_LOC_RES,</if>
<if test="resourceLocBo!=null">RESOURCE_LOC_BO,</if>
<if test="resourceLocRes!=null">RESOURCE_LOC_RES,</if>
<if test="shopOrderLocBo!=null">SHOP_ORDER_LOC_BO,</if>
<if test="shopOrderLocRes!=null">SHOP_ORDER_LOC_RES,</if>
<if test="shopOrderSetByErp!=null">SHOP_ORDER_SET_BY_ERP,</if>
<if test="originalUserBo!=null">ORIGINAL_USER_BO,</if>
<if test="storageLocationBo!=null">STORAGE_LOCATION_BO,</if>
<if test="hasBeenUsed!=null">HAS_BEEN_USED,</if>
<if test="receiveDateTime!=null">RECEIVE_DATE_TIME,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
<if test="partitionDate!=null">PARTITION_DATE,</if>
<if test="parentInventoryBo!=null">PARENT_INVENTORY_BO,</if>
<if test="erpInventory!=null">ERP_INVENTORY,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="changeStamp!=null">#{changeStamp},</if>
<if test="site!=null">#{site},</if>
<if test="inventoryId!=null">#{inventoryId},</if>
<if test="itemBo!=null">#{itemBo},</if>
<if test="inventoryContextGbo!=null">#{inventoryContextGbo},</if>
<if test="description!=null">#{description},</if>
<if test="qtyOnHand!=null">#{qtyOnHand},</if>
<if test="assyDataTypeBo!=null">#{assyDataTypeBo},</if>
<if test="usageCount!=null">#{usageCount},</if>
<if test="maximumUsage!=null">#{maximumUsage},</if>
<if test="statusBo!=null">#{statusBo},</if>
<if test="originalQty!=null">#{originalQty},</if>
<if test="workCenterLocBo!=null">#{workCenterLocBo},</if>
<if test="workCenterLocRes!=null">#{workCenterLocRes},</if>
<if test="operationLocBo!=null">#{operationLocBo},</if>
<if test="operationLocRes!=null">#{operationLocRes},</if>
<if test="resourceLocBo!=null">#{resourceLocBo},</if>
<if test="resourceLocRes!=null">#{resourceLocRes},</if>
<if test="shopOrderLocBo!=null">#{shopOrderLocBo},</if>
<if test="shopOrderLocRes!=null">#{shopOrderLocRes},</if>
<if test="shopOrderSetByErp!=null">#{shopOrderSetByErp},</if>
<if test="originalUserBo!=null">#{originalUserBo},</if>
<if test="storageLocationBo!=null">#{storageLocationBo},</if>
<if test="hasBeenUsed!=null">#{hasBeenUsed},</if>
<if test="receiveDateTime!=null">#{receiveDateTime},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
<if test="partitionDate!=null">#{partitionDate},</if>
<if test="parentInventoryBo!=null">#{parentInventoryBo},</if>
<if test="erpInventory!=null">#{erpInventory},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.meapi.model.Inventory">
INSERT INTO INVENTORY
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{changeStamp},
#{site},
#{inventoryId},
#{itemBo},
#{inventoryContextGbo},
#{description},
#{qtyOnHand},
#{assyDataTypeBo},
#{usageCount},
#{maximumUsage},
#{statusBo},
#{originalQty},
#{workCenterLocBo},
#{workCenterLocRes},
#{operationLocBo},
#{operationLocRes},
#{resourceLocBo},
#{resourceLocRes},
#{shopOrderLocBo},
#{shopOrderLocRes},
#{shopOrderSetByErp},
#{originalUserBo},
#{storageLocationBo},
#{hasBeenUsed},
#{receiveDateTime},
#{createdDateTime},
#{modifiedDateTime},
#{partitionDate},
#{parentInventoryBo},
#{erpInventory},
</trim>
</insert>
<update id="update">
UPDATE INVENTORY <trim prefix="SET" suffixOverrides=",">
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
<if test="et.changeStamp!=null">CHANGE_STAMP=#{et.changeStamp},</if>
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.inventoryId!=null">INVENTORY_ID=#{et.inventoryId},</if>
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
<if test="et.inventoryContextGbo!=null">INVENTORY_CONTEXT_GBO=#{et.inventoryContextGbo},</if>
<if test="et.description!=null">DESCRIPTION=#{et.description},</if>
<if test="et.qtyOnHand!=null">QTY_ON_HAND=#{et.qtyOnHand},</if>
<if test="et.assyDataTypeBo!=null">ASSY_DATA_TYPE_BO=#{et.assyDataTypeBo},</if>
<if test="et.usageCount!=null">USAGE_COUNT=#{et.usageCount},</if>
<if test="et.maximumUsage!=null">MAXIMUM_USAGE=#{et.maximumUsage},</if>
<if test="et.statusBo!=null">STATUS_BO=#{et.statusBo},</if>
<if test="et.originalQty!=null">ORIGINAL_QTY=#{et.originalQty},</if>
<if test="et.workCenterLocBo!=null">WORK_CENTER_LOC_BO=#{et.workCenterLocBo},</if>
<if test="et.workCenterLocRes!=null">WORK_CENTER_LOC_RES=#{et.workCenterLocRes},</if>
<if test="et.operationLocBo!=null">OPERATION_LOC_BO=#{et.operationLocBo},</if>
<if test="et.operationLocRes!=null">OPERATION_LOC_RES=#{et.operationLocRes},</if>
<if test="et.resourceLocBo!=null">RESOURCE_LOC_BO=#{et.resourceLocBo},</if>
<if test="et.resourceLocRes!=null">RESOURCE_LOC_RES=#{et.resourceLocRes},</if>
<if test="et.shopOrderLocBo!=null">SHOP_ORDER_LOC_BO=#{et.shopOrderLocBo},</if>
<if test="et.shopOrderLocRes!=null">SHOP_ORDER_LOC_RES=#{et.shopOrderLocRes},</if>
<if test="et.shopOrderSetByErp!=null">SHOP_ORDER_SET_BY_ERP=#{et.shopOrderSetByErp},</if>
<if test="et.originalUserBo!=null">ORIGINAL_USER_BO=#{et.originalUserBo},</if>
<if test="et.storageLocationBo!=null">STORAGE_LOCATION_BO=#{et.storageLocationBo},</if>
<if test="et.hasBeenUsed!=null">HAS_BEEN_USED=#{et.hasBeenUsed},</if>
<if test="et.receiveDateTime!=null">RECEIVE_DATE_TIME=#{et.receiveDateTime},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
<if test="et.partitionDate!=null">PARTITION_DATE=#{et.partitionDate},</if>
<if test="et.parentInventoryBo!=null">PARENT_INVENTORY_BO=#{et.parentInventoryBo},</if>
<if test="et.erpInventory!=null">ERP_INVENTORY=#{et.erpInventory},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.inventoryContextGbo!=null"> AND INVENTORY_CONTEXT_GBO=#{ew.entity.inventoryContextGbo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.assyDataTypeBo!=null"> AND ASSY_DATA_TYPE_BO=#{ew.entity.assyDataTypeBo}</if>
<if test="ew.entity.usageCount!=null"> AND USAGE_COUNT=#{ew.entity.usageCount}</if>
<if test="ew.entity.maximumUsage!=null"> AND MAXIMUM_USAGE=#{ew.entity.maximumUsage}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.originalQty!=null"> AND ORIGINAL_QTY=#{ew.entity.originalQty}</if>
<if test="ew.entity.workCenterLocBo!=null"> AND WORK_CENTER_LOC_BO=#{ew.entity.workCenterLocBo}</if>
<if test="ew.entity.workCenterLocRes!=null"> AND WORK_CENTER_LOC_RES=#{ew.entity.workCenterLocRes}</if>
<if test="ew.entity.operationLocBo!=null"> AND OPERATION_LOC_BO=#{ew.entity.operationLocBo}</if>
<if test="ew.entity.operationLocRes!=null"> AND OPERATION_LOC_RES=#{ew.entity.operationLocRes}</if>
<if test="ew.entity.resourceLocBo!=null"> AND RESOURCE_LOC_BO=#{ew.entity.resourceLocBo}</if>
<if test="ew.entity.resourceLocRes!=null"> AND RESOURCE_LOC_RES=#{ew.entity.resourceLocRes}</if>
<if test="ew.entity.shopOrderLocBo!=null"> AND SHOP_ORDER_LOC_BO=#{ew.entity.shopOrderLocBo}</if>
<if test="ew.entity.shopOrderLocRes!=null"> AND SHOP_ORDER_LOC_RES=#{ew.entity.shopOrderLocRes}</if>
<if test="ew.entity.shopOrderSetByErp!=null"> AND SHOP_ORDER_SET_BY_ERP=#{ew.entity.shopOrderSetByErp}</if>
<if test="ew.entity.originalUserBo!=null"> AND ORIGINAL_USER_BO=#{ew.entity.originalUserBo}</if>
<if test="ew.entity.storageLocationBo!=null"> AND STORAGE_LOCATION_BO=#{ew.entity.storageLocationBo}</if>
<if test="ew.entity.hasBeenUsed!=null"> AND HAS_BEEN_USED=#{ew.entity.hasBeenUsed}</if>
<if test="ew.entity.receiveDateTime!=null"> AND RECEIVE_DATE_TIME=#{ew.entity.receiveDateTime}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.parentInventoryBo!=null"> AND PARENT_INVENTORY_BO=#{ew.entity.parentInventoryBo}</if>
<if test="ew.entity.erpInventory!=null"> AND ERP_INVENTORY=#{ew.entity.erpInventory}</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="deleteByMap">
DELETE FROM INVENTORY
<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 INVENTORY
<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.changeStamp!=null"> AND CHANGE_STAMP=#{ew.entity.changeStamp}</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
<if test="ew.entity.inventoryContextGbo!=null"> AND INVENTORY_CONTEXT_GBO=#{ew.entity.inventoryContextGbo}</if>
<if test="ew.entity.description!=null"> AND DESCRIPTION=#{ew.entity.description}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.assyDataTypeBo!=null"> AND ASSY_DATA_TYPE_BO=#{ew.entity.assyDataTypeBo}</if>
<if test="ew.entity.usageCount!=null"> AND USAGE_COUNT=#{ew.entity.usageCount}</if>
<if test="ew.entity.maximumUsage!=null"> AND MAXIMUM_USAGE=#{ew.entity.maximumUsage}</if>
<if test="ew.entity.statusBo!=null"> AND STATUS_BO=#{ew.entity.statusBo}</if>
<if test="ew.entity.originalQty!=null"> AND ORIGINAL_QTY=#{ew.entity.originalQty}</if>
<if test="ew.entity.workCenterLocBo!=null"> AND WORK_CENTER_LOC_BO=#{ew.entity.workCenterLocBo}</if>
<if test="ew.entity.workCenterLocRes!=null"> AND WORK_CENTER_LOC_RES=#{ew.entity.workCenterLocRes}</if>
<if test="ew.entity.operationLocBo!=null"> AND OPERATION_LOC_BO=#{ew.entity.operationLocBo}</if>
<if test="ew.entity.operationLocRes!=null"> AND OPERATION_LOC_RES=#{ew.entity.operationLocRes}</if>
<if test="ew.entity.resourceLocBo!=null"> AND RESOURCE_LOC_BO=#{ew.entity.resourceLocBo}</if>
<if test="ew.entity.resourceLocRes!=null"> AND RESOURCE_LOC_RES=#{ew.entity.resourceLocRes}</if>
<if test="ew.entity.shopOrderLocBo!=null"> AND SHOP_ORDER_LOC_BO=#{ew.entity.shopOrderLocBo}</if>
<if test="ew.entity.shopOrderLocRes!=null"> AND SHOP_ORDER_LOC_RES=#{ew.entity.shopOrderLocRes}</if>
<if test="ew.entity.shopOrderSetByErp!=null"> AND SHOP_ORDER_SET_BY_ERP=#{ew.entity.shopOrderSetByErp}</if>
<if test="ew.entity.originalUserBo!=null"> AND ORIGINAL_USER_BO=#{ew.entity.originalUserBo}</if>
<if test="ew.entity.storageLocationBo!=null"> AND STORAGE_LOCATION_BO=#{ew.entity.storageLocationBo}</if>
<if test="ew.entity.hasBeenUsed!=null"> AND HAS_BEEN_USED=#{ew.entity.hasBeenUsed}</if>
<if test="ew.entity.receiveDateTime!=null"> AND RECEIVE_DATE_TIME=#{ew.entity.receiveDateTime}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
<if test="ew.entity.parentInventoryBo!=null"> AND PARENT_INVENTORY_BO=#{ew.entity.parentInventoryBo}</if>
<if test="ew.entity.erpInventory!=null"> AND ERP_INVENTORY=#{ew.entity.erpInventory}</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>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -668,7 +668,9 @@
SELECT S.SFC,S.QTY,IT.DESCRIPTION ITEM_DESCRIPTION FROM SFC S
LEFT JOIN ITEM_T IT ON S.ITEM_BO=IT.HANDLE AND IT.LOCALE=#{locale}
JOIN Z_SFC_DISPATCH zsd ON S.SFC=zsd.SFC AND S.SITE=zsd.SITE
JOIN Z_PROD_READY_TASK zprt ON ZPRT.SFC_DISPATCH_BO=zsd.HANDLE
WHERE S.SITE=#{ew.entity.site} AND ZSD.RESRCE=#{ew.entity.resrce} AND ZSD.DISPATCH_STATUS!='CANCEL'
AND S.STATUS_BO IN ('StatusBO:'||#{ew.entity.site}||',401','StatusBO:'||#{ew.entity.site}||',402','StatusBO:'||#{ew.entity.site}||',403')
AND zprt.STATUS='FINISH' AND ZPRT."RESULT"='OK'
</select>
</mapper>

@ -0,0 +1,148 @@
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.meapi.dto.WorkCenterDto;
import com.foreverwin.mesnac.production.model.LoadInventory;
import com.foreverwin.mesnac.production.service.LoadInventoryService;
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;
/**
*
* @author Philip
* @since 2021-07-09
*/
@RestController
@RequestMapping("/Z-LOAD-INVENTORY")
public class LoadInventoryController {
@Autowired
public LoadInventoryService loadInventoryService;
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("/loadList")
public R getLoadList(WorkCenterDto workCenterDto){
List<LoadInventory> result;
result = loadInventoryService.getLoadInventoryList(workCenterDto);
return R.ok(result);
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("/loadInventory")
public R loadInventory(LoadInventory loadInventory){
List<LoadInventory> result;
result = loadInventoryService.loadInventory(loadInventory);
return R.ok(result);
}
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getLoadInventoryById(@PathVariable String id) {
return R.ok( loadInventoryService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getLoadInventoryList(LoadInventory loadInventory){
List<LoadInventory> result;
QueryWrapper<LoadInventory> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(loadInventory);
result = loadInventoryService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<LoadInventory> frontPage, LoadInventory loadInventory){
IPage result;
QueryWrapper<LoadInventory> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(loadInventory);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(LoadInventory::getHandle, frontPage.getGlobalQuery())
.or().like(LoadInventory::getSite, frontPage.getGlobalQuery())
.or().like(LoadInventory::getInventoryId, frontPage.getGlobalQuery())
.or().like(LoadInventory::getResrce, frontPage.getGlobalQuery())
.or().like(LoadInventory::getItem, frontPage.getGlobalQuery())
.or().like(LoadInventory::getCreateUser, frontPage.getGlobalQuery())
.or().like(LoadInventory::getModifyUser, frontPage.getGlobalQuery())
);
}
result = loadInventoryService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param loadInventory
* @return null
*/
@PostMapping
public R save(@RequestBody LoadInventory loadInventory) {
return R.ok(loadInventoryService.save(loadInventory));
}
/**
*
* @param loadInventory
* @return null
*/
@PutMapping
public R updateById(@RequestBody LoadInventory loadInventory) {
return R.ok(loadInventoryService.updateById(loadInventory));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(loadInventoryService.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(loadInventoryService.removeByIds(ids));
}
}

@ -0,0 +1,124 @@
package com.foreverwin.mesnac.production.controller;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.production.service.LoadInventoryLogService;
import com.foreverwin.mesnac.production.model.LoadInventoryLog;
import java.util.List;
/**
*
* @author Philip
* @since 2021-07-09
*/
@RestController
@RequestMapping("/Z-LOAD-INVENTORY-LOG")
public class LoadInventoryLogController {
@Autowired
public LoadInventoryLogService loadInventoryLogService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getLoadInventoryLogById(@PathVariable String id) {
return R.ok( loadInventoryLogService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getLoadInventoryLogList(LoadInventoryLog loadInventoryLog){
List<LoadInventoryLog> result;
QueryWrapper<LoadInventoryLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(loadInventoryLog);
result = loadInventoryLogService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<LoadInventoryLog> frontPage, LoadInventoryLog loadInventoryLog){
IPage result;
QueryWrapper<LoadInventoryLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(loadInventoryLog);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(LoadInventoryLog::getHandle, frontPage.getGlobalQuery())
.or().like(LoadInventoryLog::getSite, frontPage.getGlobalQuery())
.or().like(LoadInventoryLog::getInventoryId, frontPage.getGlobalQuery())
.or().like(LoadInventoryLog::getResrce, frontPage.getGlobalQuery())
.or().like(LoadInventoryLog::getItem, frontPage.getGlobalQuery())
.or().like(LoadInventoryLog::getActionCode, frontPage.getGlobalQuery())
.or().like(LoadInventoryLog::getCreateUser, frontPage.getGlobalQuery())
);
}
result = loadInventoryLogService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param loadInventoryLog
* @return null
*/
@PostMapping
public R save(@RequestBody LoadInventoryLog loadInventoryLog) {
return R.ok(loadInventoryLogService.save(loadInventoryLog));
}
/**
*
* @param loadInventoryLog
* @return null
*/
@PutMapping
public R updateById(@RequestBody LoadInventoryLog loadInventoryLog) {
return R.ok(loadInventoryLogService.updateById(loadInventoryLog));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(loadInventoryLogService.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(loadInventoryLogService.removeByIds(ids));
}
}

@ -8,7 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/sfcDataMains")
@ -41,25 +41,25 @@ public class PodTemplateController {
/**
* sfc
* @param sfcDtoList
* @param map
* @return
*/
@ResponseBody
@PostMapping("/sfcStart")
public R sfcStart(@RequestBody List<SfcDto> sfcDtoList) {
podTemplateService.sfcStart(sfcDtoList);
public R sfcStart(@RequestBody Map<String,Object> map) {
podTemplateService.sfcStart(map);
return R.ok();
}
/**
* sfc
* @param sfcDtoList
* @param map
* @return
*/
@ResponseBody
@PostMapping("/sfcComplete")
public R sfcComplete(@RequestBody List<SfcDto> sfcDtoList) {
podTemplateService.sfcComplete(sfcDtoList);
public R sfcComplete(@RequestBody Map<String,Object> map) {
podTemplateService.sfcComplete(map);
return R.ok();
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.production.mapper;
import com.foreverwin.mesnac.production.model.LoadInventoryLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author Philip
* @since 2021-07-09
*/
@Repository
public interface LoadInventoryLogMapper extends BaseMapper<LoadInventoryLog> {
}

@ -0,0 +1,22 @@
package com.foreverwin.mesnac.production.mapper;
import com.foreverwin.mesnac.production.model.LoadInventory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
* </p>
*
* @author Philip
* @since 2021-07-09
*/
@Repository
public interface LoadInventoryMapper extends BaseMapper<LoadInventory> {
List<LoadInventory> getLoadInventoryList(@Param("site") String site,@Param("resrce") String resrce, @Param("language") String language);
}

@ -9,6 +9,7 @@ import com.foreverwin.mesnac.production.model.StepOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
@ -38,16 +39,7 @@ public interface SfcCrossMapper extends BaseMapper {
* @return
*/
List<StepOperation> findRouterOperationByRouterBo(@Param("site") String site, @Param("routerBo") String routerBo, @Param("locale") String locale);
/**
* SFCSN
* @param site
* @param shopOrderRef
* @return
*/
List<Sfc> findOpenStatusSnByShopOrder(@Param("site") String site, @Param("shopOrderRef") String shopOrderRef);
/**
* 线
@ -67,25 +59,6 @@ public interface SfcCrossMapper extends BaseMapper {
*/
StepOperation findRouterLastOperationByRouterBo(IPage page, @Param("routerBo") String routerBo);
/**
* SNSFC
* @param page
* @param site
* @param sn
* @return
*/
Sfc findSfcBySn(IPage page, @Param("site") String site, @Param("sn") String sn);
/**
* SNSFC
* @param page
* @param site
* @param sn
* @return
*/
Sfc findSfcBySnContainComplete(IPage page, @Param("site") String site, @Param("sn") String sn);
List<StepOperation> getResourceBySfc(@Param("site") String site, @Param("sfc") String sfc);
Map<String, Object> querySfcData(@Param("site")String site, @Param("locale")String locale, @Param("dto")SfcDto sfcDto);
@ -93,4 +66,8 @@ public interface SfcCrossMapper extends BaseMapper {
Map<String, Object> getSfcInfo(@Param("site")String site, @Param("sfc")String sfc, @Param("operation")String operation);
Integer getSfcDispatch(@Param("site") String site, @Param("sfc") String sfc, @Param("operation") String operation, @Param("stepId") String stepId,@Param("resrce")String resrce);
List<SfcDto> getSfcListByResrce(@Param("site") String site, @Param("resrce") String resrce,@Param("locale") String locale);
Integer resourceCheck(@Param("resrceBO")String resrceBO, @Param("dateTime")LocalDateTime dateTime);
}

@ -0,0 +1,216 @@
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-09
*/
@TableName("Z_LOAD_INVENTORY")
public class LoadInventory extends Model<LoadInventory> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SITE")
private String site;
/**
*
*/
@TableField("INVENTORY_ID")
private String inventoryId;
/**
*
*/
@TableField("RESRCE")
private String resrce;
/**
*
*/
@TableField("ITEM")
private String item;
/**
*
*/
@TableField("QTY_ON_HAND")
private Double qtyOnHand;
/**
*
*/
@TableField("LOAD_QTY")
private Double loadQty;
/**
*
*/
@TableField("CREATE_USER")
private String createUser;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
/**
*
*/
@TableField("MODIFY_USER")
private String modifyUser;
/**
*
*/
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
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 getInventoryId() {
return inventoryId;
}
public void setInventoryId(String inventoryId) {
this.inventoryId = inventoryId;
}
public String getResrce() {
return resrce;
}
public void setResrce(String resrce) {
this.resrce = resrce;
}
public String getItem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public Double getQtyOnHand() {
return qtyOnHand;
}
public void setQtyOnHand(Double qtyOnHand) {
this.qtyOnHand = qtyOnHand;
}
public Double getLoadQty() {
return loadQty;
}
public void setLoadQty(Double loadQty) {
this.loadQty = loadQty;
}
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 String getModifyUser() {
return modifyUser;
}
public void setModifyUser(String modifyUser) {
this.modifyUser = modifyUser;
}
public LocalDateTime getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String INVENTORY_ID = "INVENTORY_ID";
public static final String RESRCE = "RESRCE";
public static final String ITEM = "ITEM";
public static final String QTY_ON_HAND = "QTY_ON_HAND";
public static final String LOAD_QTY = "LOAD_QTY";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFY_USER = "MODIFY_USER";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "LoadInventory{" +
"handle = " + handle +
", site = " + site +
", inventoryId = " + inventoryId +
", resrce = " + resrce +
", item = " + item +
", qtyOnHand = " + qtyOnHand +
", loadQty = " + loadQty +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
", modifyUser = " + modifyUser +
", modifiedDateTime = " + modifiedDateTime +
"}";
}
}

@ -0,0 +1,200 @@
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-09
*/
@TableName("Z_LOAD_INVENTORY_LOG")
public class LoadInventoryLog extends Model<LoadInventoryLog> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SITE")
private String site;
/**
*
*/
@TableField("INVENTORY_ID")
private String inventoryId;
/**
*
*/
@TableField("RESRCE")
private String resrce;
/**
*
*/
@TableField("ITEM")
private String item;
/**
* 1;2
*/
@TableField("ACTION_CODE")
private String actionCode;
/**
*
*/
@TableField("QTY_ON_HAND")
private Double qtyOnHand;
/**
*
*/
@TableField("LOAD_QTY")
private Double loadQty;
/**
*
*/
@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 getInventoryId() {
return inventoryId;
}
public void setInventoryId(String inventoryId) {
this.inventoryId = inventoryId;
}
public String getResrce() {
return resrce;
}
public void setResrce(String resrce) {
this.resrce = resrce;
}
public String getItem() {
return item;
}
public void setItem(String item) {
this.item = item;
}
public String getActionCode() {
return actionCode;
}
public void setActionCode(String actionCode) {
this.actionCode = actionCode;
}
public Double getQtyOnHand() {
return qtyOnHand;
}
public void setQtyOnHand(Double qtyOnHand) {
this.qtyOnHand = qtyOnHand;
}
public Double getLoadQty() {
return loadQty;
}
public void setLoadQty(Double loadQty) {
this.loadQty = loadQty;
}
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 INVENTORY_ID = "INVENTORY_ID";
public static final String RESRCE = "RESRCE";
public static final String ITEM = "ITEM";
public static final String ACTION_CODE = "ACTION_CODE";
public static final String QTY_ON_HAND = "QTY_ON_HAND";
public static final String LOAD_QTY = "LOAD_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 "LoadInventoryLog{" +
"handle = " + handle +
", site = " + site +
", inventoryId = " + inventoryId +
", resrce = " + resrce +
", item = " + item +
", actionCode = " + actionCode +
", qtyOnHand = " + qtyOnHand +
", loadQty = " + loadQty +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
"}";
}
}

@ -0,0 +1,28 @@
package com.foreverwin.mesnac.production.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.production.model.LoadInventoryLog;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-07-09
*/
public interface LoadInventoryLogService extends IService<LoadInventoryLog> {
/**
*
* @param frontPage
* @return
*/
IPage<LoadInventoryLog> selectPage(FrontPage<LoadInventoryLog> frontPage, LoadInventoryLog loadInventoryLog);
List<LoadInventoryLog> selectList(LoadInventoryLog loadInventoryLog);
}

@ -0,0 +1,33 @@
package com.foreverwin.mesnac.production.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
import com.foreverwin.mesnac.production.model.LoadInventory;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-07-09
*/
public interface LoadInventoryService extends IService<LoadInventory> {
/**
*
* @param frontPage
* @return
*/
IPage<LoadInventory> selectPage(FrontPage<LoadInventory> frontPage, LoadInventory loadInventory);
List<LoadInventory> selectList(LoadInventory loadInventory);
List<LoadInventory> getLoadInventoryList(WorkCenterDto workCenterDto);
List<LoadInventory> loadInventory(LoadInventory loadInventory);
}

@ -3,7 +3,6 @@ package com.foreverwin.mesnac.production.service;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
import java.util.List;
import java.util.Map;
public interface PodTemplateService {
@ -13,7 +12,7 @@ public interface PodTemplateService {
Object getSfcInfo(SfcDto sfcDto);
void sfcStart(List<SfcDto> sfcDto);
void sfcStart(Map<String, Object> map);
void sfcComplete(List<SfcDto> sfcDtoList);
void sfcComplete(Map<String, Object> map);
}

@ -1,6 +1,9 @@
package com.foreverwin.mesnac.production.service;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import java.math.BigDecimal;
import java.util.List;
/**
* :
@ -41,4 +44,11 @@ public interface SfcCrossService {
*/
void passAction(String site, String operationRef, String resource, String sfcRef, BigDecimal qty) throws Exception;
List<SfcDto> getSfcListByResrce(String site, String resrce);
/**
*
* @param resrceBO
*/
void resourceCheck(String resrceBO);
}

@ -0,0 +1,46 @@
package com.foreverwin.mesnac.production.service.impl;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.production.model.LoadInventoryLog;
import com.foreverwin.mesnac.production.mapper.LoadInventoryLogMapper;
import com.foreverwin.mesnac.production.service.LoadInventoryLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-07-09
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class LoadInventoryLogServiceImpl extends ServiceImpl<LoadInventoryLogMapper, LoadInventoryLog> implements LoadInventoryLogService {
@Autowired
private LoadInventoryLogMapper loadInventoryLogMapper;
@Override
public IPage<LoadInventoryLog> selectPage(FrontPage<LoadInventoryLog> frontPage, LoadInventoryLog loadInventoryLog) {
QueryWrapper<LoadInventoryLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(loadInventoryLog);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<LoadInventoryLog> selectList(LoadInventoryLog loadInventoryLog) {
QueryWrapper<LoadInventoryLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(loadInventoryLog);
return super.list(queryWrapper);
}
}

@ -0,0 +1,94 @@
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.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.WorkCenterDto;
import com.foreverwin.mesnac.meapi.model.Resrce;
import com.foreverwin.mesnac.meapi.service.InventoryService;
import com.foreverwin.mesnac.meapi.service.ResrceService;
import com.foreverwin.mesnac.production.mapper.LoadInventoryMapper;
import com.foreverwin.mesnac.production.model.LoadInventory;
import com.foreverwin.mesnac.production.service.LoadInventoryService;
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.util.List;
/**
* <p>
*
* </p>
*
* @author Philip
* @since 2021-07-09
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class LoadInventoryServiceImpl extends ServiceImpl<LoadInventoryMapper, LoadInventory> implements LoadInventoryService {
@Autowired
private ResrceService resrceService;
@Autowired
private CommonService commonService;
@Autowired
private InventoryService inventoryService;
@Autowired
private LoadInventoryMapper loadInventoryMapper;
@Override
public IPage<LoadInventory> selectPage(FrontPage<LoadInventory> frontPage, LoadInventory loadInventory) {
QueryWrapper<LoadInventory> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(loadInventory);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<LoadInventory> selectList(LoadInventory loadInventory) {
QueryWrapper<LoadInventory> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(loadInventory);
return super.list(queryWrapper);
}
@Override
public List<LoadInventory> getLoadInventoryList(WorkCenterDto workCenterDto) {
String site = CommonMethods.getSite();
String resrce = workCenterDto.getResrce();
String workCenter = workCenterDto.getWorkCenter();
String handle = HandleEnum.RESOURCE.getHandle(site, resrce);
Resrce byId = resrceService.getById(handle);
if (byId==null){
throw new BaseException("设备"+resrce+"不存在");
}
//校验
String workShopBo = commonService.getWorkShopBo(handle);
if (StringUtil.isBlank(workShopBo)) {
throw new BaseException("资源 " + resrce + " 未匹配到车间");
}
if (!workCenter.equals(StringUtil.trimHandle(workShopBo))) {
throw new BaseException("资源 " + resrce + " 与车间不匹配");
}
return loadInventoryMapper.getLoadInventoryList(site,resrce, LocaleContextHolder.getLocale().getLanguage());
}
@Override
public List<LoadInventory> loadInventory(LoadInventory loadInventory) {
String site = CommonMethods.getSite();
String resrce = loadInventory.getResrce();
String handle = HandleEnum.RESOURCE.getHandle(site, resrce);
Resrce byId = resrceService.getById(handle);
if (byId==null){
throw new BaseException("设备"+resrce+"不存在");
}
return null;
}
}

@ -1,5 +1,7 @@
package com.foreverwin.mesnac.production.service.impl;
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.DispatchStatusEnum;
import com.foreverwin.mesnac.common.enums.HandleEnum;
@ -75,14 +77,10 @@ public class PodTemplateServiceImpl implements PodTemplateService {
if (!workCenter.equals(StringUtil.trimHandle(workShopBo))) {
throw new BaseException("资源 " + resrce + " 与车间不匹配");
}
//查询在该设备存在活动中的SFC
List<Sfc> sfcList = sfcService.getSfcListByResrceBO(resrceBO);
//List<Map<String, Object>> proReadyList = sfcDa
// taMainMapper.queryPrdReadyByResrce(site, resrce);
List<SfcDto> sfcList = sfcCrossService.getSfcListByResrce(site,resrce);
Map<String, Object> resultMap = new HashMap<String, Object>();
resultMap.put("SFC_LIST", sfcList);
//resultMap.put("READY_LIST", proReadyList);
return resultMap;
}
@ -90,7 +88,6 @@ public class PodTemplateServiceImpl implements PodTemplateService {
public Map<String, Object> sfcEnter(SfcDto sfcDto) {
String site = CommonMethods.getSite();
String sfc = sfcDto.getSfc();
String operation = sfcDto.getOperation();
String locale = LocaleContextHolder.getLocale().getLanguage();
String resrce = sfcDto.getResrce();
//校验产品条码是否存在
@ -113,8 +110,6 @@ public class PodTemplateServiceImpl implements PodTemplateService {
throw new BaseException("产品条码与当前设备工序确认的派工单不匹配");
}
String substep = "";
String substepHandle = "";
//构造前台所需要的数据
Map<String, Object> resultMap = sfcCrossMapper.querySfcData(site, locale, sfcDto);
if (resultMap == null) {
@ -124,11 +119,25 @@ public class PodTemplateServiceImpl implements PodTemplateService {
List<Map<String, Object>> substepList = new ArrayList<>();
resultMap.put("SFC_STEP_LIST", substepList);
String stepId = (String) resultMap.get("STEP_ID");
resultMap.put("IS_CREATE_W", "N");
//是否需要自检和互检
String isCreateH = "N";
String isCreateZ = "N";
resultMap.put("IS_CREATE_W", "N");
List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operationBySfcBo.getOperation(), operationBySfcBo.getStepId(), Constants.INSPECTION_TYPE_H);
if (inspectionItemDetails.size()>0&&inspectionItemDetails.get(0)!=null) {
InspectionTask createTask = inspectionTaskService.isCreateTask(site, Constants.INSPECTION_TYPE_H, sfc, operationBySfcBo.getOperation(), operationBySfcBo.getStepId());
if (createTask==null ||!createTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)){
isCreateH="Y";
}
}
inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operationBySfcBo.getOperation(), operationBySfcBo.getStepId(), Constants.INSPECTION_TYPE_Z);
if (inspectionItemDetails.size()>0&& inspectionItemDetails.get(0)!=null) {
InspectionTask createTask = inspectionTaskService.isCreateTask(site, Constants.INSPECTION_TYPE_Z, sfc, operationBySfcBo.getOperation(), operationBySfcBo.getStepId());
if (createTask==null ||!createTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)){
isCreateZ = "Y";
}
}
resultMap.put("IS_CREATE_H", isCreateH);
resultMap.put("IS_CREATE_Z", isCreateZ);
return resultMap;
@ -144,27 +153,32 @@ public class PodTemplateServiceImpl implements PodTemplateService {
}
@Override
public void sfcStart(List<SfcDto> sfcDtoList) {
public void sfcStart(Map<String, Object> map) {
List<SfcDto> sfcDtoList = (List<SfcDto>) map.get("sfcDtoList");
ObjectMapper mapper = new ObjectMapper();
sfcDtoList = mapper.convertValue(sfcDtoList, new TypeReference<List<SfcDto>>() {});
String resrce = (String) map.get("resrce");
String site = CommonMethods.getSite();
if (sfcDtoList==null||sfcDtoList.size()<1){
throw new BaseException("作业列表不能为空");
}
if (StringUtil.isBlank(resrce)){
throw new BaseException("资源不能为空");
}
//是否设备点检
sfcCrossService.resourceCheck(HandleEnum.RESOURCE.getHandle(site,resrce));
sfcDtoList.forEach(sfcDto -> {
String site = CommonMethods.getSite();
String operation = sfcDto.getOperation();
Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation);
String resrce = sfcDto.getResrce();
String sfc = sfcDto.getSfc();
String stepId = sfcDto.getStepId();
String dispatchNo = sfcDto.getDispatchNo();
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, sfc));
BigDecimal qty=new BigDecimal(sfcServiceById.getQty().toString());
try {
sfcCrossService.startAction(site, currentRevisionRef.getHandle(),resrce,sfcServiceById.getHandle(),qty);
} catch (Exception e) {
ExceptionUtil.throwException(e);
}
//更改派工单状态
sfcDispatchCommonService.updateSfcDispatchStatus(site,CommonMethods.getUser(),dispatchNo, DispatchStatusEnum.START.getCode());
//是否有互检检验项目
List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_H);
if (inspectionItemDetails.size()>0&&StringUtil.isBlank(inspectionItemDetails.get(0).getInspectionItemBo())) {
if (inspectionItemDetails.size()>0&&inspectionItemDetails.get(0)!=null) {
//是否有互检检验任务及已完成
InspectionTask createTask = inspectionTaskService.isCreateTask(site, Constants.INSPECTION_TYPE_H, sfc, operation, stepId);
if (createTask==null ||!createTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)){
@ -174,15 +188,32 @@ public class PodTemplateServiceImpl implements PodTemplateService {
throw new BaseException("互检任务不合格,不能开始请检查");
}
}
try {
sfcCrossService.startAction(site, currentRevisionRef.getHandle(),resrce,sfcServiceById.getHandle(),qty);
} catch (Exception e) {
ExceptionUtil.throwException(e);
}
//更改派工单状态
sfcDispatchCommonService.updateSfcDispatchStatus(site,CommonMethods.getUser(),dispatchNo, DispatchStatusEnum.START.getCode());
});
}
@Override
public void sfcComplete(List<SfcDto> sfcDtoList) {
public void sfcComplete(Map<String, Object> map) {
List<SfcDto> sfcDtoList = (List<SfcDto>) map.get("sfcDtoList");
ObjectMapper mapper = new ObjectMapper();
sfcDtoList = mapper.convertValue(sfcDtoList, new TypeReference<List<SfcDto>>() {});
String resrce = (String) map.get("resrce");
if (sfcDtoList==null||sfcDtoList.size()<1){
throw new BaseException("作业列表不能为空");
}
if (StringUtil.isBlank(resrce)){
throw new BaseException("资源不能为空");
}
sfcDtoList.forEach(sfcDto -> {
String site = CommonMethods.getSite();
String operation = sfcDto.getOperation();
Operation currentRevisionRef = operationService.getCurrentRevisionRef(site, operation);
String resrce = sfcDto.getResrce();
String sfc = sfcDto.getSfc();
String stepId = sfcDto.getStepId();
@ -199,7 +230,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
//是否有自检检验项目
List<InspectionItemDetail> inspectionItemDetails = inspectionItemService.selectQualityInspection(sfc, operation, stepId, Constants.INSPECTION_TYPE_Z);
if (inspectionItemDetails.size()>0&&StringUtil.isBlank(inspectionItemDetails.get(0).getInspectionItemBo())) {
if (inspectionItemDetails.size()>0&&inspectionItemDetails.get(0)!=null) {
//是否有自检检验任务
InspectionTask createTask = inspectionTaskService.isCreateTask(site, Constants.INSPECTION_TYPE_Z, sfc, operation, stepId);
if (createTask==null ||!createTask.getStatus().equals(Constants.INSPECTION_TASK_STATUS_COMPLETE)){

@ -1,15 +1,22 @@
package com.foreverwin.mesnac.production.service.impl;
import com.foreverwin.mesnac.meapi.dto.SfcDto;
import com.foreverwin.mesnac.production.mapper.SfcCrossMapper;
import com.foreverwin.mesnac.production.service.SfcCrossService;
import com.foreverwin.modular.core.exception.BaseException;
import com.foreverwin.modular.core.meext.MEServices;
import com.foreverwin.modular.core.util.CommonMethods;
import com.sap.me.plant.ResourceBOHandle;
import com.sap.me.production.*;
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.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
/**
* :
@ -19,7 +26,8 @@ import java.math.BigDecimal;
@Service
@Transactional(rollbackFor = Exception.class)
public class SfcCrossServiceImpl implements SfcCrossService {
@Autowired
private SfcCrossMapper sfcCrossMapper;
@Override
public void startAction(String site, String operationRef,
String resource, String sfcRef, BigDecimal qty) throws Exception {
@ -61,4 +69,20 @@ public class SfcCrossServiceImpl implements SfcCrossService {
}
sfcCompleteService.completeSfcQuick(paramCompleteSfcRequest);
}
@Override
public List<SfcDto> getSfcListByResrce(String site, String resrce) {
String locale = LocaleContextHolder.getLocale().getLanguage();
return sfcCrossMapper.getSfcListByResrce(site,resrce,locale);
}
@Override
public void resourceCheck(String resrceBO) {
LocalDateTime now = LocalDateTime.now();
LocalDateTime dateTime = LocalDateTime.of(now.getYear(), now.getMonth(), now.getDayOfMonth(), 0, 0, 0);
Integer integer = sfcCrossMapper.resourceCheck(resrceBO, dateTime);
if (integer<1){
throw new BaseException("当前设备点检未完成");
}
}
}

@ -0,0 +1,402 @@
<?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.LoadInventoryLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.production.model.LoadInventoryLog">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="INVENTORY_ID" property="inventoryId" />
<result column="RESRCE" property="resrce" />
<result column="ITEM" property="item" />
<result column="ACTION_CODE" property="actionCode" />
<result column="QTY_ON_HAND" property="qtyOnHand" />
<result column="LOAD_QTY" property="loadQty" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, INVENTORY_ID, RESRCE, ITEM, ACTION_CODE, QTY_ON_HAND, LOAD_QTY, CREATE_USER, CREATED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_LOAD_INVENTORY_LOG WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_LOAD_INVENTORY_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_LOAD_INVENTORY_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_LOAD_INVENTORY_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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.actionCode!=null"> AND ACTION_CODE=#{ew.entity.actionCode}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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_LOAD_INVENTORY_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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.actionCode!=null"> AND ACTION_CODE=#{ew.entity.actionCode}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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_LOAD_INVENTORY_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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.actionCode!=null"> AND ACTION_CODE=#{ew.entity.actionCode}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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_LOAD_INVENTORY_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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.actionCode!=null"> AND ACTION_CODE=#{ew.entity.actionCode}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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_LOAD_INVENTORY_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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.actionCode!=null"> AND ACTION_CODE=#{ew.entity.actionCode}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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_LOAD_INVENTORY_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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.actionCode!=null"> AND ACTION_CODE=#{ew.entity.actionCode}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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_LOAD_INVENTORY_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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.actionCode!=null"> AND ACTION_CODE=#{ew.entity.actionCode}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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.LoadInventoryLog">
INSERT INTO Z_LOAD_INVENTORY_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="inventoryId!=null">INVENTORY_ID,</if>
<if test="resrce!=null">RESRCE,</if>
<if test="item!=null">ITEM,</if>
<if test="actionCode!=null">ACTION_CODE,</if>
<if test="qtyOnHand!=null">QTY_ON_HAND,</if>
<if test="loadQty!=null">LOAD_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="inventoryId!=null">#{inventoryId},</if>
<if test="resrce!=null">#{resrce},</if>
<if test="item!=null">#{item},</if>
<if test="actionCode!=null">#{actionCode},</if>
<if test="qtyOnHand!=null">#{qtyOnHand},</if>
<if test="loadQty!=null">#{loadQty},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.production.model.LoadInventoryLog">
INSERT INTO Z_LOAD_INVENTORY_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{inventoryId},
#{resrce},
#{item},
#{actionCode},
#{qtyOnHand},
#{loadQty},
#{createUser},
#{createdDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_LOAD_INVENTORY_LOG <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.inventoryId!=null">INVENTORY_ID=#{et.inventoryId},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.item!=null">ITEM=#{et.item},</if>
<if test="et.actionCode!=null">ACTION_CODE=#{et.actionCode},</if>
<if test="et.qtyOnHand!=null">QTY_ON_HAND=#{et.qtyOnHand},</if>
<if test="et.loadQty!=null">LOAD_QTY=#{et.loadQty},</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_LOAD_INVENTORY_LOG <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
INVENTORY_ID=#{et.inventoryId},
RESRCE=#{et.resrce},
ITEM=#{et.item},
ACTION_CODE=#{et.actionCode},
QTY_ON_HAND=#{et.qtyOnHand},
LOAD_QTY=#{et.loadQty},
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_LOAD_INVENTORY_LOG <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.inventoryId!=null">INVENTORY_ID=#{et.inventoryId},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.item!=null">ITEM=#{et.item},</if>
<if test="et.actionCode!=null">ACTION_CODE=#{et.actionCode},</if>
<if test="et.qtyOnHand!=null">QTY_ON_HAND=#{et.qtyOnHand},</if>
<if test="et.loadQty!=null">LOAD_QTY=#{et.loadQty},</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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.actionCode!=null"> AND ACTION_CODE=#{ew.entity.actionCode}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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_LOAD_INVENTORY_LOG WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_LOAD_INVENTORY_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_LOAD_INVENTORY_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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.actionCode!=null"> AND ACTION_CODE=#{ew.entity.actionCode}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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_LOAD_INVENTORY_LOG WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -0,0 +1,420 @@
<?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.LoadInventoryMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.production.model.LoadInventory">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="INVENTORY_ID" property="inventoryId" />
<result column="RESRCE" property="resrce" />
<result column="ITEM" property="item" />
<result column="QTY_ON_HAND" property="qtyOnHand" />
<result column="LOAD_QTY" property="loadQty" />
<result column="CREATE_USER" property="createUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFY_USER" property="modifyUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, INVENTORY_ID, RESRCE, ITEM, QTY_ON_HAND, LOAD_QTY, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_LOAD_INVENTORY WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_LOAD_INVENTORY
<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_LOAD_INVENTORY 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_LOAD_INVENTORY
<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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_LOAD_INVENTORY
<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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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_LOAD_INVENTORY
<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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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_LOAD_INVENTORY
<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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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_LOAD_INVENTORY
<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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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_LOAD_INVENTORY
<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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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_LOAD_INVENTORY
<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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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.LoadInventory">
INSERT INTO Z_LOAD_INVENTORY
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="inventoryId!=null">INVENTORY_ID,</if>
<if test="resrce!=null">RESRCE,</if>
<if test="item!=null">ITEM,</if>
<if test="qtyOnHand!=null">QTY_ON_HAND,</if>
<if test="loadQty!=null">LOAD_QTY,</if>
<if test="createUser!=null">CREATE_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifyUser!=null">MODIFY_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="inventoryId!=null">#{inventoryId},</if>
<if test="resrce!=null">#{resrce},</if>
<if test="item!=null">#{item},</if>
<if test="qtyOnHand!=null">#{qtyOnHand},</if>
<if test="loadQty!=null">#{loadQty},</if>
<if test="createUser!=null">#{createUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifyUser!=null">#{modifyUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.production.model.LoadInventory">
INSERT INTO Z_LOAD_INVENTORY
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{inventoryId},
#{resrce},
#{item},
#{qtyOnHand},
#{loadQty},
#{createUser},
#{createdDateTime},
#{modifyUser},
#{modifiedDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_LOAD_INVENTORY <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.inventoryId!=null">INVENTORY_ID=#{et.inventoryId},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.item!=null">ITEM=#{et.item},</if>
<if test="et.qtyOnHand!=null">QTY_ON_HAND=#{et.qtyOnHand},</if>
<if test="et.loadQty!=null">LOAD_QTY=#{et.loadQty},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</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_LOAD_INVENTORY <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
INVENTORY_ID=#{et.inventoryId},
RESRCE=#{et.resrce},
ITEM=#{et.item},
QTY_ON_HAND=#{et.qtyOnHand},
LOAD_QTY=#{et.loadQty},
CREATE_USER=#{et.createUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFY_USER=#{et.modifyUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
</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_LOAD_INVENTORY <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.inventoryId!=null">INVENTORY_ID=#{et.inventoryId},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.item!=null">ITEM=#{et.item},</if>
<if test="et.qtyOnHand!=null">QTY_ON_HAND=#{et.qtyOnHand},</if>
<if test="et.loadQty!=null">LOAD_QTY=#{et.loadQty},</if>
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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_LOAD_INVENTORY WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_LOAD_INVENTORY
<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_LOAD_INVENTORY
<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.inventoryId!=null"> AND INVENTORY_ID=#{ew.entity.inventoryId}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.qtyOnHand!=null"> AND QTY_ON_HAND=#{ew.entity.qtyOnHand}</if>
<if test="ew.entity.loadQty!=null"> AND LOAD_QTY=#{ew.entity.loadQty}</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 test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</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_LOAD_INVENTORY WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="getLoadInventoryList" resultMap="BaseResultMap">
</select>
</mapper>

@ -77,51 +77,6 @@
AND CF.VALUE = #{status}
</select>
<select id="findOpenStatusSnByShopOrder" resultMap="com.foreverwin.mesnac.meapi.mapper.SfcMapper.BaseResultMap">
SELECT
SFC.SFC,
SFC.QTY ,
SFC.CREATED_DATE_TIME
FROM SFC SFC
WHERE SFC.SHOP_ORDER_BO = #{shopOrderRef}
AND SFC.SITE = #{site}
AND SFC.STATUS_BO IN ('StatusBO:' || #{site} || ',403', 'StatusBO:' || #{site} || ',402')
ORDER BY SFC.CREATED_DATE_TIME DESC
</select>
<select id="findSfcBySn" resultMap="com.foreverwin.mesnac.meapi.mapper.SfcMapper.BaseResultMap">
SELECT
SFC.HANDLE,
SFC.SFC,
SFC.STATUS_BO,
SFC.SHOP_ORDER_BO,
SFC.QTY,
SFC.ITEM_BO
FROM SFC SFC
JOIN SFC_DATA SD ON SFC.HANDLE = SD.SFC_BO AND SD.DATA_FIELD = 'SN'
WHERE SFC.SITE = #{site}
AND SD.DATA_ATTR = #{sn}
AND SFC.STATUS_BO IN ('StatusBO:' || #{site} || ',403', 'StatusBO:' || #{site} || ',402' , 'StatusBO:'|| #{site} || ',401')
ORDER BY SFC.CREATED_DATE_TIME DESC
</select>
<select id="findSfcBySnContainComplete" resultMap="com.foreverwin.mesnac.meapi.mapper.SfcMapper.BaseResultMap">
SELECT
SFC.HANDLE,
SFC.SFC,
SFC.STATUS_BO,
SFC.SHOP_ORDER_BO,
SFC.QTY,
SFC.ITEM_BO
FROM SFC SFC
JOIN SFC_DATA SD ON SFC.HANDLE = SD.SFC_BO AND SD.DATA_FIELD = 'SN'
WHERE SFC.SITE = #{site}
AND SD.DATA_ATTR = #{sn}
AND SFC.STATUS_BO IN ('StatusBO:' || #{site} || ',403', 'StatusBO:' || #{site} || ',402','StatusBO:' || #{site} || ',405')
ORDER BY SFC.CREATED_DATE_TIME DESC
</select>
<select id="getResourceBySfc" resultMap="StepOperationMap">
select siw.RESOURCE_BO
from sfc as sfc
@ -162,7 +117,7 @@ WHERE sfc.site = #{site} and
SELECT SD.HANDLE, SD.SFC,SD.RESRCE,SD.OPERATION,SD.STEP_ID,SD.PLANNED_COMP_DATE, SD.PLANNED_START_DATE,SD.DISPATCH_NO
FROM Z_PROD_READY_TASK RB
INNER JOIN Z_SFC_DISPATCH SD ON SD.HANDLE = RB.SFC_DISPATCH_BO
WHERE RB.SITE =#{site} AND RB.STATUS = 'F'
WHERE RB.SITE =#{site} AND RB.STATUS = 'FINISH' AND RB."RESULT"='OK'
) SOD ON SOD.RESRCE =#{dto.resrce} AND SOD.SFC= S.SFC AND SOD.OPERATION = OP.OPERATION
WHERE S.SITE = #{site} AND S.SFC = #{dto.sfc} AND ROWNUM=1
GROUP BY SO.SHOP_ORDER, SO_CF.VALUE , I.ITEM, IT.DESCRIPTION ,
@ -192,6 +147,19 @@ WHERE sfc.site = #{site} and
WHERE S.SFC=#{sfc} AND S.SITE=#{site}
</select>
<select id="getSfcDispatch" resultType="java.lang.Integer">
SELECT COUNT(HANDLE) FROM Z_SFC_DISPATCH zsd WHERE OPERATION= #{operation} AND SFC= #{sfc} AND STEP_ID= #{stepId} AND SITE= #{site} AND RESRCE=#{resrce}
SELECT COUNT(HANDLE) FROM Z_SFC_DISPATCH zsd WHERE OPERATION= #{operation} AND SFC= #{sfc} AND STEP_ID= #{stepId} AND SITE= #{site} AND RESRCE=#{resrce}
</select>
<select id="getSfcListByResrce" resultType="com.foreverwin.mesnac.meapi.dto.SfcDto">
SELECT ZSD.sfc,ZSD.operation,IT.DESCRIPTION item_Description,ST.STATUS,s.qty,ZSD.DISPATCH_NO,ZSD.STEP_ID
FROM Z_SFC_DISPATCH ZSD
JOIN SFC S ON ZSD.SFC=s.SFC AND ZSD.SITE=s.SITE
LEFT JOIN ITEM_T IT ON S.ITEM_BO=IT.HANDLE AND IT.LOCALE=#{locale}
INNER JOIN STATUS ST ON ST.HANDLE = S.STATUS_BO
WHERE zsd.SITE=#{site} AND zsd.DISPATCH_STATUS='START' AND ZSD.RESRCE=#{resrce}
</select>
<select id="resourceCheck" resultType="java.lang.Integer">
SELECT count(HANDLE) FROM Z_RESOURCE_INSPECT_TASK zrit WHERE RESOURCE_BO=#{resrceBO} AND CATEGORY='DM' AND STATUS='COMPLETE' AND "RESULT"='OK' AND CREATED_DATE_TIME>=#{dateTime}
</select>
</mapper>

Loading…
Cancel
Save