From 7aafd496ab1dd1bd5b1888941ce98dea0dfb5af3 Mon Sep 17 00:00:00 2001 From: "hello@lv" <2256334253@qq.com> Date: Wed, 8 May 2024 19:04:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BA=8C=E6=9C=9F=E8=B0=83=E6=95=B4=20?= =?UTF-8?q?(#926)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: lyx <2027667395@qq.com> Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/926 Co-authored-by: hello@lv <2256334253@qq.com> Co-committed-by: hello@lv <2256334253@qq.com> --- .changeset/dirty-tomatoes-grab.md | 5 +++++ .../src/server/sqls/view_records_contracts.sql | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/dirty-tomatoes-grab.md diff --git a/.changeset/dirty-tomatoes-grab.md b/.changeset/dirty-tomatoes-grab.md new file mode 100644 index 000000000..630efb812 --- /dev/null +++ b/.changeset/dirty-tomatoes-grab.md @@ -0,0 +1,5 @@ +--- +"@hera/plugin-rental": patch +--- + +二期出入库查询视图调整 diff --git a/packages/plugins/@hera/plugin-rental/src/server/sqls/view_records_contracts.sql b/packages/plugins/@hera/plugin-rental/src/server/sqls/view_records_contracts.sql index f57cbd7a4..9e3cd147d 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/sqls/view_records_contracts.sql +++ b/packages/plugins/@hera/plugin-rental/src/server/sqls/view_records_contracts.sql @@ -3,6 +3,8 @@ CREATE OR REPLACE VIEW SELECT c.id AS contract_id, r.id AS record_id, + r.createdAt, + r.updatedAt, CAST('c_' || rc.id AS VARCHAR) AS id, rc.id AS rc_id, -- 页面更新中间表存根联/回根联用 rc.movement, @@ -26,6 +28,8 @@ UNION ALL SELECT NULL AS contract_id, r.id AS record_id, + r.createdAt, + r.updatedAt, CAST('r_' || r.id AS VARCHAR) AS id, NULL AS rc_id, ( @@ -38,7 +42,7 @@ SELECT p3.id AS project_id, rc.has_receipt, rc.has_stub, - '2' AS record_category + '3' AS record_category FROM records r LEFT JOIN record_contract rc ON rc.record_id = r.id