|
@@ -235,7 +235,7 @@
|
|
|
t.out_type,
|
|
t.out_type,
|
|
|
t.from_id,
|
|
t.from_id,
|
|
|
t.from_no,
|
|
t.from_no,
|
|
|
- t.from_no as "orderNo",
|
|
|
|
|
|
|
+ t.from_no as "biznisNo",
|
|
|
t.org_id,
|
|
t.org_id,
|
|
|
tmo.org_name as "orgName",
|
|
tmo.org_name as "orgName",
|
|
|
t.staff_id,
|
|
t.staff_id,
|
|
@@ -247,7 +247,7 @@
|
|
|
tmc.cus_from as "cusFrom",
|
|
tmc.cus_from as "cusFrom",
|
|
|
tmc.contact_phone as "contactPhone",
|
|
tmc.contact_phone as "contactPhone",
|
|
|
tmc.address_full as "addressFull",
|
|
tmc.address_full as "addressFull",
|
|
|
- tmdd.data_value as "cusFromName",
|
|
|
|
|
|
|
+ tmdd.data_value as cus_from_name,
|
|
|
t.sup_id,
|
|
t.sup_id,
|
|
|
tmp.sup_name AS "supplierName",
|
|
tmp.sup_name AS "supplierName",
|
|
|
t.out_status,
|
|
t.out_status,
|
|
@@ -324,16 +324,16 @@
|
|
|
tmc.cus_from as "cusFrom",
|
|
tmc.cus_from as "cusFrom",
|
|
|
tmc.contact_phone as "contactPhone",
|
|
tmc.contact_phone as "contactPhone",
|
|
|
tmc.address_full as "addressFull",
|
|
tmc.address_full as "addressFull",
|
|
|
- tmdd.data_value as "cusFromName",
|
|
|
|
|
- tpo1.address_area,
|
|
|
|
|
- tpo1.address_name,
|
|
|
|
|
- tpo1.address_no,
|
|
|
|
|
- tpo1.address_gcj02,
|
|
|
|
|
- tpo1.address_full,
|
|
|
|
|
- tpo1.contact_name,
|
|
|
|
|
- tpo1.contact_phone,
|
|
|
|
|
- tpo1.sales_channel,
|
|
|
|
|
- tmsc.channel_name as "channelName",
|
|
|
|
|
|
|
+ tmdd.data_value as cus_from_name,
|
|
|
|
|
+ tmc.address_area,
|
|
|
|
|
+ tmc.address_name,
|
|
|
|
|
+ tmc.address_no,
|
|
|
|
|
+ tmc.address_gcj02,
|
|
|
|
|
+ tmc.address_full,
|
|
|
|
|
+ tmc.contact_name,
|
|
|
|
|
+ tmc.contact_phone,
|
|
|
|
|
+ tmc.channel_id as sales_channel,
|
|
|
|
|
+ tmsc.channel_name as channel_name,
|
|
|
t.sup_id,
|
|
t.sup_id,
|
|
|
t.out_status,
|
|
t.out_status,
|
|
|
sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "outStatusName",
|
|
sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "outStatusName",
|
|
@@ -353,14 +353,74 @@
|
|
|
t.payable_id,
|
|
t.payable_id,
|
|
|
t.cp_id,
|
|
t.cp_id,
|
|
|
t.flg_valid,
|
|
t.flg_valid,
|
|
|
- tmd.data_value as out_reason_name
|
|
|
|
|
|
|
+ tmd.data_value as out_reason_name
|
|
|
FROM dkic_b.t_psi_outbound as t
|
|
FROM dkic_b.t_psi_outbound as t
|
|
|
- left join dkic_b.t_psi_order as tpo1 on tpo1.order_id = t.from_id
|
|
|
|
|
- left join dkic_b.t_mst_sale_channel tmsc on tmsc.channel_id = tpo1.sales_channel
|
|
|
|
|
|
|
+ left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
|
|
|
|
|
+ left join dkic_b.t_mst_sale_channel tmsc on tmsc.channel_id = tmc.channel_id
|
|
|
left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
|
left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
|
|
left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
|
|
|
left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
|
|
left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
|
|
|
|
|
+ left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
|
|
|
|
|
+ left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.out_status
|
|
|
|
|
+ left join dkic_b.t_mst_dictionary_data tmd on tmd.data_id = t.out_reason
|
|
|
|
|
+ WHERE t.out_id = #{id}::uuid
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 获取出库信息(新建退货用) -->
|
|
|
|
|
+ <select id="selectByIdForReturn" resultMap="BaseResultMapResponse">
|
|
|
|
|
+ SELECT t.out_id,
|
|
|
|
|
+ t.out_no,
|
|
|
|
|
+ t.out_type,
|
|
|
|
|
+ t.from_id,
|
|
|
|
|
+ t.from_no,
|
|
|
|
|
+ t.from_no as "orderNo",
|
|
|
|
|
+ t.org_id,
|
|
|
|
|
+ tmo.org_name as "orgName",
|
|
|
|
|
+ t.staff_id,
|
|
|
|
|
+ tms.staff_name as "staffName",
|
|
|
|
|
+ t.cus_id,
|
|
|
|
|
+ tmc.cus_code as "cusCode",
|
|
|
|
|
+ tmc.cus_name as "cusName",
|
|
|
|
|
+ tmc.cus_phone as "cusPhone",
|
|
|
|
|
+ tmc.cus_from as "cusFrom",
|
|
|
|
|
+ tmc.contact_phone as "contactPhone",
|
|
|
|
|
+ tmc.address_full as "addressFull",
|
|
|
|
|
+ tmdd.data_value as cus_from_name,
|
|
|
|
|
+ tmc.address_area,
|
|
|
|
|
+ tmc.address_name,
|
|
|
|
|
+ tmc.address_no,
|
|
|
|
|
+ tmc.address_gcj02,
|
|
|
|
|
+ tmc.address_full,
|
|
|
|
|
+ tmc.contact_name,
|
|
|
|
|
+ tmc.contact_phone,
|
|
|
|
|
+ tmc.channel_id as sales_channel,
|
|
|
|
|
+ tmsc.channel_name as channel_name,
|
|
|
|
|
+ t.sup_id,
|
|
|
|
|
+ t.out_status,
|
|
|
|
|
+ sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "outStatusName",
|
|
|
|
|
+ t.outing_qty,
|
|
|
|
|
+ t.outing_amt,
|
|
|
|
|
+ t.out_qty,
|
|
|
|
|
+ t.out_amt,
|
|
|
|
|
+ t.return_qty,
|
|
|
|
|
+ t.return_amt,
|
|
|
|
|
+ t.out_date,
|
|
|
|
|
+ t.remarks,
|
|
|
|
|
+ t.annex_paths,
|
|
|
|
|
+ t.make_staff,
|
|
|
|
|
+ makestaff.staff_name as "makeStaffName",
|
|
|
|
|
+ t.make_time,
|
|
|
|
|
+ t.receivable_id,
|
|
|
|
|
+ t.payable_id,
|
|
|
|
|
+ t.cp_id,
|
|
|
|
|
+ t.flg_valid,
|
|
|
|
|
+ tmd.data_value as out_reason_name
|
|
|
|
|
+ FROM dkic_b.t_psi_outbound as t
|
|
|
left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
|
|
left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
|
|
|
|
|
+ left join dkic_b.t_mst_sale_channel tmsc on tmsc.channel_id = tmc.channel_id
|
|
|
|
|
+ left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
|
|
|
+ left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
|
|
|
|
|
+ left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
|
|
|
left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
|
|
left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
|
|
|
left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.out_status
|
|
left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.out_status
|
|
|
left join dkic_b.t_mst_dictionary_data tmd on tmd.data_id = t.out_reason
|
|
left join dkic_b.t_mst_dictionary_data tmd on tmd.data_id = t.out_reason
|