Database Queries

总计21条数据
TimeDurationTypeQuery
  
20:10:10.3782.3 msSELECTSELECT * FROM "global"."vw_user_login" WHERE "id"=1001

20:10:10.3811.4 msSELECTSELECT * FROM "a57be577deb434"."tbl_users" WHERE "id"=1001

20:10:10.38742.1 msSELECTSELECT COUNT(*) FROM (SELECT c.*, CASE WHEN p.client_id IS NULL THEN false ELSE true END AS cooperated, CASE WHEN c.sales_rep IS NULL THEN 0 ELSE 1 END AS is_public, sl.lost_contact_days, extract(epoch from (now() - max(arrive.end_at))) / 86400 AS last_arrive_days, sl.last_contact, max(arrive.end_at) as last_arrive, CASE WHEN c.client_class IS NOT NULL THEN ( (CASE WHEN cl.contact_base > 0 THEN floor(CASE WHEN c.contact_count > cl.contact_base THEN 1 * 15 ELSE c.contact_count * 15 / cl.contact_base END) ELSE 15 END) + floor(c.client_base_info_count * 15 / 9) + (CASE WHEN cl.visit_base > 0 THEN floor(CASE WHEN c.visit_count > ceil((CASE WHEN extract(year from now()) = extract(year from c.created_at::date) THEN (now()::date - c.created_at::date + 1)::float ELSE 242::float END) / cl.visit_base::float) THEN 1 * 20 ELSE c.visit_count * 20 / ceil((CASE WHEN extract(year from now()) = extract(year from c.created_at::date) THEN (now()::date - c.created_at::date + 1)::float ELSE 242::float END) / cl.visit_base::float) END) ELSE 20 END) + (CASE WHEN cl.cooperate_base > 0 THEN floor(CASE WHEN c.cooperate_count > cl.cooperate_base THEN 1 * 20 ELSE c.cooperate_count * 20 / cl.cooperate_base END) ELSE 20 END) + (CASE WHEN cl.case_pre_sales_base > 0 THEN floor(CASE WHEN c.case_pre_sales_count > cl.case_pre_sales_base THEN 1 * 15 ELSE c.case_pre_sales_count * 15 / cl.case_pre_sales_base END) ELSE 15 END) + (CASE WHEN cl.case_implement_base > 0 THEN floor(CASE WHEN c.case_implement_count > cl.case_implement_base THEN 1 * 15 ELSE c.case_implement_count * 15 / cl.case_implement_base END) ELSE 15 END) ) ELSE NULL END as score FROM "a57be577deb434"."tbl_clients" "c" LEFT JOIN "a57be577deb434"."tbl_sales_group_relationships" "sgr" ON sgr.sales_id = c.sales_rep LEFT JOIN "a57be577deb434"."tbl_client_classes" "cl" ON cl.id = c.client_class LEFT JOIN "a57be577deb434"."tbl_client_address_rels" "car" ON car.client_id = c.id LEFT JOIN "a57be577deb434"."tbl_addresses" "a" ON car.address_id = a.id LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_projects" WHERE "project_status"=3 GROUP BY "client_id") "p" ON p.client_id = c.id LEFT JOIN "a57be577deb434"."tbl_work_logs" "arrive" ON (arrive.client_id = c.id) AND ("arrive"."scenario_id"=1) AND ("arrive"."is_draft"=FALSE) AND ("arrive"."location_in_id" IS NOT NULL) AND ("arrive"."location_out_id" IS NOT NULL) AND ("arrive"."client_id" IS NOT NULL) LEFT JOIN (SELECT extract(epoch from (now() - max(end_at))) / 86400 AS lost_contact_days, max(end_at) as last_contact, client_id FROM "a57be577deb434"."tbl_work_logs" WHERE "is_draft"=FALSE GROUP BY "client_id") "sl" ON sl.client_id = c.id LEFT JOIN "a57be577deb434"."tbl_term_taxonomy_relationships" "ttr" ON ttr.object_id = c.id AND ttr.term_id = 14 LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_contacts" WHERE lower(name) LIKE '%金风%' GROUP BY "client_id") "cc" ON cc.client_id = c.id LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_sales_order_items" WHERE (lower(pn) LIKE '%金风%') OR (lower(sn) LIKE '%金风%') OR (lower(description) LIKE '%金风%') GROUP BY "client_id") "s" ON c.id = s.client_id LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_projects" WHERE ("pinyin_shortcut" ILIKE '%金风%') OR ("project_title" ILIKE '%金风%') OR ("description" ILIKE '%金风%') OR ("comment" ILIKE '%金风%') GROUP BY "client_id") "pp" ON c.id = pp.client_id WHERE (("cc"."client_id" IS NOT NULL) OR ("s"."client_id" IS NOT NULL) OR ("pp"."client_id" IS NOT NULL) OR (lower(c.name) LIKE '%金风%') OR ("c"."pinyin_shortcut" LIKE '%金风%') OR (lower(c.description) LIKE '%金风%') OR (lower(c.it_budget) LIKE '%金风%') OR (lower(c.main_business) LIKE '%金风%') OR (lower(c.deployment_mode) LIKE '%金风%') OR (lower(c.it_per_num) LIKE '%金风%') OR (lower(c.public_relations_difficulty) LIKE '%金风%') OR (lower(c.it_status) LIKE '%金风%') OR (lower(c.decision_process) LIKE '%金风%') OR (lower(c.coach) LIKE '%金风%') OR (lower(c.competitor) LIKE '%金风%') OR (lower(c.main_product) LIKE '%金风%') OR (lower(c.headcount) LIKE '%金风%') OR (lower(c.peers) LIKE '%金风%') OR (lower(c.supplier) LIKE '%金风%')) AND ("sgr"."group_id"='1') AND ("c"."sales_rep"='1001') AND ("c"."sales_rep"='1001') AND ("deleted"=FALSE) GROUP BY "c"."id", "cl"."id", "cooperated", "lost_contact_days", "last_contact" ORDER BY "is_public" DESC, lost_contact_days DESC NULLS LAST, "c"."created_at" DESC) "c"

