装箱单功能

This commit is contained in:
DESKTOP-J7ED0MB\yinjinlu 2022-10-10 12:05:25 +08:00
parent 2d300808a7
commit 87f20a6be8
8 changed files with 1065 additions and 1 deletions

View File

@ -846,7 +846,7 @@ create table wm_rt_salse_line (
-- ----------------------------
-- 12、条码清单表
-- 18、条码清单表
-- ----------------------------
drop table if exists wm_barcode;
create table wm_barcode (
@ -872,7 +872,87 @@ create table wm_barcode (
) engine=innodb auto_increment=200 comment = '条码清单表';
-- ----------------------------
-- 19、装箱单表
-- ----------------------------
drop table if exists wm_package;
create table wm_package (
package_id bigint(20) not null auto_increment comment '装箱单ID',
parent_id bigint(20) not null default 0 comment '父箱ID',
ancestors varchar(255) not null comment '所有父节点ID',
package_code varchar(64) comment '装箱单编号',
barcode_id bigint(20) comment '条码ID',
barcode_content varchar(255) comment '条码内容',
barcode_url varchar(255) comment '条码地址',
package_date datetime not null comment '装箱日期',
so_code varchar(64) comment '销售订单编号',
invoice_code varchar(255) comment '发票编号',
client_id bigint(20) comment '客户ID',
client_code varchar(64) comment '客户编码',
client_name varchar(255) comment '客户名称',
client_nick varchar(255) comment '客户简称',
package_length double(12,4) comment '箱长度',
package_width double(12,4) comment '箱宽度',
package_height double(12,4) comment '箱高度',
size_unit varchar(64) comment '尺寸单位',
net_weight double(12,4) comment '净重',
cross_weight double(12,4) comment '毛重',
weight_unit varchar(64) comment '重量单位',
inspector varchar(64) comment '检查员用户名',
inspector_name varchar(64) comment '检查员名称',
enable_flag char(1) default 'Y' comment '是否生效',
remark varchar(500) default '' comment '备注',
attr1 varchar(64) default null comment '预留字段1',
attr2 varchar(255) default null comment '预留字段2',
attr3 int(11) default 0 comment '预留字段3',
attr4 int(11) default 0 comment '预留字段4',
create_by varchar(64) default '' comment '创建者',
create_time datetime comment '创建时间',
update_by varchar(64) default '' comment '更新者',
update_time datetime comment '更新时间',
primary key (package_id)
) engine=innodb auto_increment=200 comment = '装箱单表';
-- ----------------------------
-- 20、装箱明细表
-- ----------------------------
drop table if exists wm_package_line;
create table wm_package_line (
line_id bigint(20) not null auto_increment comment '明细行ID',
package_id bigint(20) not null comment '装箱单ID',
material_stock_id bigint(20) comment '库存记录ID',
item_id bigint(20) not null comment '产品物料ID',
item_code varchar(64) comment '产品物料编码',
item_name varchar(255) comment '产品物料名称',
specification varchar(500) comment '规格型号',
unit_of_measure varchar(64) comment '单位',
quantity_package double(12,2) not null comment '装箱数量',
workorder_id bigint(20) comment '生产工单ID',
workorder_code varchar(64) comment '生产工单编号',
batch_code varchar(255) comment '批次号',
warehouse_id bigint(20) comment '仓库ID',
warehouse_code varchar(64) comment '仓库编码',
warehouse_name varchar(255) comment '仓库名称',
location_id bigint(20) comment '库区ID',
location_code varchar(64) comment '库区编码',
location_name varchar(255) comment '库区名称',
area_id bigint(20) comment '库位ID',
area_code varchar(64) comment '库位编码',
area_name varchar(255) comment '库位名称',
expire_date datetime comment '有效期',
remark varchar(500) default '' comment '备注',
attr1 varchar(64) default null comment '预留字段1',
attr2 varchar(255) default null comment '预留字段2',
attr3 int(11) default 0 comment '预留字段3',
attr4 int(11) default 0 comment '预留字段4',
create_by varchar(64) default '' comment '创建者',
create_time datetime comment '创建时间',
update_by varchar(64) default '' comment '更新者',
update_time datetime comment '更新时间',
primary key (line_id)
) engine=innodb auto_increment=200 comment = '装箱明细表';

View File

@ -0,0 +1,112 @@
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.WmPackage;
import com.ktg.mes.wm.service.IWmPackageService;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.common.core.page.TableDataInfo;
/**
* 装箱单Controller
*
* @author yinjinlu
* @date 2022-10-10
*/
@RestController
@RequestMapping("/mes/wm/package")
public class WmPackageController extends BaseController
{
@Autowired
private IWmPackageService wmPackageService;
/**
* 查询装箱单列表
*/
@PreAuthorize("@ss.hasPermi('mes:wm:package:list')")
@GetMapping("/list")
public TableDataInfo list(WmPackage wmPackage)
{
startPage();
List<WmPackage> list = wmPackageService.selectWmPackageList(wmPackage);
return getDataTable(list);
}
/**
* 导出装箱单列表
*/
@PreAuthorize("@ss.hasPermi('mes:wm:package:export')")
@Log(title = "装箱单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WmPackage wmPackage)
{
List<WmPackage> list = wmPackageService.selectWmPackageList(wmPackage);
ExcelUtil<WmPackage> util = new ExcelUtil<WmPackage>(WmPackage.class);
util.exportExcel(response, list, "装箱单数据");
}
/**
* 获取装箱单详细信息
*/
@PreAuthorize("@ss.hasPermi('mes:wm:package:query')")
@GetMapping(value = "/{packageId}")
public AjaxResult getInfo(@PathVariable("packageId") Long packageId)
{
return AjaxResult.success(wmPackageService.selectWmPackageByPackageId(packageId));
}
/**
* 新增装箱单
*/
@PreAuthorize("@ss.hasPermi('mes:wm:package:add')")
@Log(title = "装箱单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WmPackage wmPackage)
{
if(UserConstants.NOT_UNIQUE.equals(wmPackageService.checkPackgeCodeUnique(wmPackage))){
return AjaxResult.error("装箱单编号已存在!");
}
return toAjax(wmPackageService.insertWmPackage(wmPackage));
}
/**
* 修改装箱单
*/
@PreAuthorize("@ss.hasPermi('mes:wm:package:edit')")
@Log(title = "装箱单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WmPackage wmPackage)
{
if(UserConstants.NOT_UNIQUE.equals(wmPackageService.checkPackgeCodeUnique(wmPackage))){
return AjaxResult.error("装箱单编号已存在!");
}
return toAjax(wmPackageService.updateWmPackage(wmPackage));
}
/**
* 删除装箱单
*/
@PreAuthorize("@ss.hasPermi('mes:wm:package:remove')")
@Log(title = "装箱单", businessType = BusinessType.DELETE)
@DeleteMapping("/{packageIds}")
public AjaxResult remove(@PathVariable Long[] packageIds)
{
return toAjax(wmPackageService.deleteWmPackageByPackageIds(packageIds));
}
}

View File

@ -0,0 +1,420 @@
package com.ktg.mes.wm.domain;
import java.math.BigDecimal;
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_package
*
* @author yinjinlu
* @date 2022-10-10
*/
public class WmPackage extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 装箱单ID */
private Long packageId;
/** 父箱ID */
@Excel(name = "父箱ID")
private Long parentId;
/** 所有父节点ID */
@Excel(name = "所有父节点ID")
private String ancestors;
/** 装箱单编号 */
@Excel(name = "装箱单编号")
private String packageCode;
/** 条码ID */
@Excel(name = "条码ID")
private Long barcodeId;
/** 条码内容 */
@Excel(name = "条码内容")
private String barcodeContent;
/** 条码地址 */
@Excel(name = "条码地址")
private String barcodeUrl;
/** 装箱日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "装箱日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date packageDate;
/** 销售订单编号 */
@Excel(name = "销售订单编号")
private String soCode;
/** 发票编号 */
@Excel(name = "发票编号")
private String invoiceCode;
/** 客户ID */
@Excel(name = "客户ID")
private Long clientId;
/** 客户编码 */
@Excel(name = "客户编码")
private String clientCode;
/** 客户名称 */
@Excel(name = "客户名称")
private String clientName;
/** 客户简称 */
@Excel(name = "客户简称")
private String clientNick;
/** 箱长度 */
@Excel(name = "箱长度")
private BigDecimal packageLength;
/** 箱宽度 */
@Excel(name = "箱宽度")
private BigDecimal packageWidth;
/** 箱高度 */
@Excel(name = "箱高度")
private BigDecimal packageHeight;
/** 尺寸单位 */
@Excel(name = "尺寸单位")
private String sizeUnit;
/** 净重 */
@Excel(name = "净重")
private BigDecimal netWeight;
/** 毛重 */
@Excel(name = "毛重")
private BigDecimal crossWeight;
/** 重量单位 */
@Excel(name = "重量单位")
private String weightUnit;
/** 检查员用户名 */
@Excel(name = "检查员用户名")
private String inspector;
/** 检查员名称 */
@Excel(name = "检查员名称")
private String inspectorName;
/** 是否生效 */
@Excel(name = "是否生效")
private String enableFlag;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
public void setPackageId(Long packageId)
{
this.packageId = packageId;
}
public Long getPackageId()
{
return packageId;
}
public void setParentId(Long parentId)
{
this.parentId = parentId;
}
public Long getParentId()
{
return parentId;
}
public void setAncestors(String ancestors)
{
this.ancestors = ancestors;
}
public String getAncestors()
{
return ancestors;
}
public void setPackageCode(String packageCode)
{
this.packageCode = packageCode;
}
public String getPackageCode()
{
return packageCode;
}
public void setBarcodeId(Long barcodeId)
{
this.barcodeId = barcodeId;
}
public Long getBarcodeId()
{
return barcodeId;
}
public void setBarcodeContent(String barcodeContent)
{
this.barcodeContent = barcodeContent;
}
public String getBarcodeContent()
{
return barcodeContent;
}
public void setBarcodeUrl(String barcodeUrl)
{
this.barcodeUrl = barcodeUrl;
}
public String getBarcodeUrl()
{
return barcodeUrl;
}
public void setPackageDate(Date packageDate)
{
this.packageDate = packageDate;
}
public Date getPackageDate()
{
return packageDate;
}
public void setSoCode(String soCode)
{
this.soCode = soCode;
}
public String getSoCode()
{
return soCode;
}
public void setInvoiceCode(String invoiceCode)
{
this.invoiceCode = invoiceCode;
}
public String getInvoiceCode()
{
return invoiceCode;
}
public void setClientId(Long clientId)
{
this.clientId = clientId;
}
public Long getClientId()
{
return clientId;
}
public void setClientCode(String clientCode)
{
this.clientCode = clientCode;
}
public String getClientCode()
{
return clientCode;
}
public void setClientName(String clientName)
{
this.clientName = clientName;
}
public String getClientName()
{
return clientName;
}
public void setClientNick(String clientNick)
{
this.clientNick = clientNick;
}
public String getClientNick()
{
return clientNick;
}
public void setPackageLength(BigDecimal packageLength)
{
this.packageLength = packageLength;
}
public BigDecimal getPackageLength()
{
return packageLength;
}
public void setPackageWidth(BigDecimal packageWidth)
{
this.packageWidth = packageWidth;
}
public BigDecimal getPackageWidth()
{
return packageWidth;
}
public void setPackageHeight(BigDecimal packageHeight)
{
this.packageHeight = packageHeight;
}
public BigDecimal getPackageHeight()
{
return packageHeight;
}
public void setSizeUnit(String sizeUnit)
{
this.sizeUnit = sizeUnit;
}
public String getSizeUnit()
{
return sizeUnit;
}
public void setNetWeight(BigDecimal netWeight)
{
this.netWeight = netWeight;
}
public BigDecimal getNetWeight()
{
return netWeight;
}
public void setCrossWeight(BigDecimal crossWeight)
{
this.crossWeight = crossWeight;
}
public BigDecimal getCrossWeight()
{
return crossWeight;
}
public void setWeightUnit(String weightUnit)
{
this.weightUnit = weightUnit;
}
public String getWeightUnit()
{
return weightUnit;
}
public void setInspector(String inspector)
{
this.inspector = inspector;
}
public String getInspector()
{
return inspector;
}
public void setInspectorName(String inspectorName)
{
this.inspectorName = inspectorName;
}
public String getInspectorName()
{
return inspectorName;
}
public void setEnableFlag(String enableFlag)
{
this.enableFlag = enableFlag;
}
public String getEnableFlag()
{
return enableFlag;
}
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("packageId", getPackageId())
.append("parentId", getParentId())
.append("ancestors", getAncestors())
.append("packageCode", getPackageCode())
.append("barcodeId", getBarcodeId())
.append("barcodeContent", getBarcodeContent())
.append("barcodeUrl", getBarcodeUrl())
.append("packageDate", getPackageDate())
.append("soCode", getSoCode())
.append("invoiceCode", getInvoiceCode())
.append("clientId", getClientId())
.append("clientCode", getClientCode())
.append("clientName", getClientName())
.append("clientNick", getClientNick())
.append("packageLength", getPackageLength())
.append("packageWidth", getPackageWidth())
.append("packageHeight", getPackageHeight())
.append("sizeUnit", getSizeUnit())
.append("netWeight", getNetWeight())
.append("crossWeight", getCrossWeight())
.append("weightUnit", getWeightUnit())
.append("inspector", getInspector())
.append("inspectorName", getInspectorName())
.append("enableFlag", getEnableFlag())
.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();
}
}

View File

@ -0,0 +1,68 @@
package com.ktg.mes.wm.mapper;
import java.util.List;
import com.ktg.mes.wm.domain.WmPackage;
/**
* 装箱单Mapper接口
*
* @author yinjinlu
* @date 2022-10-10
*/
public interface WmPackageMapper
{
/**
* 查询装箱单
*
* @param packageId 装箱单主键
* @return 装箱单
*/
public WmPackage selectWmPackageByPackageId(Long packageId);
/**
* 查询装箱单列表
*
* @param wmPackage 装箱单
* @return 装箱单集合
*/
public List<WmPackage> selectWmPackageList(WmPackage wmPackage);
/**
* 检查装箱单编号是否唯一
* @param wmPackage
* @return
*/
public WmPackage checkPackgeCodeUnique(WmPackage wmPackage);
/**
* 新增装箱单
*
* @param wmPackage 装箱单
* @return 结果
*/
public int insertWmPackage(WmPackage wmPackage);
/**
* 修改装箱单
*
* @param wmPackage 装箱单
* @return 结果
*/
public int updateWmPackage(WmPackage wmPackage);
/**
* 删除装箱单
*
* @param packageId 装箱单主键
* @return 结果
*/
public int deleteWmPackageByPackageId(Long packageId);
/**
* 批量删除装箱单
*
* @param packageIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteWmPackageByPackageIds(Long[] packageIds);
}

View File

@ -0,0 +1,68 @@
package com.ktg.mes.wm.service;
import java.util.List;
import com.ktg.mes.wm.domain.WmPackage;
/**
* 装箱单Service接口
*
* @author yinjinlu
* @date 2022-10-10
*/
public interface IWmPackageService
{
/**
* 查询装箱单
*
* @param packageId 装箱单主键
* @return 装箱单
*/
public WmPackage selectWmPackageByPackageId(Long packageId);
/**
* 查询装箱单列表
*
* @param wmPackage 装箱单
* @return 装箱单集合
*/
public List<WmPackage> selectWmPackageList(WmPackage wmPackage);
/**
* 检查装箱单编号是否唯一
* @param wmPackage
* @return
*/
public String checkPackgeCodeUnique(WmPackage wmPackage);
/**
* 新增装箱单
*
* @param wmPackage 装箱单
* @return 结果
*/
public int insertWmPackage(WmPackage wmPackage);
/**
* 修改装箱单
*
* @param wmPackage 装箱单
* @return 结果
*/
public int updateWmPackage(WmPackage wmPackage);
/**
* 批量删除装箱单
*
* @param packageIds 需要删除的装箱单主键集合
* @return 结果
*/
public int deleteWmPackageByPackageIds(Long[] packageIds);
/**
* 删除装箱单信息
*
* @param packageId 装箱单主键
* @return 结果
*/
public int deleteWmPackageByPackageId(Long packageId);
}

View File

@ -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.WmPackageMapper;
import com.ktg.mes.wm.domain.WmPackage;
import com.ktg.mes.wm.service.IWmPackageService;
/**
* 装箱单Service业务层处理
*
* @author yinjinlu
* @date 2022-10-10
*/
@Service
public class WmPackageServiceImpl implements IWmPackageService
{
@Autowired
private WmPackageMapper wmPackageMapper;
/**
* 查询装箱单
*
* @param packageId 装箱单主键
* @return 装箱单
*/
@Override
public WmPackage selectWmPackageByPackageId(Long packageId)
{
return wmPackageMapper.selectWmPackageByPackageId(packageId);
}
/**
* 查询装箱单列表
*
* @param wmPackage 装箱单
* @return 装箱单
*/
@Override
public List<WmPackage> selectWmPackageList(WmPackage wmPackage)
{
return wmPackageMapper.selectWmPackageList(wmPackage);
}
@Override
public String checkPackgeCodeUnique(WmPackage wmPackage) {
WmPackage pack = wmPackageMapper.checkPackgeCodeUnique(wmPackage);
Long packgeId = wmPackage.getPackageId() ==null?-1L:wmPackage.getPackageId();
if(StringUtils.isNotNull(pack) && packgeId.longValue()!=pack.getPackageId()){
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 新增装箱单
*
* @param wmPackage 装箱单
* @return 结果
*/
@Override
public int insertWmPackage(WmPackage wmPackage)
{
wmPackage.setCreateTime(DateUtils.getNowDate());
return wmPackageMapper.insertWmPackage(wmPackage);
}
/**
* 修改装箱单
*
* @param wmPackage 装箱单
* @return 结果
*/
@Override
public int updateWmPackage(WmPackage wmPackage)
{
wmPackage.setUpdateTime(DateUtils.getNowDate());
return wmPackageMapper.updateWmPackage(wmPackage);
}
/**
* 批量删除装箱单
*
* @param packageIds 需要删除的装箱单主键
* @return 结果
*/
@Override
public int deleteWmPackageByPackageIds(Long[] packageIds)
{
return wmPackageMapper.deleteWmPackageByPackageIds(packageIds);
}
/**
* 删除装箱单信息
*
* @param packageId 装箱单主键
* @return 结果
*/
@Override
public int deleteWmPackageByPackageId(Long packageId)
{
return wmPackageMapper.deleteWmPackageByPackageId(packageId);
}
}

View File

@ -0,0 +1,207 @@
<?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.WmPackageMapper">
<resultMap type="WmPackage" id="WmPackageResult">
<result property="packageId" column="package_id" />
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="packageCode" column="package_code" />
<result property="barcodeId" column="barcode_id" />
<result property="barcodeContent" column="barcode_content" />
<result property="barcodeUrl" column="barcode_url" />
<result property="packageDate" column="package_date" />
<result property="soCode" column="so_code" />
<result property="invoiceCode" column="invoice_code" />
<result property="clientId" column="client_id" />
<result property="clientCode" column="client_code" />
<result property="clientName" column="client_name" />
<result property="clientNick" column="client_nick" />
<result property="packageLength" column="package_length" />
<result property="packageWidth" column="package_width" />
<result property="packageHeight" column="package_height" />
<result property="sizeUnit" column="size_unit" />
<result property="netWeight" column="net_weight" />
<result property="crossWeight" column="cross_weight" />
<result property="weightUnit" column="weight_unit" />
<result property="inspector" column="inspector" />
<result property="inspectorName" column="inspector_name" />
<result property="enableFlag" column="enable_flag" />
<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="selectWmPackageVo">
select package_id, parent_id, ancestors, package_code, barcode_id, barcode_content, barcode_url, package_date, so_code, invoice_code, client_id, client_code, client_name, client_nick, package_length, package_width, package_height, size_unit, net_weight, cross_weight, weight_unit, inspector, inspector_name, enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_package
</sql>
<select id="selectWmPackageList" parameterType="WmPackage" resultMap="WmPackageResult">
<include refid="selectWmPackageVo"/>
<where>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
<if test="packageCode != null and packageCode != ''"> and package_code = #{packageCode}</if>
<if test="barcodeId != null "> and barcode_id = #{barcodeId}</if>
<if test="barcodeContent != null and barcodeContent != ''"> and barcode_content = #{barcodeContent}</if>
<if test="barcodeUrl != null and barcodeUrl != ''"> and barcode_url = #{barcodeUrl}</if>
<if test="packageDate != null "> and package_date = #{packageDate}</if>
<if test="soCode != null and soCode != ''"> and so_code = #{soCode}</if>
<if test="invoiceCode != null and invoiceCode != ''"> and invoice_code = #{invoiceCode}</if>
<if test="clientId != null "> and client_id = #{clientId}</if>
<if test="clientCode != null and clientCode != ''"> and client_code = #{clientCode}</if>
<if test="clientName != null and clientName != ''"> and client_name like concat('%', #{clientName}, '%')</if>
<if test="clientNick != null and clientNick != ''"> and client_nick = #{clientNick}</if>
<if test="packageLength != null "> and package_length = #{packageLength}</if>
<if test="packageWidth != null "> and package_width = #{packageWidth}</if>
<if test="packageHeight != null "> and package_height = #{packageHeight}</if>
<if test="sizeUnit != null and sizeUnit != ''"> and size_unit = #{sizeUnit}</if>
<if test="netWeight != null "> and net_weight = #{netWeight}</if>
<if test="crossWeight != null "> and cross_weight = #{crossWeight}</if>
<if test="weightUnit != null and weightUnit != ''"> and weight_unit = #{weightUnit}</if>
<if test="inspector != null and inspector != ''"> and inspector = #{inspector}</if>
<if test="inspectorName != null and inspectorName != ''"> and inspector_name like concat('%', #{inspectorName}, '%')</if>
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
</where>
</select>
<select id="selectWmPackageByPackageId" parameterType="Long" resultMap="WmPackageResult">
<include refid="selectWmPackageVo"/>
where package_id = #{packageId}
</select>
<select id="checkPackgeCodeUnique" parameterType="WmPackage" resultMap="WmPackageResult">
<include refid="selectWmPackageVo"/>
where package_code = #{packageCode}
</select>
<insert id="insertWmPackage" parameterType="WmPackage" useGeneratedKeys="true" keyProperty="packageId">
insert into wm_package
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentId != null">parent_id,</if>
<if test="ancestors != null and ancestors != ''">ancestors,</if>
<if test="packageCode != null">package_code,</if>
<if test="barcodeId != null">barcode_id,</if>
<if test="barcodeContent != null">barcode_content,</if>
<if test="barcodeUrl != null">barcode_url,</if>
<if test="packageDate != null">package_date,</if>
<if test="soCode != null">so_code,</if>
<if test="invoiceCode != null">invoice_code,</if>
<if test="clientId != null">client_id,</if>
<if test="clientCode != null">client_code,</if>
<if test="clientName != null">client_name,</if>
<if test="clientNick != null">client_nick,</if>
<if test="packageLength != null">package_length,</if>
<if test="packageWidth != null">package_width,</if>
<if test="packageHeight != null">package_height,</if>
<if test="sizeUnit != null">size_unit,</if>
<if test="netWeight != null">net_weight,</if>
<if test="crossWeight != null">cross_weight,</if>
<if test="weightUnit != null">weight_unit,</if>
<if test="inspector != null">inspector,</if>
<if test="inspectorName != null">inspector_name,</if>
<if test="enableFlag != null">enable_flag,</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="parentId != null">#{parentId},</if>
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="packageCode != null">#{packageCode},</if>
<if test="barcodeId != null">#{barcodeId},</if>
<if test="barcodeContent != null">#{barcodeContent},</if>
<if test="barcodeUrl != null">#{barcodeUrl},</if>
<if test="packageDate != null">#{packageDate},</if>
<if test="soCode != null">#{soCode},</if>
<if test="invoiceCode != null">#{invoiceCode},</if>
<if test="clientId != null">#{clientId},</if>
<if test="clientCode != null">#{clientCode},</if>
<if test="clientName != null">#{clientName},</if>
<if test="clientNick != null">#{clientNick},</if>
<if test="packageLength != null">#{packageLength},</if>
<if test="packageWidth != null">#{packageWidth},</if>
<if test="packageHeight != null">#{packageHeight},</if>
<if test="sizeUnit != null">#{sizeUnit},</if>
<if test="netWeight != null">#{netWeight},</if>
<if test="crossWeight != null">#{crossWeight},</if>
<if test="weightUnit != null">#{weightUnit},</if>
<if test="inspector != null">#{inspector},</if>
<if test="inspectorName != null">#{inspectorName},</if>
<if test="enableFlag != null">#{enableFlag},</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="updateWmPackage" parameterType="WmPackage">
update wm_package
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
<if test="packageCode != null">package_code = #{packageCode},</if>
<if test="barcodeId != null">barcode_id = #{barcodeId},</if>
<if test="barcodeContent != null">barcode_content = #{barcodeContent},</if>
<if test="barcodeUrl != null">barcode_url = #{barcodeUrl},</if>
<if test="packageDate != null">package_date = #{packageDate},</if>
<if test="soCode != null">so_code = #{soCode},</if>
<if test="invoiceCode != null">invoice_code = #{invoiceCode},</if>
<if test="clientId != null">client_id = #{clientId},</if>
<if test="clientCode != null">client_code = #{clientCode},</if>
<if test="clientName != null">client_name = #{clientName},</if>
<if test="clientNick != null">client_nick = #{clientNick},</if>
<if test="packageLength != null">package_length = #{packageLength},</if>
<if test="packageWidth != null">package_width = #{packageWidth},</if>
<if test="packageHeight != null">package_height = #{packageHeight},</if>
<if test="sizeUnit != null">size_unit = #{sizeUnit},</if>
<if test="netWeight != null">net_weight = #{netWeight},</if>
<if test="crossWeight != null">cross_weight = #{crossWeight},</if>
<if test="weightUnit != null">weight_unit = #{weightUnit},</if>
<if test="inspector != null">inspector = #{inspector},</if>
<if test="inspectorName != null">inspector_name = #{inspectorName},</if>
<if test="enableFlag != null">enable_flag = #{enableFlag},</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 package_id = #{packageId}
</update>
<delete id="deleteWmPackageByPackageId" parameterType="Long">
delete from wm_package where package_id = #{packageId}
</delete>
<delete id="deleteWmPackageByPackageIds" parameterType="String">
delete from wm_package where package_id in
<foreach item="packageId" collection="array" open="(" separator="," close=")">
#{packageId}
</foreach>
</delete>
</mapper>