|
|
@@ -798,7 +798,6 @@
|
|
|
tmp.sup_name AS "supplierName",
|
|
|
tms.staff_name AS "staffName",
|
|
|
tms.staff_name AS "makeStaffName",
|
|
|
- tmw.wh_name as "whName",
|
|
|
tmc.cus_name as "cusName",
|
|
|
tmc.cus_phone as "cusPhone",
|
|
|
tmc.cus_from as "cusFrom",
|
|
|
@@ -836,7 +835,10 @@
|
|
|
AND tmc.cus_name LIKE concat('%',my_ex.likequery(#{cusName}),'%')
|
|
|
</if>
|
|
|
<if test="whName != null and whName != ''">
|
|
|
- AND tmw.wh_name LIKE concat('%',my_ex.likequery(#{whName}),'%')
|
|
|
+ AND
|
|
|
+ exists(select 1 from dkic_b.t_psi_inbound_item item
|
|
|
+ inner join dkic_b.t_mst_warehouse tmw on item.wh_id = tmw.wh_id where tpi.into_id = item.into_id
|
|
|
+ and item.flg_valid and tmw.wh_name LIKE concat ( '%', my_ex.likequery ( #{whName} ), '%' ) )
|
|
|
</if>
|
|
|
<if test="supId != null and supId != ''">
|
|
|
AND tpi.sup_id = #{supId}::uuid
|
|
|
@@ -863,7 +865,6 @@
|
|
|
tmp.sup_name AS "supplierName",
|
|
|
tms.staff_name AS "staffName",
|
|
|
tms.staff_name AS "makeStaffName",
|
|
|
- null as "whName",
|
|
|
tmc.cus_name as "cusName",
|
|
|
tmc.cus_phone as "cusPhone",
|
|
|
tmc.cus_from as "cusFrom",
|
|
|
@@ -941,6 +942,7 @@
|
|
|
tmd.data_value as into_reason_name
|
|
|
FROM dkic_b.t_psi_inbound tpi
|
|
|
<include refid="Select_Inbound_Join_Table_Into"/>
|
|
|
+ Left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpi.wh_id
|
|
|
<where>
|
|
|
AND tpi.cp_id = #{cpId}
|
|
|
<if test="intoTypes != null and intoTypes.size()>0">
|
|
|
@@ -1043,7 +1045,6 @@
|
|
|
Left join dkic_b.t_mst_staff makestaff on makestaff.staff_id = tpi.make_staff
|
|
|
LEFT JOIN sys.t_data_kind tdk ON tdk.kind_code = tpi.into_status
|
|
|
LEFT JOIN sys.t_data_kind tdktype ON tdktype.kind_code = tpi.into_type
|
|
|
- Left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = tpi.wh_id
|
|
|
left join dkic_b.t_mst_customer tmc on tpi.cus_id = tmc.cus_id
|
|
|
left join dkic_b.t_mst_dictionary_data tmd on tmd.data_id = tpi.into_reason
|
|
|
</sql>
|