余料标示
parent
7517c1deac
commit
8777d65d43
@ -0,0 +1,40 @@
|
|||||||
|
package com.foreverwin.mesnac.dispatch.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.dispatch.service.IssueItemService;
|
||||||
|
import com.foreverwin.mesnac.dispatch.model.IssueItem;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Leon.L
|
||||||
|
* @since 2021-07-09
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/Z-ISSUE-ITEM")
|
||||||
|
public class IssueItemController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public IssueItemService issueItemService;
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/scanIssueInventory")
|
||||||
|
public R scanIssueInventory(String item, String inventory){
|
||||||
|
try {
|
||||||
|
String site = CommonMethods.getSite();
|
||||||
|
issueItemService.scanIssueInventory(site, item, inventory);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return R.failed(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.foreverwin.mesnac.dispatch.controller;
|
||||||
|
|
||||||
|
import com.foreverwin.mesnac.common.util.StringUtil;
|
||||||
|
import com.foreverwin.modular.core.exception.BusinessException;
|
||||||
|
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.dispatch.service.SurplusItemReturnService;
|
||||||
|
import com.foreverwin.mesnac.dispatch.model.SurplusItemReturn;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Leon.L
|
||||||
|
* @since 2021-07-10
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/Z-SURPLUS-ITEM-RETURN")
|
||||||
|
public class SurplusItemReturnController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public SurplusItemReturnService surplusItemReturnService;
|
||||||
|
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/{inventory:.+}")
|
||||||
|
public R getInventoryData(@PathVariable String inventory) {
|
||||||
|
Map<String, Object> result;
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (StringUtil.isBlank(inventory)) {
|
||||||
|
throw BusinessException.build("物料条码不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
String site = CommonMethods.getSite();
|
||||||
|
result = surplusItemReturnService.getInventoryData(site, inventory);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return R.failed(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.foreverwin.mesnac.dispatch.mapper;
|
||||||
|
|
||||||
|
import com.foreverwin.mesnac.dispatch.model.IssueItem;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 车间发料 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Leon.L
|
||||||
|
* @since 2021-07-09
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface IssueItemMapper extends BaseMapper<IssueItem> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.foreverwin.mesnac.dispatch.mapper;
|
||||||
|
|
||||||
|
import com.foreverwin.mesnac.dispatch.model.SurplusItemReturn;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 余料退回 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Leon.L
|
||||||
|
* @since 2021-07-10
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface SurplusItemReturnMapper extends BaseMapper<SurplusItemReturn> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询库存信息
|
||||||
|
*
|
||||||
|
* @param inventoryBo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> selectInventoryData(@Param("inventoryBo") String inventoryBo);
|
||||||
|
}
|
@ -0,0 +1,232 @@
|
|||||||
|
package com.foreverwin.mesnac.dispatch.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 车间发料
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Leon.L
|
||||||
|
* @since 2021-07-09
|
||||||
|
*/
|
||||||
|
|
||||||
|
@TableName("Z_ISSUE_ITEM")
|
||||||
|
|
||||||
|
public class IssueItem extends Model<IssueItem> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableField("HANDLE")
|
||||||
|
private String handle;
|
||||||
|
/**
|
||||||
|
* 站点
|
||||||
|
*/
|
||||||
|
@TableField("SITE")
|
||||||
|
private String site;
|
||||||
|
/**
|
||||||
|
* 叫料单号
|
||||||
|
*/
|
||||||
|
@TableField("CALL_ITEM_NO")
|
||||||
|
private String callItemNo;
|
||||||
|
/**
|
||||||
|
* 生产批次
|
||||||
|
*/
|
||||||
|
@TableField("SHOP_ORDER")
|
||||||
|
private String shopOrder;
|
||||||
|
/**
|
||||||
|
* 生产批次
|
||||||
|
*/
|
||||||
|
@TableField("SFC")
|
||||||
|
private String sfc;
|
||||||
|
/**
|
||||||
|
* 组件物料
|
||||||
|
*/
|
||||||
|
@TableField("ITEM")
|
||||||
|
private String item;
|
||||||
|
/**
|
||||||
|
* 库存编号
|
||||||
|
*/
|
||||||
|
@TableField("INVENTORY")
|
||||||
|
private String inventory;
|
||||||
|
/**
|
||||||
|
* 发料数量
|
||||||
|
*/
|
||||||
|
@TableField("QTY")
|
||||||
|
private Double qty;
|
||||||
|
/**
|
||||||
|
* 创建用户
|
||||||
|
*/
|
||||||
|
@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 getCallItemNo() {
|
||||||
|
return callItemNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCallItemNo(String callItemNo) {
|
||||||
|
this.callItemNo = callItemNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShopOrder() {
|
||||||
|
return shopOrder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShopOrder(String shopOrder) {
|
||||||
|
this.shopOrder = shopOrder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSfc() {
|
||||||
|
return sfc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSfc(String sfc) {
|
||||||
|
this.sfc = sfc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getItem() {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItem(String item) {
|
||||||
|
this.item = item;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInventory() {
|
||||||
|
return inventory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInventory(String inventory) {
|
||||||
|
this.inventory = inventory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getQty() {
|
||||||
|
return qty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQty(Double qty) {
|
||||||
|
this.qty = qty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateUser() {
|
||||||
|
return createUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateUser(String createUser) {
|
||||||
|
this.createUser = createUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getCreatedDateTime() {
|
||||||
|
return createdDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedDateTime(LocalDateTime createdDateTime) {
|
||||||
|
this.createdDateTime = createdDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public 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 CALL_ITEM_NO = "CALL_ITEM_NO";
|
||||||
|
|
||||||
|
public static final String SHOP_ORDER = "SHOP_ORDER";
|
||||||
|
|
||||||
|
public static final String SFC = "SFC";
|
||||||
|
|
||||||
|
public static final String ITEM = "ITEM";
|
||||||
|
|
||||||
|
public static final String INVENTORY = "INVENTORY";
|
||||||
|
|
||||||
|
public static final String QTY = "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 "IssueItem{" +
|
||||||
|
"handle = " + handle +
|
||||||
|
", site = " + site +
|
||||||
|
", callItemNo = " + callItemNo +
|
||||||
|
", shopOrder = " + shopOrder +
|
||||||
|
", sfc = " + sfc +
|
||||||
|
", item = " + item +
|
||||||
|
", inventory = " + inventory +
|
||||||
|
", qty = " + qty +
|
||||||
|
", createUser = " + createUser +
|
||||||
|
", createdDateTime = " + createdDateTime +
|
||||||
|
", modifyUser = " + modifyUser +
|
||||||
|
", modifiedDateTime = " + modifiedDateTime +
|
||||||
|
"}";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,233 @@
|
|||||||
|
package com.foreverwin.mesnac.dispatch.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 余料退回
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Leon.L
|
||||||
|
* @since 2021-07-10
|
||||||
|
*/
|
||||||
|
|
||||||
|
@TableName("Z_SURPLUS_ITEM_RETURN")
|
||||||
|
|
||||||
|
public class SurplusItemReturn extends Model<SurplusItemReturn> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "HANDLE", type = IdType.INPUT)
|
||||||
|
private String handle;
|
||||||
|
/**
|
||||||
|
* 站点
|
||||||
|
*/
|
||||||
|
@TableField("SITE")
|
||||||
|
private String site;
|
||||||
|
/**
|
||||||
|
* 库存批次
|
||||||
|
*/
|
||||||
|
@TableField("INVENTORY")
|
||||||
|
private String inventory;
|
||||||
|
/**
|
||||||
|
* 父库存批次
|
||||||
|
*/
|
||||||
|
@TableField("PARENT_INVENTORY")
|
||||||
|
private String parentInventory;
|
||||||
|
/**
|
||||||
|
* 物料编号
|
||||||
|
*/
|
||||||
|
@TableField("ITEM_BO")
|
||||||
|
private String itemBo;
|
||||||
|
/**
|
||||||
|
* 余料长度
|
||||||
|
*/
|
||||||
|
@TableField("LENGHT")
|
||||||
|
private Double lenght;
|
||||||
|
/**
|
||||||
|
* 余料宽度
|
||||||
|
*/
|
||||||
|
@TableField("WIDTH")
|
||||||
|
private Double width;
|
||||||
|
/**
|
||||||
|
* 余料数量
|
||||||
|
*/
|
||||||
|
@TableField("QTY")
|
||||||
|
private Double qty;
|
||||||
|
/**
|
||||||
|
* 创建用户
|
||||||
|
*/
|
||||||
|
@TableField("CREATE_USER_BO")
|
||||||
|
private String createUserBo;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField("CREATED_DATE_TIME")
|
||||||
|
private LocalDateTime createdDateTime;
|
||||||
|
/**
|
||||||
|
* 更新用户
|
||||||
|
*/
|
||||||
|
@TableField("UPDATE_USER_BO")
|
||||||
|
private String updateUserBo;
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField("UPDATED_DATE_TIME")
|
||||||
|
private LocalDateTime updatedDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
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 getInventory() {
|
||||||
|
return inventory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInventory(String inventory) {
|
||||||
|
this.inventory = inventory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParentInventory() {
|
||||||
|
return parentInventory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentInventory(String parentInventory) {
|
||||||
|
this.parentInventory = parentInventory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getItemBo() {
|
||||||
|
return itemBo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemBo(String itemBo) {
|
||||||
|
this.itemBo = itemBo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getLenght() {
|
||||||
|
return lenght;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLenght(Double lenght) {
|
||||||
|
this.lenght = lenght;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getWidth() {
|
||||||
|
return width;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWidth(Double width) {
|
||||||
|
this.width = width;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getQty() {
|
||||||
|
return qty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQty(Double qty) {
|
||||||
|
this.qty = qty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateUserBo() {
|
||||||
|
return createUserBo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateUserBo(String createUserBo) {
|
||||||
|
this.createUserBo = createUserBo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getCreatedDateTime() {
|
||||||
|
return createdDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedDateTime(LocalDateTime createdDateTime) {
|
||||||
|
this.createdDateTime = createdDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUpdateUserBo() {
|
||||||
|
return updateUserBo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateUserBo(String updateUserBo) {
|
||||||
|
this.updateUserBo = updateUserBo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getUpdatedDateTime() {
|
||||||
|
return updatedDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdatedDateTime(LocalDateTime updatedDateTime) {
|
||||||
|
this.updatedDateTime = updatedDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String HANDLE = "HANDLE";
|
||||||
|
|
||||||
|
public static final String SITE = "SITE";
|
||||||
|
|
||||||
|
public static final String INVENTORY = "INVENTORY";
|
||||||
|
|
||||||
|
public static final String PARENT_INVENTORY = "PARENT_INVENTORY";
|
||||||
|
|
||||||
|
public static final String ITEM_BO = "ITEM_BO";
|
||||||
|
|
||||||
|
public static final String LENGHT = "LENGHT";
|
||||||
|
|
||||||
|
public static final String WIDTH = "WIDTH";
|
||||||
|
|
||||||
|
public static final String QTY = "QTY";
|
||||||
|
|
||||||
|
public static final String CREATE_USER_BO = "CREATE_USER_BO";
|
||||||
|
|
||||||
|
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
|
||||||
|
|
||||||
|
public static final String UPDATE_USER_BO = "UPDATE_USER_BO";
|
||||||
|
|
||||||
|
public static final String UPDATED_DATE_TIME = "UPDATED_DATE_TIME";
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Serializable pkVal() {
|
||||||
|
return this.handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "SurplusItemReturn{" +
|
||||||
|
"handle = " + handle +
|
||||||
|
", site = " + site +
|
||||||
|
", inventory = " + inventory +
|
||||||
|
", parentInventory = " + parentInventory +
|
||||||
|
", itemBo = " + itemBo +
|
||||||
|
", lenght = " + lenght +
|
||||||
|
", width = " + width +
|
||||||
|
", qty = " + qty +
|
||||||
|
", createUserBo = " + createUserBo +
|
||||||
|
", createdDateTime = " + createdDateTime +
|
||||||
|
", updateUserBo = " + updateUserBo +
|
||||||
|
", updatedDateTime = " + updatedDateTime +
|
||||||
|
"}";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.foreverwin.mesnac.dispatch.service;
|
||||||
|
;
|
||||||
|
import com.foreverwin.mesnac.dispatch.model.IssueItem;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 车间发料 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Leon.L
|
||||||
|
* @since 2021-07-09
|
||||||
|
*/
|
||||||
|
public interface IssueItemService extends IService<IssueItem> {
|
||||||
|
|
||||||
|
Map<String, Object> scanIssueInventory(String site, String item, String inventory);
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package com.foreverwin.mesnac.dispatch.service;
|
||||||
|
|
||||||
|
import com.foreverwin.mesnac.dispatch.model.SurplusItemReturn;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 余料退回 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Leon.L
|
||||||
|
* @since 2021-07-10
|
||||||
|
*/
|
||||||
|
public interface SurplusItemReturnService extends IService<SurplusItemReturn> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询库存信息
|
||||||
|
* --物料编号&描述
|
||||||
|
* --物料自定义字段
|
||||||
|
* --库存数量
|
||||||
|
*
|
||||||
|
* @param site
|
||||||
|
* @param inventory
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> getInventoryData(String site, String inventory);
|
||||||
|
}
|
@ -0,0 +1,81 @@
|
|||||||
|
package com.foreverwin.mesnac.dispatch.service.impl;
|
||||||
|
|
||||||
|
import com.foreverwin.mesnac.common.enums.HandleEnum;
|
||||||
|
import com.foreverwin.mesnac.dispatch.model.IssueItem;
|
||||||
|
import com.foreverwin.mesnac.dispatch.mapper.IssueItemMapper;
|
||||||
|
import com.foreverwin.mesnac.dispatch.model.ItemBatch;
|
||||||
|
import com.foreverwin.mesnac.dispatch.service.IssueItemService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.foreverwin.mesnac.dispatch.service.ItemBatchService;
|
||||||
|
import com.foreverwin.mesnac.meapi.model.Inventory;
|
||||||
|
import com.foreverwin.mesnac.meapi.model.Item;
|
||||||
|
import com.foreverwin.mesnac.meapi.service.InventoryService;
|
||||||
|
import com.foreverwin.mesnac.meapi.service.ItemService;
|
||||||
|
import com.foreverwin.modular.core.exception.BusinessException;
|
||||||
|
import com.sap.me.common.MaterialType;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 车间发料 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Leon.L
|
||||||
|
* @since 2021-07-09
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class IssueItemServiceImpl extends ServiceImpl<IssueItemMapper, IssueItem> implements IssueItemService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ItemService itemService;
|
||||||
|
@Autowired
|
||||||
|
private IssueItemMapper issueItemMapper;
|
||||||
|
@Autowired
|
||||||
|
private ItemBatchService itemBatchService;
|
||||||
|
@Autowired
|
||||||
|
private InventoryService inventoryService;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> scanIssueInventory(String site, String item, String inventory) {
|
||||||
|
Item itemModel = itemService.selectCurrent(site, item);
|
||||||
|
if (itemModel == null) {
|
||||||
|
throw BusinessException.build("物料【" +item+"】当前版本不存在!");
|
||||||
|
}
|
||||||
|
String itemBo = itemModel.getHandle();
|
||||||
|
String materialType = itemModel.getMaterialType();
|
||||||
|
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
if (MaterialType.RAW.value().equals(materialType)){
|
||||||
|
//原材料
|
||||||
|
List<ItemBatch> itemBatchList = itemBatchService.findItemBatch(site, item, inventory);
|
||||||
|
if (itemBatchList == null || itemBatchList.size() <= 0) {
|
||||||
|
throw BusinessException.build("扫描的物料条码【 "+ inventory +" 】不存在!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//半成品
|
||||||
|
String inventoryBo = HandleEnum.INVENTORY.getHandle(site, inventory);
|
||||||
|
Inventory inventoryModel = inventoryService.getById(inventoryBo);
|
||||||
|
if (inventoryModel == null) {
|
||||||
|
throw BusinessException.build("扫描的物料条码【 "+ inventory +" 】不存在!");
|
||||||
|
}
|
||||||
|
String invItemBo = inventoryModel.getItemBo();
|
||||||
|
if (invItemBo.equals(itemBo)) {
|
||||||
|
throw BusinessException.build("扫描的物料条码【 "+ inventory +" 】不是物料【"+ item +"】的库存!");
|
||||||
|
}
|
||||||
|
map.put("qty", inventoryModel.getQtyOnHand());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package com.foreverwin.mesnac.dispatch.service.impl;
|
||||||
|
|
||||||
|
import com.foreverwin.mesnac.common.enums.HandleEnum;
|
||||||
|
import com.foreverwin.mesnac.common.util.NumberUtil;
|
||||||
|
import com.foreverwin.mesnac.common.util.StringUtil;
|
||||||
|
import com.foreverwin.mesnac.meapi.model.Inventory;
|
||||||
|
import com.foreverwin.mesnac.meapi.service.InventoryService;
|
||||||
|
import com.foreverwin.modular.core.exception.BusinessException;
|
||||||
|
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.dispatch.model.SurplusItemReturn;
|
||||||
|
import com.foreverwin.mesnac.dispatch.mapper.SurplusItemReturnMapper;
|
||||||
|
import com.foreverwin.mesnac.dispatch.service.SurplusItemReturnService;
|
||||||
|
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;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 余料退回 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Leon.L
|
||||||
|
* @since 2021-07-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class SurplusItemReturnServiceImpl extends ServiceImpl<SurplusItemReturnMapper, SurplusItemReturn> implements SurplusItemReturnService {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InventoryService inventoryService;
|
||||||
|
@Autowired
|
||||||
|
private SurplusItemReturnMapper surplusItemReturnMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getInventoryData(String site, String inventory) {
|
||||||
|
String inventoryBo = HandleEnum.INVENTORY.getHandle(site, inventory);
|
||||||
|
Inventory inventoryModel = inventoryService.getById(inventoryBo);
|
||||||
|
if (inventoryModel == null) {
|
||||||
|
throw BusinessException.build("物料条码【" + inventory +"】不存在!");
|
||||||
|
}
|
||||||
|
if (inventoryModel.getQtyOnHand() <= 0) {
|
||||||
|
throw BusinessException.build("物料条码【" + inventory +"】没有可用数量!");
|
||||||
|
}
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
Map<String, Object> map = surplusItemReturnMapper.selectInventoryData(inventoryBo);
|
||||||
|
if (map == null || map.size() <= 0) {
|
||||||
|
throw BusinessException.build("物料条码【" + inventory +"】不存在!");
|
||||||
|
}
|
||||||
|
String item = (String) map.get("ITEM");
|
||||||
|
String perMater = (String) map.get("PER_METER");
|
||||||
|
String perSquareMeter = (String) map.get("PER_SQUARE_METER");
|
||||||
|
if (StringUtil.isBlank(perMater) && StringUtil.isBlank(perSquareMeter)) {
|
||||||
|
throw BusinessException.build("物料【" +item+ "】的自定义字段【每米重量】和【每平米重量】都没维护!");
|
||||||
|
}
|
||||||
|
if (StringUtil.notBlank(perMater) && !NumberUtil.isNumber(perMater)) {
|
||||||
|
throw BusinessException.build("物料【" +item+ "】的自定义字段【每米重量】只能维护数值!");
|
||||||
|
}
|
||||||
|
if (StringUtil.notBlank(perSquareMeter) && !NumberUtil.isNumber(perSquareMeter)) {
|
||||||
|
throw BusinessException.build("物料【" +item+ "】的自定义字段【每平米重量】只能维护数值!");
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,388 @@
|
|||||||
|
<?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.dispatch.mapper.IssueItemMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.dispatch.model.IssueItem">
|
||||||
|
<result column="HANDLE" property="handle" />
|
||||||
|
<result column="SITE" property="site" />
|
||||||
|
<result column="CALL_ITEM_NO" property="callItemNo" />
|
||||||
|
<result column="SHOP_ORDER" property="shopOrder" />
|
||||||
|
<result column="SFC" property="sfc" />
|
||||||
|
<result column="ITEM" property="item" />
|
||||||
|
<result column="INVENTORY" property="inventory" />
|
||||||
|
<result column="QTY" property="qty" />
|
||||||
|
<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, CALL_ITEM_NO, SHOP_ORDER, SFC, ITEM, INVENTORY, QTY, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- BaseMapper标准查询/修改/删除 -->
|
||||||
|
|
||||||
|
<select id="selectByMap" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"></include>
|
||||||
|
FROM Z_ISSUE_ITEM
|
||||||
|
<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 Z_ISSUE_ITEM
|
||||||
|
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</if>
|
||||||
|
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||||
|
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||||
|
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||||
|
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if 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_ISSUE_ITEM
|
||||||
|
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</if>
|
||||||
|
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||||
|
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||||
|
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||||
|
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if 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_ISSUE_ITEM
|
||||||
|
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</if>
|
||||||
|
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||||
|
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||||
|
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||||
|
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if 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_ISSUE_ITEM
|
||||||
|
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</if>
|
||||||
|
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||||
|
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||||
|
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||||
|
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if 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_ISSUE_ITEM
|
||||||
|
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</if>
|
||||||
|
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||||
|
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||||
|
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||||
|
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if 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_ISSUE_ITEM
|
||||||
|
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</if>
|
||||||
|
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||||
|
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||||
|
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||||
|
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if 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_ISSUE_ITEM
|
||||||
|
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</if>
|
||||||
|
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||||
|
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||||
|
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||||
|
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if 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.dispatch.model.IssueItem">
|
||||||
|
INSERT INTO Z_ISSUE_ITEM
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
HANDLE,
|
||||||
|
<if test="site!=null">SITE,</if>
|
||||||
|
<if test="callItemNo!=null">CALL_ITEM_NO,</if>
|
||||||
|
<if test="shopOrder!=null">SHOP_ORDER,</if>
|
||||||
|
<if test="sfc!=null">SFC,</if>
|
||||||
|
<if test="item!=null">ITEM,</if>
|
||||||
|
<if test="inventory!=null">INVENTORY,</if>
|
||||||
|
<if test="qty!=null">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="callItemNo!=null">#{callItemNo},</if>
|
||||||
|
<if test="shopOrder!=null">#{shopOrder},</if>
|
||||||
|
<if test="sfc!=null">#{sfc},</if>
|
||||||
|
<if test="item!=null">#{item},</if>
|
||||||
|
<if test="inventory!=null">#{inventory},</if>
|
||||||
|
<if test="qty!=null">#{qty},</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.dispatch.model.IssueItem">
|
||||||
|
INSERT INTO Z_ISSUE_ITEM
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<include refid="Base_Column_List"></include>
|
||||||
|
</trim> VALUES
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
#{handle},
|
||||||
|
#{site},
|
||||||
|
#{callItemNo},
|
||||||
|
#{shopOrder},
|
||||||
|
#{sfc},
|
||||||
|
#{item},
|
||||||
|
#{inventory},
|
||||||
|
#{qty},
|
||||||
|
#{createUser},
|
||||||
|
#{createdDateTime},
|
||||||
|
#{modifyUser},
|
||||||
|
#{modifiedDateTime},
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<update id="update">
|
||||||
|
UPDATE Z_ISSUE_ITEM <trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
|
||||||
|
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||||
|
<if test="et.callItemNo!=null">CALL_ITEM_NO=#{et.callItemNo},</if>
|
||||||
|
<if test="et.shopOrder!=null">SHOP_ORDER=#{et.shopOrder},</if>
|
||||||
|
<if test="et.sfc!=null">SFC=#{et.sfc},</if>
|
||||||
|
<if test="et.item!=null">ITEM=#{et.item},</if>
|
||||||
|
<if test="et.inventory!=null">INVENTORY=#{et.inventory},</if>
|
||||||
|
<if test="et.qty!=null">QTY=#{et.qty},</if>
|
||||||
|
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
|
||||||
|
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||||
|
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</if>
|
||||||
|
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||||
|
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||||
|
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||||
|
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if 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="deleteByMap">
|
||||||
|
DELETE FROM Z_ISSUE_ITEM
|
||||||
|
<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_ISSUE_ITEM
|
||||||
|
<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.callItemNo!=null"> AND CALL_ITEM_NO=#{ew.entity.callItemNo}</if>
|
||||||
|
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
|
||||||
|
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
|
||||||
|
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
|
||||||
|
<if test="ew.entity.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if 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>
|
||||||
|
|
||||||
|
<!-- BaseMapper标准查询/修改/删除 -->
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,444 @@
|
|||||||
|
<?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.dispatch.mapper.SurplusItemReturnMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.dispatch.model.SurplusItemReturn">
|
||||||
|
<id column="HANDLE" property="handle" />
|
||||||
|
<result column="SITE" property="site" />
|
||||||
|
<result column="INVENTORY" property="inventory" />
|
||||||
|
<result column="PARENT_INVENTORY" property="parentInventory" />
|
||||||
|
<result column="ITEM_BO" property="itemBo" />
|
||||||
|
<result column="LENGHT" property="lenght" />
|
||||||
|
<result column="WIDTH" property="width" />
|
||||||
|
<result column="QTY" property="qty" />
|
||||||
|
<result column="CREATE_USER_BO" property="createUserBo" />
|
||||||
|
<result column="CREATED_DATE_TIME" property="createdDateTime" />
|
||||||
|
<result column="UPDATE_USER_BO" property="updateUserBo" />
|
||||||
|
<result column="UPDATED_DATE_TIME" property="updatedDateTime" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 通用查询结果列 -->
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
HANDLE, SITE, INVENTORY, PARENT_INVENTORY, ITEM_BO, LENGHT, WIDTH, QTY, CREATE_USER_BO, CREATED_DATE_TIME, UPDATE_USER_BO, UPDATED_DATE_TIME
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- BaseMapper标准查询/修改/删除 -->
|
||||||
|
<select id="selectById" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"></include> FROM Z_SURPLUS_ITEM_RETURN WHERE HANDLE=#{handle}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByMap" resultMap="BaseResultMap">
|
||||||
|
SELECT <include refid="Base_Column_List"></include>
|
||||||
|
FROM Z_SURPLUS_ITEM_RETURN
|
||||||
|
<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_SURPLUS_ITEM_RETURN 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_SURPLUS_ITEM_RETURN
|
||||||
|
<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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
|
||||||
|
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||||
|
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
|
||||||
|
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||||
|
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectCount" resultType="Integer">
|
||||||
|
SELECT COUNT(1) FROM Z_SURPLUS_ITEM_RETURN
|
||||||
|
<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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
|
||||||
|
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||||
|
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
|
||||||
|
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||||
|
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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_SURPLUS_ITEM_RETURN
|
||||||
|
<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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
|
||||||
|
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||||
|
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
|
||||||
|
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||||
|
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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_SURPLUS_ITEM_RETURN
|
||||||
|
<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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
|
||||||
|
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||||
|
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
|
||||||
|
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||||
|
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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_SURPLUS_ITEM_RETURN
|
||||||
|
<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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
|
||||||
|
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||||
|
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
|
||||||
|
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||||
|
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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_SURPLUS_ITEM_RETURN
|
||||||
|
<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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
|
||||||
|
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||||
|
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
|
||||||
|
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||||
|
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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_SURPLUS_ITEM_RETURN
|
||||||
|
<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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
|
||||||
|
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||||
|
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
|
||||||
|
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||||
|
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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.dispatch.model.SurplusItemReturn">
|
||||||
|
INSERT INTO Z_SURPLUS_ITEM_RETURN
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
HANDLE,
|
||||||
|
<if test="site!=null">SITE,</if>
|
||||||
|
<if test="inventory!=null">INVENTORY,</if>
|
||||||
|
<if test="parentInventory!=null">PARENT_INVENTORY,</if>
|
||||||
|
<if test="itemBo!=null">ITEM_BO,</if>
|
||||||
|
<if test="lenght!=null">LENGHT,</if>
|
||||||
|
<if test="width!=null">WIDTH,</if>
|
||||||
|
<if test="qty!=null">QTY,</if>
|
||||||
|
<if test="createUserBo!=null">CREATE_USER_BO,</if>
|
||||||
|
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
|
||||||
|
<if test="updateUserBo!=null">UPDATE_USER_BO,</if>
|
||||||
|
<if test="updatedDateTime!=null">UPDATED_DATE_TIME,</if>
|
||||||
|
</trim> VALUES
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
#{handle},
|
||||||
|
<if test="site!=null">#{site},</if>
|
||||||
|
<if test="inventory!=null">#{inventory},</if>
|
||||||
|
<if test="parentInventory!=null">#{parentInventory},</if>
|
||||||
|
<if test="itemBo!=null">#{itemBo},</if>
|
||||||
|
<if test="lenght!=null">#{lenght},</if>
|
||||||
|
<if test="width!=null">#{width},</if>
|
||||||
|
<if test="qty!=null">#{qty},</if>
|
||||||
|
<if test="createUserBo!=null">#{createUserBo},</if>
|
||||||
|
<if test="createdDateTime!=null">#{createdDateTime},</if>
|
||||||
|
<if test="updateUserBo!=null">#{updateUserBo},</if>
|
||||||
|
<if test="updatedDateTime!=null">#{updatedDateTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.dispatch.model.SurplusItemReturn">
|
||||||
|
INSERT INTO Z_SURPLUS_ITEM_RETURN
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<include refid="Base_Column_List"></include>
|
||||||
|
</trim> VALUES
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
#{handle},
|
||||||
|
#{site},
|
||||||
|
#{inventory},
|
||||||
|
#{parentInventory},
|
||||||
|
#{itemBo},
|
||||||
|
#{lenght},
|
||||||
|
#{width},
|
||||||
|
#{qty},
|
||||||
|
#{createUserBo},
|
||||||
|
#{createdDateTime},
|
||||||
|
#{updateUserBo},
|
||||||
|
#{updatedDateTime},
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<update id="updateById">
|
||||||
|
UPDATE Z_SURPLUS_ITEM_RETURN <trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||||
|
<if test="et.inventory!=null">INVENTORY=#{et.inventory},</if>
|
||||||
|
<if test="et.parentInventory!=null">PARENT_INVENTORY=#{et.parentInventory},</if>
|
||||||
|
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
|
||||||
|
<if test="et.lenght!=null">LENGHT=#{et.lenght},</if>
|
||||||
|
<if test="et.width!=null">WIDTH=#{et.width},</if>
|
||||||
|
<if test="et.qty!=null">QTY=#{et.qty},</if>
|
||||||
|
<if test="et.createUserBo!=null">CREATE_USER_BO=#{et.createUserBo},</if>
|
||||||
|
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||||
|
<if test="et.updateUserBo!=null">UPDATE_USER_BO=#{et.updateUserBo},</if>
|
||||||
|
<if test="et.updatedDateTime!=null">UPDATED_DATE_TIME=#{et.updatedDateTime},</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_SURPLUS_ITEM_RETURN <trim prefix="SET" suffixOverrides=",">
|
||||||
|
SITE=#{et.site},
|
||||||
|
INVENTORY=#{et.inventory},
|
||||||
|
PARENT_INVENTORY=#{et.parentInventory},
|
||||||
|
ITEM_BO=#{et.itemBo},
|
||||||
|
LENGHT=#{et.lenght},
|
||||||
|
WIDTH=#{et.width},
|
||||||
|
QTY=#{et.qty},
|
||||||
|
CREATE_USER_BO=#{et.createUserBo},
|
||||||
|
CREATED_DATE_TIME=#{et.createdDateTime},
|
||||||
|
UPDATE_USER_BO=#{et.updateUserBo},
|
||||||
|
UPDATED_DATE_TIME=#{et.updatedDateTime},
|
||||||
|
</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_SURPLUS_ITEM_RETURN <trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="et.site!=null">SITE=#{et.site},</if>
|
||||||
|
<if test="et.inventory!=null">INVENTORY=#{et.inventory},</if>
|
||||||
|
<if test="et.parentInventory!=null">PARENT_INVENTORY=#{et.parentInventory},</if>
|
||||||
|
<if test="et.itemBo!=null">ITEM_BO=#{et.itemBo},</if>
|
||||||
|
<if test="et.lenght!=null">LENGHT=#{et.lenght},</if>
|
||||||
|
<if test="et.width!=null">WIDTH=#{et.width},</if>
|
||||||
|
<if test="et.qty!=null">QTY=#{et.qty},</if>
|
||||||
|
<if test="et.createUserBo!=null">CREATE_USER_BO=#{et.createUserBo},</if>
|
||||||
|
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
||||||
|
<if test="et.updateUserBo!=null">UPDATE_USER_BO=#{et.updateUserBo},</if>
|
||||||
|
<if test="et.updatedDateTime!=null">UPDATED_DATE_TIME=#{et.updatedDateTime},</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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
|
||||||
|
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||||
|
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
|
||||||
|
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||||
|
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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_SURPLUS_ITEM_RETURN WHERE HANDLE=#{handle}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteByMap">
|
||||||
|
DELETE FROM Z_SURPLUS_ITEM_RETURN
|
||||||
|
<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_SURPLUS_ITEM_RETURN
|
||||||
|
<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.inventory!=null"> AND INVENTORY=#{ew.entity.inventory}</if>
|
||||||
|
<if test="ew.entity.parentInventory!=null"> AND PARENT_INVENTORY=#{ew.entity.parentInventory}</if>
|
||||||
|
<if test="ew.entity.itemBo!=null"> AND ITEM_BO=#{ew.entity.itemBo}</if>
|
||||||
|
<if test="ew.entity.lenght!=null"> AND LENGHT=#{ew.entity.lenght}</if>
|
||||||
|
<if test="ew.entity.width!=null"> AND WIDTH=#{ew.entity.width}</if>
|
||||||
|
<if test="ew.entity.qty!=null"> AND QTY=#{ew.entity.qty}</if>
|
||||||
|
<if test="ew.entity.createUserBo!=null"> AND CREATE_USER_BO=#{ew.entity.createUserBo}</if>
|
||||||
|
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
||||||
|
<if test="ew.entity.updateUserBo!=null"> AND UPDATE_USER_BO=#{ew.entity.updateUserBo}</if>
|
||||||
|
<if test="ew.entity.updatedDateTime!=null"> AND UPDATED_DATE_TIME=#{ew.entity.updatedDateTime}</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_SURPLUS_ITEM_RETURN WHERE HANDLE IN (
|
||||||
|
<foreach item="item" index="index" collection="coll" separator=",">#{item}
|
||||||
|
</foreach>)
|
||||||
|
</delete>
|
||||||
|
<!-- BaseMapper标准查询/修改/删除 -->
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectInventoryData" resultType="hashMap">
|
||||||
|
SELECT IV.HANDLE, IV.SITE, IV.INVENTORY_ID, IV.QTY_ON_HAND, IM.ITEM, IT.DESCRIPTION, CS1.VALUE PER_METER, CS2.VALUE PER_SQUARE_METER
|
||||||
|
FROM INVENTORY IV
|
||||||
|
INNER JOIN ITEM IM ON IM.HANDLE = IV.ITEM_BO
|
||||||
|
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE AND IT.LOCALE = 'zh'
|
||||||
|
LEFT JOIN CUSTOM_FIELDS CS1 ON CS1.HANDLE = IM.HANDLE AND CS1.ATTRIBUTE = 'PER_METER'
|
||||||
|
LEFT JOIN CUSTOM_FIELDS CS2 ON CS2.HANDLE = IM.HANDLE AND CS2.ATTRIBUTE = 'PER_SQUARE_METER'
|
||||||
|
WHERE IV.HANDLE = #{inventoryBo}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -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 Leon.L
|
||||||
|
* @since 2021-07-09
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface InventoryMapper extends BaseMapper<Inventory> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,443 @@
|
|||||||
|
package com.foreverwin.mesnac.meapi.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Leon.L
|
||||||
|
* @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 Double 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 Double 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 Double getQtyOnHand() {
|
||||||
|
return qtyOnHand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQtyOnHand(Double 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 Double getOriginalQty() {
|
||||||
|
return originalQty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginalQty(Double 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 Leon.L
|
||||||
|
* @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;
|
||||||
|
import java.util.logging.Handler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Leon.L
|
||||||
|
* @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>
|
Loading…
Reference in New Issue