Merge remote-tracking branch 'origin/master'

This commit is contained in:
LJW 2024-11-12 16:47:45 +08:00
commit 8766db00ff
13 changed files with 1600 additions and 0 deletions

View File

@ -0,0 +1,154 @@
package com.ktg.mes.config;
import com.ktg.mes.md.domain.*;
import com.ktg.mes.md.mapper.*;
import com.ktg.mes.wm.domain.WmStorageArea;
import com.ktg.mes.wm.domain.WmStorageLocation;
import com.ktg.mes.wm.mapper.WmStorageAreaMapper;
import com.ktg.mes.wm.mapper.WmStorageLocationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@Configuration
@EnableScheduling
public class BizConfig {
@Autowired
private WmsInventoryConfigureMapper wmsInventoryConfigureMapper;
@Autowired
private WmStorageLocationMapper wmStorageLocationMapper;
@Autowired
private WmStorageAreaMapper wmStorageAreaMapper;
@Autowired
private BaseKnifeMapper baseKnifeMapper;
@Autowired
private MdItemMapper mdItemMapper;
@Autowired
private MdUnitMeasureMapper mdUnitMeasureMapper;
@Autowired
private WmsInventoryPlanMapper wmsInventoryPlanMapper;
@Autowired
private WmsInventoryMapper wmsInventoryMapper;
@Transactional
@Scheduled(fixedDelay = 1000 * 60)
public void configureTasks() {
// 获取当前时间字符串
Date nowDate = new Date(System.currentTimeMillis());
String nowDateTimeStr = new SimpleDateFormat("HH:mm").format(nowDate);
// 判断是否到达目标时间
if ("00:00".equals(nowDateTimeStr)) {
/* 集合存储物料实体集合 */
HashMap<Long, HashMap<String, List<BaseKnife>>> superBaseKnifeListHashMap = new HashMap<>();
/* 获得全部日盘且全盘的盘点计划配置 */
WmsInventoryConfigure wmsInventoryConfigureQuery = new WmsInventoryConfigure();
wmsInventoryConfigureQuery.setDataType("RP");
wmsInventoryConfigureQuery.setInventoryType("QP");
List<WmsInventoryConfigure> wmsInventoryConfigureList = wmsInventoryConfigureMapper.selectWmsInventoryConfigureList(wmsInventoryConfigureQuery);
wmsInventoryConfigureList.forEach(wmsInventoryConfigure -> {
/* 开始时间与结束时间 */
String nowDateStr = new SimpleDateFormat("yyyy-MM-dd").format(nowDate);
Date startTime = nowDate;
Date endTime = nowDate;
try {
startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(nowDateStr + " 00:00:00");
endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(nowDateStr + " 23:59:59");
} catch (ParseException ignored) {
}
/* 构建盘点计划数据 */
WmsInventoryPlan wmsInventoryPlan = new WmsInventoryPlan();
wmsInventoryPlan.setWmsInventoryConfigureId(wmsInventoryConfigure.getWmsInventoryConfigureId());
wmsInventoryPlan.setPlanCode(String.format("%s_%s_%s", wmsInventoryConfigure.getDataType(), wmsInventoryConfigure.getInventoryType(), Long.toString(System.currentTimeMillis(), 32).toUpperCase(Locale.ROOT)));
wmsInventoryPlan.setPlanName(wmsInventoryConfigure.getConfigureName());
wmsInventoryPlan.setDataType(wmsInventoryConfigure.getDataType());
wmsInventoryPlan.setmWarehouseId(wmsInventoryConfigure.getmWarehouseId());
wmsInventoryPlan.setBeginTime(startTime);
wmsInventoryPlan.setEndTime(endTime);
wmsInventoryPlan.setStatus("STATUS_1");
wmsInventoryPlan.setDescription(String.format("%s自动生成的盘点计划。", new SimpleDateFormat("yyyy年MM月dd日").format(nowDate)));
wmsInventoryPlan.setCreateTime(nowDate);
/* 保存盘点计划数据 */
wmsInventoryPlanMapper.insertWmsInventoryPlan(wmsInventoryPlan);
/* 以新创建的盘点计划ID为主键构建集合 */
superBaseKnifeListHashMap.computeIfAbsent(wmsInventoryPlan.getWmsStockPlanId(), k -> new HashMap<>());
/* 根据仓库ID获取库区列表 */
WmStorageLocation wmStorageLocationQuery = new WmStorageLocation();
wmStorageLocationQuery.setWarehouseId(wmsInventoryConfigure.getmWarehouseId());
List<WmStorageLocation> wmStorageLocationList = wmStorageLocationMapper.selectWmStorageLocationList(wmStorageLocationQuery);
wmStorageLocationList.forEach(wmStorageLocation -> {
/* 根据库区ID获取库位列表 */
WmStorageArea wmStorageAreaQuery = new WmStorageArea();
wmStorageAreaQuery.setLocationId(wmStorageLocation.getLocationId());
List<WmStorageArea> wmStorageAreaList = wmStorageAreaMapper.selectWmStorageAreaList(wmStorageAreaQuery);
wmStorageAreaList.forEach(wmStorageArea -> {
/* 根据库位编码获取台账列表 */
BaseKnife baseKnifeQuery = new BaseKnife();
baseKnifeQuery.setAreaCode(wmStorageArea.getAreaCode());
baseKnifeQuery.setKnifeFineState(0);
List<BaseKnife> baseKnifeList = baseKnifeMapper.selectBaseKnifeList(baseKnifeQuery);
baseKnifeList.forEach(baseKnife -> {
/* 获取无聊信息 */
MdItem mdItem = mdItemMapper.selectMdItemById(baseKnife.getMbbBdMrlId());
/* 获得单位信息 */
MdUnitMeasure mdUnitMeasure = mdUnitMeasureMapper.selectMdUnitByCode(mdItem.getUnitOfMeasure());
/* 根据无聊信息构建无聊信息数 */
String key = wmsInventoryConfigure.getmWarehouseId().toString() + "-" +
wmStorageArea.getAreaId().toString() + "-" +
baseKnife.getMbbBdMrlId().toString() + "-" +
mdUnitMeasure.getMeasureId().toString();
/* 校验是否存在该列表 */
superBaseKnifeListHashMap.get(wmsInventoryPlan.getWmsStockPlanId()).computeIfAbsent(key, k -> new ArrayList<>());
/* 填入数据 */
superBaseKnifeListHashMap.get(wmsInventoryPlan.getWmsStockPlanId()).get(key).add(baseKnife);
});
});
});
});
/* 遍历集合 */
superBaseKnifeListHashMap.keySet().forEach(key1 -> {
superBaseKnifeListHashMap.get(key1).keySet().forEach(key2 -> {
/* 切割字符串 */
String[] idStrArray = key2.split("-");
/* 构建数据 */
WmsInventory wmsInventory = new WmsInventory();
wmsInventory.setWmsStockPlanId(key1);
wmsInventory.setmWarehouseId(Long.valueOf(idStrArray[0]));
wmsInventory.setAreaId(Long.valueOf(idStrArray[1]));
wmsInventory.setMdItemId(Long.valueOf(idStrArray[2]));
wmsInventory.setUnitId(Long.valueOf(idStrArray[3]));
wmsInventory.setSystemCount(superBaseKnifeListHashMap.get(key1).get(key2).size());
wmsInventory.setCreateTime(nowDate);
/* 保存数据 */
wmsInventoryMapper.insertWmsInventory(wmsInventory);
});
});
}
}
}