20:10:10.42939.6 msSELECTSELECT c.*, CASE WHEN p.client_id IS NULL THEN false ELSE true END AS cooperated, CASE WHEN c.sales_rep IS NULL THEN 0 ELSE 1 END AS is_public, sl.lost_contact_days, extract(epoch from (now() - max(arrive.end_at))) / 86400 AS last_arrive_days, sl.last_contact, max(arrive.end_at) as last_arrive, CASE WHEN c.client_class IS NOT NULL THEN ( (CASE WHEN cl.contact_base > 0 THEN floor(CASE WHEN c.contact_count > cl.contact_base THEN 1 * 15 ELSE c.contact_count * 15 / cl.contact_base END) ELSE 15 END) + floor(c.client_base_info_count * 15 / 9) + (CASE WHEN cl.visit_base > 0 THEN floor(CASE WHEN c.visit_count > ceil((CASE WHEN extract(year from now()) = extract(year from c.created_at::date) THEN (now()::date - c.created_at::date + 1)::float ELSE 242::float END) / cl.visit_base::float) THEN 1 * 20 ELSE c.visit_count * 20 / ceil((CASE WHEN extract(year from now()) = extract(year from c.created_at::date) THEN (now()::date - c.created_at::date + 1)::float ELSE 242::float END) / cl.visit_base::float) END) ELSE 20 END) + (CASE WHEN cl.cooperate_base > 0 THEN floor(CASE WHEN c.cooperate_count > cl.cooperate_base THEN 1 * 20 ELSE c.cooperate_count * 20 / cl.cooperate_base END) ELSE 20 END) + (CASE WHEN cl.case_pre_sales_base > 0 THEN floor(CASE WHEN c.case_pre_sales_count > cl.case_pre_sales_base THEN 1 * 15 ELSE c.case_pre_sales_count * 15 / cl.case_pre_sales_base END) ELSE 15 END) + (CASE WHEN cl.case_implement_base > 0 THEN floor(CASE WHEN c.case_implement_count > cl.case_implement_base THEN 1 * 15 ELSE c.case_implement_count * 15 / cl.case_implement_base END) ELSE 15 END) ) ELSE NULL END as score FROM "a57be577deb434"."tbl_clients" "c" LEFT JOIN "a57be577deb434"."tbl_sales_group_relationships" "sgr" ON sgr.sales_id = c.sales_rep LEFT JOIN "a57be577deb434"."tbl_client_classes" "cl" ON cl.id = c.client_class LEFT JOIN "a57be577deb434"."tbl_client_address_rels" "car" ON car.client_id = c.id LEFT JOIN "a57be577deb434"."tbl_addresses" "a" ON car.address_id = a.id LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_projects" WHERE "project_status"=3 GROUP BY "client_id") "p" ON p.client_id = c.id LEFT JOIN "a57be577deb434"."tbl_work_logs" "arrive" ON (arrive.client_id = c.id) AND ("arrive"."scenario_id"=1) AND ("arrive"."is_draft"=FALSE) AND ("arrive"."location_in_id" IS NOT NULL) AND ("arrive"."location_out_id" IS NOT NULL) AND ("arrive"."client_id" IS NOT NULL) LEFT JOIN (SELECT extract(epoch from (now() - max(end_at))) / 86400 AS lost_contact_days, max(end_at) as last_contact, client_id FROM "a57be577deb434"."tbl_work_logs" WHERE "is_draft"=FALSE GROUP BY "client_id") "sl" ON sl.client_id = c.id LEFT JOIN "a57be577deb434"."tbl_term_taxonomy_relationships" "ttr" ON ttr.object_id = c.id AND ttr.term_id = 14 LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_contacts" WHERE lower(name) LIKE '%金风%' GROUP BY "client_id") "cc" ON cc.client_id = c.id LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_sales_order_items" WHERE (lower(pn) LIKE '%金风%') OR (lower(sn) LIKE '%金风%') OR (lower(description) LIKE '%金风%') GROUP BY "client_id") "s" ON c.id = s.client_id LEFT JOIN (SELECT "client_id" FROM "a57be577deb434"."tbl_projects" WHERE ("pinyin_shortcut" ILIKE '%金风%') OR ("project_title" ILIKE '%金风%') OR ("description" ILIKE '%金风%') OR ("comment" ILIKE '%金风%') GROUP BY "client_id") "pp" ON c.id = pp.client_id WHERE (("cc"."client_id" IS NOT NULL) OR ("s"."client_id" IS NOT NULL) OR ("pp"."client_id" IS NOT NULL) OR (lower(c.name) LIKE '%金风%') OR ("c"."pinyin_shortcut" LIKE '%金风%') OR (lower(c.description) LIKE '%金风%') OR (lower(c.it_budget) LIKE '%金风%') OR (lower(c.main_business) LIKE '%金风%') OR (lower(c.deployment_mode) LIKE '%金风%') OR (lower(c.it_per_num) LIKE '%金风%') OR (lower(c.public_relations_difficulty) LIKE '%金风%') OR (lower(c.it_status) LIKE '%金风%') OR (lower(c.decision_process) LIKE '%金风%') OR (lower(c.coach) LIKE '%金风%') OR (lower(c.competitor) LIKE '%金风%') OR (lower(c.main_product) LIKE '%金风%') OR (lower(c.headcount) LIKE '%金风%') OR (lower(c.peers) LIKE '%金风%') OR (lower(c.supplier) LIKE '%金风%')) AND ("sgr"."group_id"='1') AND ("c"."sales_rep"='1001') AND ("c"."sales_rep"='1001') AND ("deleted"=FALSE) GROUP BY "c"."id", "cl"."id", "cooperated", "lost_contact_days", "last_contact" ORDER BY "is_public" DESC, lost_contact_days DESC NULLS LAST, "c"."created_at" DESC LIMIT 20

