From fd42035863d53c237372cb03b875ea044947eda3 Mon Sep 17 00:00:00 2001 From: lijiarao Date: Wed, 18 Sep 2024 17:49:27 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=A0=87=E5=8D=8F=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E7=9A=84=E8=A7=86=E5=9B=BE=20=E5=A4=8D=E5=88=B6=E5=88=B0=20?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E8=A7=86=E5=9B=BE=EF=BC=88=E6=96=B0=EF=BC=89?= =?UTF-8?q?.sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/统计视图(新).sql | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/db/统计视图(新).sql b/db/统计视图(新).sql index 3a6bbf31..384f8af2 100644 --- a/db/统计视图(新).sql +++ b/db/统计视图(新).sql @@ -2109,4 +2109,26 @@ from ( ) pp where pp.allMoney is not null and pp.allMoney != 0 -order by pp.createTime; \ No newline at end of file +order by pp.createTime; + +-- 20240705 标协会员的视图创建 +drop view if exists v_member_project_subitem; +CREATE VIEW v_member_project_subitem AS +select t1.id, + t1.member_no AS member_no, + t1.company_id AS company_id, + t1.company_name AS company_name, + t1.liaison_man_id AS liaison_man_id, + t1.member_status AS member_status, + t1.effective_date AS effective_date, + t1.invalidation_date AS invalidation_date, + t1.create_time AS create_time, + t1.project_id AS project_id +from tb_member_project_subitem t1 + join + (select tb_member_project_subitem.company_id AS company_id, + max(tb_member_project_subitem.create_time) AS max_create_time + from tb_member_project_subitem + group by tb_member_project_subitem.company_id) t2 on t1.company_id = t2.company_id + and t1.create_time = t2.max_create_time +where t1.member_status is not null; \ No newline at end of file