From 829e95da47e75c99b5580f4aa829a4db6bf4dd7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E9=A3=9E?= Date: Tue, 18 Feb 2020 11:34:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B2=E9=83=A8=E8=AF=84=E4=BB=B7=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc-module/epdc-custom/db/mysql.sql | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/esua-epdc/epdc-module/epdc-custom/db/mysql.sql b/esua-epdc/epdc-module/epdc-custom/db/mysql.sql index e69de29bb..f690234a8 100644 --- a/esua-epdc/epdc-module/epdc-custom/db/mysql.sql +++ b/esua-epdc/epdc-module/epdc-custom/db/mysql.sql @@ -0,0 +1,49 @@ +Insert into esua_epdc_custom.epdc_evaluate_dept(ID,DEPT_ID, +DEPT_NAME, +PARENT_DEPT_IDS, +PARENT_DEPT_NAMES, +ALL_DEPT_IDS, +ALL_DEPT_NAMES, +OFFICER_COUNT, +DEL_FLAG, +REVISION, +CREATED_BY, +CREATED_TIME, +UPDATED_BY, +UPDATED_TIME +) SELECT + dept.gridId ID, + dept.gridId DEPT_ID, + dept.grid DEPT_NAME, + dept.communityId PARENT_DEPT_IDS, + dept.community PARENT_DEPT_NAMES, + concat( dept.communityId, ',', dept.gridId ) ALL_DEPT_IDS, + concat( dept.community, '-', dept.grid ) ALL_DEPT_NAMES, + 0 OFFICER_COUNT, + 0 DEL_FLAG, + 1 REVISION, + 'admin' CREATED_BY, + now() CREATED_TIME, + 'admin' UPDATED_BY, + now() UPDATED_TIME +FROM + ( +SELECT + dis.`name` district, + dis.id districtId, + str.`name` street, + str.id streetId, + com.`name` community, + com.id communityId, + gri.`name` grid, + gri.id gridId +FROM + sys_dept gri + LEFT JOIN sys_dept com ON gri.pid = com.id + LEFT JOIN sys_dept str ON com.pid = str.id + LEFT JOIN sys_dept dis ON str.pid = dis.id +WHERE + gri.del_flag = '0' + AND gri.type_key = 'street_party' + AND gri.id NOT IN (SELECT id from esua_epdc_custom.epdc_evaluate_dept where DEL_FLAG = "0") + ) dept \ No newline at end of file