20:10:10.4690.4 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_client_types" WHERE "id"=5

20:10:10.4700.2 msSELECTSELECT "id", "id" AS "key", "name", "notice_days", "color" FROM "a57be577deb434"."tbl_client_classes" WHERE "id"=43

20:10:10.4700.3 msSELECTSELECT * FROM "a57be577deb434"."tbl_term_taxonomy_relationships" WHERE "object_id"=3081

20:10:10.4710.5 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_term_taxonomies" WHERE ("term_id"=14) AND ("id" IN (5, 128, 132, 176, 196, 204, 349, 340)) ORDER BY "sort"

20:10:10.4710.3 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_client_industries" WHERE "id"=57

20:10:10.4720.3 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_company_natures" WHERE "id"=4

20:10:10.4720.2 msSELECTSELECT "id", "id" AS "key", "name", "sex", "client_lock" FROM "a57be577deb434"."tbl_users" WHERE "id"=1001

20:10:10.4730.5 msSELECTSELECT "id", "user_id", "meta_value" AS "name" FROM "a57be577deb434"."tbl_user_meta" WHERE ("meta_key"='avatar') AND ("user_id"=1001)

20:10:10.4730.2 msSELECTSELECT "id", "id" AS "key", "name", "sex", "department_id" FROM "a57be577deb434"."tbl_users" WHERE "id"=1001

