集成oms服务模块

This commit is contained in:
hjx
2026-01-19 15:20:20 +08:00
parent 1837337488
commit 56356839bf
163 changed files with 16893 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
server:
port: 8017
management:
metrics:
web:
server:
auto-time-requests: false # 关闭自动检测
spring:
application:
name: mhd-oms-service
profiles:
active:
main:
allow-circular-references: true
# nacos配置
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
# 演示环境
# server-addr: 47.92.229.169:8848
# 测试开发环境
# server-addr: 192.168.10.18:8848
# Saas环境
# server-addr: 8.130.64.92:8848
# ip: 118.25.4.55
# 大运通泰生产环境
# server-addr: 39.107.137.158:8848
# 线上测试环境
# server-addr: 116.204.23.92:8848
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
# 演示环境
# server-addr: 47.92.229.169:8848
# 测试开发环境
# server-addr: 192.168.10.18:8848
# Saas环境
# server-addr: 8.130.64.92:8848
# 大运通泰生产环境
# server-addr: 39.107.137.158:8848
# 线上测试环境
# server-addr: 116.204.23.92:8848
# 锁定server端的配置文件(读取它的配置项)
namespace: # 命名空间id
group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
file-extension: yml #默认properties
@@ -0,0 +1,70 @@
<?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.mhd.oms.domain.deliveryInfo.repository.mapper.DeliveryInfoMapper">
<resultMap type="com.mhd.oms.domain.deliveryInfo.repository.po.DeliveryInfoPO" id="DeliveryInfoResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="orderId" column="order_id" />
<result property="consigner" column="consigner" />
<result property="consignerPhone" column="consigner_phone" />
<result property="consignerAreaCode" column="consigner_area_code" />
<result property="consignerArea" column="consigner_area" />
<result property="consignerAddress" column="consigner_address" />
<result property="saddressLatLon" column="saddress_lat_lon" />
</resultMap>
<sql id="selectDeliveryInfoPo">
select id, create_by, create_time, update_by, update_time, del_flag, top_organization_id, organization_id, organization_name, order_id, consigner, consigner_phone, consigner_area_code, consigner_area, consigner_address, saddress_lat_lon from oms_delivery_info
</sql>
<sql id="selectDeliveryInfoPo1">
<where>
<if test="topOrganizationId != null ">
and top_organization_id = #{topOrganizationId}
</if>
<if test="organizationId != null ">
and organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="orderId != null ">
and order_id = #{orderId}
</if>
<if test="consigner != null and consigner != ''">
and consigner = #{consigner}
</if>
<if test="consignerPhone != null and consignerPhone != ''">
and consigner_phone = #{consignerPhone}
</if>
<if test="consignerAreaCode != null and consignerAreaCode != ''">
and consigner_area_code = #{consignerAreaCode}
</if>
<if test="consignerArea != null and consignerArea != ''">
and consigner_area = #{consignerArea}
</if>
<if test="consignerAddress != null and consignerAddress != ''">
and consigner_address = #{consignerAddress}
</if>
<if test="saddressLatLon != null and saddressLatLon != ''">
and saddress_lat_lon = #{saddressLatLon}
</if>
</where>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.deliveryInfo.repository.todo.DeliveryInfoDO" resultMap="DeliveryInfoResult">
<include refid="selectDeliveryInfoPo"/>
<include refid="selectDeliveryInfoPo1"/>
</select>
</mapper>
@@ -0,0 +1,140 @@
<?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.mhd.oms.domain.goods.repository.mapper.GoodsMapper">
<resultMap type="com.mhd.oms.domain.goods.repository.po.GoodsPO" id="GoodsResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="delFlag" column="del_flag" />
<result property="orderId" column="order_id" />
<result property="goodsNo" column="goods_no" />
<result property="goodsName" column="goods_name" />
<result property="packingSize" column="packing_size" />
<result property="supportUnitId" column="support_unit_id" />
<result property="supportUnit" column="support_unit" />
<result property="supportUnitQuantity" column="support_unit_quantity" />
<result property="materialUnitEa" column="material_unit_ea" />
<result property="materialUnitEaQuantity" column="material_unit_ea_quantity" />
<result property="unitPrice" column="unit_price" />
<result property="taxUnitPrice" column="tax_unit_price" />
<result property="taxRate" column="tax_rate" />
<result property="taxes" column="taxes" />
<result property="amount" column="amount" />
<result property="taxAmount" column="tax_amount" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectGoodsPo">
select
a.id,
a.goods_name,
a.goods_no,
a.packing_size,
a.support_unit_id,
a.support_unit,
a.support_unit_quantity,
a.material_unit_ea,
a.material_unit_ea_quantity,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.top_organization_id,
a.organization_id,
a.organization_name,
a.del_flag,
a.order_id,
a.unit_price,
a.tax_unit_price,
a.tax_rate,
a.taxes,
a.amount,
a.tax_amount,
sum(case task.task_status when 2 then task.plan_num else 0 end) completeNum, -- 物料完成数量
1234567890 stockUsableNum,
a.remark
FROM
oms_goods a
left join oms_task_order task on a.id = task.goods_id and task.del_flag = 1 -- 作业任务(未删除)
left join oms_scm_order scm on a.order_id = scm.order_id and scm.del_flag = 1 -- 供应链订单(未删除)
</sql>
<sql id="selectGoodsPo1">
<where>
a.del_flag = 1
<if test="topOrganizationId != null ">
and a.top_organization_id = #{topOrganizationId}
</if>
<if test="organizationId != null ">
and a.organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and a.organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="orderId != null ">
and a.order_id = #{orderId}
</if>
<if test="goodsNo != null and goodsNo != ''">
and a.goods_no = #{goodsNo}
</if>
<if test="goodsName != null and goodsName != ''">
and a.goods_name like concat('%', #{goodsName}, '%')
</if>
<if test="packingSize != null and packingSize != ''">
and a.packing_size = #{packingSize}
</if>
<if test="supportUnitId != null and supportUnitId != ''">
and a.support_unit_id = #{supportUnitId}
</if>
<if test="supportUnit != null and supportUnit != ''">
and a.support_unit = #{supportUnit}
</if>
<if test="materialUnitEa != null and materialUnitEa != ''">
and a.material_unit_ea = #{materialUnitEa}
</if>
<if test="unitPrice != null ">
and a.unit_price = #{unitPrice}
</if>
<if test="taxUnitPrice != null ">
and a.tax_unit_price = #{taxUnitPrice}
</if>
<if test="taxRate != null ">
and a.tax_rate = #{taxRate}
</if>
<if test="taxes != null ">
and a.taxes = #{taxes}
</if>
<if test="amount != null ">
and a.amount = #{amount}
</if>
<if test="taxAmount != null ">
and a.tax_amount = #{taxAmount}
</if>
<if test="scmId != null ">
and scm.id = #{scmId}
</if>
<if test="idList != null">
and a.id in
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.goods.repository.todo.GoodsDO" resultMap="GoodsResult">
<include refid="selectGoodsPo"/>
<include refid="selectGoodsPo1"/>
GROUP BY
a.id
</select>
</mapper>
@@ -0,0 +1,106 @@
<?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.mhd.oms.domain.interceptOrder.repository.mapper.InterceptOrderMapper">
<resultMap type="com.mhd.oms.domain.interceptOrder.repository.po.InterceptOrderPO" id="InterceptOrderResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createByName" column="create_by_name" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateByName" column="update_by_name" />
<result property="updateTime" column="update_time" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="delFlag" column="del_flag" />
<result property="orderId" column="order_id" />
<result property="interceptState" column="intercept_state" />
<result property="interceptBy" column="intercept_by" />
<result property="interceptByName" column="intercept_by_name" />
<result property="interceptTime" column="intercept_time" />
<result property="failCause" column="fail_cause" />
<result property="taskNos" column="task_nos" />
<result property="customerOrders" column="customer_orders" />
<result property="orderType" column="order_type" />
<result property="jobTaskType" column="job_task_type" />
<result property="deliverySystem" column="delivery_system" />
</resultMap>
<sql id="selectInterceptOrderPo">
SELECT
a.id,
a.create_by,
a.create_by_name,
a.create_time,
a.update_by,
a.update_by_name,
a.update_time,
a.top_organization_id,
a.organization_id,
a.organization_name,
a.del_flag,
a.order_id,
a.intercept_state,
a.intercept_by,
a.intercept_by_name,
a.intercept_time,
a.fail_cause,
a.task_nos,
b.customer_orders,
b.order_type,
b.job_task_type,
b.delivery_system
FROM
oms_intercept_order a
left join oms_purchase_order b on a.order_id = b.id
where a.del_flag = 1
</sql>
<sql id="selectInterceptOrderPo1">
<!-- <if test="createByName != null and createByName != ''">-->
<!-- and a.create_by_name like concat('%', #{createByName}, '%')-->
<!-- </if>-->
<!-- <if test="updateByName != null and updateByName != ''">-->
<!-- and a.update_by_name like concat('%', #{updateByName}, '%')-->
<!-- </if>-->
<if test="topOrganizationId != null ">
and a.top_organization_id = #{topOrganizationId}
</if>
<if test="organizationId != null ">
and a.organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and a.organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="orderId != null ">
and a.order_id = #{orderId}
</if>
<if test="interceptState != null ">
and a.intercept_state = #{interceptState}
</if>
<if test="interceptBy != null and interceptBy != ''">
and a.intercept_by = #{interceptBy}
</if>
<if test="interceptByName != null and interceptByName != ''">
and a.intercept_by_name like concat('%', #{interceptByName}, '%')
</if>
<if test="interceptTime != null ">
and a.intercept_time = #{interceptTime}
</if>
<if test="failCause != null and failCause != ''">
and a.fail_cause = #{failCause}
</if>
<if test="taskNos != null and taskNos != ''">
and a.task_nos = #{taskNos}
</if>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.interceptOrder.repository.todo.InterceptOrderDO" resultMap="InterceptOrderResult">
<include refid="selectInterceptOrderPo"/>
<include refid="selectInterceptOrderPo1"/>
</select>
</mapper>
@@ -0,0 +1,82 @@
<?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.mhd.oms.domain.logistics.repository.mapper.LogisticsMapper">
<resultMap type="com.mhd.oms.domain.logistics.repository.po.LogisticsPO" id="LogisticsResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="orderId" column="order_id" />
<result property="shippingTypeId" column="shipping_type_id" />
<result property="shippingType" column="shipping_type" />
<result property="carrierId" column="carrier_id" />
<result property="carrier" column="carrier" />
<result property="trackingNum" column="tracking_num" />
<result property="freightAmount" column="freight_amount" />
<result property="plateNum" column="plate_num" />
<result property="driverName" column="driver_name" />
<result property="driverPhone" column="driver_phone" />
</resultMap>
<sql id="selectLogisticsPo">
select id, create_by, create_time, update_by, update_time, del_flag, top_organization_id, organization_id, organization_name, order_id, shipping_type_id, shipping_type, carrier_id, carrier, tracking_num, freight_amount, plate_num, driver_name, driver_phone from oms_logistics
</sql>
<sql id="selectLogisticsPo1">
<where>
<if test="topOrganizationId != null ">
and top_organization_id = #{topOrganizationId}
</if>
<if test="organizationId != null ">
and organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="orderId != null ">
and order_id = #{orderId}
</if>
<if test="shippingTypeId != null and shippingTypeId != ''">
and shipping_type_id = #{shippingTypeId}
</if>
<if test="shippingType != null and shippingType != ''">
and shipping_type = #{shippingType}
</if>
<if test="carrierId != null ">
and carrier_id = #{carrierId}
</if>
<if test="carrier != null and carrier != ''">
and carrier = #{carrier}
</if>
<if test="trackingNum != null and trackingNum != ''">
and tracking_num = #{trackingNum}
</if>
<if test="freightAmount != null ">
and freight_amount = #{freightAmount}
</if>
<if test="plateNum != null and plateNum != ''">
and plate_num = #{plateNum}
</if>
<if test="driverName != null and driverName != ''">
and driver_name like concat('%', #{driverName}, '%')
</if>
<if test="driverPhone != null and driverPhone != ''">
and driver_phone = #{driverPhone}
</if>
</where>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.logistics.repository.todo.LogisticsDO" resultMap="LogisticsResult">
<include refid="selectLogisticsPo"/>
<include refid="selectLogisticsPo1"/>
</select>
</mapper>
@@ -0,0 +1,68 @@
<?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.mhd.oms.domain.orderType.repository.mapper.OrderTypeMapper">
<resultMap type="com.mhd.oms.domain.orderType.repository.po.OrderTypePO" id="OrderTypeResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createByName" column="create_by_name" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateByName" column="update_by_name" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="businessOrderTypeId" column="business_order_type_id" />
<result property="businessOrderType" column="business_order_type" />
<result property="jobTaskTypeId" column="job_task_type_id" />
<result property="jobTaskType" column="job_task_type" />
<result property="deliverySystemId" column="delivery_system_id" />
<result property="deliverySystem" column="delivery_system" />
<result property="orderTypeId" column="order_type_id" />
<result property="orderType" column="order_type" />
</resultMap>
<sql id="selectOrderTypePo">
select id, create_by,create_by_name, create_time, update_by, update_by_name, update_time, del_flag, top_organization_id, organization_id, organization_name, business_order_type_id, business_order_type, job_task_type_id, job_task_type, delivery_system_id, delivery_system, order_type_id, order_type from oms_order_type
where del_flag = 1
</sql>
<sql id="selectOrderTypePo1">
<if test="topOrganizationId != null ">
and top_organization_id = #{topOrganizationId}
</if>
<if test="organizationId != null ">
and organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="businessOrderType != null and businessOrderType != ''">
and business_order_type like concat('%', #{businessOrderType}, '%')
</if>
<if test="jobTaskTypeId != null and jobTaskTypeId != ''">
and job_task_type_id = #{jobTaskTypeId}
</if>
<if test="deliverySystemId != null and deliverySystemId != ''">
and delivery_system_id = #{deliverySystemId}
</if>
<if test="orderTypeId != null and orderTypeId != ''">
and order_type_id = #{orderTypeId}
</if>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.orderType.repository.todo.OrderTypeDO" resultMap="OrderTypeResult">
<include refid="selectOrderTypePo"/>
<include refid="selectOrderTypePo1"/>
</select>
<select id="listDict" resultType="com.mhd.oms.domain.orderType.repository.po.OrderTypeDictPO">
select id, business_order_type from oms_order_type
where del_flag = 1
</select>
</mapper>
@@ -0,0 +1,218 @@
<?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.mhd.oms.domain.purchaseOrder.repository.mapper.PurchaseOrderMapper">
<resultMap type="com.mhd.oms.domain.purchaseOrder.repository.po.PurchaseOrderPO" id="PurchaseOrderResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="auditBy" column="audit_by" />
<result property="auditTime" column="audit_time" />
<result property="auditState" column="audit_state" />
<result property="auditResult" column="audit_result" />
<result property="orderNo" column="order_no" />
<result property="orderState" column="order_state" />
<result property="supplierId" column="supplier_id" />
<result property="supplier" column="supplier" />
<result property="shipperId" column="shipper_id" />
<result property="shipper" column="shipper" />
<result property="orgId" column="org_id" />
<result property="org" column="org" />
<result property="orderTime" column="order_time" />
<result property="orderTypeId" column="order_type_id" />
<result property="orderType" column="order_type" />
<result property="jobTaskTypeId" column="job_task_type_id" />
<result property="jobTaskType" column="job_task_type" />
<result property="receivingWarehouseId" column="receiving_warehouse_id" />
<result property="receivingWarehouse" column="receiving_warehouse" />
<result property="deliveryDate" column="delivery_date" />
<result property="customerOrders" column="customer_orders" />
<result property="contractNo" column="contract_no" />
<result property="projectId" column="project_id" />
<result property="project" column="project" />
<result property="rateConcession" column="rate_concession" />
<result property="discountAmount" column="discount_amount" />
<result property="totalAmount" column="total_amount" />
<result property="fileName" column="file_name" />
<result property="fileUrl" column="file_url" />
<result property="source" column="source" />
<result property="tacklState" column="tackl_state" />
<result property="tacklTime" column="tackl_time" />
<result property="remark" column="remark" />
<result property="settlementObj" column="settlement_obj" />
<result property="settlementWay" column="settlement_way" />
<result property="payStatus" column="pay_status" />
<result property="totalPriceTax" column="total_price_tax" />
<result property="materialInfo" column="material_info" />
<result property="materialNum" column="material_num" />
<result property="inStorageNum" column="in_storage_num" />
</resultMap>
<sql id="selectPurchaseOrderPo">
SELECT
a.id,
a.create_by,
a.create_by_name,
a.create_time,
a.update_by,
a.update_by_name,
a.update_time,
a.del_flag,
a.top_organization_id,
a.organization_id,
a.organization_name,
a.audit_by,
a.audit_time,
a.audit_state,
a.audit_result,
a.order_no,
a.order_state,
a.supplier_id,
a.supplier,
a.shipper_id,
a.shipper,
a.org_id,
a.org,
a.order_time,
a.order_type_id,
a.order_type,
a.job_task_type_id,
a.job_task_type,
a.receiving_warehouse_id,
a.receiving_warehouse,
a.delivery_date,
a.customer_orders,
a.contract_no,
a.project_id,
a.project,
a.rate_concession,
a.discount_amount,
a.total_amount,
a.file_name,
a.file_url,
a.source,
a.tackl_state,
a.tackl_time,
a.remark,
a.total_price_tax,
a.material_info,
a.material_num,
a.in_storage_num,
b.settlement_obj,
b.settlement_way,
b.pay_status
FROM
oms_purchase_order a
LEFT JOIN oms_settlement b on a.id = b.order_id
WHERE
a.del_flag = 1
</sql>
<sql id="selectPurchaseOrderPo1">
<if test="topOrganizationId != null ">
and a.top_organization_id = #{topOrganizationId}
</if>
<if test="organizationId != null ">
and a.organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and a.organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="auditBy != null and auditBy != ''">
and a.audit_by = #{auditBy}
</if>
<if test="auditTime != null ">
and a.audit_time = #{auditTime}
</if>
<if test="auditState != null ">
and a.audit_state = #{auditState}
</if>
<if test="auditResult != null and auditResult != ''">
and a.audit_result = #{auditResult}
</if>
<if test="orderNo != null and orderNo != ''">
and a.order_no = #{orderNo}
</if>
<if test="orderState != null ">
and a.order_state = #{orderState}
</if>
<if test="supplierId != null ">
and a.supplier_id = #{supplierId}
</if>
<if test="supplier != null and supplier != ''">
and a.supplier = #{supplier}
</if>
<if test="shipperId != null ">
and a.shipper_id = #{shipperId}
</if>
<if test="shipper != null and shipper != ''">
and a.shipper = #{shipper}
</if>
<if test="orgId != null ">
and a.org_id = #{orgId}
</if>
<if test="org != null and org != ''">
and a.org = #{org}
</if>
<if test="orderTime != null ">
and a.order_time = #{orderTime}
</if>
<if test="orderTypeId != null ">
and a.order_type_id = #{orderTypeId}
</if>
<if test="orderType != null and orderType != ''">
and a.order_type = #{orderType}
</if>
<if test="jobTaskTypeId != null and jobTaskTypeId != ''">
and a.job_task_type_id = #{jobTaskTypeId}
</if>
<if test="jobTaskType != null and jobTaskType != ''">
and a.job_task_type = #{jobTaskType}
</if>
<if test="receivingWarehouseId != null ">
and a.receiving_warehouse_id = #{receivingWarehouseId}
</if>
<if test="receivingWarehouse != null and receivingWarehouse != ''">
and a.receiving_warehouse = #{receivingWarehouse}
</if>
<if test="deliveryDate != null ">
and a.delivery_date = #{deliveryDate}
</if>
<if test="customerOrders != null and customerOrders != ''">
and a.customer_orders = #{customerOrders}
</if>
<if test="contractNo != null and contractNo != ''">
and a.contract_no = #{contractNo}
</if>
<if test="projectId != null and projectId != ''">
and a.project_id = #{projectId}
</if>
<if test="project != null and project != ''">
and a.project = #{project}
</if>
<if test="tacklState != null ">
and a.tackl_state = #{tacklState}
</if>
<if test="tacklTime != null ">
and a.tackl_time = #{tacklTime}
</if>
<if test="source != null ">
and a.source = #{source}
</if>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.purchaseOrder.repository.todo.PurchaseOrderDO" resultMap="PurchaseOrderResult">
<include refid="selectPurchaseOrderPo"/>
<include refid="selectPurchaseOrderPo1"/>
</select>
</mapper>
@@ -0,0 +1,70 @@
<?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.mhd.oms.domain.receiptInfo.repository.mapper.ReceiptInfoMapper">
<resultMap type="com.mhd.oms.domain.receiptInfo.repository.po.ReceiptInfoPO" id="ReceiptInfoResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="orderId" column="order_id" />
<result property="consignee" column="consignee" />
<result property="consigneePhone" column="consignee_phone" />
<result property="consigneeAreaCode" column="consignee_area_code" />
<result property="consigneeArea" column="consignee_area" />
<result property="consigneeAddress" column="consignee_address" />
<result property="raddressLatLon" column="raddress_lat_lon" />
</resultMap>
<sql id="selectReceiptInfoPo">
select id, create_by, create_time, update_by, update_time, del_flag, top_organization_id, organization_id, organization_name, order_id, consignee, consignee_phone, consignee_area_code, consignee_area, consignee_address, raddress_lat_lon from oms_receipt_info
</sql>
<sql id="selectReceiptInfoPo1">
<where>
<if test="topOrganizationId != null ">
and top_organization_id = #{topOrganizationId}
</if>
<if test="organizationId != null ">
and organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="orderId != null ">
and order_id = #{orderId}
</if>
<if test="consignee != null and consignee != ''">
and consignee = #{consignee}
</if>
<if test="consigneePhone != null and consigneePhone != ''">
and consignee_phone = #{consigneePhone}
</if>
<if test="consigneeAreaCode != null and consigneeAreaCode != ''">
and consignee_area_code = #{consigneeAreaCode}
</if>
<if test="consigneeArea != null and consigneeArea != ''">
and consignee_area = #{consigneeArea}
</if>
<if test="consigneeAddress != null and consigneeAddress != ''">
and consignee_address = #{consigneeAddress}
</if>
<if test="raddressLatLon != null and raddressLatLon != ''">
and raddress_lat_lon = #{raddressLatLon}
</if>
</where>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.receiptInfo.repository.todo.ReceiptInfoDO" resultMap="ReceiptInfoResult">
<include refid="selectReceiptInfoPo"/>
<include refid="selectReceiptInfoPo1"/>
</select>
</mapper>
@@ -0,0 +1,191 @@
<?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.mhd.oms.domain.salesOrder.repository.mapper.SalesOrderMapper">
<resultMap type="com.mhd.oms.domain.salesOrder.repository.po.SalesOrderPO" id="SalesOrderResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createByName" column="create_by_name" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateByName" column="update_by_name" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="auditBy" column="audit_by" />
<result property="auditTime" column="audit_time" />
<result property="auditState" column="audit_state" />
<result property="auditResult" column="audit_result" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="orderNo" column="order_no" />
<result property="orderState" column="order_state" />
<result property="scoNo" column="sco_no" />
<result property="customerId" column="customer_id" />
<result property="customer" column="customer" />
<result property="totalAmount" column="total_amount" />
<result property="taxAmount" column="tax_amount" />
<result property="inStorageNum" column="in_storage_num" />
<result property="orderTypeId" column="order_type_id" />
<result property="orderType" column="order_type" />
<result property="shipperId" column="shipper_id" />
<result property="shipper" column="shipper" />
<result property="contractNo" column="contract_no" />
<result property="projectId" column="project_id" />
<result property="project" column="project" />
<result property="tacklState" column="tackl_state" />
<result property="tacklTime" column="tackl_time" />
<result property="source" column="source" />
<result property="orgId" column="org_id" />
<result property="org" column="org" />
<result property="orderTime" column="order_time" />
<result property="deliveryWarehouseId" column="delivery_warehouse_id" />
<result property="deliveryWarehouse" column="delivery_warehouse" />
<result property="deliveryDate" column="delivery_date" />
<result property="customerOrders" column="customer_orders" />
<result property="checkInventory" column="check_inventory" />
<result property="rateConcession" column="rate_concession" />
<result property="discountAmount" column="discount_amount" />
<result property="fileUrl" column="file_url" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSalesOrderPo">
select id, create_by, create_by_name, create_time, update_by, update_by_name, update_time, del_flag, audit_by, audit_time, audit_state, audit_result, top_organization_id, organization_id, organization_name, order_no, order_state, sco_no, customer_id, customer, total_amount, tax_amount, in_storage_num, order_type_id, order_type, shipper_id, shipper, contract_no, project_id, project, tackl_state, tackl_time, source, org_id, org, order_time, delivery_warehouse_id, delivery_warehouse, delivery_date, customer_orders, check_inventory, rate_concession, discount_amount, file_url, remark from oms_sales_order
where del_flag = 1
</sql>
<sql id="selectSalesOrderPo1">
<!-- <if test="createByName != null and createByName != ''">-->
<!-- and create_by_name like concat('%', #{createByName}, '%')-->
<!-- </if>-->
<!-- <if test="updateByName != null and updateByName != ''">-->
<!-- and update_by_name like concat('%', #{updateByName}, '%')-->
<!-- </if>-->
<if test="auditBy != null and auditBy != ''">
and audit_by = #{auditBy}
</if>
<if test="auditTime != null ">
and audit_time = #{auditTime}
</if>
<if test="auditState != null ">
and audit_state = #{auditState}
</if>
<if test="auditResult != null and auditResult != ''">
and audit_result = #{auditResult}
</if>
<if test="topOrganizationId != null ">
and top_organization_id = #{topOrganizationId}
</if>
<if test="organizationId != null ">
and organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="orderNo != null and orderNo != ''">
and order_no = #{orderNo}
</if>
<if test="orderState != null ">
and order_state = #{orderState}
</if>
<if test="scoNo != null and scoNo != ''">
and sco_no = #{scoNo}
</if>
<if test="customerId != null ">
and customer_id = #{customerId}
</if>
<if test="customer != null and customer != ''">
and customer = #{customer}
</if>
<if test="totalAmount != null ">
and total_amount = #{totalAmount}
</if>
<if test="taxAmount != null ">
and tax_amount = #{taxAmount}
</if>
<if test="inStorageNum != null ">
and in_storage_num = #{inStorageNum}
</if>
<if test="orderTypeId != null ">
and order_type_id = #{orderTypeId}
</if>
<if test="orderType != null and orderType != ''">
and order_type = #{orderType}
</if>
<if test="shipperId != null ">
and shipper_id = #{shipperId}
</if>
<if test="shipper != null and shipper != ''">
and shipper = #{shipper}
</if>
<if test="contractNo != null and contractNo != ''">
and contract_no = #{contractNo}
</if>
<if test="projectId != null and projectId != ''">
and project_id = #{projectId}
</if>
<if test="project != null and project != ''">
and project = #{project}
</if>
<if test="tacklState != null ">
and tackl_state = #{tacklState}
</if>
<if test="tacklTime != null ">
and tackl_time = #{tacklTime}
</if>
<if test="source != null ">
and source = #{source}
</if>
<if test="orgId != null ">
and org_id = #{orgId}
</if>
<if test="org != null and org != ''">
and org = #{org}
</if>
<if test="orderTime != null ">
and order_time = #{orderTime}
</if>
<if test="deliveryWarehouseId != null ">
and delivery_warehouse_id = #{deliveryWarehouseId}
</if>
<if test="deliveryWarehouse != null and deliveryWarehouse != ''">
and delivery_warehouse = #{deliveryWarehouse}
</if>
<if test="deliveryDate != null ">
and delivery_date = #{deliveryDate}
</if>
<if test="customerOrders != null and customerOrders != ''">
and customer_orders = #{customerOrders}
</if>
<if test="checkInventory != null ">
and check_inventory = #{checkInventory}
</if>
<if test="rateConcession != null ">
and rate_concession = #{rateConcession}
</if>
<if test="discountAmount != null ">
and discount_amount = #{discountAmount}
</if>
<if test="fileUrl != null and fileUrl != ''">
and file_url = #{fileUrl}
</if>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.salesOrder.repository.todo.SalesOrderDO" resultMap="SalesOrderResult">
<include refid="selectSalesOrderPo"/>
<include refid="selectSalesOrderPo1"/>
</select>
<select id="getInfosById" parameterType="java.util.List" resultType="com.mhd.oms.domain.salesOrder.repository.po.SalesOrderPO">
select id, create_by, create_by_name, create_time, update_by, update_by_name, update_time, del_flag, audit_by, audit_time, audit_state, audit_result, top_organization_id, organization_id, organization_name, order_no, order_state, sco_no, customer_id, customer, total_amount, tax_amount, in_storage_num, order_type_id, order_type, shipper_id, shipper, contract_no, project_id, project, tackl_state, tackl_time, source, org_id, org, order_time, delivery_warehouse_id, delivery_warehouse, delivery_date, customer_orders, check_inventory, rate_concession, discount_amount, file_url, remark from oms_sales_order
where del_flag = 1
and id in
<foreach item="id" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>
@@ -0,0 +1,123 @@
<?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.mhd.oms.domain.scmOrder.repository.mapper.ScmOrderMapper">
<resultMap type="com.mhd.oms.domain.scmOrder.repository.po.ScmOrderPO" id="ScmOrderResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createByName" column="create_by_name" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateByName" column="update_by_name" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="scmSource" column="scm_source" />
<result property="orderId" column="order_id" />
<result property="scmNo" column="scm_no" />
<result property="orderState" column="order_state" />
<result property="taskNum" column="task_num" />
<result property="activeTaskNum" column="active_task_num" />
<result property="finishTaskNum" column="finish_task_num" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectScmOrderPo">
select id, create_by, create_by_name, create_time, update_by, update_by_name, update_time, del_flag, top_organization_id, organization_id, organization_name, scm_source, order_id, scm_no, order_state, task_num, active_task_num, finish_task_num, remark from oms_scm_order
where del_flag = 1
</sql>
<sql id="selectScmOrderPo1">
<if test="topOrganizationId != null ">
and top_organization_id = #{topOrganizationId}
</if>
<if test="organizationId != null ">
and organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="scmSource != null ">
and scm_source = #{scmSource}
</if>
<if test="orderId != null ">
and order_id = #{orderId}
</if>
<if test="scmNo != null and scmNo != ''">
and scm_no = #{scmNo}
</if>
<if test="orderState != null ">
and order_state = #{orderState}
</if>
<if test="taskNum != null ">
and task_num = #{taskNum}
</if>
<if test="activeTaskNum != null ">
and active_task_num = #{activeTaskNum}
</if>
<if test="finishTaskNum != null ">
and finish_task_num = #{finishTaskNum}
</if>
<if test="idList != null">
and id in
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.scmOrder.repository.todo.ScmOrderDO" resultMap="ScmOrderResult">
<include refid="selectScmOrderPo"/>
<include refid="selectScmOrderPo1"/>
</select>
<update id="batchUpdateOrderState">
UPDATE oms_scm_order
set
order_state = #{orderState},
update_by = #{userPo.userId},
update_by_name = #{userPo.userName},
update_time = now()
WHERE
del_flag = 1
and id IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<select id="getGoodsAndTaskInfoList" resultType="com.mhd.oms.domain.scmOrder.repository.po.ScmOrderPO">
select
a.id,
a.scm_no,
a.order_id,
a.order_state,
a.scm_source,
goods.id goodsId,
goods.goods_name,
ifnull(goods.material_unit_ea_quantity, 0) totalGoodsNum, -- 总物料数量
ifnull(sum(task.plan_num), 0) existedGoodsNum, -- 已生成物料数量
case a.scm_source when 1 then pur.receiving_warehouse_id when 2 then sales.delivery_warehouse_id else '异常订单来源' end warehouseId,
case a.scm_source when 1 then pur.receiving_warehouse when 2 then sales.delivery_warehouse else '异常订单来源' end warehouseName,
case a.scm_source when 1 then pur.job_task_type_id when 2 then sales.job_task_type_id else '异常订单来源' end jobTaskTypeId,
case a.scm_source when 1 then pur.job_task_type when 2 then sales.job_task_type else '异常订单来源' end jobTaskType
FROM
oms_scm_order a
left join oms_purchase_order pur on a.order_id = pur.id and pur.del_flag = 1
left join oms_sales_order sales on a.order_id = sales.id and sales.del_flag = 1
left join oms_goods goods on a.order_id = goods.order_id and goods.del_flag = 1
left join oms_task_order task on goods.order_id = task.order_id and goods.id = task.goods_id and task.del_flag = 1 and task.task_status in (0,1,2)
where
a.del_flag = 1
and a.id IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
group by goods.id
</select>
</mapper>
@@ -0,0 +1,99 @@
<?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.mhd.oms.domain.settlement.repository.mapper.SettlementMapper">
<resultMap type="com.mhd.oms.domain.settlement.repository.po.SettlementPO" id="SettlementResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="delFlag" column="del_flag" />
<result property="orderId" column="order_id" />
<result property="settlementObjId" column="settlement_obj_id" />
<result property="settlementObj" column="settlement_obj" />
<result property="settlementWayId" column="settlement_way_id" />
<result property="settlementWay" column="settlement_way" />
<result property="payMethod" column="pay_method" />
<result property="payStatusId" column="pay_status_id" />
<result property="payStatus" column="pay_status" />
<result property="prepaidAmount" column="prepaid_amount" />
<result property="paidAmount" column="paid_amount" />
<result property="debtAmount" column="debt_amount" />
<result property="paymentAccNo" column="payment_acc_no" />
<result property="paymentOrderNo" column="payment_order_no" />
<result property="fileUrl" column="file_url" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSettlementPo">
select id, create_by, create_time, update_by, update_time, top_organization_id, organization_id, organization_name, del_flag, order_id, settlement_obj_id, settlement_obj, settlement_way_id, settlement_way, pay_method, pay_status_id, pay_status, prepaid_amount, paid_amount, debt_amount, payment_acc_no, payment_order_no, file_url, remark from oms_settlement
</sql>
<sql id="selectSettlementPo1">
<where>
<if test="topOrganizationId != null ">
and top_organization_id = #{topOrganizationId}
</if>
<if test="organizationId != null ">
and organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="orderId != null ">
and order_id = #{orderId}
</if>
<if test="settlementObjId != null ">
and settlement_obj_id = #{settlementObjId}
</if>
<if test="settlementObj != null and settlementObj != ''">
and settlement_obj = #{settlementObj}
</if>
<if test="settlementWayId != null and settlementWayId != ''">
and settlement_way_id = #{settlementWayId}
</if>
<if test="settlementWay != null and settlementWay != ''">
and settlement_way = #{settlementWay}
</if>
<if test="payMethod != null and payMethod != ''">
and pay_method = #{payMethod}
</if>
<if test="payStatusId != null and payStatusId != ''">
and pay_status_id = #{payStatusId}
</if>
<if test="payStatus != null and payStatus != ''">
and pay_status = #{payStatus}
</if>
<if test="prepaidAmount != null ">
and prepaid_amount = #{prepaidAmount}
</if>
<if test="paidAmount != null ">
and paid_amount = #{paidAmount}
</if>
<if test="debtAmount != null ">
and debt_amount = #{debtAmount}
</if>
<if test="paymentAccNo != null and paymentAccNo != ''">
and payment_acc_no = #{paymentAccNo}
</if>
<if test="paymentOrderNo != null and paymentOrderNo != ''">
and payment_order_no = #{paymentOrderNo}
</if>
<if test="fileUrl != null and fileUrl != ''">
and file_url = #{fileUrl}
</if>
</where>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.settlement.repository.todo.SettlementDO" resultMap="SettlementResult">
<include refid="selectSettlementPo"/>
<include refid="selectSettlementPo1"/>
</select>
</mapper>
@@ -0,0 +1,180 @@
<?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.mhd.oms.domain.taskOrder.repository.mapper.TaskOrderMapper">
<resultMap type="com.mhd.oms.domain.taskOrder.repository.po.TaskOrderPO" id="TaskOrderResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createByName" column="create_by_name" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateByName" column="update_by_name" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="scmId" column="scm_id" />
</resultMap>
<sql id="selectTaskOrderPo">
select
a.id,a.create_by,a.create_by_name,a.create_time,a.update_by,a.update_by_name,a.update_time,a.del_flag,a.scm_id,a.task_no,a.task_status,a.order_id,a.merge_state,a.notice_code,a.enter_warehouse_code,a.warehouse_id,a.warehouse_name,a.plan_num,a.merge_task_no,
c.estimated_receiving_time,
case a.merge_state when 0 then '未合并' when 1 then '已合并' else '未知状态' end mergeStateStr,
case a.task_status when 0 then '未下发' when 1 then '已下发' when 2 then '已完成' when 3 then '已拦截' when 4 then '已取消' else '未知状态' end taskStatusStr
from
oms_task_order a
left join oms_receipt_info c on a.order_id = c.order_id and c.del_flag = 1
</sql>
<sql id="selectTaskOrderPo1">
<where>
a.del_flag = 1
<!-- <if test="createByName != null and createByName != ''">-->
<!-- and a.create_by_name like concat('%', #{createByName}, '%')-->
<!-- </if>-->
<!-- <if test="updateByName != null and updateByName != ''">-->
<!-- and a.update_by_name like concat('%', #{updateByName}, '%')-->
<!-- </if>-->
<if test="scmId != null and scmId != ''">
and a.scm_id = #{scmId}
</if>
<if test="taskStatus != null">
and a.task_status = #{taskStatus}
</if>
<if test="taskTypeId != null">
and a.task_type_id = #{taskTypeId}
</if>
<if test="idList != null">
and a.id in
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="scmIdList != null">
and a.scm_id in
<foreach collection="scmIdList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="orderIdList != null">
and a.order_id in
<foreach collection="orderIdList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.taskOrder.repository.todo.TaskOrderDO" resultType="com.mhd.oms.domain.taskOrder.repository.po.TaskOrderPO">
<include refid="selectTaskOrderPo"/>
<include refid="selectTaskOrderPo1"/>
</select>
<select id="queryEffectiveNumByScmId" resultType="java.math.BigDecimal">
select
ifnull(sum(plan_num), 0)
from
oms_task_order
WHERE
del_flag = 1
and task_status in (0,1,2)
and scm_id = #{scmId}
and goods_id = #{goodsId}
</select>
<select id="getPoTaskDetail" parameterType="java.util.List" resultType="com.mhd.oms.domain.taskOrder.repository.po.PoTaskDetailPO">
SELECT
a.id,
a.task_no,
a.warehouse_id,
a.warehouse_name,
b.shipper_id,
b.shipper
FROM
oms_task_order a
LEFT JOIN oms_purchase_order b ON a.order_id = b.id
WHERE
a.del_flag = 1 and
a.id in
<foreach collection="ids" open="(" separator="," close=")" item="item" index="index">
#{item}
</foreach>
</select>
<select id="getAbleCancelledTaskList" resultType="com.mhd.oms.domain.taskOrder.repository.po.TaskOrderPO">
select
scm_id,plan_num
from oms_task_order
where
del_flag = 1
and task_status = 0
and(merge_task_no is null or merge_task_no = '')
and id in
<foreach collection="idList" open="(" separator="," close=")" item="item" index="index">
#{item}
</foreach>
</select>
<select id="getInfoByIds" resultType="com.mhd.oms.domain.taskOrder.repository.po.TaskOrderPO">
SELECT
*
FROM
oms_task_order
WHERE
del_flag = 1
and ( id IN
<foreach collection="ids" open="(" separator="," close=")" item="item" index="index">
#{item}
</foreach>
OR merge_task_no IN ( SELECT merge_task_no FROM oms_task_order
WHERE id IN
<foreach collection="ids" open="(" separator="," close=")" item="item" index="index">
#{item}
</foreach>
AND merge_state = 1))
</select>
<select id="queryPurListByOrderId" resultMap="TaskOrderResult">
select
a.id,a.create_by,a.create_by_name,a.create_time,a.update_by,a.update_by_name,a.update_time,a.del_flag,a.scm_id,a.task_no,a.task_status,a.order_id,a.merge_state,a.notice_code,a.enter_warehouse_code,a.warehouse_id,a.warehouse_name,a.plan_num,
b.order_no,b.customer_orders,b.shipper_id,b.shipper,b.supplier_id,b.supplier,b.order_type_id,b.order_type,b.delivery_system,
c.estimated_receiving_time,
case a.merge_state when 0 then '未合并' when 1 then '已合并' else '未知状态' end mergeStateStr,
case a.task_status when 0 then '未下发' when 1 then '已下发' when 2 then '已完成' when 3 then '已拦截' when 4 then '已取消' else '未知状态' end taskStatusStr
from
oms_task_order a
left join oms_purchase_order b on a.order_id = b.id and b.del_flag = 1
left join oms_receipt_info c on a.order_id = c.order_id and c.del_flag = 1
<include refid="where_queryListByOrderId"/>
</select>
<select id="querySalesListByOrderId" resultMap="TaskOrderResult">
select
a.id,a.create_by,a.create_by_name,a.create_time,a.update_by,a.update_by_name,a.update_time,a.del_flag,a.scm_id,a.task_no,a.task_status,a.order_id,a.merge_state,a.notice_code,a.enter_warehouse_code,a.warehouse_id,a.warehouse_name,a.plan_num,
b.order_no,b.customer_orders,b.shipper_id,b.shipper,b.customer_id,b.customer,b.order_type_id,b.order_type,b.delivery_system,
c.estimated_receiving_time,
case a.merge_state when 0 then '未合并' when 1 then '已合并' else '未知状态' end mergeStateStr,
case a.task_status when 0 then '未下发' when 1 then '已下发' when 2 then '已完成' when 3 then '已拦截' when 4 then '已取消' else '未知状态' end taskStatusStr
from
oms_task_order a
left join oms_sales_order b on a.order_id = b.id and b.del_flag = 1
left join oms_receipt_info c on a.order_id = c.order_id and c.del_flag = 1
<include refid="where_queryListByOrderId"/>
</select>
<sql id="where_queryListByOrderId">
<where>
a.del_flag = 1
<if test="orderIdList != null">
and a.order_id in
<foreach collection="orderIdList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</sql>
</mapper>