转移单后台代码
This commit is contained in:
parent
701235eb45
commit
41f79db739
@ -0,0 +1,123 @@
|
||||
package com.ktg.mes.wm.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.mes.wm.service.IWmTransferLineService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
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.WmTransfer;
|
||||
import com.ktg.mes.wm.service.IWmTransferService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 转移单Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-11-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wm/transfer")
|
||||
public class WmTransferController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWmTransferService wmTransferService;
|
||||
|
||||
@Autowired
|
||||
private IWmTransferLineService wmTransferLineService;
|
||||
|
||||
/**
|
||||
* 查询转移单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wm:transfer:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WmTransfer wmTransfer)
|
||||
{
|
||||
startPage();
|
||||
List<WmTransfer> list = wmTransferService.selectWmTransferList(wmTransfer);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出转移单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wm:transfer:export')")
|
||||
@Log(title = "转移单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WmTransfer wmTransfer)
|
||||
{
|
||||
List<WmTransfer> list = wmTransferService.selectWmTransferList(wmTransfer);
|
||||
ExcelUtil<WmTransfer> util = new ExcelUtil<WmTransfer>(WmTransfer.class);
|
||||
util.exportExcel(response, list, "转移单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取转移单详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wm:transfer:query')")
|
||||
@GetMapping(value = "/{transferId}")
|
||||
public AjaxResult getInfo(@PathVariable("transferId") Long transferId)
|
||||
{
|
||||
return AjaxResult.success(wmTransferService.selectWmTransferByTransferId(transferId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增转移单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wm:transfer:add')")
|
||||
@Log(title = "转移单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WmTransfer wmTransfer)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(wmTransferService.checkUnique(wmTransfer))){
|
||||
return AjaxResult.error("转移单编号已存在");
|
||||
}
|
||||
return toAjax(wmTransferService.insertWmTransfer(wmTransfer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改转移单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wm:transfer:edit')")
|
||||
@Log(title = "转移单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WmTransfer wmTransfer)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(wmTransferService.checkUnique(wmTransfer))){
|
||||
return AjaxResult.error("转移单编号已存在");
|
||||
}
|
||||
return toAjax(wmTransferService.updateWmTransfer(wmTransfer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除转移单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wm:transfer:remove')")
|
||||
@Log(title = "转移单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{transferIds}")
|
||||
@Transactional
|
||||
public AjaxResult remove(@PathVariable Long[] transferIds)
|
||||
{
|
||||
for (Long transferId:transferIds
|
||||
) {
|
||||
wmTransferLineService.deleteByTransferId(transferId);
|
||||
}
|
||||
return toAjax(wmTransferService.deleteWmTransferByTransferIds(transferIds));
|
||||
}
|
||||
}
|
293
ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmTransfer.java
Normal file
293
ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmTransfer.java
Normal file
@ -0,0 +1,293 @@
|
||||
package com.ktg.mes.wm.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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_transfer
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-11-28
|
||||
*/
|
||||
public class WmTransfer extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 转移单ID */
|
||||
private Long transferId;
|
||||
|
||||
/** 转移单编号 */
|
||||
@Excel(name = "转移单编号")
|
||||
private String transferCode;
|
||||
|
||||
/** 转移单名称 */
|
||||
@Excel(name = "转移单名称")
|
||||
private String transferName;
|
||||
|
||||
/** 转移单类型 */
|
||||
@Excel(name = "转移单类型")
|
||||
private String transferType;
|
||||
|
||||
/** 目的地 */
|
||||
@Excel(name = "目的地")
|
||||
private String destination;
|
||||
|
||||
/** 承运商 */
|
||||
@Excel(name = "承运商")
|
||||
private String carrier;
|
||||
|
||||
/** 托运单号 */
|
||||
@Excel(name = "托运单号")
|
||||
private String bookingNote;
|
||||
|
||||
/** 移出仓库ID */
|
||||
@Excel(name = "移出仓库ID")
|
||||
private Long fromWarehouseId;
|
||||
|
||||
/** 移出仓库编码 */
|
||||
@Excel(name = "移出仓库编码")
|
||||
private String fromWarehouseCode;
|
||||
|
||||
/** 移出仓库名称 */
|
||||
@Excel(name = "移出仓库名称")
|
||||
private String fromWarehouseName;
|
||||
|
||||
/** 移入仓库ID */
|
||||
@Excel(name = "移入仓库ID")
|
||||
private Long toWarehouseId;
|
||||
|
||||
/** 移入仓库编码 */
|
||||
@Excel(name = "移入仓库编码")
|
||||
private String toWarehouseCode;
|
||||
|
||||
/** 移入仓库名称 */
|
||||
@Excel(name = "移入仓库名称")
|
||||
private String toWarehouseName;
|
||||
|
||||
/** 转移日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "转移日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date transferDate;
|
||||
|
||||
/** 单据状态 */
|
||||
@Excel(name = "单据状态")
|
||||
private String status;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setTransferId(Long transferId)
|
||||
{
|
||||
this.transferId = transferId;
|
||||
}
|
||||
|
||||
public Long getTransferId()
|
||||
{
|
||||
return transferId;
|
||||
}
|
||||
public void setTransferCode(String transferCode)
|
||||
{
|
||||
this.transferCode = transferCode;
|
||||
}
|
||||
|
||||
public String getTransferCode()
|
||||
{
|
||||
return transferCode;
|
||||
}
|
||||
public void setTransferName(String transferName)
|
||||
{
|
||||
this.transferName = transferName;
|
||||
}
|
||||
|
||||
public String getTransferName()
|
||||
{
|
||||
return transferName;
|
||||
}
|
||||
public void setTransferType(String transferType)
|
||||
{
|
||||
this.transferType = transferType;
|
||||
}
|
||||
|
||||
public String getTransferType()
|
||||
{
|
||||
return transferType;
|
||||
}
|
||||
public void setDestination(String destination)
|
||||
{
|
||||
this.destination = destination;
|
||||
}
|
||||
|
||||
public String getDestination()
|
||||
{
|
||||
return destination;
|
||||
}
|
||||
public void setCarrier(String carrier)
|
||||
{
|
||||
this.carrier = carrier;
|
||||
}
|
||||
|
||||
public String getCarrier()
|
||||
{
|
||||
return carrier;
|
||||
}
|
||||
public void setBookingNote(String bookingNote)
|
||||
{
|
||||
this.bookingNote = bookingNote;
|
||||
}
|
||||
|
||||
public String getBookingNote()
|
||||
{
|
||||
return bookingNote;
|
||||
}
|
||||
public void setFromWarehouseId(Long fromWarehouseId)
|
||||
{
|
||||
this.fromWarehouseId = fromWarehouseId;
|
||||
}
|
||||
|
||||
public Long getFromWarehouseId()
|
||||
{
|
||||
return fromWarehouseId;
|
||||
}
|
||||
public void setFromWarehouseCode(String fromWarehouseCode)
|
||||
{
|
||||
this.fromWarehouseCode = fromWarehouseCode;
|
||||
}
|
||||
|
||||
public String getFromWarehouseCode()
|
||||
{
|
||||
return fromWarehouseCode;
|
||||
}
|
||||
public void setFromWarehouseName(String fromWarehouseName)
|
||||
{
|
||||
this.fromWarehouseName = fromWarehouseName;
|
||||
}
|
||||
|
||||
public String getFromWarehouseName()
|
||||
{
|
||||
return fromWarehouseName;
|
||||
}
|
||||
public void setToWarehouseId(Long toWarehouseId)
|
||||
{
|
||||
this.toWarehouseId = toWarehouseId;
|
||||
}
|
||||
|
||||
public Long getToWarehouseId()
|
||||
{
|
||||
return toWarehouseId;
|
||||
}
|
||||
public void setToWarehouseCode(String toWarehouseCode)
|
||||
{
|
||||
this.toWarehouseCode = toWarehouseCode;
|
||||
}
|
||||
|
||||
public String getToWarehouseCode()
|
||||
{
|
||||
return toWarehouseCode;
|
||||
}
|
||||
public void setToWarehouseName(String toWarehouseName)
|
||||
{
|
||||
this.toWarehouseName = toWarehouseName;
|
||||
}
|
||||
|
||||
public String getToWarehouseName()
|
||||
{
|
||||
return toWarehouseName;
|
||||
}
|
||||
public void setTransferDate(Date transferDate)
|
||||
{
|
||||
this.transferDate = transferDate;
|
||||
}
|
||||
|
||||
public Date getTransferDate()
|
||||
{
|
||||
return transferDate;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
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("transferId", getTransferId())
|
||||
.append("transferCode", getTransferCode())
|
||||
.append("transferName", getTransferName())
|
||||
.append("transferType", getTransferType())
|
||||
.append("destination", getDestination())
|
||||
.append("carrier", getCarrier())
|
||||
.append("bookingNote", getBookingNote())
|
||||
.append("fromWarehouseId", getFromWarehouseId())
|
||||
.append("fromWarehouseCode", getFromWarehouseCode())
|
||||
.append("fromWarehouseName", getFromWarehouseName())
|
||||
.append("toWarehouseId", getToWarehouseId())
|
||||
.append("toWarehouseCode", getToWarehouseCode())
|
||||
.append("toWarehouseName", getToWarehouseName())
|
||||
.append("transferDate", getTransferDate())
|
||||
.append("status", getStatus())
|
||||
.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,68 @@
|
||||
package com.ktg.mes.wm.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.wm.domain.WmTransfer;
|
||||
|
||||
/**
|
||||
* 转移单Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-11-28
|
||||
*/
|
||||
public interface WmTransferMapper
|
||||
{
|
||||
/**
|
||||
* 查询转移单
|
||||
*
|
||||
* @param transferId 转移单主键
|
||||
* @return 转移单
|
||||
*/
|
||||
public WmTransfer selectWmTransferByTransferId(Long transferId);
|
||||
|
||||
/**
|
||||
* 查询转移单列表
|
||||
*
|
||||
* @param wmTransfer 转移单
|
||||
* @return 转移单集合
|
||||
*/
|
||||
public List<WmTransfer> selectWmTransferList(WmTransfer wmTransfer);
|
||||
|
||||
/**
|
||||
* 检查编码是否唯一
|
||||
* @param wmTransfer
|
||||
* @return
|
||||
*/
|
||||
public WmTransfer checkUnique(WmTransfer wmTransfer);
|
||||
|
||||
/**
|
||||
* 新增转移单
|
||||
*
|
||||
* @param wmTransfer 转移单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWmTransfer(WmTransfer wmTransfer);
|
||||
|
||||
/**
|
||||
* 修改转移单
|
||||
*
|
||||
* @param wmTransfer 转移单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWmTransfer(WmTransfer wmTransfer);
|
||||
|
||||
/**
|
||||
* 删除转移单
|
||||
*
|
||||
* @param transferId 转移单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmTransferByTransferId(Long transferId);
|
||||
|
||||
/**
|
||||
* 批量删除转移单
|
||||
*
|
||||
* @param transferIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmTransferByTransferIds(Long[] transferIds);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.ktg.mes.wm.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.wm.domain.WmTransfer;
|
||||
|
||||
/**
|
||||
* 转移单Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-11-28
|
||||
*/
|
||||
public interface IWmTransferService
|
||||
{
|
||||
/**
|
||||
* 查询转移单
|
||||
*
|
||||
* @param transferId 转移单主键
|
||||
* @return 转移单
|
||||
*/
|
||||
public WmTransfer selectWmTransferByTransferId(Long transferId);
|
||||
|
||||
/**
|
||||
* 查询转移单列表
|
||||
*
|
||||
* @param wmTransfer 转移单
|
||||
* @return 转移单集合
|
||||
*/
|
||||
public List<WmTransfer> selectWmTransferList(WmTransfer wmTransfer);
|
||||
|
||||
|
||||
/**
|
||||
* 检查编码是否唯一
|
||||
* @param wmTransfer
|
||||
* @return
|
||||
*/
|
||||
public String checkUnique(WmTransfer wmTransfer);
|
||||
|
||||
/**
|
||||
* 新增转移单
|
||||
*
|
||||
* @param wmTransfer 转移单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWmTransfer(WmTransfer wmTransfer);
|
||||
|
||||
/**
|
||||
* 修改转移单
|
||||
*
|
||||
* @param wmTransfer 转移单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWmTransfer(WmTransfer wmTransfer);
|
||||
|
||||
/**
|
||||
* 批量删除转移单
|
||||
*
|
||||
* @param transferIds 需要删除的转移单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmTransferByTransferIds(Long[] transferIds);
|
||||
|
||||
/**
|
||||
* 删除转移单信息
|
||||
*
|
||||
* @param transferId 转移单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmTransferByTransferId(Long transferId);
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.wm.mapper.WmTransferMapper;
|
||||
import com.ktg.mes.wm.domain.WmTransfer;
|
||||
import com.ktg.mes.wm.service.IWmTransferService;
|
||||
|
||||
/**
|
||||
* 转移单Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-11-28
|
||||
*/
|
||||
@Service
|
||||
public class WmTransferServiceImpl implements IWmTransferService
|
||||
{
|
||||
@Autowired
|
||||
private WmTransferMapper wmTransferMapper;
|
||||
|
||||
/**
|
||||
* 查询转移单
|
||||
*
|
||||
* @param transferId 转移单主键
|
||||
* @return 转移单
|
||||
*/
|
||||
@Override
|
||||
public WmTransfer selectWmTransferByTransferId(Long transferId)
|
||||
{
|
||||
return wmTransferMapper.selectWmTransferByTransferId(transferId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询转移单列表
|
||||
*
|
||||
* @param wmTransfer 转移单
|
||||
* @return 转移单
|
||||
*/
|
||||
@Override
|
||||
public List<WmTransfer> selectWmTransferList(WmTransfer wmTransfer)
|
||||
{
|
||||
return wmTransferMapper.selectWmTransferList(wmTransfer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkUnique(WmTransfer wmTransfer) {
|
||||
WmTransfer transfer = wmTransferMapper.checkUnique(wmTransfer);
|
||||
Long transferId = wmTransfer.getTransferId() == null?-1L:wmTransfer.getTransferId();
|
||||
if(StringUtils.isNotNull(transfer) && transferId.longValue() != transfer.getTransferId().longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增转移单
|
||||
*
|
||||
* @param wmTransfer 转移单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWmTransfer(WmTransfer wmTransfer)
|
||||
{
|
||||
wmTransfer.setCreateTime(DateUtils.getNowDate());
|
||||
return wmTransferMapper.insertWmTransfer(wmTransfer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改转移单
|
||||
*
|
||||
* @param wmTransfer 转移单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWmTransfer(WmTransfer wmTransfer)
|
||||
{
|
||||
wmTransfer.setUpdateTime(DateUtils.getNowDate());
|
||||
return wmTransferMapper.updateWmTransfer(wmTransfer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除转移单
|
||||
*
|
||||
* @param transferIds 需要删除的转移单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWmTransferByTransferIds(Long[] transferIds)
|
||||
{
|
||||
return wmTransferMapper.deleteWmTransferByTransferIds(transferIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除转移单信息
|
||||
*
|
||||
* @param transferId 转移单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWmTransferByTransferId(Long transferId)
|
||||
{
|
||||
return wmTransferMapper.deleteWmTransferByTransferId(transferId);
|
||||
}
|
||||
}
|
162
ktg-mes/src/main/resources/mapper/wm/WmTransferMapper.xml
Normal file
162
ktg-mes/src/main/resources/mapper/wm/WmTransferMapper.xml
Normal file
@ -0,0 +1,162 @@
|
||||
<?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.WmTransferMapper">
|
||||
|
||||
<resultMap type="WmTransfer" id="WmTransferResult">
|
||||
<result property="transferId" column="transfer_id" />
|
||||
<result property="transferCode" column="transfer_code" />
|
||||
<result property="transferName" column="transfer_name" />
|
||||
<result property="transferType" column="transfer_type" />
|
||||
<result property="destination" column="destination" />
|
||||
<result property="carrier" column="carrier" />
|
||||
<result property="bookingNote" column="booking_note" />
|
||||
<result property="fromWarehouseId" column="from_warehouse_id" />
|
||||
<result property="fromWarehouseCode" column="from_warehouse_code" />
|
||||
<result property="fromWarehouseName" column="from_warehouse_name" />
|
||||
<result property="toWarehouseId" column="to_warehouse_id" />
|
||||
<result property="toWarehouseCode" column="to_warehouse_code" />
|
||||
<result property="toWarehouseName" column="to_warehouse_name" />
|
||||
<result property="transferDate" column="transfer_date" />
|
||||
<result property="status" column="status" />
|
||||
<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="selectWmTransferVo">
|
||||
select transfer_id, transfer_code, transfer_name, transfer_type, destination, carrier, booking_note, from_warehouse_id, from_warehouse_code, from_warehouse_name, to_warehouse_id, to_warehouse_code, to_warehouse_name, transfer_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_transfer
|
||||
</sql>
|
||||
|
||||
<select id="selectWmTransferList" parameterType="WmTransfer" resultMap="WmTransferResult">
|
||||
<include refid="selectWmTransferVo"/>
|
||||
<where>
|
||||
<if test="transferCode != null and transferCode != ''"> and transfer_code = #{transferCode}</if>
|
||||
<if test="transferName != null and transferName != ''"> and transfer_name like concat('%', #{transferName}, '%')</if>
|
||||
<if test="transferType != null and transferType != ''"> and transfer_type = #{transferType}</if>
|
||||
<if test="destination != null and destination != ''"> and destination = #{destination}</if>
|
||||
<if test="carrier != null and carrier != ''"> and carrier = #{carrier}</if>
|
||||
<if test="bookingNote != null and bookingNote != ''"> and booking_note = #{bookingNote}</if>
|
||||
<if test="fromWarehouseId != null "> and from_warehouse_id = #{fromWarehouseId}</if>
|
||||
<if test="fromWarehouseCode != null and fromWarehouseCode != ''"> and from_warehouse_code = #{fromWarehouseCode}</if>
|
||||
<if test="fromWarehouseName != null and fromWarehouseName != ''"> and from_warehouse_name like concat('%', #{fromWarehouseName}, '%')</if>
|
||||
<if test="toWarehouseId != null "> and to_warehouse_id = #{toWarehouseId}</if>
|
||||
<if test="toWarehouseCode != null and toWarehouseCode != ''"> and to_warehouse_code = #{toWarehouseCode}</if>
|
||||
<if test="toWarehouseName != null and toWarehouseName != ''"> and to_warehouse_name like concat('%', #{toWarehouseName}, '%')</if>
|
||||
<if test="transferDate != null "> and transfer_date = #{transferDate}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWmTransferByTransferId" parameterType="Long" resultMap="WmTransferResult">
|
||||
<include refid="selectWmTransferVo"/>
|
||||
where transfer_id = #{transferId}
|
||||
</select>
|
||||
|
||||
<select id="checkUnique" parameterType="WmTransfer" resultMap="WmTransferResult">
|
||||
<include refid="selectWmTransferVo"/>
|
||||
where transfer_code = #{transferCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertWmTransfer" parameterType="WmTransfer" useGeneratedKeys="true" keyProperty="transferId">
|
||||
insert into wm_transfer
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="transferCode != null and transferCode != ''">transfer_code,</if>
|
||||
<if test="transferName != null and transferName != ''">transfer_name,</if>
|
||||
<if test="transferType != null and transferType != ''">transfer_type,</if>
|
||||
<if test="destination != null">destination,</if>
|
||||
<if test="carrier != null">carrier,</if>
|
||||
<if test="bookingNote != null">booking_note,</if>
|
||||
<if test="fromWarehouseId != null">from_warehouse_id,</if>
|
||||
<if test="fromWarehouseCode != null">from_warehouse_code,</if>
|
||||
<if test="fromWarehouseName != null">from_warehouse_name,</if>
|
||||
<if test="toWarehouseId != null">to_warehouse_id,</if>
|
||||
<if test="toWarehouseCode != null">to_warehouse_code,</if>
|
||||
<if test="toWarehouseName != null">to_warehouse_name,</if>
|
||||
<if test="transferDate != null">transfer_date,</if>
|
||||
<if test="status != null">status,</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="transferCode != null and transferCode != ''">#{transferCode},</if>
|
||||
<if test="transferName != null and transferName != ''">#{transferName},</if>
|
||||
<if test="transferType != null and transferType != ''">#{transferType},</if>
|
||||
<if test="destination != null">#{destination},</if>
|
||||
<if test="carrier != null">#{carrier},</if>
|
||||
<if test="bookingNote != null">#{bookingNote},</if>
|
||||
<if test="fromWarehouseId != null">#{fromWarehouseId},</if>
|
||||
<if test="fromWarehouseCode != null">#{fromWarehouseCode},</if>
|
||||
<if test="fromWarehouseName != null">#{fromWarehouseName},</if>
|
||||
<if test="toWarehouseId != null">#{toWarehouseId},</if>
|
||||
<if test="toWarehouseCode != null">#{toWarehouseCode},</if>
|
||||
<if test="toWarehouseName != null">#{toWarehouseName},</if>
|
||||
<if test="transferDate != null">#{transferDate},</if>
|
||||
<if test="status != null">#{status},</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="updateWmTransfer" parameterType="WmTransfer">
|
||||
update wm_transfer
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="transferCode != null and transferCode != ''">transfer_code = #{transferCode},</if>
|
||||
<if test="transferName != null and transferName != ''">transfer_name = #{transferName},</if>
|
||||
<if test="transferType != null and transferType != ''">transfer_type = #{transferType},</if>
|
||||
<if test="destination != null">destination = #{destination},</if>
|
||||
<if test="carrier != null">carrier = #{carrier},</if>
|
||||
<if test="bookingNote != null">booking_note = #{bookingNote},</if>
|
||||
<if test="fromWarehouseId != null">from_warehouse_id = #{fromWarehouseId},</if>
|
||||
<if test="fromWarehouseCode != null">from_warehouse_code = #{fromWarehouseCode},</if>
|
||||
<if test="fromWarehouseName != null">from_warehouse_name = #{fromWarehouseName},</if>
|
||||
<if test="toWarehouseId != null">to_warehouse_id = #{toWarehouseId},</if>
|
||||
<if test="toWarehouseCode != null">to_warehouse_code = #{toWarehouseCode},</if>
|
||||
<if test="toWarehouseName != null">to_warehouse_name = #{toWarehouseName},</if>
|
||||
<if test="transferDate != null">transfer_date = #{transferDate},</if>
|
||||
<if test="status != null">status = #{status},</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 transfer_id = #{transferId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWmTransferByTransferId" parameterType="Long">
|
||||
delete from wm_transfer where transfer_id = #{transferId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWmTransferByTransferIds" parameterType="String">
|
||||
delete from wm_transfer where transfer_id in
|
||||
<foreach item="transferId" collection="array" open="(" separator="," close=")">
|
||||
#{transferId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user