20:10:10.4740.2 msSELECTSELECT "id", "user_id", "meta_value" AS "name" FROM "a57be577deb434"."tbl_user_meta" WHERE ("meta_key"='avatar') AND ("user_id"=1001)

20:10:10.4740.3 msSELECTSELECT "id", "id" AS "key", "name" FROM "a57be577deb434"."tbl_departments" WHERE "id"=4

20:10:10.47419.8 msSELECTSELECT "object_id", count(*) as comment FROM "a57be577deb434"."tbl_comments" WHERE ("object_type"=10) AND ("object_id"=3081) GROUP BY "object_id"

20:10:10.4940.3 msSELECTSELECT * FROM "a57be577deb434"."tbl_user_visit_clients" WHERE ("user_id"='5446') AND ("client_id"=3081)

20:10:10.4951.1 msSELECTSELECT "id", "client_id" FROM "a57be577deb434"."tbl_cases" WHERE ("case_status" NOT IN (5, 6)) AND ("client_id"=3081)

20:10:10.4973.5 msSELECTSELECT * FROM "a57be577deb434"."tbl_visit_module_histories" WHERE ("user_id"=1001) AND ("object_type"=29) AND ("visit_date"='2025-08-30')

20:10:10.5000.8 msUPDATEUPDATE "a57be577deb434"."tbl_visit_module_histories" SET "num"=6, "last_visit_at"='now()' WHERE "id"=55415

