Merge remote-tracking branch 'origin/master'
commit
8cf9d7ef86
@ -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>
|
@ -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));
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
@ -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);
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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>
|
Loading…
Reference in New Issue