QUERY PLAN
Limit (cost=1572.37..1572.42 rows=20 width=222)
-> Sort (cost=1572.37..1572.44 rows=30 width=222)
Sort Key: (CASE WHEN ((sub.verify_status = 0) OR (sub.stop_verify_status = 0) OR (sub.cancel_verify_status = 0)) THEN 1 ELSE 2 END), sub.created_at DESC
-> Result (cost=22.61..1571.63 rows=30 width=222)
-> Append (cost=22.61..1571.11 rows=30 width=218)
-> Subquery Scan on sub (cost=22.61..22.69 rows=1 width=182)
-> GroupAggregate (cost=22.61..22.68 rows=1 width=190)
Group Key: r.id, rvr.status, rsvr.status
-> Sort (cost=22.61..22.62 rows=1 width=123)
Sort Key: r.id, rvr.status, rsvr.status
-> Nested Loop Left Join (cost=8.47..22.60 rows=1 width=123)
Join Filter: (rsvr.erp_purchase_inbound_id = r.id)
Filter: (((rvr.user_id = 1001) OR (rsvr.user_id = 1001)) AND ((CASE WHEN (1 = r.verify_type) THEN rvr.status ELSE CASE WHEN (r.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr.status = 0) THEN NULL::integer ELSE rvr.status END END END = 0) OR (CASE WHEN (1 = r.verify_type) THEN rsvr.status ELSE CASE WHEN (r.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr.status = 0) THEN NULL::integer ELSE rsvr.status END END END = 0)))
-> Hash Right Join (cost=8.47..21.48 rows=1 width=115)
Hash Cond: (rvr.erp_purchase_inbound_id = r.id)
-> Seq Scan on tbl_erp_purchase_inbound_verify_rels rvr (cost=0.00..12.45 rows=206 width=20)
Filter: (user_id = 1001)
-> Hash (cost=8.46..8.46 rows=1 width=99)
-> Seq Scan on tbl_erp_purchase_inbounds r (cost=0.00..8.46 rows=1 width=99)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Seq Scan on tbl_erp_purchase_inbound_stop_verify_rels rsvr (cost=0.00..1.05 rows=2 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 2" (cost=84.57..84.66 rows=1 width=213)
-> GroupAggregate (cost=84.57..84.65 rows=1 width=225)
Group Key: r_1.id, rvr_1.status, rsvr_1.status, rcvr.status
-> Sort (cost=84.57..84.57 rows=1 width=170)
Sort Key: r_1.id, rvr_1.status, rsvr_1.status, rcvr.status
-> Hash Left Join (cost=78.87..84.56 rows=1 width=170)
Hash Cond: (r_1.id = rsvr_1.erp_purchase_order_id)
Filter: (((rvr_1.user_id = 1001) OR (rsvr_1.user_id = 1001) OR (rcvr.user_id = 1001)) AND ((CASE WHEN (1 = r_1.verify_type) THEN rvr_1.status ELSE CASE WHEN (r_1.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_1.status = 0) THEN NULL::integer ELSE rvr_1.status END END END = 0) OR (CASE WHEN (1 = r_1.verify_type) THEN rsvr_1.status ELSE CASE WHEN (r_1.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_1.status = 0) THEN NULL::integer ELSE rsvr_1.status END END END = 0) OR (CASE WHEN (1 = r_1.verify_type) THEN rcvr.status ELSE CASE WHEN (r_1.next_cancel_verify_user = 1001) THEN 0 ELSE CASE WHEN (rcvr.status = 0) THEN NULL::integer ELSE rcvr.status END END END = 0)))
-> Hash Right Join (cost=77.55..83.15 rows=9 width=166)
Hash Cond: (rvr_1.erp_purchase_order_id = r_1.id)
-> Seq Scan on tbl_erp_purchase_order_verify_rels rvr_1 (cost=0.00..5.33 rows=70 width=20)
Filter: (user_id = 1001)
-> Hash (cost=77.44..77.44 rows=9 width=150)
-> Merge Left Join (cost=77.37..77.44 rows=9 width=150)
Merge Cond: (r_1.id = rcvr.erp_purchase_order_id)
-> Sort (cost=76.25..76.27 rows=9 width=134)
Sort Key: r_1.id
-> Seq Scan on tbl_erp_purchase_orders r_1 (cost=0.00..76.11 rows=9 width=134)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Sort (cost=1.11..1.12 rows=4 width=20)
Sort Key: rcvr.erp_purchase_order_id
-> Seq Scan on tbl_erp_purchase_order_cancel_verify_rels rcvr (cost=0.00..1.07 rows=4 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.25..1.25 rows=5 width=20)
-> Seq Scan on tbl_erp_purchase_order_stop_verify_rels rsvr_1 (cost=0.00..1.25 rows=5 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 3" (cost=24.67..24.75 rows=1 width=246)
-> GroupAggregate (cost=24.67..24.74 rows=1 width=254)
Group Key: r_2.id, rvr_2.status, rsvr_2.status
-> Sort (cost=24.67..24.68 rows=1 width=179)
Sort Key: r_2.id, rvr_2.status, rsvr_2.status
-> Nested Loop Left Join (cost=0.00..24.66 rows=1 width=179)
Join Filter: (rvr_2.erp_purchase_return_id = r_2.id)
Filter: (((rvr_2.user_id = 1001) OR (rsvr_2.user_id = 1001)) AND ((CASE WHEN (1 = r_2.verify_type) THEN rvr_2.status ELSE CASE WHEN (r_2.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_2.status = 0) THEN NULL::integer ELSE rvr_2.status END END END = 0) OR (CASE WHEN (1 = r_2.verify_type) THEN rsvr_2.status ELSE CASE WHEN (r_2.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_2.status = 0) THEN NULL::integer ELSE rsvr_2.status END END END = 0)))
-> Nested Loop Left Join (cost=0.00..23.29 rows=1 width=171)
Join Filter: (rsvr_2.erp_purchase_return_id = r_2.id)
-> Seq Scan on tbl_erp_purchase_returns r_2 (cost=0.00..1.10 rows=1 width=155)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Seq Scan on tbl_erp_purchase_return_stop_verify_rels rsvr_2 (cost=0.00..22.12 rows=5 width=20)
Filter: (user_id = 1001)
-> Seq Scan on tbl_erp_purchase_return_verify_rels rvr_2 (cost=0.00..1.15 rows=6 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 4" (cost=3.54..3.61 rows=1 width=182)
-> GroupAggregate (cost=3.54..3.60 rows=1 width=190)
Group Key: r_3.id, rvr_3.status, rsvr_3.status
-> Sort (cost=3.54..3.54 rows=1 width=111)
Sort Key: r_3.id, rvr_3.status, rsvr_3.status
-> Hash Left Join (cost=2.27..3.53 rows=1 width=111)
Hash Cond: (r_3.id = rsvr_3.erp_inventory_lost_id)
Filter: (((rvr_3.user_id = 1001) OR (rsvr_3.user_id = 1001)) AND ((CASE WHEN (1 = r_3.verify_type) THEN rvr_3.status ELSE CASE WHEN (r_3.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_3.status = 0) THEN NULL::integer ELSE rvr_3.status END END END = 0) OR (CASE WHEN (1 = r_3.verify_type) THEN rsvr_3.status ELSE CASE WHEN (r_3.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_3.status = 0) THEN NULL::integer ELSE rsvr_3.status END END END = 0)))
-> Hash Right Join (cost=1.18..2.39 rows=3 width=103)
Hash Cond: (rvr_3.erp_inventory_lost_id = r_3.id)
-> Seq Scan on tbl_erp_inventory_lost_verify_rels rvr_3 (cost=0.00..1.18 rows=8 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.15..1.15 rows=3 width=87)
-> Seq Scan on tbl_erp_inventory_losts r_3 (cost=0.00..1.15 rows=3 width=87)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.05..1.05 rows=3 width=20)
-> Seq Scan on tbl_erp_inventory_lost_stop_verify_rels rsvr_3 (cost=0.00..1.05 rows=3 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 5" (cost=3.49..3.56 rows=1 width=222)
-> GroupAggregate (cost=3.49..3.55 rows=1 width=230)
Group Key: r_4.id, rvr_4.status, rsvr_4.status
-> Sort (cost=3.49..3.49 rows=1 width=159)
Sort Key: r_4.id, rvr_4.status, rsvr_4.status
-> Hash Left Join (cost=1.19..3.48 rows=1 width=159)
Hash Cond: (r_4.id = rvr_4.erp_inventory_overflow_id)
Filter: (((rvr_4.user_id = 1001) OR (rsvr_4.user_id = 1001)) AND ((CASE WHEN (1 = r_4.verify_type) THEN rvr_4.status ELSE CASE WHEN (r_4.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_4.status = 0) THEN NULL::integer ELSE rvr_4.status END END END = 0) OR (CASE WHEN (1 = r_4.verify_type) THEN rsvr_4.status ELSE CASE WHEN (r_4.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_4.status = 0) THEN NULL::integer ELSE rsvr_4.status END END END = 0)))
-> Nested Loop Left Join (cost=0.00..2.23 rows=3 width=151)
Join Filter: (rsvr_4.erp_inventory_overflow_id = r_4.id)
-> Seq Scan on tbl_erp_inventory_overflows r_4 (cost=0.00..1.16 rows=3 width=135)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Materialize (cost=0.00..1.03 rows=1 width=20)
-> Seq Scan on tbl_erp_inventory_overflow_stop_verify_rels rsvr_4 (cost=0.00..1.02 rows=1 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.15..1.15 rows=3 width=20)
-> Seq Scan on tbl_erp_inventory_overflow_verify_rels rvr_4 (cost=0.00..1.15 rows=3 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 6" (cost=24.74..24.81 rows=1 width=176)
-> GroupAggregate (cost=24.74..24.80 rows=1 width=184)
Group Key: r_5.id, rvr_5.status, rsvr_5.status
-> Sort (cost=24.74..24.74 rows=1 width=105)
Sort Key: r_5.id, rvr_5.status, rsvr_5.status
-> Hash Right Join (cost=2.55..24.73 rows=1 width=105)
Hash Cond: (rsvr_5.erp_inventory_build_id = r_5.id)
Filter: (((rvr_5.user_id = 1001) OR (rsvr_5.user_id = 1001)) AND ((CASE WHEN (1 = r_5.verify_type) THEN rvr_5.status ELSE CASE WHEN (r_5.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_5.status = 0) THEN NULL::integer ELSE rvr_5.status END END END = 0) OR (CASE WHEN (1 = r_5.verify_type) THEN rsvr_5.status ELSE CASE WHEN (r_5.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_5.status = 0) THEN NULL::integer ELSE rsvr_5.status END END END = 0)))
-> Seq Scan on tbl_erp_inventory_build_stop_verify_rels rsvr_5 (cost=0.00..22.12 rows=5 width=20)
Filter: (user_id = 1001)
-> Hash (cost=2.49..2.49 rows=5 width=97)
-> Hash Right Join (cost=1.26..2.49 rows=5 width=97)
Hash Cond: (rvr_5.erp_inventory_build_id = r_5.id)
-> Seq Scan on tbl_erp_inventory_build_verify_rels rvr_5 (cost=0.00..1.19 rows=11 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.20..1.20 rows=5 width=81)
-> Seq Scan on tbl_erp_inventory_builds r_5 (cost=0.00..1.20 rows=5 width=81)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Subquery Scan on "*SELECT* 7" (cost=24.62..24.70 rows=1 width=231)
-> GroupAggregate (cost=24.62..24.69 rows=1 width=239)
Group Key: r_6.id, rvr_6.status, rsvr_6.status
-> Sort (cost=24.62..24.63 rows=1 width=160)
Sort Key: r_6.id, rvr_6.status, rsvr_6.status
-> Nested Loop Left Join (cost=0.00..24.61 rows=1 width=160)
Join Filter: (rvr_6.erp_inventory_disassemble_id = r_6.id)
Filter: (((rvr_6.user_id = 1001) OR (rsvr_6.user_id = 1001)) AND ((CASE WHEN (1 = r_6.verify_type) THEN rvr_6.status ELSE CASE WHEN (r_6.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_6.status = 0) THEN NULL::integer ELSE rvr_6.status END END END = 0) OR (CASE WHEN (1 = r_6.verify_type) THEN rsvr_6.status ELSE CASE WHEN (r_6.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_6.status = 0) THEN NULL::integer ELSE rsvr_6.status END END END = 0)))
-> Nested Loop Left Join (cost=0.00..23.37 rows=2 width=152)
Join Filter: (rsvr_6.erp_inventory_disassemble_id = r_6.id)
-> Seq Scan on tbl_erp_inventory_disassembles r_6 (cost=0.00..1.08 rows=2 width=136)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Materialize (cost=0.00..22.15 rows=5 width=20)
-> Seq Scan on tbl_erp_inventory_disassemble_stop_verify_rels rsvr_6 (cost=0.00..22.12 rows=5 width=20)
Filter: (user_id = 1001)
-> Materialize (cost=0.00..1.17 rows=1 width=20)
-> Seq Scan on tbl_erp_inventory_disassemble_verify_rels rvr_6 (cost=0.00..1.16 rows=1 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 8" (cost=57.37..57.44 rows=1 width=321)
-> GroupAggregate (cost=57.37..57.43 rows=1 width=329)
Group Key: r_7.id, rvr_7.status, rsvr_7.status
-> Sort (cost=57.37..57.37 rows=1 width=250)
Sort Key: r_7.id, rvr_7.status, rsvr_7.status
-> Hash Left Join (cost=22.19..57.36 rows=1 width=250)
Hash Cond: (r_7.id = rvr_7.erp_inventory_transfer_id)
Filter: (((rvr_7.user_id = 1001) OR (rsvr_7.user_id = 1001)) AND ((CASE WHEN (1 = r_7.verify_type) THEN rvr_7.status ELSE CASE WHEN (r_7.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_7.status = 0) THEN NULL::integer ELSE rvr_7.status END END END = 0) OR (CASE WHEN (1 = r_7.verify_type) THEN rsvr_7.status ELSE CASE WHEN (r_7.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_7.status = 0) THEN NULL::integer ELSE rsvr_7.status END END END = 0)))
-> Nested Loop Left Join (cost=0.00..35.12 rows=3 width=242)
Join Filter: (rsvr_7.erp_inventory_transfer_id = r_7.id)
-> Seq Scan on tbl_erp_inventory_transfers r_7 (cost=0.00..12.76 rows=3 width=226)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Materialize (cost=0.00..22.15 rows=5 width=20)
-> Seq Scan on tbl_erp_inventory_transfer_stop_verify_rels rsvr_7 (cost=0.00..22.12 rows=5 width=20)
Filter: (user_id = 1001)
-> Hash (cost=22.12..22.12 rows=5 width=20)
-> Seq Scan on tbl_erp_inventory_transfer_verify_rels rvr_7 (cost=0.00..22.12 rows=5 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 9" (cost=72.73..72.82 rows=1 width=221)
-> GroupAggregate (cost=72.73..72.81 rows=1 width=233)
Group Key: r_8.id, rvr_8.status, rsvr_8.status, rcvr_1.status
-> Sort (cost=72.73..72.73 rows=1 width=178)
Sort Key: r_8.id, rvr_8.status, rsvr_8.status, rcvr_1.status
-> Hash Left Join (cost=67.61..72.72 rows=1 width=178)
Hash Cond: (r_8.id = rsvr_8.erp_sales_order_id)
Filter: (((rvr_8.user_id = 1001) OR (rsvr_8.user_id = 1001) OR (rcvr_1.user_id = 1001)) AND ((CASE WHEN (1 = r_8.verify_type) THEN rvr_8.status ELSE CASE WHEN (r_8.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_8.status = 0) THEN NULL::integer ELSE rvr_8.status END END END = 0) OR (CASE WHEN (1 = r_8.verify_type) THEN rsvr_8.status ELSE CASE WHEN (r_8.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_8.status = 0) THEN NULL::integer ELSE rsvr_8.status END END END = 0) OR (CASE WHEN (1 = r_8.verify_type) THEN rcvr_1.status ELSE CASE WHEN (r_8.next_cancel_verify_user = 1001) THEN 0 ELSE CASE WHEN (rcvr_1.status = 0) THEN NULL::integer ELSE rcvr_1.status END END END = 0)))
-> Nested Loop Left Join (cost=66.01..71.02 rows=10 width=174)
Join Filter: (rcvr_1.erp_sales_order_id = r_8.id)
-> Hash Right Join (cost=66.01..69.19 rows=10 width=158)
Hash Cond: (rvr_8.erp_sales_order_id = r_8.id)
-> Seq Scan on tbl_erp_sales_order_verify_rels rvr_8 (cost=0.00..2.81 rows=141 width=20)
Filter: (user_id = 1001)
-> Hash (cost=65.89..65.89 rows=10 width=142)
-> Seq Scan on tbl_erp_sales_orders r_8 (cost=0.00..65.89 rows=10 width=142)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Materialize (cost=0.00..1.09 rows=5 width=20)
-> Seq Scan on tbl_erp_sales_order_cancel_verify_rels rcvr_1 (cost=0.00..1.06 rows=5 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.31..1.31 rows=23 width=20)
-> Seq Scan on tbl_erp_sales_order_stop_verify_rels rsvr_8 (cost=0.00..1.31 rows=23 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 10" (cost=19.28..19.36 rows=1 width=232)
-> GroupAggregate (cost=19.28..19.35 rows=1 width=240)
Group Key: r_9.id, rvr_9.status, rsvr_9.status
-> Sort (cost=19.28..19.29 rows=1 width=165)
Sort Key: r_9.id, rvr_9.status, rsvr_9.status
-> Hash Left Join (cost=9.31..19.27 rows=1 width=165)
Hash Cond: (r_9.id = rsvr_9.erp_sales_outbound_id)
Filter: (((rvr_9.user_id = 1001) OR (rsvr_9.user_id = 1001)) AND ((CASE WHEN (1 = r_9.verify_type) THEN rvr_9.status ELSE CASE WHEN (r_9.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_9.status = 0) THEN NULL::integer ELSE rvr_9.status END END END = 0) OR (CASE WHEN (1 = r_9.verify_type) THEN rsvr_9.status ELSE CASE WHEN (r_9.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_9.status = 0) THEN NULL::integer ELSE rsvr_9.status END END END = 0)))
-> Hash Right Join (cost=8.18..18.08 rows=5 width=157)
Hash Cond: (rvr_9.erp_sales_outbound_id = r_9.id)
-> Seq Scan on tbl_erp_sales_outbound_verify_rels rvr_9 (cost=0.00..9.49 rows=153 width=20)
Filter: (user_id = 1001)
-> Hash (cost=8.12..8.12 rows=5 width=141)
-> Seq Scan on tbl_erp_sales_outbounds r_9 (cost=0.00..8.12 rows=5 width=141)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.09..1.09 rows=3 width=20)
-> Seq Scan on tbl_erp_sales_outbound_stop_verify_rels rsvr_9 (cost=0.00..1.09 rows=3 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 11" (cost=24.62..24.70 rows=1 width=256)
-> GroupAggregate (cost=24.62..24.69 rows=1 width=264)
Group Key: r_10.id, rvr_10.status, rsvr_10.status
-> Sort (cost=24.62..24.63 rows=1 width=189)
Sort Key: r_10.id, rvr_10.status, rsvr_10.status
-> Nested Loop Left Join (cost=0.00..24.61 rows=1 width=189)
Join Filter: (rvr_10.erp_sales_return_id = r_10.id)
Filter: (((rvr_10.user_id = 1001) OR (rsvr_10.user_id = 1001)) AND ((CASE WHEN (1 = r_10.verify_type) THEN rvr_10.status ELSE CASE WHEN (r_10.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_10.status = 0) THEN NULL::integer ELSE rvr_10.status END END END = 0) OR (CASE WHEN (1 = r_10.verify_type) THEN rsvr_10.status ELSE CASE WHEN (r_10.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_10.status = 0) THEN NULL::integer ELSE rsvr_10.status END END END = 0)))
-> Nested Loop Left Join (cost=0.00..23.29 rows=1 width=181)
Join Filter: (rsvr_10.erp_sales_return_id = r_10.id)
-> Seq Scan on tbl_erp_sales_returns r_10 (cost=0.00..1.10 rows=1 width=165)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Seq Scan on tbl_erp_sales_return_stop_verify_rels rsvr_10 (cost=0.00..22.12 rows=5 width=20)
Filter: (user_id = 1001)
-> Seq Scan on tbl_erp_sales_return_verify_rels rvr_10 (cost=0.00..1.10 rows=6 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 12" (cost=4.21..4.28 rows=1 width=184)
-> GroupAggregate (cost=4.21..4.27 rows=1 width=192)
Group Key: r_11.id, rvr_11.status, rsvr_11.status
-> Sort (cost=4.21..4.21 rows=1 width=129)
Sort Key: r_11.id, rvr_11.status, rsvr_11.status
-> Hash Left Join (cost=2.49..4.20 rows=1 width=129)
Hash Cond: (r_11.id = rsvr_11.erp_purchase_gift_id)
Filter: (((rvr_11.user_id = 1001) OR (rsvr_11.user_id = 1001)) AND ((CASE WHEN (1 = r_11.verify_type) THEN rvr_11.status ELSE CASE WHEN (r_11.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_11.status = 0) THEN NULL::integer ELSE rvr_11.status END END END = 0) OR (CASE WHEN (1 = r_11.verify_type) THEN rsvr_11.status ELSE CASE WHEN (r_11.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_11.status = 0) THEN NULL::integer ELSE rsvr_11.status END END END = 0)))
-> Hash Right Join (cost=1.40..3.05 rows=3 width=121)
Hash Cond: (rvr_11.erp_purchase_gift_id = r_11.id)
-> Seq Scan on tbl_erp_purchase_gift_verify_rels rvr_11 (cost=0.00..1.59 rows=21 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.36..1.36 rows=3 width=105)
-> Seq Scan on tbl_erp_purchase_gifts r_11 (cost=0.00..1.36 rows=3 width=105)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.07..1.07 rows=2 width=20)
-> Seq Scan on tbl_erp_purchase_gift_stop_verify_rels rsvr_11 (cost=0.00..1.07 rows=2 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 13" (cost=16.00..16.07 rows=1 width=211)
-> GroupAggregate (cost=16.00..16.06 rows=1 width=219)
Group Key: r_12.id, rvr_12.status, rsvr_12.status
-> Sort (cost=16.00..16.00 rows=1 width=144)
Sort Key: r_12.id, rvr_12.status, rsvr_12.status
-> Hash Left Join (cost=7.92..15.99 rows=1 width=144)
Hash Cond: (r_12.id = rsvr_12.erp_sales_gift_id)
Filter: (((rvr_12.user_id = 1001) OR (rsvr_12.user_id = 1001)) AND ((CASE WHEN (1 = r_12.verify_type) THEN rvr_12.status ELSE CASE WHEN (r_12.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_12.status = 0) THEN NULL::integer ELSE rvr_12.status END END END = 0) OR (CASE WHEN (1 = r_12.verify_type) THEN rsvr_12.status ELSE CASE WHEN (r_12.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_12.status = 0) THEN NULL::integer ELSE rsvr_12.status END END END = 0)))
-> Hash Right Join (cost=6.84..14.86 rows=4 width=136)
Hash Cond: (rvr_12.erp_sales_gift_id = r_12.id)
-> Seq Scan on tbl_erp_sales_gift_verify_rels rvr_12 (cost=0.00..7.66 rows=129 width=20)
Filter: (user_id = 1001)
-> Hash (cost=6.79..6.79 rows=4 width=120)
-> Seq Scan on tbl_erp_sales_gifts r_12 (cost=0.00..6.79 rows=4 width=120)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.05..1.05 rows=2 width=20)
-> Seq Scan on tbl_erp_sales_gift_stop_verify_rels rsvr_12 (cost=0.00..1.05 rows=2 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 14" (cost=78.07..78.14 rows=1 width=162)
-> GroupAggregate (cost=78.07..78.13 rows=1 width=170)
Group Key: r_13.id, rvr_13.status, rsvr_13.status
-> Sort (cost=78.07..78.07 rows=1 width=139)
Sort Key: r_13.id, rvr_13.status, rsvr_13.status
-> Hash Left Join (cost=4.89..78.06 rows=1 width=139)
Hash Cond: (r_13.id = rvr_13.erp_collect_ticket_id)
Filter: (((rvr_13.user_id = 1001) OR (rsvr_13.user_id = 1001)) AND ((CASE WHEN (1 = r_13.verify_type) THEN rvr_13.status ELSE CASE WHEN (r_13.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_13.status = 0) THEN NULL::integer ELSE rvr_13.status END END END = 0) OR (CASE WHEN (1 = r_13.verify_type) THEN rsvr_13.status ELSE CASE WHEN (r_13.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_13.status = 0) THEN NULL::integer ELSE rsvr_13.status END END END = 0)))
-> Nested Loop Left Join (cost=0.00..73.09 rows=11 width=131)
Join Filter: (rsvr_13.erp_collect_ticket_id = r_13.id)
-> Seq Scan on tbl_erp_collect_tickets r_13 (cost=0.00..71.69 rows=11 width=115)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Materialize (cost=0.00..1.08 rows=2 width=20)
-> Seq Scan on tbl_erp_collect_ticket_stop_verify_rels rsvr_13 (cost=0.00..1.07 rows=2 width=20)
Filter: (user_id = 1001)
-> Hash (cost=4.45..4.45 rows=35 width=20)
-> Seq Scan on tbl_erp_collect_ticket_verify_rels rvr_13 (cost=0.00..4.45 rows=35 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 15" (cost=84.69..84.76 rows=1 width=167)
-> GroupAggregate (cost=84.69..84.75 rows=1 width=175)
Group Key: r_14.id, rvr_14.status, rsvr_14.status
-> Sort (cost=84.69..84.69 rows=1 width=145)
Sort Key: r_14.id, rvr_14.status, rsvr_14.status
-> Hash Left Join (cost=78.53..84.68 rows=1 width=145)
Hash Cond: (r_14.id = rsvr_14.erp_payment_ticket_id)
Filter: (((rvr_14.user_id = 1001) OR (rsvr_14.user_id = 1001)) AND ((CASE WHEN (1 = r_14.verify_type) THEN rvr_14.status ELSE CASE WHEN (r_14.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_14.status = 0) THEN NULL::integer ELSE rvr_14.status END END END = 0) OR (CASE WHEN (1 = r_14.verify_type) THEN rsvr_14.status ELSE CASE WHEN (r_14.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_14.status = 0) THEN NULL::integer ELSE rsvr_14.status END END END = 0)))
-> Hash Right Join (cost=77.30..83.40 rows=4 width=137)
Hash Cond: (rvr_14.erp_payment_ticket_id = r_14.id)
-> Seq Scan on tbl_erp_payment_ticket_verify_rels rvr_14 (cost=0.00..5.39 rows=271 width=20)
Filter: (user_id = 1001)
-> Hash (cost=77.25..77.25 rows=4 width=121)
-> Seq Scan on tbl_erp_payment_tickets r_14 (cost=0.00..77.25 rows=4 width=121)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.11..1.11 rows=9 width=20)
-> Seq Scan on tbl_erp_payment_ticket_stop_verify_rels rsvr_14 (cost=0.00..1.11 rows=9 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 16" (cost=6.02..6.09 rows=1 width=219)
-> GroupAggregate (cost=6.02..6.08 rows=1 width=227)
Group Key: r_15.id, rvr_15.status, rsvr_15.status
-> Sort (cost=6.02..6.02 rows=1 width=192)
Sort Key: r_15.id, rvr_15.status, rsvr_15.status
-> Hash Left Join (cost=4.07..6.01 rows=1 width=192)
Hash Cond: (r_15.id = rsvr_15.erp_cost_ticket_id)
Filter: (((rvr_15.user_id = 1001) OR (rsvr_15.user_id = 1001)) AND ((CASE WHEN (1 = r_15.verify_type) THEN rvr_15.status ELSE CASE WHEN (r_15.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_15.status = 0) THEN NULL::integer ELSE rvr_15.status END END END = 0) OR (CASE WHEN (1 = r_15.verify_type) THEN rsvr_15.status ELSE CASE WHEN (r_15.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_15.status = 0) THEN NULL::integer ELSE rsvr_15.status END END END = 0)))
-> Hash Right Join (cost=3.00..4.88 rows=3 width=184)
Hash Cond: (rvr_15.erp_cost_ticket_id = r_15.id)
-> Seq Scan on tbl_erp_cost_ticket_verify_rels rvr_15 (cost=0.00..1.73 rows=58 width=20)
Filter: (user_id = 1001)
-> Hash (cost=2.96..2.96 rows=3 width=168)
-> Seq Scan on tbl_erp_cost_tickets r_15 (cost=0.00..2.96 rows=3 width=168)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.04..1.04 rows=3 width=20)
-> Seq Scan on tbl_erp_cost_ticket_stop_verify_rels rsvr_15 (cost=0.00..1.04 rows=3 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 17" (cost=6.10..6.17 rows=1 width=188)
-> GroupAggregate (cost=6.10..6.16 rows=1 width=196)
Group Key: r_16.id, rvr_16.status, rsvr_16.status
-> Sort (cost=6.10..6.10 rows=1 width=165)
Sort Key: r_16.id, rvr_16.status, rsvr_16.status
-> Hash Left Join (cost=4.43..6.09 rows=1 width=165)
Hash Cond: (r_16.id = rsvr_16.erp_other_income_ticket_id)
Filter: (((rvr_16.user_id = 1001) OR (rsvr_16.user_id = 1001)) AND ((CASE WHEN (1 = r_16.verify_type) THEN rvr_16.status ELSE CASE WHEN (r_16.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_16.status = 0) THEN NULL::integer ELSE rvr_16.status END END END = 0) OR (CASE WHEN (1 = r_16.verify_type) THEN rsvr_16.status ELSE CASE WHEN (r_16.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_16.status = 0) THEN NULL::integer ELSE rsvr_16.status END END END = 0)))
-> Hash Right Join (cost=3.38..4.98 rows=6 width=157)
Hash Cond: (rvr_16.erp_other_income_ticket_id = r_16.id)
-> Seq Scan on tbl_erp_other_income_ticket_verify_rels rvr_16 (cost=0.00..1.50 rows=40 width=20)
Filter: (user_id = 1001)
-> Hash (cost=3.30..3.30 rows=6 width=141)
-> Seq Scan on tbl_erp_other_income_tickets r_16 (cost=0.00..3.30 rows=6 width=141)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.02..1.02 rows=2 width=20)
-> Seq Scan on tbl_erp_other_income_ticket_stop_verify_rels rsvr_16 (cost=0.00..1.02 rows=2 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 18" (cost=3.47..3.55 rows=1 width=294)
-> GroupAggregate (cost=3.47..3.54 rows=1 width=302)
Group Key: r_17.id, rvr_17.status, rsvr_17.status
-> Sort (cost=3.47..3.48 rows=1 width=231)
Sort Key: r_17.id, rvr_17.status, rsvr_17.status
-> Hash Left Join (cost=2.24..3.46 rows=1 width=231)
Hash Cond: (r_17.id = rsvr_17.erp_cost_convert_ticket_id)
Filter: (((rvr_17.user_id = 1001) OR (rsvr_17.user_id = 1001)) AND ((CASE WHEN (1 = r_17.verify_type) THEN rvr_17.status ELSE CASE WHEN (r_17.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_17.status = 0) THEN NULL::integer ELSE rvr_17.status END END END = 0) OR (CASE WHEN (1 = r_17.verify_type) THEN rsvr_17.status ELSE CASE WHEN (r_17.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_17.status = 0) THEN NULL::integer ELSE rsvr_17.status END END END = 0)))
-> Hash Right Join (cost=1.22..2.39 rows=3 width=223)
Hash Cond: (rvr_17.erp_cost_convert_ticket_id = r_17.id)
-> Seq Scan on tbl_erp_cost_convert_ticket_verify_rels rvr_17 (cost=0.00..1.14 rows=11 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.18..1.18 rows=3 width=207)
-> Seq Scan on tbl_erp_cost_convert_tickets r_17 (cost=0.00..1.18 rows=3 width=207)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.01..1.01 rows=1 width=20)
-> Seq Scan on tbl_erp_cost_convert_ticket_stop_verify_rels rsvr_17 (cost=0.00..1.01 rows=1 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 19" (cost=4.24..4.31 rows=1 width=232)
-> GroupAggregate (cost=4.24..4.30 rows=1 width=240)
Group Key: r_18.id, rvr_18.status, rsvr_18.status
-> Sort (cost=4.24..4.24 rows=1 width=161)
Sort Key: r_18.id, rvr_18.status, rsvr_18.status
-> Hash Left Join (cost=2.50..4.23 rows=1 width=161)
Hash Cond: (r_18.id = rsvr_18.erp_bank_transfer_ticket_id)
Filter: (((rvr_18.user_id = 1001) OR (rsvr_18.user_id = 1001)) AND ((CASE WHEN (1 = r_18.verify_type) THEN rvr_18.status ELSE CASE WHEN (r_18.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_18.status = 0) THEN NULL::integer ELSE rvr_18.status END END END = 0) OR (CASE WHEN (1 = r_18.verify_type) THEN rsvr_18.status ELSE CASE WHEN (r_18.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_18.status = 0) THEN NULL::integer ELSE rsvr_18.status END END END = 0)))
-> Hash Right Join (cost=1.43..3.10 rows=3 width=153)
Hash Cond: (rvr_18.erp_bank_transfer_ticket_id = r_18.id)
-> Seq Scan on tbl_erp_bank_transfer_ticket_verify_rels rvr_18 (cost=0.00..1.60 rows=24 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.39..1.39 rows=3 width=137)
-> Seq Scan on tbl_erp_bank_transfer_tickets r_18 (cost=0.00..1.39 rows=3 width=137)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.05..1.05 rows=2 width=20)
-> Seq Scan on tbl_erp_bank_transfer_ticket_stop_verify_rels rsvr_18 (cost=0.00..1.05 rows=2 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 20" (cost=910.89..910.96 rows=1 width=175)
-> GroupAggregate (cost=910.89..910.95 rows=1 width=183)
Group Key: r_19.id, rvr_19.status, rsvr_19.status
-> Sort (cost=910.89..910.89 rows=1 width=145)
Sort Key: r_19.id, rvr_19.status, rsvr_19.status
-> Hash Left Join (cost=504.03..910.88 rows=1 width=145)
Hash Cond: (r_19.id = rsvr_19.erp_cash_cost_ticket_id)
Filter: (((rvr_19.user_id = 1001) OR (rsvr_19.user_id = 1001)) AND ((CASE WHEN (1 = r_19.verify_type) THEN rvr_19.status ELSE CASE WHEN (r_19.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_19.status = 0) THEN NULL::integer ELSE rvr_19.status END END END = 0) OR (CASE WHEN (1 = r_19.verify_type) THEN rsvr_19.status ELSE CASE WHEN (r_19.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_19.status = 0) THEN NULL::integer ELSE rsvr_19.status END END END = 0)))
-> Hash Right Join (cost=502.81..909.58 rows=7 width=137)
Hash Cond: (rvr_19.erp_cash_cost_ticket_id = r_19.id)
-> Seq Scan on tbl_erp_cash_cost_ticket_verify_rels rvr_19 (cost=0.00..384.75 rows=8386 width=20)
Filter: (user_id = 1001)
-> Hash (cost=502.72..502.72 rows=7 width=121)
-> Seq Scan on tbl_erp_cash_cost_tickets r_19 (cost=0.00..502.72 rows=7 width=121)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.15..1.15 rows=6 width=20)
-> Seq Scan on tbl_erp_cash_cost_ticket_stop_verify_rels rsvr_19 (cost=0.00..1.15 rows=6 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 21" (cost=3.24..3.31 rows=1 width=161)
-> GroupAggregate (cost=3.24..3.30 rows=1 width=169)
Group Key: r_20.id, rvr_20.status, rsvr_20.status
-> Sort (cost=3.24..3.24 rows=1 width=131)
Sort Key: r_20.id, rvr_20.status, rsvr_20.status
-> Hash Left Join (cost=1.07..3.23 rows=1 width=131)
Hash Cond: (r_20.id = rvr_20.erp_advance_payment_ticket_id)
Filter: (((rvr_20.user_id = 1001) OR (rsvr_20.user_id = 1001)) AND ((CASE WHEN (1 = r_20.verify_type) THEN rvr_20.status ELSE CASE WHEN (r_20.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_20.status = 0) THEN NULL::integer ELSE rvr_20.status END END END = 0) OR (CASE WHEN (1 = r_20.verify_type) THEN rsvr_20.status ELSE CASE WHEN (r_20.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_20.status = 0) THEN NULL::integer ELSE rsvr_20.status END END END = 0)))
-> Nested Loop Left Join (cost=0.00..2.11 rows=2 width=123)
Join Filter: (rsvr_20.erp_advance_payment_ticket_id = r_20.id)
-> Seq Scan on tbl_erp_advance_payment_tickets r_20 (cost=0.00..1.05 rows=2 width=107)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Materialize (cost=0.00..1.03 rows=1 width=20)
-> Seq Scan on tbl_erp_advance_payment_ticket_stop_verify_rels rsvr_20 (cost=0.00..1.02 rows=1 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.05..1.05 rows=2 width=20)
-> Seq Scan on tbl_erp_advance_payment_ticket_verify_rels rvr_20 (cost=0.00..1.05 rows=2 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 22" (cost=26.24..26.31 rows=1 width=174)
-> GroupAggregate (cost=26.24..26.30 rows=1 width=182)
Group Key: r_21.id, rvr_21.status, rsvr_21.status
-> Sort (cost=26.24..26.24 rows=1 width=151)
Sort Key: r_21.id, rvr_21.status, rsvr_21.status
-> Hash Right Join (cost=4.05..26.23 rows=1 width=151)
Hash Cond: (rsvr_21.erp_other_payment_ticket_id = r_21.id)
Filter: (((rvr_21.user_id = 1001) OR (rsvr_21.user_id = 1001)) AND ((CASE WHEN (1 = r_21.verify_type) THEN rvr_21.status ELSE CASE WHEN (r_21.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_21.status = 0) THEN NULL::integer ELSE rvr_21.status END END END = 0) OR (CASE WHEN (1 = r_21.verify_type) THEN rsvr_21.status ELSE CASE WHEN (r_21.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_21.status = 0) THEN NULL::integer ELSE rsvr_21.status END END END = 0)))
-> Seq Scan on tbl_erp_other_payment_ticket_stop_verify_rels rsvr_21 (cost=0.00..22.12 rows=5 width=20)
Filter: (user_id = 1001)
-> Hash (cost=4.01..4.01 rows=3 width=143)
-> Hash Right Join (cost=2.77..4.01 rows=3 width=143)
Hash Cond: (rvr_21.erp_other_payment_ticket_id = r_21.id)
-> Seq Scan on tbl_erp_other_payment_ticket_verify_rels rvr_21 (cost=0.00..1.20 rows=16 width=20)
Filter: (user_id = 1001)
-> Hash (cost=2.73..2.73 rows=3 width=127)
-> Seq Scan on tbl_erp_other_payment_tickets r_21 (cost=0.00..2.73 rows=3 width=127)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Subquery Scan on "*SELECT* 23" (cost=5.62..5.69 rows=1 width=196)
-> GroupAggregate (cost=5.62..5.68 rows=1 width=204)
Group Key: r_22.id, rvr_22.status, rsvr_22.status
-> Sort (cost=5.62..5.62 rows=1 width=173)
Sort Key: r_22.id, rvr_22.status, rsvr_22.status
-> Hash Left Join (cost=3.90..5.61 rows=1 width=173)
Hash Cond: (r_22.id = rsvr_22.erp_other_collect_ticket_id)
Filter: (((rvr_22.user_id = 1001) OR (rsvr_22.user_id = 1001)) AND ((CASE WHEN (1 = r_22.verify_type) THEN rvr_22.status ELSE CASE WHEN (r_22.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_22.status = 0) THEN NULL::integer ELSE rvr_22.status END END END = 0) OR (CASE WHEN (1 = r_22.verify_type) THEN rsvr_22.status ELSE CASE WHEN (r_22.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_22.status = 0) THEN NULL::integer ELSE rsvr_22.status END END END = 0)))
-> Hash Right Join (cost=2.80..4.46 rows=3 width=165)
Hash Cond: (rvr_22.erp_other_collect_ticket_id = r_22.id)
-> Seq Scan on tbl_erp_other_collect_ticket_verify_rels rvr_22 (cost=0.00..1.54 rows=43 width=20)
Filter: (user_id = 1001)
-> Hash (cost=2.76..2.76 rows=3 width=149)
-> Seq Scan on tbl_erp_other_collect_tickets r_22 (cost=0.00..2.76 rows=3 width=149)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.05..1.05 rows=4 width=20)
-> Seq Scan on tbl_erp_other_collect_ticket_stop_verify_rels rsvr_22 (cost=0.00..1.05 rows=4 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 24" (cost=7.58..7.67 rows=1 width=257)
-> GroupAggregate (cost=7.58..7.66 rows=1 width=269)
Group Key: r_23.id, rvr_23.status, rsvr_23.status, rcvr_2.status
-> Sort (cost=7.58..7.59 rows=1 width=214)
Sort Key: r_23.id, rvr_23.status, rsvr_23.status, rcvr_2.status
-> Hash Left Join (cost=5.22..7.57 rows=1 width=214)
Hash Cond: (r_23.id = rcvr_2.erp_purchase_cost_id)
Filter: (((rvr_23.user_id = 1001) OR (rsvr_23.user_id = 1001) OR (rcvr_2.user_id = 1001)) AND ((CASE WHEN (1 = r_23.verify_type) THEN rvr_23.status ELSE CASE WHEN (r_23.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_23.status = 0) THEN NULL::integer ELSE rvr_23.status END END END = 0) OR (CASE WHEN (1 = r_23.verify_type) THEN rsvr_23.status ELSE CASE WHEN (r_23.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_23.status = 0) THEN NULL::integer ELSE rsvr_23.status END END END = 0) OR (CASE WHEN (1 = r_23.verify_type) THEN rcvr_2.status ELSE CASE WHEN (r_23.next_cancel_verify_user = 1001) THEN 0 ELSE CASE WHEN (rcvr_2.status = 0) THEN NULL::integer ELSE rcvr_2.status END END END = 0)))
-> Hash Left Join (cost=4.16..6.42 rows=8 width=210)
Hash Cond: (r_23.id = rsvr_23.erp_purchase_cost_id)
-> Hash Right Join (cost=2.94..5.16 rows=8 width=194)
Hash Cond: (rvr_23.erp_purchase_cost_id = r_23.id)
-> Seq Scan on tbl_erp_purchase_cost_verify_rels rvr_23 (cost=0.00..2.09 rows=45 width=20)
Filter: (user_id = 1001)
-> Hash (cost=2.84..2.84 rows=8 width=178)
-> Seq Scan on tbl_erp_purchase_costs r_23 (cost=0.00..2.84 rows=8 width=178)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.14..1.14 rows=6 width=20)
-> Seq Scan on tbl_erp_purchase_cost_stop_verify_rels rsvr_23 (cost=0.00..1.14 rows=6 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.04..1.04 rows=2 width=20)
-> Seq Scan on tbl_erp_purchase_cost_cancel_verify_rels rcvr_2 (cost=0.00..1.04 rows=2 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 25" (cost=3.61..3.68 rows=1 width=217)
-> GroupAggregate (cost=3.61..3.67 rows=1 width=225)
Group Key: r_24.id, rvr_24.status, rsvr_24.status
-> Sort (cost=3.61..3.61 rows=1 width=179)
Sort Key: r_24.id, rvr_24.status, rsvr_24.status
-> Hash Left Join (cost=2.33..3.60 rows=1 width=179)
Hash Cond: (r_24.id = rsvr_24.erp_wage_ticket_id)
Filter: (((rvr_24.user_id = 1001) OR (rsvr_24.user_id = 1001)) AND ((CASE WHEN (1 = r_24.verify_type) THEN rvr_24.status ELSE CASE WHEN (r_24.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_24.status = 0) THEN NULL::integer ELSE rvr_24.status END END END = 0) OR (CASE WHEN (1 = r_24.verify_type) THEN rsvr_24.status ELSE CASE WHEN (r_24.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_24.status = 0) THEN NULL::integer ELSE rsvr_24.status END END END = 0)))
-> Hash Right Join (cost=1.28..2.50 rows=3 width=171)
Hash Cond: (rvr_24.erp_wage_ticket_id = r_24.id)
-> Seq Scan on tbl_erp_wage_ticket_verify_rels rvr_24 (cost=0.00..1.18 rows=12 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.24..1.24 rows=3 width=155)
-> Seq Scan on tbl_erp_wage_tickets r_24 (cost=0.00..1.24 rows=3 width=155)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.02..1.02 rows=2 width=20)
-> Seq Scan on tbl_erp_wage_ticket_stop_verify_rels rsvr_24 (cost=0.00..1.02 rows=2 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 26" (cost=3.68..3.76 rows=1 width=190)
-> GroupAggregate (cost=3.68..3.75 rows=1 width=198)
Group Key: r_25.id, rvr_25.status, rsvr_25.status
-> Sort (cost=3.68..3.69 rows=1 width=152)
Sort Key: r_25.id, rvr_25.status, rsvr_25.status
-> Hash Left Join (cost=2.31..3.67 rows=1 width=152)
Hash Cond: (r_25.id = rsvr_25.erp_social_insurance_id)
Filter: (((rvr_25.user_id = 1001) OR (rsvr_25.user_id = 1001)) AND ((CASE WHEN (1 = r_25.verify_type) THEN rvr_25.status ELSE CASE WHEN (r_25.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_25.status = 0) THEN NULL::integer ELSE rvr_25.status END END END = 0) OR (CASE WHEN (1 = r_25.verify_type) THEN rsvr_25.status ELSE CASE WHEN (r_25.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_25.status = 0) THEN NULL::integer ELSE rsvr_25.status END END END = 0)))
-> Hash Right Join (cost=1.23..2.55 rows=3 width=144)
Hash Cond: (rvr_25.erp_social_insurance_id = r_25.id)
-> Seq Scan on tbl_erp_social_insurance_verify_rels rvr_25 (cost=0.00..1.27 rows=11 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.20..1.20 rows=3 width=128)
-> Seq Scan on tbl_erp_social_insurances r_25 (cost=0.00..1.20 rows=3 width=128)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.05..1.05 rows=2 width=20)
-> Seq Scan on tbl_erp_social_insurance_stop_verify_rels rsvr_25 (cost=0.00..1.05 rows=2 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 27" (cost=24.64..24.72 rows=1 width=206)
-> GroupAggregate (cost=24.64..24.71 rows=1 width=214)
Group Key: r_26.id, rvr_26.status, rsvr_26.status
-> Sort (cost=24.64..24.65 rows=1 width=168)
Sort Key: r_26.id, rvr_26.status, rsvr_26.status
-> Hash Right Join (cost=2.45..24.63 rows=1 width=168)
Hash Cond: (rsvr_26.erp_provident_fund_id = r_26.id)
Filter: (((rvr_26.user_id = 1001) OR (rsvr_26.user_id = 1001)) AND ((CASE WHEN (1 = r_26.verify_type) THEN rvr_26.status ELSE CASE WHEN (r_26.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_26.status = 0) THEN NULL::integer ELSE rvr_26.status END END END = 0) OR (CASE WHEN (1 = r_26.verify_type) THEN rsvr_26.status ELSE CASE WHEN (r_26.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_26.status = 0) THEN NULL::integer ELSE rsvr_26.status END END END = 0)))
-> Seq Scan on tbl_erp_provident_fund_stop_verify_rels rsvr_26 (cost=0.00..22.12 rows=5 width=20)
Filter: (user_id = 1001)
-> Hash (cost=2.42..2.42 rows=3 width=160)
-> Hash Right Join (cost=1.18..2.42 rows=3 width=160)
Hash Cond: (rvr_26.erp_provident_fund_id = r_26.id)
-> Seq Scan on tbl_erp_provident_fund_verify_rels rvr_26 (cost=0.00..1.20 rows=8 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.15..1.15 rows=3 width=144)
-> Seq Scan on tbl_erp_provident_funds r_26 (cost=0.00..1.15 rows=3 width=144)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Subquery Scan on "*SELECT* 28" (cost=3.43..3.50 rows=1 width=197)
-> GroupAggregate (cost=3.43..3.49 rows=1 width=205)
Group Key: r_27.id, rvr_27.status, rsvr_27.status
-> Sort (cost=3.43..3.43 rows=1 width=159)
Sort Key: r_27.id, rvr_27.status, rsvr_27.status
-> Hash Left Join (cost=2.23..3.42 rows=1 width=159)
Hash Cond: (r_27.id = rsvr_27.erp_personal_tax_id)
Filter: (((rvr_27.user_id = 1001) OR (rsvr_27.user_id = 1001)) AND ((CASE WHEN (1 = r_27.verify_type) THEN rvr_27.status ELSE CASE WHEN (r_27.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_27.status = 0) THEN NULL::integer ELSE rvr_27.status END END END = 0) OR (CASE WHEN (1 = r_27.verify_type) THEN rsvr_27.status ELSE CASE WHEN (r_27.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_27.status = 0) THEN NULL::integer ELSE rsvr_27.status END END END = 0)))
-> Hash Right Join (cost=1.20..2.35 rows=3 width=151)
Hash Cond: (rvr_27.erp_personal_tax_id = r_27.id)
-> Seq Scan on tbl_erp_personal_tax_verify_rels rvr_27 (cost=0.00..1.11 rows=9 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.16..1.16 rows=3 width=135)
-> Seq Scan on tbl_erp_personal_taxs r_27 (cost=0.00..1.16 rows=3 width=135)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.01..1.01 rows=1 width=20)
-> Seq Scan on tbl_erp_personal_tax_stop_verify_rels rsvr_27 (cost=0.00..1.01 rows=1 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 29" (cost=3.30..3.37 rows=1 width=222)
-> GroupAggregate (cost=3.30..3.36 rows=1 width=230)
Group Key: r_28.id, rvr_28.status, rsvr_28.status
-> Sort (cost=3.30..3.30 rows=1 width=184)
Sort Key: r_28.id, rvr_28.status, rsvr_28.status
-> Nested Loop Left Join (cost=1.11..3.29 rows=1 width=184)
Join Filter: (rsvr_28.erp_wage_prize_id = r_28.id)
Filter: (((rvr_28.user_id = 1001) OR (rsvr_28.user_id = 1001)) AND ((CASE WHEN (1 = r_28.verify_type) THEN rvr_28.status ELSE CASE WHEN (r_28.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_28.status = 0) THEN NULL::integer ELSE rvr_28.status END END END = 0) OR (CASE WHEN (1 = r_28.verify_type) THEN rsvr_28.status ELSE CASE WHEN (r_28.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_28.status = 0) THEN NULL::integer ELSE rsvr_28.status END END END = 0)))
-> Hash Right Join (cost=1.11..2.19 rows=2 width=176)
Hash Cond: (rvr_28.erp_wage_prize_id = r_28.id)
-> Seq Scan on tbl_erp_wage_prize_verify_rels rvr_28 (cost=0.00..1.06 rows=5 width=20)
Filter: (user_id = 1001)
-> Hash (cost=1.08..1.08 rows=2 width=160)
-> Seq Scan on tbl_erp_wage_prizes r_28 (cost=0.00..1.08 rows=2 width=160)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Materialize (cost=0.00..1.02 rows=1 width=20)
-> Seq Scan on tbl_erp_wage_prize_stop_verify_rels rsvr_28 (cost=0.00..1.01 rows=1 width=20)
Filter: (user_id = 1001)
-> Subquery Scan on "*SELECT* 30" (cost=11.58..11.66 rows=1 width=391)
-> GroupAggregate (cost=11.58..11.65 rows=1 width=399)
Group Key: r_29.id, rvr_29.status, rsvr_29.status
-> Sort (cost=11.58..11.58 rows=1 width=297)
Sort Key: r_29.id, rvr_29.status, rsvr_29.status
-> Nested Loop Left Join (cost=1.36..11.57 rows=1 width=297)
-> Nested Loop Left Join (cost=1.08..3.26 rows=1 width=296)
Join Filter: (rsvr_29.erp_profit_distribute_id = r_29.id)
Filter: (((rvr_29.user_id = 1001) OR (rsvr_29.user_id = 1001)) AND ((CASE WHEN (1 = r_29.verify_type) THEN rvr_29.status ELSE CASE WHEN (r_29.next_verify_user = 1001) THEN 0 ELSE CASE WHEN (rvr_29.status = 0) THEN NULL::integer ELSE rvr_29.status END END END = 0) OR (CASE WHEN (1 = r_29.verify_type) THEN rsvr_29.status ELSE CASE WHEN (r_29.next_stop_verify_user = 1001) THEN 0 ELSE CASE WHEN (rsvr_29.status = 0) THEN NULL::integer ELSE rsvr_29.status END END END = 0)))
-> Hash Left Join (cost=1.08..2.17 rows=2 width=288)
Hash Cond: (r_29.id = rvr_29.erp_profit_distribute_id)
-> Seq Scan on tbl_erp_profit_distributes r_29 (cost=0.00..1.06 rows=2 width=272)
Filter: ((status <> 0) AND (status = ANY ('{1,5,7}'::integer[])))
-> Hash (cost=1.04..1.04 rows=3 width=20)
-> Seq Scan on tbl_erp_profit_distribute_verify_rels rvr_29 (cost=0.00..1.04 rows=3 width=20)
Filter: (user_id = 1001)
-> Materialize (cost=0.00..1.02 rows=1 width=20)
-> Seq Scan on tbl_erp_profit_distribute_stop_verify_rels rsvr_29 (cost=0.00..1.01 rows=1 width=20)
Filter: (user_id = 1001)
-> Index Scan using tbl_projects_pkey on tbl_projects p (cost=0.28..8.30 rows=1 width=9)
Index Cond: (r_29.project_id = id)