20:10:10.5011.3 msINSERTINSERT INTO "global"."tbl_api_log" ("code", "schema", "user_id", "device_type", "url", "request", "response", "php_error", "time") VALUES (200, 'a57be577deb434', 1001, 5, 'vue/account/list-client', '{"ClientSearch":{"group":"1","sales_rep":"1001","target":"5446","keyword":"\u91d1\u98ce"},"Filter":{"name":"lost_contact_days","sort":"ASC"},"page":"1","web_access_token":"GwzcwQPxiTG2B3PUDaCrV_Wl4I70m3do"}', '{"code":2000,"result":{"list":[{"id":3081,"name":"\u91d1\u98ce\u79d1\u521b\u98ce\u7535\u8bbe\u5907\u6709\u9650\u516c\u53f8(CAE)-\uff08\u91cd\u590d\u5ba2\u6237\uff09","abbr":"","pinyin_shortcut":"jfkcfdsbyxgsCAEcfkh","description":"\u6240\u5c5e\u884c\u4e1a\u6c7d\u8f66\/\u667a\u80fd\u5236\u9020\u516c\u53f8\u4ea7\u54c1\u98ce\u7535\u8bbe\u5907\u3001\u667a\u6167\u50a8\u80fd\u5355\u5143\u5ba2\u6237\u7fa4\u98ce\u7535\u8fd0\u8425\u5546\u7ade\u4e89\u4f18\u52bf\u7ade\u4e89\u5bf9\u624b\uff08\u542f\u4fe1\u5b9d\u7ade\u54c1\u4fe1\u606f\u660e\u786e\u6807\u660e\uff09\u745e\u80fd\u5317\u65b9\u98ce\u7535\u8bbe\u5907\u6709\u9650\u516c\u53f8\u516c\u53f8\u4eba\u65701210\u79d1\u7814\u56e2\u961f\uff08\u542f\u4fe1\u5b9d\u660e\u786e\u6807\u660e\uff0977\u4e13\u5229\uff08\u542f\u4fe1\u5b9d\u660e\u786e\u6807\u660e\uff092814","corp_rep":"","website":"https:\/\/www.goldwind.com\/cn\/windpower\/solution-onshore\/","capital":"","established_at":"2006-02-13","headcount":"","reg_address":"","working_address":"","telephone":"","fax":"","scale":"","branch":"","purchase_scale_per_yr":"0.0","purchase_freq":"","company_nature":4,"client_class":43,"client_industry":57,"client_type":5,"sales_rep":1001,"main_contact":"","created_by":1001,"created_at":"2024-05-10 18:01:54","updated_at":"2025-08-29 12:48:43","main_business":"","deleted":false,"capital_currency":"rmb","invoice_info":"","logo":"","en_name":"","pick_at":"2024-10-28 17:59:52","it_budget":"","deployment_mode":"","it_per_num":"","public_relations_difficulty":"","it_status":"","decision_process":"","coach":"","competitor":"","peers":"","supplier":"","main_product":"","client_base_info_count":3,"client_key_info_count":0,"contact_count":7,"visit_count":2,"cooperate_count":0,"case_pre_sales_count":0,"case_implement_count":0,"is_overdue_remind":false,"from_contact":5750,"tax_no":"","cooperated":false,"is_public":1,"lost_contact_days":"387.152898508785","last_arrive_days":"459.365398508785","last_contact":"2024-08-08 16:30:00","last_arrive":"2024-05-28 11:24:00+08","score":"22","clientType":{"id":5,"key":5,"name":"\u5546\u4e1a"},"clientClass":{"id":43,"key":43,"name":"\u6f5c\u529b\u5ba2\u6237","notice_days":60,"color":"#1EE6DC"},"clientFrom":"","clientIndustry":{"id":57,"key":57,"name":"EDA\/CAE"},"companyNature":{"id":4,"key":4,"name":"\u6c11\u8425\u4f01\u4e1a"},"salesRep":{"id":1001,"key":1001,"name":"\u5218\u4eba\u8bda","sex":"M","client_lock":false,"avatar":{"id":2,"user_id":1001,"name":"\/files\/cdn\/a57be577deb434\/avatar\/9f73cfbd-bae6-3b50-b7ac-61b936c40727.png"}},"createdBy":{"id":1001,"key":1001,"name":"\u5218\u4eba\u8bda","sex":"M","department_id":4,"avatar":{"id":2,"user_id":1001,"name":"\/files\/cdn\/a57be577deb434\/avatar\/9f73cfbd-bae6-3b50-b7ac-61b936c40727.png"},"department":{"id":4,"key":4,"name":"\u603b\u7ecf\u7406"}},"commentCount":{"object_id":3081,"comment":4},"visitUsers":[{"id":6580,"client_id":3081,"user_id":5446}],"unCloseCases":[],"checked":true}],"pagenation":{"totalcount":1,"thispage":1,"pagesize":20}},"status":1,"msg":[{"name":"success","success":"\u6210\u529f\u83b7\u53d6\u6570\u636e","error":""}],"mod":0}', FALSE, '2025-08-30 20:10:10') RETURNING "id"