From cdf2dd2b50777104c1f34a9e9d93bb1d70108996 Mon Sep 17 00:00:00 2001 From: jeesun Date: Mon, 5 Aug 2019 16:03:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=94=AF=E6=8C=81sqlserv?= =?UTF-8?q?er=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-common.yml | 2 +- .../main/resources/application-sqlserver.yml | 20 ++ .../resources/mapping/AuthorityMapper.xml | 36 ++++ .../resources/mapping/DictTypeGroupMapper.xml | 20 ++ .../resources/mapping/FontAwesomeMapper.xml | 12 ++ .../resources/mapping/QuartzJobMapper.xml | 19 ++ .../main/resources/mapping/SideMenuMapper.xml | 197 +++++++++++++++++- .../templates/vue/authority/list.html | 11 +- .../templates/vue/sideMenu/list.html | 11 +- 9 files changed, 313 insertions(+), 15 deletions(-) create mode 100644 common/src/main/resources/application-sqlserver.yml diff --git a/common/src/main/resources/application-common.yml b/common/src/main/resources/application-common.yml index 91cd2aa..8da70eb 100644 --- a/common/src/main/resources/application-common.yml +++ b/common/src/main/resources/application-common.yml @@ -3,7 +3,7 @@ security: enabled: false spring: profiles: - active: mysql #pg, mysql, oracle。默认使用MySQL数据库连接配置。 + active: mysql #pg, mysql, oracle,sqlserver。默认使用MySQL数据库连接配置。 thymeleaf: prefix: classpath:/templates/ #默认值 suffix: .html diff --git a/common/src/main/resources/application-sqlserver.yml b/common/src/main/resources/application-sqlserver.yml new file mode 100644 index 0000000..21dcd56 --- /dev/null +++ b/common/src/main/resources/application-sqlserver.yml @@ -0,0 +1,20 @@ +spring: + datasource: + # MySQL连接信息 + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + url: jdbc:sqlserver://localhost:1433;DatabaseName=thymelte + username: sa + password: 123456 + druid: + validation-query: SELECT 1 + jpa: + database-platform: org.hibernate.dialect.SQLServerDialect + +#pagehelper分页插件 +pagehelper: + #禁用reasonable分页参数合理化,页码小于1或者大于最大页码返回空数据 + reasonable: false + params: count=countSql + # oracle,mysql,mariadb,sqlite,hsqldb,postgresql,db2,sqlserver,informix,h2,sqlserver2012 + helper-dialect: sqlserver + support-methods-arguments: true \ No newline at end of file diff --git a/common/src/main/resources/mapping/AuthorityMapper.xml b/common/src/main/resources/mapping/AuthorityMapper.xml index 080f041..957b781 100644 --- a/common/src/main/resources/mapping/AuthorityMapper.xml +++ b/common/src/main/resources/mapping/AuthorityMapper.xml @@ -100,6 +100,42 @@ + + DELETE FROM diff --git a/common/src/main/resources/mapping/DictTypeGroupMapper.xml b/common/src/main/resources/mapping/DictTypeGroupMapper.xml index 3ff39c2..f48ff87 100644 --- a/common/src/main/resources/mapping/DictTypeGroupMapper.xml +++ b/common/src/main/resources/mapping/DictTypeGroupMapper.xml @@ -111,6 +111,26 @@ + + + + + + update t_s_quartz_job set job_status=#{jobStatus} diff --git a/common/src/main/resources/mapping/SideMenuMapper.xml b/common/src/main/resources/mapping/SideMenuMapper.xml index 030a94c..b0a1c79 100644 --- a/common/src/main/resources/mapping/SideMenuMapper.xml +++ b/common/src/main/resources/mapping/SideMenuMapper.xml @@ -129,6 +129,36 @@ ORDER BY order_num ASC + + + + SELECT - , - string_agg( tsma.authority, ',') as authority, - #{language} AS language + , + string_agg( tsma.authority, ',') as authority, + #{language} AS language FROM - t_side_menu tsm - LEFT JOIN t_s_side_menu_multi_languages tsmml ON tsm.id=tsmml.side_menu_id AND tsmml.language=#{language} - LEFT JOIN t_side_menu_authority tsma ON tsm.id = tsma.side_menu_id + t_side_menu tsm + LEFT JOIN t_s_side_menu_multi_languages tsmml ON tsm.id=tsmml.side_menu_id AND tsmml.language=#{language} + LEFT JOIN t_side_menu_authority tsma ON tsm.id = tsma.side_menu_id WHERE - ( tsm.pid IS NULL OR tsm.pid = 0 ) + ( tsm.pid IS NULL OR tsm.pid = 0 ) GROUP BY - + ORDER BY tsm.order_num ASC + + + + DELETE FROM t_side_menu WHERE entity_name=#{entityName} @@ -340,6 +457,33 @@ tsm.id,tsm.remark + + + +