You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

430 lines
16 KiB
XML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?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="org.dromara.wms.mapper.WmsShippingBillMapper">
<resultMap type="org.dromara.wms.domain.vo.WmsShippingBillVo" id="WmsShippingBillResult">
</resultMap>
<select id="selectCustomWmsShippingBillVoList" resultMap="WmsShippingBillResult">
select t.shipping_bill_id, t.tenant_id, t.shipping_code, t.shipping_type,
t.shipping_mode, t.bind_type, t.project_id, t.project_code,
t.project_name, t.customer_id, t.customer_contact_id, t.customer_name,
t.shipping_address, t.inventory_amount, t.source_bill_type, t.source_bill_id,
t.source_bill_code, t.contract_id, t.contract_code, t.contract_name,
c.order_contract_code as orderContractCode,
t.supplier, t.supplier_id, t.contact_user, t.contact_number, t.receiver_name, t.receiver_phone, t.logistics_company, t.tracking_no, t.logistics_phone, t.directions, t.plan_arrival_time, t.shipping_time, t.received_time, t.completed_time, t.out_stock_bill_status, t.flow_status, t.shipping_status, t.warehouse_id, t.warehouse_name, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
from wms_shipping_bill t
left join erp_contract_info c on t.contract_id = c.contract_id
${ew.getCustomSqlSegment}
</select>
<!-- 根据ID查询详情联查合同获取SAP订单号 -->
<select id="selectCustomWmsShippingBillVoById" resultMap="WmsShippingBillResult">
select t.shipping_bill_id, t.tenant_id, t.shipping_code, t.shipping_type,
t.shipping_mode, t.bind_type, t.project_id, t.project_code, t.project_name,
t.customer_id, t.customer_contact_id, t.customer_name, t.shipping_address,
t.inventory_amount, t.source_bill_type, t.source_bill_id, t.source_bill_code,
t.contract_id, t.contract_code, t.contract_name,
c.order_contract_code as orderContractCode,
t.supplier, t.supplier_id, t.contact_user,
t.contact_number, t.receiver_name, t.receiver_phone, t.logistics_company, t.tracking_no, t.logistics_phone, t.directions, t.plan_arrival_time, t.shipping_time, t.received_time, t.completed_time, t.out_stock_bill_status, t.flow_status, t.shipping_status, t.warehouse_id, t.warehouse_name, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
from wms_shipping_bill t
left join erp_contract_info c on t.contract_id = c.contract_id
where t.shipping_bill_id = #{shippingBillId}
</select>
<!-- 批量查询 - 根据ID列表联查合同获取SAP订单号 -->
<select id="selectCustomWmsShippingBillVoByIds" resultMap="WmsShippingBillResult">
select t.shipping_bill_id, t.tenant_id, t.shipping_code, t.shipping_type,
t.shipping_mode, t.bind_type, t.project_id, t.project_code, t.project_name,
t.customer_id, t.customer_contact_id, t.customer_name, t.shipping_address,
t.inventory_amount, t.source_bill_type, t.source_bill_id, t.source_bill_code,
t.contract_id, t.contract_code, t.contract_name,
c.order_contract_code as orderContractCode,
t.supplier, t.supplier_id, t.contact_user, t.contact_number, t.receiver_name,
t.receiver_phone, t.logistics_company, t.tracking_no, t.logistics_phone, t.directions,
t.plan_arrival_time, t.shipping_time, t.received_time, t.completed_time,
t.out_stock_bill_status, t.flow_status, t.shipping_status, t.warehouse_id, t.warehouse_name, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
from wms_shipping_bill t
left join erp_contract_info c on t.contract_id = c.contract_id
where t.shipping_bill_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<!-- 统计查询 -->
<select id="countCustomWmsShippingBill" resultType="java.lang.Long">
select count(1) from wms_shipping_bill t
${ew.getCustomSqlSegment}
</select>
<!-- 分页查询带自定义条件联查合同获取SAP订单号 -->
<select id="selectCustomWmsShippingBillVoPage" resultMap="WmsShippingBillResult">
select t.shipping_bill_id, t.tenant_id, t.shipping_code, t.shipping_type, t.shipping_mode, t.bind_type, t.project_id, t.project_code, t.project_name, t.customer_id, t.customer_contact_id, t.customer_name, t.shipping_address, t.inventory_amount, t.source_bill_type, t.source_bill_id, t.source_bill_code, t.contract_id, t.contract_code, t.contract_name, c.order_contract_code as orderContractCode, t.supplier, t.supplier_id, t.contact_user, t.contact_number, t.receiver_name, t.receiver_phone, t.logistics_company, t.tracking_no, t.logistics_phone, t.directions, t.plan_arrival_time, t.shipping_time, t.received_time, t.completed_time, t.out_stock_bill_status, t.flow_status, t.shipping_status, t.warehouse_id, t.warehouse_name, t.remark, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
from wms_shipping_bill t
left join erp_contract_info c on t.contract_id = c.contract_id
${ew.getCustomSqlSegment}
</select>
<!-- 批量插入 -->
<insert id="batchInsertWmsShippingBill">
insert into wms_shipping_bill(
tenant_id,
shipping_code,
shipping_type,
shipping_mode,
bind_type,
project_id,
project_code,
project_name,
customer_id,
customer_contact_id,
customer_name,
shipping_address,
inventory_amount,
source_bill_type,
source_bill_id,
source_bill_code,
contract_id,
contract_code,
contract_name,
supplier,
supplier_id,
contact_user,
contact_number,
receiver_name,
receiver_phone,
logistics_company,
tracking_no,
logistics_phone,
directions,
plan_arrival_time,
shipping_time,
received_time,
completed_time,
out_stock_bill_status,
flow_status,
shipping_status,
warehouse_id,
warehouse_name,
remark,
del_flag,
create_dept,
create_by,
create_time,
update_by,
update_time
)
values
<foreach collection="list" item="item" separator=",">
(
#{item.tenantId},
#{item.shippingCode},
#{item.shippingType},
#{item.shippingMode},
#{item.bindType},
#{item.projectId},
#{item.projectCode},
#{item.projectName},
#{item.customerId},
#{item.customerContactId},
#{item.customerName},
#{item.shippingAddress},
#{item.inventoryAmount},
#{item.sourceBillType},
#{item.sourceBillId},
#{item.sourceBillCode},
#{item.contractId},
#{item.contractCode},
#{item.contractName},
#{item.supplier},
#{item.supplierId},
#{item.contactUser},
#{item.contactNumber},
#{item.receiverName},
#{item.receiverPhone},
#{item.logisticsCompany},
#{item.trackingNo},
#{item.logisticsPhone},
#{item.directions},
#{item.planArrivalTime},
#{item.shippingTime},
#{item.receivedTime},
#{item.completedTime},
#{item.outStockBillStatus},
#{item.flowStatus},
#{item.shippingStatus},
#{item.warehouseId},
#{item.warehouseName},
#{item.remark},
#{item.delFlag},
#{item.createDept},
#{item.createBy},
#{item.createTime},
#{item.updateBy},
#{item.updateTime}
)
</foreach>
</insert>
<!-- 批量更新 -->
<update id="batchUpdateWmsShippingBill">
<foreach collection="list" item="item" separator=";">
update wms_shipping_bill t
<set>
<if test="item.tenantId != null and item.tenantId != ''">
t.tenant_id = #{item.tenantId},
</if>
<if test="item.shippingCode != null and item.shippingCode != ''">
t.shipping_code = #{item.shippingCode},
</if>
<if test="item.shippingType != null and item.shippingType != ''">
t.shipping_type = #{item.shippingType},
</if>
<if test="item.shippingMode != null and item.shippingMode != ''">
t.shipping_mode = #{item.shippingMode},
</if>
<if test="item.bindType != null and item.bindType != ''">
t.bind_type = #{item.bindType},
</if>
<if test="item.projectId != null">
t.project_id = #{item.projectId},
</if>
<if test="item.projectCode != null and item.projectCode != ''">
t.project_code = #{item.projectCode},
</if>
<if test="item.projectName != null and item.projectName != ''">
t.project_name = #{item.projectName},
</if>
<if test="item.customerId != null">
t.customer_id = #{item.customerId},
</if>
<if test="item.customerContactId != null">
t.customer_contact_id = #{item.customerContactId},
</if>
<if test="item.customerName != null and item.customerName != ''">
t.customer_name = #{item.customerName},
</if>
<if test="item.shippingAddress != null and item.shippingAddress != ''">
t.shipping_address = #{item.shippingAddress},
</if>
<if test="item.inventoryAmount != null and item.inventoryAmount != ''">
t.inventory_amount = #{item.inventoryAmount},
</if>
<if test="item.sourceBillType != null and item.sourceBillType != ''">
t.source_bill_type = #{item.sourceBillType},
</if>
<if test="item.sourceBillId != null">
t.source_bill_id = #{item.sourceBillId},
</if>
<if test="item.sourceBillCode != null and item.sourceBillCode != ''">
t.source_bill_code = #{item.sourceBillCode},
</if>
<if test="item.contractId != null">
t.contract_id = #{item.contractId},
</if>
<if test="item.contractCode != null and item.contractCode != ''">
t.contract_code = #{item.contractCode},
</if>
<if test="item.contractName != null and item.contractName != ''">
t.contract_name = #{item.contractName},
</if>
<if test="item.supplier != null and item.supplier != ''">
t.supplier = #{item.supplier},
</if>
<if test="item.supplierId != null">
t.supplier_id = #{item.supplierId},
</if>
<if test="item.contactUser != null and item.contactUser != ''">
t.contact_user = #{item.contactUser},
</if>
<if test="item.contactNumber != null and item.contactNumber != ''">
t.contact_number = #{item.contactNumber},
</if>
<if test="item.receiverName != null and item.receiverName != ''">
t.receiver_name = #{item.receiverName},
</if>
<if test="item.receiverPhone != null and item.receiverPhone != ''">
t.receiver_phone = #{item.receiverPhone},
</if>
<if test="item.logisticsCompany != null and item.logisticsCompany != ''">
t.logistics_company = #{item.logisticsCompany},
</if>
<if test="item.trackingNo != null and item.trackingNo != ''">
t.tracking_no = #{item.trackingNo},
</if>
<if test="item.logisticsPhone != null and item.logisticsPhone != ''">
t.logistics_phone = #{item.logisticsPhone},
</if>
<if test="item.directions != null and item.directions != ''">
t.directions = #{item.directions},
</if>
<if test="item.planArrivalTime != null">
t.plan_arrival_time = #{item.planArrivalTime},
</if>
<if test="item.shippingTime != null">
t.shipping_time = #{item.shippingTime},
</if>
<if test="item.receivedTime != null">
t.received_time = #{item.receivedTime},
</if>
<if test="item.completedTime != null">
t.completed_time = #{item.completedTime},
</if>
<if test="item.outStockBillStatus != null and item.outStockBillStatus != ''">
t.out_stock_bill_status = #{item.outStockBillStatus},
</if>
<if test="item.flowStatus != null and item.flowStatus != ''">
t.flow_status = #{item.flowStatus},
</if>
<if test="item.shippingStatus != null and item.shippingStatus != ''">
t.shipping_status = #{item.shippingStatus},
</if>
<if test="item.warehouseId != null">
t.warehouse_id = #{item.warehouseId},
</if>
<if test="item.warehouseName != null and item.warehouseName != ''">
t.warehouse_name = #{item.warehouseName},
</if>
<if test="item.remark != null and item.remark != ''">
t.remark = #{item.remark},
</if>
<if test="item.delFlag != null and item.delFlag != ''">
t.del_flag = #{item.delFlag},
</if>
<if test="item.createDept != null">
t.create_dept = #{item.createDept},
</if>
<if test="item.createBy != null">
t.create_by = #{item.createBy},
</if>
<if test="item.createTime != null">
t.create_time = #{item.createTime},
</if>
<if test="item.updateBy != null">
t.update_by = #{item.updateBy},
</if>
<if test="item.updateTime != null">
t.update_time = #{item.updateTime}
</if>
</set>
where t.shipping_bill_id = #{item.shippingBillId}
</foreach>
</update>
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomWmsShippingBill">
delete from wms_shipping_bill t
${ew.getCustomSqlSegment}
</delete>
<!-- 根据ID列表批量删除 -->
<delete id="deleteCustomWmsShippingBillByIds">
delete from wms_shipping_bill t
where t.shipping_bill_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 检查是否存在 -->
<select id="existsWmsShippingBill" resultType="java.lang.Boolean">
select count(1) > 0 from wms_shipping_bill t
${ew.getCustomSqlSegment}
</select>
</mapper>