View File

@ -0,0 +1,91 @@
package com.ktg.mes.md.controller;
import com.ktg.common.annotation.Log;
import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.core.page.TableDataInfo;
import com.ktg.common.enums.BusinessType;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.mes.md.domain.WmsInventory;
import com.ktg.mes.md.service.IWmsInventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 盘点Controller
*
* @author yinjinlu
* @date 2024-11-12
*/
@RestController
@RequestMapping("/md/WMS_INVENTORY")
public class WmsInventoryController extends BaseController {
@Autowired
private IWmsInventoryService wmsInventoryService;
/**
* 查询盘点列表
*/
@PreAuthorize("@ss.hasPermi('md:WMS_INVENTORY:list')")
@GetMapping("/list")
public TableDataInfo list(WmsInventory wmsInventory) {
startPage();
List<WmsInventory> list = wmsInventoryService.selectWmsInventoryList(wmsInventory);
return getDataTable(list);
}
/**
* 导出盘点列表
*/
@PreAuthorize("@ss.hasPermi('md:WMS_INVENTORY:export')")
@Log(title = "盘点", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WmsInventory wmsInventory) {
List<WmsInventory> list = wmsInventoryService.selectWmsInventoryList(wmsInventory);
ExcelUtil<WmsInventory> util = new ExcelUtil<WmsInventory>(WmsInventory.class);
util.exportExcel(response, list, "盘点数据");
}
/**
* 获取盘点详细信息
*/
@PreAuthorize("@ss.hasPermi('md:WMS_INVENTORY:query')")
@GetMapping(value = "/{wmsInventoryId}")
public AjaxResult getInfo(@PathVariable("wmsInventoryId") Long wmsInventoryId) {
return AjaxResult.success(wmsInventoryService.selectWmsInventoryByWmsInventoryId(wmsInventoryId));
}
/**
* 新增盘点
*/
@PreAuthorize("@ss.hasPermi('md:WMS_INVENTORY:add')")
@Log(title = "盘点", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WmsInventory wmsInventory) {
return toAjax(wmsInventoryService.insertWmsInventory(wmsInventory));
}
/**
* 修改盘点
*/
@PreAuthorize("@ss.hasPermi('md:WMS_INVENTORY:edit')")
@Log(title = "盘点", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WmsInventory wmsInventory) {
return toAjax(wmsInventoryService.updateWmsInventory(wmsInventory));
}
/**
* 删除盘点
*/
@PreAuthorize("@ss.hasPermi('md:WMS_INVENTORY:remove')")
@Log(title = "盘点", businessType = BusinessType.DELETE)
@DeleteMapping("/{wmsInventoryIds}")
public AjaxResult remove(@PathVariable Long[] wmsInventoryIds) {
return toAjax(wmsInventoryService.deleteWmsInventoryByWmsInventoryIds(wmsInventoryIds));
}
}

View File

