仓库设置
This commit is contained in:
parent
8c0fab5f83
commit
6318c16656
@ -0,0 +1,113 @@
|
|||||||
|
package com.ktg.mes.wm.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.ktg.common.constant.UserConstants;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.ktg.common.annotation.Log;
|
||||||
|
import com.ktg.common.core.controller.BaseController;
|
||||||
|
import com.ktg.common.core.domain.AjaxResult;
|
||||||
|
import com.ktg.common.enums.BusinessType;
|
||||||
|
import com.ktg.mes.wm.domain.WmWarehouse;
|
||||||
|
import com.ktg.mes.wm.service.IWmWarehouseService;
|
||||||
|
import com.ktg.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ktg.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库设置Controller
|
||||||
|
*
|
||||||
|
* @author yinjinlu
|
||||||
|
* @date 2022-05-07
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/mes/wm/warehouse")
|
||||||
|
public class WmWarehouseController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IWmWarehouseService wmWarehouseService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询仓库设置列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('mes:wm:warehouse:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(WmWarehouse wmWarehouse)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<WmWarehouse> list = wmWarehouseService.selectWmWarehouseList(wmWarehouse);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出仓库设置列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('mes:wm:warehouse:export')")
|
||||||
|
@Log(title = "仓库设置", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, WmWarehouse wmWarehouse)
|
||||||
|
{
|
||||||
|
List<WmWarehouse> list = wmWarehouseService.selectWmWarehouseList(wmWarehouse);
|
||||||
|
ExcelUtil<WmWarehouse> util = new ExcelUtil<WmWarehouse>(WmWarehouse.class);
|
||||||
|
util.exportExcel(response, list, "仓库设置数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取仓库设置详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('mes:wm:warehouse:query')")
|
||||||
|
@GetMapping(value = "/{warehouseId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("warehouseId") Long warehouseId)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(wmWarehouseService.selectWmWarehouseByWarehouseId(warehouseId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增仓库设置
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('mes:wm:warehouse:add')")
|
||||||
|
@Log(title = "仓库设置", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody WmWarehouse wmWarehouse)
|
||||||
|
{
|
||||||
|
if(UserConstants.NOT_UNIQUE.equals(wmWarehouseService.checkWarehouseCodeUnique(wmWarehouse))){
|
||||||
|
return AjaxResult.error("仓库编码已存在!");
|
||||||
|
}
|
||||||
|
if(UserConstants.NOT_UNIQUE.equals(wmWarehouseService.checkWarehouseNameUnique(wmWarehouse))){
|
||||||
|
return AjaxResult.error("仓库名称已存在!");
|
||||||
|
}
|
||||||
|
|
||||||
|
return toAjax(wmWarehouseService.insertWmWarehouse(wmWarehouse));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改仓库设置
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('mes:wm:warehouse:edit')")
|
||||||
|
@Log(title = "仓库设置", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody WmWarehouse wmWarehouse)
|
||||||
|
{
|
||||||
|
return toAjax(wmWarehouseService.updateWmWarehouse(wmWarehouse));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除仓库设置
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('mes:wm:warehouse:remove')")
|
||||||
|
@Log(title = "仓库设置", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{warehouseIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] warehouseIds)
|
||||||
|
{
|
||||||
|
return toAjax(wmWarehouseService.deleteWmWarehouseByWarehouseIds(warehouseIds));
|
||||||
|
}
|
||||||
|
}
|
165
ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmWarehouse.java
Normal file
165
ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmWarehouse.java
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
package com.ktg.mes.wm.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ktg.common.annotation.Excel;
|
||||||
|
import com.ktg.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库设置对象 wm_warehouse
|
||||||
|
*
|
||||||
|
* @author yinjinlu
|
||||||
|
* @date 2022-05-07
|
||||||
|
*/
|
||||||
|
public class WmWarehouse extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 仓库ID */
|
||||||
|
private Long warehouseId;
|
||||||
|
|
||||||
|
/** 仓库编码 */
|
||||||
|
@Excel(name = "仓库编码")
|
||||||
|
private String warehouseCode;
|
||||||
|
|
||||||
|
/** 仓库名称 */
|
||||||
|
@Excel(name = "仓库名称")
|
||||||
|
private String warehouseName;
|
||||||
|
|
||||||
|
/** 位置 */
|
||||||
|
@Excel(name = "位置")
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
/** 面积 */
|
||||||
|
@Excel(name = "面积")
|
||||||
|
private BigDecimal area;
|
||||||
|
|
||||||
|
/** 负责人 */
|
||||||
|
@Excel(name = "负责人")
|
||||||
|
private String charge;
|
||||||
|
|
||||||
|
/** 预留字段1 */
|
||||||
|
private String attr1;
|
||||||
|
|
||||||
|
/** 预留字段2 */
|
||||||
|
private String attr2;
|
||||||
|
|
||||||
|
/** 预留字段3 */
|
||||||
|
private Long attr3;
|
||||||
|
|
||||||
|
/** 预留字段4 */
|
||||||
|
private Long attr4;
|
||||||
|
|
||||||
|
public void setWarehouseId(Long warehouseId)
|
||||||
|
{
|
||||||
|
this.warehouseId = warehouseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getWarehouseId()
|
||||||
|
{
|
||||||
|
return warehouseId;
|
||||||
|
}
|
||||||
|
public void setWarehouseCode(String warehouseCode)
|
||||||
|
{
|
||||||
|
this.warehouseCode = warehouseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWarehouseCode()
|
||||||
|
{
|
||||||
|
return warehouseCode;
|
||||||
|
}
|
||||||
|
public void setWarehouseName(String warehouseName)
|
||||||
|
{
|
||||||
|
this.warehouseName = warehouseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWarehouseName()
|
||||||
|
{
|
||||||
|
return warehouseName;
|
||||||
|
}
|
||||||
|
public void setLocation(String location)
|
||||||
|
{
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocation()
|
||||||
|
{
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
public void setArea(BigDecimal area)
|
||||||
|
{
|
||||||
|
this.area = area;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getArea()
|
||||||
|
{
|
||||||
|
return area;
|
||||||
|
}
|
||||||
|
public void setCharge(String charge)
|
||||||
|
{
|
||||||
|
this.charge = charge;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCharge()
|
||||||
|
{
|
||||||
|
return charge;
|
||||||
|
}
|
||||||
|
public void setAttr1(String attr1)
|
||||||
|
{
|
||||||
|
this.attr1 = attr1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAttr1()
|
||||||
|
{
|
||||||
|
return attr1;
|
||||||
|
}
|
||||||
|
public void setAttr2(String attr2)
|
||||||
|
{
|
||||||
|
this.attr2 = attr2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAttr2()
|
||||||
|
{
|
||||||
|
return attr2;
|
||||||
|
}
|
||||||
|
public void setAttr3(Long attr3)
|
||||||
|
{
|
||||||
|
this.attr3 = attr3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getAttr3()
|
||||||
|
{
|
||||||
|
return attr3;
|
||||||
|
}
|
||||||
|
public void setAttr4(Long attr4)
|
||||||
|
{
|
||||||
|
this.attr4 = attr4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getAttr4()
|
||||||
|
{
|
||||||
|
return attr4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("warehouseId", getWarehouseId())
|
||||||
|
.append("warehouseCode", getWarehouseCode())
|
||||||
|
.append("warehouseName", getWarehouseName())
|
||||||
|
.append("location", getLocation())
|
||||||
|
.append("area", getArea())
|
||||||
|
.append("charge", getCharge())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.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();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package com.ktg.mes.wm.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ktg.mes.wm.domain.WmWarehouse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库设置Mapper接口
|
||||||
|
*
|
||||||
|
* @author yinjinlu
|
||||||
|
* @date 2022-05-07
|
||||||
|
*/
|
||||||
|
public interface WmWarehouseMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询仓库设置
|
||||||
|
*
|
||||||
|
* @param warehouseId 仓库设置主键
|
||||||
|
* @return 仓库设置
|
||||||
|
*/
|
||||||
|
public WmWarehouse selectWmWarehouseByWarehouseId(Long warehouseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询仓库设置列表
|
||||||
|
*
|
||||||
|
* @param wmWarehouse 仓库设置
|
||||||
|
* @return 仓库设置集合
|
||||||
|
*/
|
||||||
|
public List<WmWarehouse> selectWmWarehouseList(WmWarehouse wmWarehouse);
|
||||||
|
|
||||||
|
public WmWarehouse checkWarehouseCodeUnique(WmWarehouse wmWarehouse);
|
||||||
|
public WmWarehouse checkWarehouseNameUnique(WmWarehouse wmWarehouse);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增仓库设置
|
||||||
|
*
|
||||||
|
* @param wmWarehouse 仓库设置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertWmWarehouse(WmWarehouse wmWarehouse);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改仓库设置
|
||||||
|
*
|
||||||
|
* @param wmWarehouse 仓库设置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateWmWarehouse(WmWarehouse wmWarehouse);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除仓库设置
|
||||||
|
*
|
||||||
|
* @param warehouseId 仓库设置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteWmWarehouseByWarehouseId(Long warehouseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除仓库设置
|
||||||
|
*
|
||||||
|
* @param warehouseIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteWmWarehouseByWarehouseIds(Long[] warehouseIds);
|
||||||
|
}
|
@ -0,0 +1,75 @@
|
|||||||
|
package com.ktg.mes.wm.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ktg.mes.wm.domain.WmWarehouse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库设置Service接口
|
||||||
|
*
|
||||||
|
* @author yinjinlu
|
||||||
|
* @date 2022-05-07
|
||||||
|
*/
|
||||||
|
public interface IWmWarehouseService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询仓库设置
|
||||||
|
*
|
||||||
|
* @param warehouseId 仓库设置主键
|
||||||
|
* @return 仓库设置
|
||||||
|
*/
|
||||||
|
public WmWarehouse selectWmWarehouseByWarehouseId(Long warehouseId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询仓库设置列表
|
||||||
|
*
|
||||||
|
* @param wmWarehouse 仓库设置
|
||||||
|
* @return 仓库设置集合
|
||||||
|
*/
|
||||||
|
public List<WmWarehouse> selectWmWarehouseList(WmWarehouse wmWarehouse);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查仓库编码是否重复
|
||||||
|
* @param wmWarehouse
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String checkWarehouseCodeUnique(WmWarehouse wmWarehouse);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查仓库名称是否重复
|
||||||
|
* @param wmWarehouse
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String checkWarehouseNameUnique(WmWarehouse wmWarehouse);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增仓库设置
|
||||||
|
*
|
||||||
|
* @param wmWarehouse 仓库设置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertWmWarehouse(WmWarehouse wmWarehouse);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改仓库设置
|
||||||
|
*
|
||||||
|
* @param wmWarehouse 仓库设置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateWmWarehouse(WmWarehouse wmWarehouse);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除仓库设置
|
||||||
|
*
|
||||||
|
* @param warehouseIds 需要删除的仓库设置主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteWmWarehouseByWarehouseIds(Long[] warehouseIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除仓库设置信息
|
||||||
|
*
|
||||||
|
* @param warehouseId 仓库设置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteWmWarehouseByWarehouseId(Long warehouseId);
|
||||||
|
}
|
@ -0,0 +1,120 @@
|
|||||||
|
package com.ktg.mes.wm.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ktg.common.constant.UserConstants;
|
||||||
|
import com.ktg.common.utils.DateUtils;
|
||||||
|
import com.ktg.common.utils.StringUtils;
|
||||||
|
import org.apache.catalina.User;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ktg.mes.wm.mapper.WmWarehouseMapper;
|
||||||
|
import com.ktg.mes.wm.domain.WmWarehouse;
|
||||||
|
import com.ktg.mes.wm.service.IWmWarehouseService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库设置Service业务层处理
|
||||||
|
*
|
||||||
|
* @author yinjinlu
|
||||||
|
* @date 2022-05-07
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class WmWarehouseServiceImpl implements IWmWarehouseService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private WmWarehouseMapper wmWarehouseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询仓库设置
|
||||||
|
*
|
||||||
|
* @param warehouseId 仓库设置主键
|
||||||
|
* @return 仓库设置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WmWarehouse selectWmWarehouseByWarehouseId(Long warehouseId)
|
||||||
|
{
|
||||||
|
return wmWarehouseMapper.selectWmWarehouseByWarehouseId(warehouseId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询仓库设置列表
|
||||||
|
*
|
||||||
|
* @param wmWarehouse 仓库设置
|
||||||
|
* @return 仓库设置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<WmWarehouse> selectWmWarehouseList(WmWarehouse wmWarehouse)
|
||||||
|
{
|
||||||
|
return wmWarehouseMapper.selectWmWarehouseList(wmWarehouse);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String checkWarehouseCodeUnique(WmWarehouse wmWarehouse) {
|
||||||
|
WmWarehouse warehouse = wmWarehouseMapper.checkWarehouseCodeUnique(wmWarehouse);
|
||||||
|
Long warehouseId = wmWarehouse.getWarehouseId()==null?-1L:wmWarehouse.getWarehouseId();
|
||||||
|
if(StringUtils.isNotNull(warehouse) && warehouse.getWarehouseId().longValue() != warehouseId.longValue()){
|
||||||
|
return UserConstants.NOT_UNIQUE;
|
||||||
|
}
|
||||||
|
return UserConstants.UNIQUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String checkWarehouseNameUnique(WmWarehouse wmWarehouse) {
|
||||||
|
WmWarehouse warehouse = wmWarehouseMapper.checkWarehouseNameUnique(wmWarehouse);
|
||||||
|
Long warehouseId = wmWarehouse.getWarehouseId()==null?-1L:wmWarehouse.getWarehouseId();
|
||||||
|
if(StringUtils.isNotNull(warehouse) && warehouse.getWarehouseId().longValue() != warehouseId.longValue()){
|
||||||
|
return UserConstants.NOT_UNIQUE;
|
||||||
|
}
|
||||||
|
return UserConstants.UNIQUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增仓库设置
|
||||||
|
*
|
||||||
|
* @param wmWarehouse 仓库设置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertWmWarehouse(WmWarehouse wmWarehouse)
|
||||||
|
{
|
||||||
|
wmWarehouse.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return wmWarehouseMapper.insertWmWarehouse(wmWarehouse);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改仓库设置
|
||||||
|
*
|
||||||
|
* @param wmWarehouse 仓库设置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateWmWarehouse(WmWarehouse wmWarehouse)
|
||||||
|
{
|
||||||
|
wmWarehouse.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return wmWarehouseMapper.updateWmWarehouse(wmWarehouse);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除仓库设置
|
||||||
|
*
|
||||||
|
* @param warehouseIds 需要删除的仓库设置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteWmWarehouseByWarehouseIds(Long[] warehouseIds)
|
||||||
|
{
|
||||||
|
return wmWarehouseMapper.deleteWmWarehouseByWarehouseIds(warehouseIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除仓库设置信息
|
||||||
|
*
|
||||||
|
* @param warehouseId 仓库设置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteWmWarehouseByWarehouseId(Long warehouseId)
|
||||||
|
{
|
||||||
|
return wmWarehouseMapper.deleteWmWarehouseByWarehouseId(warehouseId);
|
||||||
|
}
|
||||||
|
}
|
@ -44,12 +44,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="checkWorkshopCodeUnique" parameterType="MdWorkshop" resultMap="MdWorkshopResult">
|
<select id="checkWorkshopCodeUnique" parameterType="MdWorkshop" resultMap="MdWorkshopResult">
|
||||||
<include refid="selectMdWorkshopVo"/>
|
<include refid="selectMdWorkshopVo"/>
|
||||||
where workshop_code = #{workshopCode}
|
where workshop_code = #{workshopCode} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkWorkshopNameUnique" parameterType="MdWorkshop" resultMap="MdWorkshopResult">
|
<select id="checkWorkshopNameUnique" parameterType="MdWorkshop" resultMap="MdWorkshopResult">
|
||||||
<include refid="selectMdWorkshopVo"/>
|
<include refid="selectMdWorkshopVo"/>
|
||||||
where workshop_name = #{workshopName}
|
where workshop_name = #{workshopName} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertMdWorkshop" parameterType="MdWorkshop" useGeneratedKeys="true" keyProperty="workshopId">
|
<insert id="insertMdWorkshop" parameterType="MdWorkshop" useGeneratedKeys="true" keyProperty="workshopId">
|
||||||
|
122
ktg-mes/src/main/resources/mapper/wm/WmWarehouseMapper.xml
Normal file
122
ktg-mes/src/main/resources/mapper/wm/WmWarehouseMapper.xml
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
<?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.wm.mapper.WmWarehouseMapper">
|
||||||
|
|
||||||
|
<resultMap type="WmWarehouse" id="WmWarehouseResult">
|
||||||
|
<result property="warehouseId" column="warehouse_id" />
|
||||||
|
<result property="warehouseCode" column="warehouse_code" />
|
||||||
|
<result property="warehouseName" column="warehouse_name" />
|
||||||
|
<result property="location" column="location" />
|
||||||
|
<result property="area" column="area" />
|
||||||
|
<result property="charge" column="charge" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<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="selectWmWarehouseVo">
|
||||||
|
select warehouse_id, warehouse_code, warehouse_name, location, area, charge, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_warehouse
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectWmWarehouseList" parameterType="WmWarehouse" resultMap="WmWarehouseResult">
|
||||||
|
<include refid="selectWmWarehouseVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="warehouseCode != null and warehouseCode != ''"> and warehouse_code = #{warehouseCode}</if>
|
||||||
|
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
|
||||||
|
<if test="location != null and location != ''"> and location = #{location}</if>
|
||||||
|
<if test="area != null "> and area = #{area}</if>
|
||||||
|
<if test="charge != null and charge != ''"> and charge = #{charge}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectWmWarehouseByWarehouseId" parameterType="Long" resultMap="WmWarehouseResult">
|
||||||
|
<include refid="selectWmWarehouseVo"/>
|
||||||
|
where warehouse_id = #{warehouseId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="checkWarehouseCodeUnique" parameterType="WmWarehouse" resultMap="WmWarehouseResult">
|
||||||
|
<include refid="selectWmWarehouseVo"/>
|
||||||
|
where warehouse_code = #{warehouseCode} limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="checkWarehouseNameUnique" parameterType="WmWarehouse" resultMap="WmWarehouseResult">
|
||||||
|
<include refid="selectWmWarehouseVo"/>
|
||||||
|
where warehouse_name = #{warehouseName} limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertWmWarehouse" parameterType="WmWarehouse" useGeneratedKeys="true" keyProperty="warehouseId">
|
||||||
|
insert into wm_warehouse
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="warehouseCode != null and warehouseCode != ''">warehouse_code,</if>
|
||||||
|
<if test="warehouseName != null and warehouseName != ''">warehouse_name,</if>
|
||||||
|
<if test="location != null">location,</if>
|
||||||
|
<if test="area != null">area,</if>
|
||||||
|
<if test="charge != null">charge,</if>
|
||||||
|
<if test="remark != null">remark,</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="warehouseCode != null and warehouseCode != ''">#{warehouseCode},</if>
|
||||||
|
<if test="warehouseName != null and warehouseName != ''">#{warehouseName},</if>
|
||||||
|
<if test="location != null">#{location},</if>
|
||||||
|
<if test="area != null">#{area},</if>
|
||||||
|
<if test="charge != null">#{charge},</if>
|
||||||
|
<if test="remark != null">#{remark},</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="updateWmWarehouse" parameterType="WmWarehouse">
|
||||||
|
update wm_warehouse
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="warehouseCode != null and warehouseCode != ''">warehouse_code = #{warehouseCode},</if>
|
||||||
|
<if test="warehouseName != null and warehouseName != ''">warehouse_name = #{warehouseName},</if>
|
||||||
|
<if test="location != null">location = #{location},</if>
|
||||||
|
<if test="area != null">area = #{area},</if>
|
||||||
|
<if test="charge != null">charge = #{charge},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</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 warehouse_id = #{warehouseId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteWmWarehouseByWarehouseId" parameterType="Long">
|
||||||
|
delete from wm_warehouse where warehouse_id = #{warehouseId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteWmWarehouseByWarehouseIds" parameterType="String">
|
||||||
|
delete from wm_warehouse where warehouse_id in
|
||||||
|
<foreach item="warehouseId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{warehouseId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue
Block a user