@ -0,0 +1,91 @@
package com.ktg.mes.md.controller;
import com.ktg.common.annotation.Log;
import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.core.page.TableDataInfo;
import com.ktg.common.enums.BusinessType;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.mes.md.domain.WmsInventoryPlan;
import com.ktg.mes.md.service.IWmsInventoryPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 盘点计划Controller
*
* @author yinjinlu
* @date 2024-11-12
*/
@RestController
@RequestMapping("/md/WMS_INVENTORY_PLAN")
public class WmsInventoryPlanController extends BaseController {
@Autowired
private IWmsInventoryPlanService wmsInventoryPlanService;
/**
* 查询盘点计划列表
*/
@PreAuthorize("@ss.hasPermi('md:WMS_INVENTORY_PLAN:list')")
@GetMapping("/list")
public TableDataInfo list(WmsInventoryPlan wmsInventoryPlan) {
startPage();
List<WmsInventoryPlan> list = wmsInventoryPlanService.selectWmsInventoryPlanList(wmsInventoryPlan);
return getDataTable(list);
}
/**
* 导出盘点计划列表
*/
@PreAuthorize("@ss.hasPermi('md:WMS_INVENTORY_PLAN:export')")
@Log(title = "盘点计划", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WmsInventoryPlan wmsInventoryPlan) {
List<WmsInventoryPlan> list = wmsInventoryPlanService.selectWmsInventoryPlanList(wmsInventoryPlan);
ExcelUtil<WmsInventoryPlan> util = new ExcelUtil<WmsInventoryPlan>(WmsInventoryPlan.class);
util.exportExcel(response, list, "盘点计划数据");
}
/**
* 获取盘点计划详细信息
*/
@PreAuthorize("@ss.hasPermi('md:WMS_INVENTORY_PLAN:query')")
@GetMapping(value = "/{wmsStockPlanId}")
public AjaxResult getInfo(@PathVariable("wmsStockPlanId") Long wmsStockPlanId) {
return AjaxResult.success(wmsInventoryPlanService.selectWmsInventoryPlanByWmsStockPlanId(wmsStockPlanId));
}
/**
* 新增盘点计划
*/
@PreAuthorize("@ss.hasPermi('md:WMS_INVENTORY_PLAN:add')")
@Log(title = "盘点计划", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WmsInventoryPlan wmsInventoryPlan) {
return toAjax(wmsInventoryPlanService.insertWmsInventoryPlan(wmsInventoryPlan));
}
/**
* 修改盘点计划
*/
@PreAuthorize("@ss.hasPermi('md:WMS_INVENTORY_PLAN:edit')")
@Log(title = "盘点计划", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WmsInventoryPlan wmsInventoryPlan) {
return toAjax(wmsInventoryPlanService.updateWmsInventoryPlan(wmsInventoryPlan));
}
/**
* 删除盘点计划
*/
@PreAuthorize("@ss.hasPermi('md:WMS_INVENTORY_PLAN:remove')")
@Log(title = "盘点计划", businessType = BusinessType.DELETE)
@DeleteMapping("/{wmsStockPlanIds}")
public AjaxResult remove(@PathVariable Long[] wmsStockPlanIds) {
return toAjax(wmsInventoryPlanService.deleteWmsInventoryPlanByWmsStockPlanIds(wmsStockPlanIds));
}
}

View File

@ -0,0 +1,266 @@
package com.ktg.mes.md.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 盘点对象 WMS_INVENTORY
*
* @author yinjinlu
* @date 2024-11-12
*/
public class WmsInventory extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long wmsInventoryId;
/**
* 盘点计划
*/
@Excel(name = "盘点计划")
private Long wmsStockPlanId;
/**
* 仓库
*/
@Excel(name = "仓库")
private Long mWarehouseId;
/**
* 库位
*/
@Excel(name = "库位")
private Long areaId;
/**
* 物料
*/
@Excel(name = "物料")
private Long mdItemId;
/**
* 单位
*/
@Excel(name = "单位")
private Long unitId;
/**
* 系统库存数
*/
@Excel(name = "系统库存数")
private Integer systemCount;
/**
* 盘点数量
*/
@Excel(name = "盘点数量")
private Integer inventoryCount;
/**
* 盘点时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "盘点时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date inventoryTime;
/**
* 复盘数量
*/
@Excel(name = "复盘数量")
private Integer agCount;
/**
* 复盘时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "复盘时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date agTime;
/**
* 差异数量
*/
@Excel(name = "差异数量")
private Integer diffCount;
/**
* 预留字段1
*/
private String attr1;
/**
* 预留字段2
*/
private String attr2;
/**
* 预留字段3
*/
private String attr3;
/**
* 预留字段4
*/
private String attr4;
public Long getWmsInventoryId() {
return wmsInventoryId;
}
public void setWmsInventoryId(Long wmsInventoryId) {
this.wmsInventoryId = wmsInventoryId;
}
public Long getWmsStockPlanId() {
return wmsStockPlanId;
}
public void setWmsStockPlanId(Long wmsStockPlanId) {
this.wmsStockPlanId = wmsStockPlanId;
}
public Long getmWarehouseId() {
return mWarehouseId;
}
public void setmWarehouseId(Long mWarehouseId) {
this.mWarehouseId = mWarehouseId;
}
public Long getAreaId() {
return areaId;
}
public void setAreaId(Long areaId) {
this.areaId = areaId;
}
public Long getMdItemId() {
return mdItemId;
}
public void setMdItemId(Long mdItemId) {
this.mdItemId = mdItemId;
}
public Long getUnitId() {
return unitId;
}
public void setUnitId(Long unitId) {
this.unitId = unitId;
}
public Integer getSystemCount() {
return systemCount;
}
public void setSystemCount(Integer systemCount) {
this.systemCount = systemCount;
}
public Integer getInventoryCount() {
return inventoryCount;
}
public void setInventoryCount(Integer inventoryCount) {
this.inventoryCount = inventoryCount;
}
public Date getInventoryTime() {
return inventoryTime;
}
public void setInventoryTime(Date inventoryTime) {
this.inventoryTime = inventoryTime;
}
public Integer getAgCount() {
return agCount;
}
public void setAgCount(Integer agCount) {
this.agCount = agCount;
}
public Date getAgTime() {
return agTime;
}
public void setAgTime(Date agTime) {
this.agTime = agTime;
}
public Integer getDiffCount() {
return diffCount;
}
public void setDiffCount(Integer diffCount) {
this.diffCount = diffCount;
}
public String getAttr1() {
return attr1;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr2() {
return attr2;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr3() {
return attr3;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr4() {
return attr4;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("wmsInventoryId", getWmsInventoryId())
.append("wmsStockPlanId", getWmsStockPlanId())
.append("mWarehouseId", getmWarehouseId())
.append("areaId", getAreaId())
.append("mdItemId", getMdItemId())
.append("unitId", getUnitId())
.append("systemCount", getSystemCount())
.append("inventoryCount", getInventoryCount())
.append("inventoryTime", getInventoryTime())
.append("agCount", getAgCount())
.append("agTime", getAgTime())
.append("diffCount", getDiffCount())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,251 @@
package com.ktg.mes.md.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 盘点计划对象 WMS_INVENTORY_PLAN
*
* @author yinjinlu
* @date 2024-11-12
*/
public class WmsInventoryPlan extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long wmsStockPlanId;
/**
* 盘点计划配置
*/
@Excel(name = "盘点计划配置")
private Long wmsInventoryConfigureId;
/**
* 盘点单编码
*/
@Excel(name = "盘点单编码")
private String planCode;
/**
* 盘点计划名称
*/
@Excel(name = "盘点计划名称")
private String planName;
/**
* 盘点类型
*/
@Excel(name = "盘点类型")
private String dataType;
/**
* 盘点仓库ID
*/
@Excel(name = "盘点仓库ID")
private Long mWarehouseId;
/**
* 开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date beginTime;
/**
* 结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/**
* 是否复盘
*/
@Excel(name = "是否复盘")
private String isag;
/**
* 单据状态
*/
@Excel(name = "单据状态")
private String status;
/**
* 描述
*/
@Excel(name = "描述")
private String description;
/**
* 预留字段1
*/
private String attr1;
/**
* 预留字段2
*/
private String attr2;
/**
* 预留字段3
*/
private String attr3;
/**
* 预留字段4
*/
private String attr4;
public Long getWmsStockPlanId() {
return wmsStockPlanId;
}
public void setWmsStockPlanId(Long wmsStockPlanId) {
this.wmsStockPlanId = wmsStockPlanId;
}
public Long getWmsInventoryConfigureId() {
return wmsInventoryConfigureId;
}
public void setWmsInventoryConfigureId(Long wmsInventoryConfigureId) {
this.wmsInventoryConfigureId = wmsInventoryConfigureId;
}
public String getPlanCode() {
return planCode;
}
public void setPlanCode(String planCode) {
this.planCode = planCode;
}
public String getPlanName() {
return planName;
}
public void setPlanName(String planName) {
this.planName = planName;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public Long getmWarehouseId() {
return mWarehouseId;
}
public void setmWarehouseId(Long mWarehouseId) {
this.mWarehouseId = mWarehouseId;
}
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getIsag() {
return isag;
}
public void setIsag(String isag) {
this.isag = isag;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getAttr1() {
return attr1;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr2() {
return attr2;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr3() {
return attr3;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr4() {
return attr4;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("wmsStockPlanId", getWmsStockPlanId())
.append("wmsInventoryConfigureId", getWmsInventoryConfigureId())
.append("planCode", getPlanCode())
.append("planName", getPlanName())
.append("dataType", getDataType())
.append("mWarehouseId", getmWarehouseId())
.append("beginTime", getBeginTime())
.append("endTime", getEndTime())
.append("isag", getIsag())
.append("status", getStatus())
.append("description", getDescription())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.md.mapper;
import com.ktg.mes.md.domain.WmsInventory;
import java.util.List;
/**
* 盘点Mapper接口
*
* @author yinjinlu
* @date 2024-11-12
*/
public interface WmsInventoryMapper {
/**
* 查询盘点
*
* @param wmsInventoryId 盘点主键
* @return 盘点
*/
public WmsInventory selectWmsInventoryByWmsInventoryId(Long wmsInventoryId);
/**
* 查询盘点列表
*
* @param wmsInventory 盘点
* @return 盘点集合
*/
public List<WmsInventory> selectWmsInventoryList(WmsInventory wmsInventory);
/**
* 新增盘点
*
* @param wmsInventory 盘点
* @return 结果
*/
public int insertWmsInventory(WmsInventory wmsInventory);
/**
* 修改盘点
*
* @param wmsInventory 盘点
* @return 结果
*/
public int updateWmsInventory(WmsInventory wmsInventory);
/**
* 删除盘点
*
* @param wmsInventoryId 盘点主键
* @return 结果
*/
public int deleteWmsInventoryByWmsInventoryId(Long wmsInventoryId);
/**
* 批量删除盘点
*
* @param wmsInventoryIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteWmsInventoryByWmsInventoryIds(Long[] wmsInventoryIds);
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.md.mapper;
import com.ktg.mes.md.domain.WmsInventoryPlan;
import java.util.List;
/**
* 盘点计划Mapper接口
*
* @author yinjinlu
* @date 2024-11-12
*/
public interface WmsInventoryPlanMapper {
/**
* 查询盘点计划
*
* @param wmsStockPlanId 盘点计划主键
* @return 盘点计划
*/
public WmsInventoryPlan selectWmsInventoryPlanByWmsStockPlanId(Long wmsStockPlanId);
/**
* 查询盘点计划列表
*
* @param wmsInventoryPlan 盘点计划
* @return 盘点计划集合
*/
public List<WmsInventoryPlan> selectWmsInventoryPlanList(WmsInventoryPlan wmsInventoryPlan);
/**
* 新增盘点计划
*
* @param wmsInventoryPlan 盘点计划
* @return 结果
*/
public int insertWmsInventoryPlan(WmsInventoryPlan wmsInventoryPlan);
/**
* 修改盘点计划
*
* @param wmsInventoryPlan 盘点计划
* @return 结果
*/
public int updateWmsInventoryPlan(WmsInventoryPlan wmsInventoryPlan);
/**
* 删除盘点计划
*
* @param wmsStockPlanId 盘点计划主键
* @return 结果
*/
public int deleteWmsInventoryPlanByWmsStockPlanId(Long wmsStockPlanId);
/**
* 批量删除盘点计划
*
* @param wmsStockPlanIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteWmsInventoryPlanByWmsStockPlanIds(Long[] wmsStockPlanIds);
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.md.service;
import com.ktg.mes.md.domain.WmsInventoryPlan;
import java.util.List;
/**
* 盘点计划Service接口
*
* @author yinjinlu
* @date 2024-11-12
*/
public interface IWmsInventoryPlanService {
/**
* 查询盘点计划
*
* @param wmsStockPlanId 盘点计划主键
* @return 盘点计划
*/
public WmsInventoryPlan selectWmsInventoryPlanByWmsStockPlanId(Long wmsStockPlanId);
/**
* 查询盘点计划列表
*
* @param wmsInventoryPlan 盘点计划
* @return 盘点计划集合
*/
public List<WmsInventoryPlan> selectWmsInventoryPlanList(WmsInventoryPlan wmsInventoryPlan);
/**
* 新增盘点计划
*
* @param wmsInventoryPlan 盘点计划
* @return 结果
*/
public int insertWmsInventoryPlan(WmsInventoryPlan wmsInventoryPlan);
/**
* 修改盘点计划
*
* @param wmsInventoryPlan 盘点计划
* @return 结果
*/
public int updateWmsInventoryPlan(WmsInventoryPlan wmsInventoryPlan);
/**
* 批量删除盘点计划
*
* @param wmsStockPlanIds 需要删除的盘点计划主键集合
* @return 结果
*/
public int deleteWmsInventoryPlanByWmsStockPlanIds(Long[] wmsStockPlanIds);
/**
* 删除盘点计划信息
*
* @param wmsStockPlanId 盘点计划主键
* @return 结果
*/
public int deleteWmsInventoryPlanByWmsStockPlanId(Long wmsStockPlanId);
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.md.service;
import com.ktg.mes.md.domain.WmsInventory;
import java.util.List;
/**
* 盘点Service接口
*
* @author yinjinlu
* @date 2024-11-12
*/
public interface IWmsInventoryService {
/**
* 查询盘点
*
* @param wmsInventoryId 盘点主键
* @return 盘点
*/
public WmsInventory selectWmsInventoryByWmsInventoryId(Long wmsInventoryId);
/**
* 查询盘点列表
*
* @param wmsInventory 盘点
* @return 盘点集合
*/
public List<WmsInventory> selectWmsInventoryList(WmsInventory wmsInventory);
/**
* 新增盘点
*
* @param wmsInventory 盘点
* @return 结果
*/
public int insertWmsInventory(WmsInventory wmsInventory);
/**
* 修改盘点
*
* @param wmsInventory 盘点
* @return 结果
*/
public int updateWmsInventory(WmsInventory wmsInventory);
/**
* 批量删除盘点
*
* @param wmsInventoryIds 需要删除的盘点主键集合
* @return 结果
*/
public int deleteWmsInventoryByWmsInventoryIds(Long[] wmsInventoryIds);
/**
* 删除盘点信息
*
* @param wmsInventoryId 盘点主键
* @return 结果
*/
public int deleteWmsInventoryByWmsInventoryId(Long wmsInventoryId);
}

View File

@ -0,0 +1,90 @@
package com.ktg.mes.md.service.impl;
import com.ktg.common.utils.DateUtils;
import com.ktg.mes.md.domain.WmsInventoryPlan;
import com.ktg.mes.md.mapper.WmsInventoryPlanMapper;
import com.ktg.mes.md.service.IWmsInventoryPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 盘点计划Service业务层处理
*
* @author yinjinlu
* @date 2024-11-12
*/
@Service
public class WmsInventoryPlanServiceImpl implements IWmsInventoryPlanService {
@Autowired
private WmsInventoryPlanMapper wmsInventoryPlanMapper;
/**
* 查询盘点计划
*
* @param wmsStockPlanId 盘点计划主键
* @return 盘点计划
*/
@Override
public WmsInventoryPlan selectWmsInventoryPlanByWmsStockPlanId(Long wmsStockPlanId) {
return wmsInventoryPlanMapper.selectWmsInventoryPlanByWmsStockPlanId(wmsStockPlanId);
}
/**
* 查询盘点计划列表
*
* @param wmsInventoryPlan 盘点计划
* @return 盘点计划
*/
@Override
public List<WmsInventoryPlan> selectWmsInventoryPlanList(WmsInventoryPlan wmsInventoryPlan) {
return wmsInventoryPlanMapper.selectWmsInventoryPlanList(wmsInventoryPlan);
}
/**
* 新增盘点计划
*
* @param wmsInventoryPlan 盘点计划
* @return 结果
*/
@Override
public int insertWmsInventoryPlan(WmsInventoryPlan wmsInventoryPlan) {
wmsInventoryPlan.setCreateTime(DateUtils.getNowDate());
return wmsInventoryPlanMapper.insertWmsInventoryPlan(wmsInventoryPlan);
}
/**
* 修改盘点计划
*
* @param wmsInventoryPlan 盘点计划
* @return 结果
*/
@Override
public int updateWmsInventoryPlan(WmsInventoryPlan wmsInventoryPlan) {
wmsInventoryPlan.setUpdateTime(DateUtils.getNowDate());
return wmsInventoryPlanMapper.updateWmsInventoryPlan(wmsInventoryPlan);
}
/**
* 批量删除盘点计划
*
* @param wmsStockPlanIds 需要删除的盘点计划主键
* @return 结果
*/
@Override
public int deleteWmsInventoryPlanByWmsStockPlanIds(Long[] wmsStockPlanIds) {
return wmsInventoryPlanMapper.deleteWmsInventoryPlanByWmsStockPlanIds(wmsStockPlanIds);
}
/**
* 删除盘点计划信息
*
* @param wmsStockPlanId 盘点计划主键
* @return 结果
*/
@Override
public int deleteWmsInventoryPlanByWmsStockPlanId(Long wmsStockPlanId) {
return wmsInventoryPlanMapper.deleteWmsInventoryPlanByWmsStockPlanId(wmsStockPlanId);
}
}

View File

@ -0,0 +1,90 @@
package com.ktg.mes.md.service.impl;
import com.ktg.common.utils.DateUtils;
import com.ktg.mes.md.domain.WmsInventory;
import com.ktg.mes.md.mapper.WmsInventoryMapper;
import com.ktg.mes.md.service.IWmsInventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 盘点Service业务层处理
*
* @author yinjinlu
* @date 2024-11-12
*/
@Service
public class WmsInventoryServiceImpl implements IWmsInventoryService {
@Autowired
private WmsInventoryMapper wmsInventoryMapper;
/**
* 查询盘点
*
* @param wmsInventoryId 盘点主键
* @return 盘点
*/
@Override
public WmsInventory selectWmsInventoryByWmsInventoryId(Long wmsInventoryId) {
return wmsInventoryMapper.selectWmsInventoryByWmsInventoryId(wmsInventoryId);
}
/**
* 查询盘点列表
*
* @param wmsInventory 盘点
* @return 盘点
*/
@Override
public List<WmsInventory> selectWmsInventoryList(WmsInventory wmsInventory) {
return wmsInventoryMapper.selectWmsInventoryList(wmsInventory);
}
/**
* 新增盘点
*
* @param wmsInventory 盘点
* @return 结果
*/
@Override
public int insertWmsInventory(WmsInventory wmsInventory) {
wmsInventory.setCreateTime(DateUtils.getNowDate());
return wmsInventoryMapper.insertWmsInventory(wmsInventory);
}
/**
* 修改盘点
*
* @param wmsInventory 盘点
* @return 结果
*/
@Override
public int updateWmsInventory(WmsInventory wmsInventory) {
wmsInventory.setUpdateTime(DateUtils.getNowDate());
return wmsInventoryMapper.updateWmsInventory(wmsInventory);
}
/**
* 批量删除盘点
*
* @param wmsInventoryIds 需要删除的盘点主键
* @return 结果
*/
@Override
public int deleteWmsInventoryByWmsInventoryIds(Long[] wmsInventoryIds) {
return wmsInventoryMapper.deleteWmsInventoryByWmsInventoryIds(wmsInventoryIds);
}
/**
* 删除盘点信息
*
* @param wmsInventoryId 盘点主键
* @return 结果
*/
@Override
public int deleteWmsInventoryByWmsInventoryId(Long wmsInventoryId) {
return wmsInventoryMapper.deleteWmsInventoryByWmsInventoryId(wmsInventoryId);
}
}

View File

@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ktg.mes.md.mapper.WmsInventoryMapper">
<resultMap type="WmsInventory" id="WmsInventoryResult">
<result property="wmsInventoryId" column="WMS_INVENTORY_ID"/>
<result property="wmsStockPlanId" column="WMS_STOCK_PLAN_ID"/>
<result property="mWarehouseId" column="M_WAREHOUSE_ID"/>
<result property="areaId" column="AREA_ID"/>
<result property="mdItemId" column="MD_ITEM_ID"/>
<result property="unitId" column="UNIT_ID"/>
<result property="systemCount" column="SYSTEM_COUNT"/>
<result property="inventoryCount" column="INVENTORY_COUNT"/>
<result property="inventoryTime" column="INVENTORY_TIME"/>
<result property="agCount" column="AG_COUNT"/>
<result property="agTime" column="AG_TIME"/>
<result property="diffCount" column="DIFF_COUNT"/>
<result property="attr1" column="ATTR1"/>
<result property="attr2" column="ATTR2"/>
<result property="attr3" column="ATTR3"/>
<result property="attr4" column="ATTR4"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
<sql id="selectWmsInventoryVo">
select WMS_INVENTORY_ID,
WMS_STOCK_PLAN_ID,
M_WAREHOUSE_ID,
AREA_ID,
MD_ITEM_ID,
UNIT_ID,
SYSTEM_COUNT,
INVENTORY_COUNT,
INVENTORY_TIME,
AG_COUNT,
AG_TIME,
DIFF_COUNT,
ATTR1,
ATTR2,
ATTR3,
ATTR4,
CREATE_BY,
CREATE_TIME,
UPDATE_BY,
UPDATE_TIME
from WMS_INVENTORY
</sql>
<select id="selectWmsInventoryList" parameterType="WmsInventory" resultMap="WmsInventoryResult">
<include refid="selectWmsInventoryVo"/>
<where>
<if test="wmsStockPlanId != null ">and WMS_STOCK_PLAN_ID = #{wmsStockPlanId}</if>
<if test="mWarehouseId != null ">and M_WAREHOUSE_ID = #{mWarehouseId}</if>
<if test="areaId != null ">and AREA_ID = #{areaId}</if>
<if test="mdItemId != null ">and MD_ITEM_ID = #{mdItemId}</if>
<if test="unitId != null ">and UNIT_ID = #{unitId}</if>
<if test="systemCount != null ">and SYSTEM_COUNT = #{systemCount}</if>
<if test="inventoryCount != null ">and INVENTORY_COUNT = #{inventoryCount}</if>
<if test="inventoryTime != null ">and INVENTORY_TIME = #{inventoryTime}</if>
<if test="agCount != null ">and AG_COUNT = #{agCount}</if>
<if test="agTime != null ">and AG_TIME = #{agTime}</if>
<if test="diffCount != null ">and DIFF_COUNT = #{diffCount}</if>
<if test="createBy != null and createBy != ''">and CREATE_BY = #{createBy}</if>
<if test="createTime != null ">and CREATE_TIME = #{createTime}</if>
<if test="updateBy != null and updateBy != ''">and UPDATE_BY = #{updateBy}</if>
<if test="updateTime != null ">and UPDATE_TIME = #{updateTime}</if>
</where>
</select>
<select id="selectWmsInventoryByWmsInventoryId" parameterType="Long" resultMap="WmsInventoryResult">
<include refid="selectWmsInventoryVo"/>
where WMS_INVENTORY_ID = #{wmsInventoryId}
</select>
<insert id="insertWmsInventory" parameterType="WmsInventory" useGeneratedKeys="true" keyProperty="wmsInventoryId">
insert into WMS_INVENTORY
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="wmsStockPlanId != null">WMS_STOCK_PLAN_ID,</if>
<if test="mWarehouseId != null">M_WAREHOUSE_ID,</if>
<if test="areaId != null">AREA_ID,</if>
<if test="mdItemId != null">MD_ITEM_ID,</if>
<if test="unitId != null">UNIT_ID,</if>
<if test="systemCount != null">SYSTEM_COUNT,</if>
<if test="inventoryCount != null">INVENTORY_COUNT,</if>
<if test="inventoryTime != null">INVENTORY_TIME,</if>
<if test="agCount != null">AG_COUNT,</if>
<if test="agTime != null">AG_TIME,</if>
<if test="diffCount != null">DIFF_COUNT,</if>
<if test="attr1 != null">ATTR1,</if>
<if test="attr2 != null">ATTR2,</if>
<if test="attr3 != null">ATTR3,</if>
<if test="attr4 != null">ATTR4,</if>
<if test="createBy != null">CREATE_BY,</if>
<if test="createTime != null">CREATE_TIME,</if>
<if test="updateBy != null">UPDATE_BY,</if>
<if test="updateTime != null">UPDATE_TIME,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="wmsStockPlanId != null">#{wmsStockPlanId},</if>
<if test="mWarehouseId != null">#{mWarehouseId},</if>
<if test="areaId != null">#{areaId},</if>
<if test="mdItemId != null">#{mdItemId},</if>
<if test="unitId != null">#{unitId},</if>
<if test="systemCount != null">#{systemCount},</if>
<if test="inventoryCount != null">#{inventoryCount},</if>
<if test="inventoryTime != null">#{inventoryTime},</if>
<if test="agCount != null">#{agCount},</if>
<if test="agTime != null">#{agTime},</if>
<if test="diffCount != null">#{diffCount},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateWmsInventory" parameterType="WmsInventory">
update WMS_INVENTORY
<trim prefix="SET" suffixOverrides=",">
<if test="wmsStockPlanId != null">WMS_STOCK_PLAN_ID = #{wmsStockPlanId},</if>
<if test="mWarehouseId != null">M_WAREHOUSE_ID = #{mWarehouseId},</if>
<if test="areaId != null">AREA_ID = #{areaId},</if>
<if test="mdItemId != null">MD_ITEM_ID = #{mdItemId},</if>
<if test="unitId != null">UNIT_ID = #{unitId},</if>
<if test="systemCount != null">SYSTEM_COUNT = #{systemCount},</if>
<if test="inventoryCount != null">INVENTORY_COUNT = #{inventoryCount},</if>
<if test="inventoryTime != null">INVENTORY_TIME = #{inventoryTime},</if>
<if test="agCount != null">AG_COUNT = #{agCount},</if>
<if test="agTime != null">AG_TIME = #{agTime},</if>
<if test="diffCount != null">DIFF_COUNT = #{diffCount},</if>
<if test="attr1 != null">ATTR1 = #{attr1},</if>
<if test="attr2 != null">ATTR2 = #{attr2},</if>
<if test="attr3 != null">ATTR3 = #{attr3},</if>
<if test="attr4 != null">ATTR4 = #{attr4},</if>
<if test="createBy != null">CREATE_BY = #{createBy},</if>
<if test="createTime != null">CREATE_TIME = #{createTime},</if>
<if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
<if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
</trim>
where WMS_INVENTORY_ID = #{wmsInventoryId}
</update>
<delete id="deleteWmsInventoryByWmsInventoryId" parameterType="Long">
delete
from WMS_INVENTORY
where WMS_INVENTORY_ID = #{wmsInventoryId}
</delete>
<delete id="deleteWmsInventoryByWmsInventoryIds" parameterType="String">
delete from WMS_INVENTORY where WMS_INVENTORY_ID in
<foreach item="wmsInventoryId" collection="array" open="(" separator="," close=")">
#{wmsInventoryId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,159 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ktg.mes.md.mapper.WmsInventoryPlanMapper">
<resultMap type="WmsInventoryPlan" id="WmsInventoryPlanResult">
<result property="wmsStockPlanId" column="WMS_STOCK_PLAN_ID"/>
<result property="wmsInventoryConfigureId" column="WMS_INVENTORY_CONFIGURE_ID"/>
<result property="planCode" column="PLAN_CODE"/>
<result property="planName" column="PLAN_NAME"/>
<result property="dataType" column="DATA_TYPE"/>
<result property="mWarehouseId" column="M_WAREHOUSE_ID"/>
<result property="beginTime" column="BEGIN_TIME"/>
<result property="endTime" column="END_TIME"/>
<result property="isag" column="ISAG"/>
<result property="status" column="STATUS"/>
<result property="description" column="DESCRIPTION"/>
<result property="attr1" column="ATTR1"/>
<result property="attr2" column="ATTR2"/>
<result property="attr3" column="ATTR3"/>
<result property="attr4" column="ATTR4"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
<sql id="selectWmsInventoryPlanVo">
select WMS_STOCK_PLAN_ID,
WMS_INVENTORY_CONFIGURE_ID,
PLAN_CODE,
PLAN_NAME,
DATA_TYPE,
M_WAREHOUSE_ID,
BEGIN_TIME,
END_TIME,
ISAG,
STATUS,
DESCRIPTION,
ATTR1,
ATTR2,
ATTR3,
ATTR4,
CREATE_BY,
CREATE_TIME,
UPDATE_BY,
UPDATE_TIME
from WMS_INVENTORY_PLAN
</sql>
<select id="selectWmsInventoryPlanList" parameterType="WmsInventoryPlan" resultMap="WmsInventoryPlanResult">
<include refid="selectWmsInventoryPlanVo"/>
<where>
<if test="wmsInventoryConfigureId != null ">and WMS_INVENTORY_CONFIGURE_ID = #{wmsInventoryConfigureId}</if>
<if test="planCode != null and planCode != ''">and PLAN_CODE like concat('%', #{planCode}, '%')</if>
<if test="planName != null and planName != ''">and PLAN_NAME like concat('%', #{planName}, '%')</if>
<if test="dataType != null and dataType != ''">and DATA_TYPE = #{dataType}</if>
<if test="mWarehouseId != null ">and M_WAREHOUSE_ID = #{mWarehouseId}</if>
<if test="beginTime != null ">and BEGIN_TIME = #{beginTime}</if>
<if test="endTime != null ">and END_TIME = #{endTime}</if>
<if test="isag != null and isag != ''">and ISAG = #{isag}</if>
<if test="status != null and status != ''">and STATUS = #{status}</if>
<if test="description != null and description != ''">and DESCRIPTION = #{description}</if>
<if test="createBy != null and createBy != ''">and CREATE_BY = #{createBy}</if>
<if test="createTime != null ">and CREATE_TIME = #{createTime}</if>
<if test="updateBy != null and updateBy != ''">and UPDATE_BY = #{updateBy}</if>
<if test="updateTime != null ">and UPDATE_TIME = #{updateTime}</if>
</where>
</select>
<select id="selectWmsInventoryPlanByWmsStockPlanId" parameterType="Long" resultMap="WmsInventoryPlanResult">
<include refid="selectWmsInventoryPlanVo"/>
where WMS_STOCK_PLAN_ID = #{wmsStockPlanId}
</select>
<insert id="insertWmsInventoryPlan" parameterType="WmsInventoryPlan" useGeneratedKeys="true"
keyProperty="wmsStockPlanId">
insert into WMS_INVENTORY_PLAN
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="wmsInventoryConfigureId != null">WMS_INVENTORY_CONFIGURE_ID,</if>
<if test="planCode != null">PLAN_CODE,</if>
<if test="planName != null">PLAN_NAME,</if>
<if test="dataType != null">DATA_TYPE,</if>
<if test="mWarehouseId != null">M_WAREHOUSE_ID,</if>
<if test="beginTime != null">BEGIN_TIME,</if>
<if test="endTime != null">END_TIME,</if>
<if test="isag != null">ISAG,</if>
<if test="status != null">STATUS,</if>
<if test="description != null">DESCRIPTION,</if>
<if test="attr1 != null">ATTR1,</if>
<if test="attr2 != null">ATTR2,</if>
<if test="attr3 != null">ATTR3,</if>
<if test="attr4 != null">ATTR4,</if>
<if test="createBy != null">CREATE_BY,</if>
<if test="createTime != null">CREATE_TIME,</if>
<if test="updateBy != null">UPDATE_BY,</if>
<if test="updateTime != null">UPDATE_TIME,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="wmsInventoryConfigureId != null">#{wmsInventoryConfigureId},</if>
<if test="planCode != null">#{planCode},</if>
<if test="planName != null">#{planName},</if>
<if test="dataType != null">#{dataType},</if>
<if test="mWarehouseId != null">#{mWarehouseId},</if>
<if test="beginTime != null">#{beginTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="isag != null">#{isag},</if>
<if test="status != null">#{status},</if>
<if test="description != null">#{description},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateWmsInventoryPlan" parameterType="WmsInventoryPlan">
update WMS_INVENTORY_PLAN
<trim prefix="SET" suffixOverrides=",">
<if test="wmsInventoryConfigureId != null">WMS_INVENTORY_CONFIGURE_ID = #{wmsInventoryConfigureId},</if>
<if test="planCode != null">PLAN_CODE = #{planCode},</if>
<if test="planName != null">PLAN_NAME = #{planName},</if>
<if test="dataType != null">DATA_TYPE = #{dataType},</if>
<if test="mWarehouseId != null">M_WAREHOUSE_ID = #{mWarehouseId},</if>
<if test="beginTime != null">BEGIN_TIME = #{beginTime},</if>
<if test="endTime != null">END_TIME = #{endTime},</if>
<if test="isag != null">ISAG = #{isag},</if>
<if test="status != null">STATUS = #{status},</if>
<if test="description != null">DESCRIPTION = #{description},</if>
<if test="attr1 != null">ATTR1 = #{attr1},</if>
<if test="attr2 != null">ATTR2 = #{attr2},</if>
<if test="attr3 != null">ATTR3 = #{attr3},</if>
<if test="attr4 != null">ATTR4 = #{attr4},</if>
<if test="createBy != null">CREATE_BY = #{createBy},</if>
<if test="createTime != null">CREATE_TIME = #{createTime},</if>
<if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
<if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
</trim>
where WMS_STOCK_PLAN_ID = #{wmsStockPlanId}
</update>
<delete id="deleteWmsInventoryPlanByWmsStockPlanId" parameterType="Long">
delete
from WMS_INVENTORY_PLAN
where WMS_STOCK_PLAN_ID = #{wmsStockPlanId}
</delete>
<delete id="deleteWmsInventoryPlanByWmsStockPlanIds" parameterType="String">
delete from WMS_INVENTORY_PLAN where WMS_STOCK_PLAN_ID in
<foreach item="wmsStockPlanId" collection="array" open="(" separator="," close=")">
#{wmsStockPlanId}
</foreach>
</delete>
</mapper>