diff --git a/build.gradle b/build.gradle index 2384d7962..4f642ce95 100644 --- a/build.gradle +++ b/build.gradle @@ -286,6 +286,7 @@ subprojects { implementation group: 'org.quartz-scheduler', name: 'quartz', version: "${quartzVersion}" //database implementation group: 'mysql', name: 'mysql-connector-java', version: "${mysqlconnectorjavaVersion}" + implementation group: 'org.postgresql', name: 'postgresql', version: "${postgresqlVersion}" implementation group: 'com.alibaba', name: 'druid', version: "${druidVersion}" implementation group: 'com.alibaba', name: 'druid-spring-boot-starter', version: "${druidspringbootstarterVersion}" implementation group: 'redis.clients', name: 'jedis', version: "${jedisVersion}" diff --git a/config/build_docker.gradle b/config/build_docker.gradle index bc533b5a9..ee4d2d11d 100644 --- a/config/build_docker.gradle +++ b/config/build_docker.gradle @@ -282,6 +282,7 @@ subprojects { implementation group: 'org.quartz-scheduler', name: 'quartz', version: "${quartzVersion}" //database implementation group: 'mysql', name: 'mysql-connector-java', version: "${mysqlconnectorjavaVersion}" + implementation group: 'org.postgresql', name: 'postgresql', version: "${postgresqlVersion}" implementation group: 'com.alibaba', name: 'druid', version: "${druidVersion}" implementation group: 'com.alibaba', name: 'druid-spring-boot-starter', version: "${druidspringbootstarterVersion}" implementation group: 'redis.clients', name: 'jedis', version: "${jedisVersion}" diff --git a/config/build_jar.gradle b/config/build_jar.gradle index 87724c9c1..009bee4af 100644 --- a/config/build_jar.gradle +++ b/config/build_jar.gradle @@ -282,6 +282,7 @@ subprojects { implementation group: 'org.quartz-scheduler', name: 'quartz', version: "${quartzVersion}" //database implementation group: 'mysql', name: 'mysql-connector-java', version: "${mysqlconnectorjavaVersion}" + implementation group: 'org.postgresql', name: 'postgresql', version: "${postgresqlVersion}" implementation group: 'com.alibaba', name: 'druid', version: "${druidVersion}" implementation group: 'com.alibaba', name: 'druid-spring-boot-starter', version: "${druidspringbootstarterVersion}" implementation group: 'redis.clients', name: 'jedis', version: "${jedisVersion}" diff --git a/config/build_standard.gradle b/config/build_standard.gradle index 6d8ea169d..a9d90f65f 100644 --- a/config/build_standard.gradle +++ b/config/build_standard.gradle @@ -283,6 +283,7 @@ subprojects { implementation group: 'org.quartz-scheduler', name: 'quartz', version: "${quartzVersion}" //database implementation group: 'mysql', name: 'mysql-connector-java', version: "${mysqlconnectorjavaVersion}" + implementation group: 'org.postgresql', name: 'postgresql', version: "${postgresqlVersion}" implementation group: 'com.alibaba', name: 'druid', version: "${druidVersion}" implementation group: 'com.alibaba', name: 'druid-spring-boot-starter', version: "${druidspringbootstarterVersion}" implementation group: 'redis.clients', name: 'jedis', version: "${jedisVersion}" diff --git a/gradle.properties b/gradle.properties index 00b799b40..9a9e9e46b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -61,6 +61,7 @@ swaggerVersion =1.6.2 swaggerV3Version =2.1.6 knife4jVersion =3.0.2 #database +postgresqlVersion =42.2.20 mysqlconnectorjavaVersion =8.0.21 druidVersion =1.2.5 druidspringbootstarterVersion =1.2.5 diff --git a/maxkey-core/src/main/java/org/maxkey/entity/Groups.java b/maxkey-core/src/main/java/org/maxkey/entity/Groups.java index b34f2a6ee..1a90ae88b 100644 --- a/maxkey-core/src/main/java/org/maxkey/entity/Groups.java +++ b/maxkey-core/src/main/java/org/maxkey/entity/Groups.java @@ -67,7 +67,7 @@ public class Groups extends JpaBaseEntity implements Serializable { @Column String modifiedDate; @Column - String status; + int status; public Groups() { } @@ -153,11 +153,11 @@ public class Groups extends JpaBaseEntity implements Serializable { this.modifiedDate = modifiedDate; } - public String getStatus() { + public int getStatus() { return status; } - public void setStatus(String status) { + public void setStatus(int status) { this.status = status; } diff --git a/maxkey-core/src/main/java/org/maxkey/entity/Organizations.java b/maxkey-core/src/main/java/org/maxkey/entity/Organizations.java index ff60bcbd7..f055bc2e9 100644 --- a/maxkey-core/src/main/java/org/maxkey/entity/Organizations.java +++ b/maxkey-core/src/main/java/org/maxkey/entity/Organizations.java @@ -78,13 +78,13 @@ public class Organizations extends JpaBaseEntity implements Serializable { @Column private String email; @Column - private String sortIndex; + private long sortIndex; @Column private String ldapDn; @Column private String description; - private String status; + private int status; @Column private String extId; @Column @@ -256,14 +256,6 @@ public class Organizations extends JpaBaseEntity implements Serializable { this.email = email; } - public String getSortOrder() { - return sortOrder; - } - - public void setSortOrder(String sortOrder) { - this.sortOrder = sortOrder; - } - public String getDescription() { return description; } @@ -288,11 +280,11 @@ public class Organizations extends JpaBaseEntity implements Serializable { this.namePath = namePath; } - public String getSortIndex() { + public long getSortIndex() { return sortIndex; } - public void setSortIndex(String sortIndex) { + public void setSortIndex(long sortIndex) { this.sortIndex = sortIndex; } @@ -306,11 +298,11 @@ public class Organizations extends JpaBaseEntity implements Serializable { this.ldapDn = ldapDn; } - public String getStatus() { + public int getStatus() { return status; } - public void setStatus(String status) { + public void setStatus(int status) { this.status = status; } diff --git a/maxkey-core/src/main/java/org/maxkey/persistence/db/LoginService.java b/maxkey-core/src/main/java/org/maxkey/persistence/db/LoginService.java index 09fddb3c0..4300777e3 100644 --- a/maxkey-core/src/main/java/org/maxkey/persistence/db/LoginService.java +++ b/maxkey-core/src/main/java/org/maxkey/persistence/db/LoginService.java @@ -52,7 +52,7 @@ public class LoginService { private static final String LOGOUT_USERINFO_UPDATE_STATEMENT = "update mxk_userinfo set lastlogofftime = ? , online = " + UserInfo.ONLINE.OFFLINE + " where id = ?"; - private static final String GROUPS_SELECT_STATEMENT = "select distinct g.id,g.name from mxk_userinfo u,`mxk_groups` g,mxk_group_member gm where u.id = ? and u.id=gm.memberid and gm.groupid=g.id "; + private static final String GROUPS_SELECT_STATEMENT = "select distinct g.id,g.name from mxk_userinfo u,mxk_groups g,mxk_group_member gm where u.id = ? and u.id=gm.memberid and gm.groupid=g.id "; private static final String DEFAULT_USERINFO_SELECT_STATEMENT = "select * from mxk_userinfo where username = ?"; diff --git a/maxkey-identitys/maxkey-synchronizers/src/main/java/org/maxkey/synchronizer/workweixin/WorkweixinOrganizationService.java b/maxkey-identitys/maxkey-synchronizers/src/main/java/org/maxkey/synchronizer/workweixin/WorkweixinOrganizationService.java index f4e5e8fdd..9cdf6172a 100644 --- a/maxkey-identitys/maxkey-synchronizers/src/main/java/org/maxkey/synchronizer/workweixin/WorkweixinOrganizationService.java +++ b/maxkey-identitys/maxkey-synchronizers/src/main/java/org/maxkey/synchronizer/workweixin/WorkweixinOrganizationService.java @@ -76,7 +76,7 @@ public class WorkweixinOrganizationService implements ISynchronizerService{ org.setId(dept.getId()+""); org.setName(dept.getName()); org.setParentId(dept.getParentid()+""); - org.setSortIndex(dept.getOrder()+""); + org.setSortIndex(dept.getOrder()); return org; } diff --git a/maxkey-lib/hgjdbc-6.0.4-jdbc42.jar b/maxkey-lib/hgjdbc-6.0.4-jdbc42.jar new file mode 100644 index 000000000..01710ae13 Binary files /dev/null and b/maxkey-lib/hgjdbc-6.0.4-jdbc42.jar differ diff --git a/maxkey-lib/mybatis-jpa-extra-2.3.jar b/maxkey-lib/mybatis-jpa-extra-2.3.jar index 8bd855a6b..6c1fc0817 100644 Binary files a/maxkey-lib/mybatis-jpa-extra-2.3.jar and b/maxkey-lib/mybatis-jpa-extra-2.3.jar differ diff --git a/maxkey-persistence/src/main/java/org/maxkey/persistence/service/OrganizationsService.java b/maxkey-persistence/src/main/java/org/maxkey/persistence/service/OrganizationsService.java index 07aeae735..fd374ede6 100644 --- a/maxkey-persistence/src/main/java/org/maxkey/persistence/service/OrganizationsService.java +++ b/maxkey-persistence/src/main/java/org/maxkey/persistence/service/OrganizationsService.java @@ -176,7 +176,7 @@ public class OrganizationsService extends JpaBaseService{ // 排序 Cell cell = row.getCell(k); String sortIndex=getValue(cell); - organization.setSortIndex(sortIndex.equals("") ? "1" : sortIndex); + organization.setSortIndex(sortIndex.equals("") ? 1 : Integer.parseInt(sortIndex)); } else if (k == 11) { // 联系人 Cell cell = row.getCell(k); @@ -219,7 +219,7 @@ public class OrganizationsService extends JpaBaseService{ organization.setDescription(getValue(cell)); } } - organization.setStatus("1"); + organization.setStatus(1); orgsList.add(organization); } diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AccountsMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AccountsMapper.xml new file mode 100644 index 000000000..68ff01084 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AccountsMapper.xml @@ -0,0 +1,32 @@ + + + + + + + and id = #{id} + + + and appid = #{appId} + + + and username = #{username} + + + and relatedusername = #{relatedUsername} + + + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsAdaptersMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsAdaptersMapper.xml new file mode 100644 index 000000000..0a3a95b98 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsAdaptersMapper.xml @@ -0,0 +1,30 @@ + + + + + + + and id = #{id} + + + and name like '%${name}%' + + + and protocol = #{protocol} + + + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsCasDetailsMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsCasDetailsMapper.xml new file mode 100644 index 000000000..b0b068d81 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsCasDetailsMapper.xml @@ -0,0 +1,18 @@ + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsFormBasedDetailsMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsFormBasedDetailsMapper.xml new file mode 100644 index 000000000..2a2affafd --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsFormBasedDetailsMapper.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsJwtDetailsMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsJwtDetailsMapper.xml new file mode 100644 index 000000000..a67202759 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsJwtDetailsMapper.xml @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsMapper.xml new file mode 100644 index 000000000..3244e33c8 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsMapper.xml @@ -0,0 +1,197 @@ + + + + + + + and id = #{id} + + + and name like '%${name}%' + + + and protocol = #{protocol} + + + and credential = #{credential} + + + and category = #{category} + + + and vendor = #{vendor} + + + + + + + + + insert into mxk_apps( + id, + name, + icon, + loginurl, + protocol, + category, + secret, + description, + vendor, + vendorurl, + + credential, + sharedusername, + sharedpassword, + systemuserattr, + + isextendattr, + extendattr, + userpropertys, + + issignature, + + isadapter, + adapter, + + principal, + credentials, + + visible, + + sortindex, + + createdby, + createddate, + + status, + + logouturl, + logouttype + )values( + #{id}, + #{name}, + #{icon}, + #{loginUrl}, + #{protocol}, + #{category}, + #{secret}, + #{description}, + #{vendor} , + #{vendorUrl}, + + #{credential}, + #{sharedUsername}, + #{sharedPassword}, + #{systemUserAttr}, + + #{isExtendAttr}, + #{extendAttr}, + #{userPropertys}, + #{isSignature}, + + #{isAdapter}, + #{adapter}, + + #{principal}, + #{credentials}, + + #{visible}, + + #{sortIndex}, + + #{createdBy}, + #{createdDate} , + + #{status}, + + #{logoutUrl}, + #{logoutType} + ) + + + + update mxk_apps set + name = #{name}, + + icon = #{icon}, + + loginurl = #{loginUrl}, + protocol = #{protocol}, + category = #{category}, + secret = #{secret}, + description = #{description}, + vendor = #{vendor}, + vendorurl = #{vendorUrl}, + + credential = #{credential}, + sharedusername = #{sharedUsername}, + sharedpassword = #{sharedPassword}, + systemuserattr = #{systemUserAttr}, + + userpropertys = #{userPropertys}, + issignature = #{isSignature}, + + + isadapter = #{isAdapter}, + adapter = #{adapter}, + + principal = #{principal}, + credentials = #{credentials}, + visible = #{visible}, + sortindex = #{sortIndex}, + + modifiedby = #{modifiedBy}, + modifieddate = #{modifiedDate}, + + status = #{status}, + + logouturl = #{logoutUrl}, + logouttype = #{logoutType} + where + id = #{id} + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsSaml20DetailsMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsSaml20DetailsMapper.xml new file mode 100644 index 000000000..c0c6e8582 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsSaml20DetailsMapper.xml @@ -0,0 +1,34 @@ + + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsTokenBasedDetailsMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsTokenBasedDetailsMapper.xml new file mode 100644 index 000000000..d2dc02ac3 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/AppsTokenBasedDetailsMapper.xml @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/ForgotPasswordMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/ForgotPasswordMapper.xml new file mode 100644 index 000000000..9b4906d2b --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/ForgotPasswordMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/GroupMemberMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/GroupMemberMapper.xml new file mode 100644 index 000000000..3458631fa --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/GroupMemberMapper.xml @@ -0,0 +1,260 @@ + + + + + + + and id = #{id} + + + and name = #{name} + + + + + + + + + + + + + + + + + + insert into mxk_group_member( + id, + groupid, + memberid, + type + ) + select + concat_ws('-','UD','${id}',u.id) id, + '${id}' groupid, + u.id memberid, + 'USER-DYNAMIC' as type + from mxk_userinfo u + where not exists( + select 1 from mxk_group_member gm + where gm.groupid=#{id} + and gm.memberid=u.id + and gm.type='USER-DYNAMIC' + ) + + and (${filters}) + + + and u.departmentid in( ${orgIdsList}) + + + + + delete from mxk_group_member gm + where type = 'user-dynamic' + and gm.groupid=#{id} + and not exists( + select 1 + from mxk_userinfo u + where 1 = 1 + and u.id=gm.memberid + + and (${filters}) + + + and u.departmentid in ( ${orgIdsList}) + + ) + + + + delete from mxk_group_member gm + where gm.groupid=#{value} + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/GroupPrivilegesMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/GroupPrivilegesMapper.xml new file mode 100644 index 000000000..e5e7bc0b7 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/GroupPrivilegesMapper.xml @@ -0,0 +1,61 @@ + + + + + + + and apps.id = #{id} + + + and apps.name like '%${name}%' + + + and apps.protocol = #{protocol} + + + and apps.category = #{category} + + + + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/GroupsMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/GroupsMapper.xml new file mode 100644 index 000000000..314695df2 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/GroupsMapper.xml @@ -0,0 +1,58 @@ + + + + + + + and id = #{id} + + + and name like '%${name}%' + + + + + + + + + + + + update mxk_groups set + status = '2' + where 1 = 1 + + and id = #{id} + + + and name = #{name} + + + + + + update mxk_groups set status='2' where id in + + #{item} + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/HistoryLoginAppsMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/HistoryLoginAppsMapper.xml new file mode 100644 index 000000000..ba27ae8e0 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/HistoryLoginAppsMapper.xml @@ -0,0 +1,54 @@ + + + + + + + and id = #{id} + + + and sessionid = #{sessionId} + + + and appid = #{appId} + + + and appname like concat('%',#{appName},'%') + + + and uid = #{uid} + + + and username like concat('%',#{username},'%') + + + and displayname like concat('%',#{displayName},'%') + + + and logintime >= #{startDate} + + + and #{endDate} >= logintime + + + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/HistoryLoginMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/HistoryLoginMapper.xml new file mode 100644 index 000000000..ffde7d882 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/HistoryLoginMapper.xml @@ -0,0 +1,72 @@ + + + + + + + and id = #{id} + + + and uid = #{uid} + + + and lower(username) like lower(concat('%',#{username},'%')) + + + and lower(message) like lower(concat('%',#{message},'%')) + + + and lower(displayname) like lower(concat('%',#{displayName},'%')) + + + + and logintime >= #{startDate} + + + and #{endDate} >= logintime + + + and sessionid = #{sessionId} + + + and logintype = #{loginType} + + + and sourceip = #{sourceIp} + + + + + + + + + update mxk_history_login set + logouttime = current_timestamp + where + sessionid = #{value} + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/HistoryLogsMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/HistoryLogsMapper.xml new file mode 100644 index 000000000..350d4da18 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/HistoryLogsMapper.xml @@ -0,0 +1,55 @@ + + + + + + + and id = #{id} + + + and lower(servicename) like lower(concat('%',#{serviceName},'%')) + + + and lower(message) like lower(concat('%',#{message},'%')) + + + and createddate between #{startDate} and #{endDate} + + + and createdby = #{createdBy} + + + + and lower(username) like lower(concat('%',#{username},'%')) + + + and messagetype = #{messageType} + + + and operatetype = #{operateType} + + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/NoticesMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/NoticesMapper.xml new file mode 100644 index 000000000..1606c52d1 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/NoticesMapper.xml @@ -0,0 +1,36 @@ + + + + + + + and id = #{id} + + + and title like '%${title}%' + + + + + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/OrganizationsMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/OrganizationsMapper.xml new file mode 100644 index 000000000..2b6ca69be --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/OrganizationsMapper.xml @@ -0,0 +1,58 @@ + + + + + + + and id = #{id} + + + and name like '%#{name}%' + + + and parentid = #{parentId} + + + and parentname like '%#{parentName}%' + + + + + + + + + + + update mxk_organizations set status = '2' + where 1 = 1 + + and id = #{id} + + + and name = #{name} + + + and status = '1' + + + and codepath = #{codePath} + + + + + UPDATE MXK_ORGANIZATIONS SET STATUS = '2' + WHERE ID IN + + #{selectId} + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/PasswordPolicyMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/PasswordPolicyMapper.xml new file mode 100644 index 000000000..21c258c02 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/PasswordPolicyMapper.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/RegistrationMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/RegistrationMapper.xml new file mode 100644 index 000000000..84a5378a5 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/RegistrationMapper.xml @@ -0,0 +1,23 @@ + + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/ReportMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/ReportMapper.xml new file mode 100644 index 000000000..d55ff14a0 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/ReportMapper.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/ResourcesMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/ResourcesMapper.xml new file mode 100644 index 000000000..c99475f9e --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/ResourcesMapper.xml @@ -0,0 +1,55 @@ + + + + + + + and res.id = #{id} + + + and res.appid = #{appId} + + + and res.parentid = #{parentId} + + + and res.name like '%${name}%' + + + + + + + + + + update mxk_resources set + status = '2' + where 1 = 1 + + and id = #{id} + + + and name = #{name} + + + + + + update mxk_resources set status='2' where id in + + #{item} + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/RoleMemberMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/RoleMemberMapper.xml new file mode 100644 index 000000000..9b45878ef --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/RoleMemberMapper.xml @@ -0,0 +1,261 @@ + + + + + + + and id = #{id} + + + and name = #{name} + + + + + + + + + + + + + + + + + + insert into mxk_role_member( + id, + roleid, + memberid, + type + ) + select + concat_ws('-','UD','${id}',u.id) id, + '${id}' ROLEID, + u.id memberid, + 'USER-DYNAMIC' type + from mxk_userinfo u + where not exists( + select 1 from mxk_role_member rm + where rm.roleid=#{id} + and rm.memberid=u.id + and rm.type='USER-DYNAMIC' + ) + + ${filters} + + + and u.departmentid in( ${orgIdsList}) + + + + + delete from mxk_role_member rm + where type = 'USER-DYNAMIC' + and rm.roleid = #{id} + and not exists( + select 1 + from mxk_userinfo u + where 1 = 1 + and u.id=rm.memberid + + ${filters} + + + and u.departmentid in( ${orgIdsList}) + + ) + + + + delete from mxk_role_member rm + where rm.roleid=#{value} + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/RolesMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/RolesMapper.xml new file mode 100644 index 000000000..3fa6c9f1c --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/RolesMapper.xml @@ -0,0 +1,92 @@ + + + + + + + and id = #{id} + + + and name like '%${name}%' + + + + + + + + + + update mxk_roles set + status = '2' + where 1 = 1 + + and id = #{id} + + + and name = #{name} + + + + + + update mxk_roles set status='2' where id in + + #{item} + + + + + + + + update mxk_role_permissions set status=9 where id in + + #{item.id} + + + + + insert into mxk_role_permissions ( id,appid,roleid,resourceid,status) + values + + (#{item.id},#{item.appId},#{item.roleId},#{item.resourceId},#{item.status}) + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/SynchronizersMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/SynchronizersMapper.xml new file mode 100644 index 000000000..100e745c1 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/SynchronizersMapper.xml @@ -0,0 +1,25 @@ + + + + + + + and id = #{id} + + + and name like '%${name}%' + + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/UserInfoAdjointMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/UserInfoAdjointMapper.xml new file mode 100644 index 000000000..cf632f8fd --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/UserInfoAdjointMapper.xml @@ -0,0 +1,49 @@ + + + + + + + and id = #{id} + + + and userid = #{userId} + + + + + + + + + + update mxk_userinfo_adjunct set + status = '2' + where 1 = 1 + + and id = #{id} + + + and name = #{name} + + + + + + update mxk_userinfo_adjunct set status='2' where id in + + #{item} + + + + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/UserInfoMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/UserInfoMapper.xml new file mode 100644 index 000000000..7bcea1efc --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/highgo/UserInfoMapper.xml @@ -0,0 +1,252 @@ + + + + + + + + + + update mxk_userinfo set + + islocked = #{isLocked}, + + modifieddate = current_timestamp + where + id = #{id} + + + + update mxk_userinfo set + + islocked = #{isLocked}, + badpwdcount = 0, + + unlockdate = current_timestamp, + modifieddate = current_timestamp + where + id = #{id} + + + + update mxk_userinfo set + + password = #{password}, + decipherable = #{decipherable}, + + passwordsettype = 0, + passwordlastsettime = current_timestamp + where + id = #{id} + + + + update mxk_userinfo set + + sharedsecret = #{sharedSecret}, + sharedcounter = #{sharedCounter}, + + modifieddate = current_timestamp + where + id = #{id} + + + + update mxk_userinfo set + + apploginpassword = #{appLoginPassword}, + + modifieddate = current_timestamp + where + id = #{id} + + + + update mxk_userinfo set + + protectedapps = #{protectedApps}, + + modifieddate = current_timestamp + where + id = #{id} + + + + update mxk_userinfo set + + passwordquestion = #{passwordQuestion}, + passwordanswer = #{passwordAnswer}, + + modifieddate = current_timestamp + where + id = #{id} + + + + update mxk_userinfo set + + authntype = #{authnType}, + + modifieddate = current_timestamp + where + id = #{id} + + + + update mxk_userinfo set + + email = #{email}, + + + emailverified = #{emailVerified}, + + + theme = #{theme}, + + modifieddate = current_timestamp + where + id = #{id} + + + + update mxk_userinfo set + + mobile = #{mobile}, + + + mobileverified = #{mobileVerified}, + + modifieddate = current_timestamp + where + id = #{id} + + + + update mxk_userinfo set status='2' where id in + + #{item} + + + + + update mxk_userinfo set + displayname = #{displayName}, + nickname = #{nickName}, + namezhspell = #{nameZhSpell}, + namezhshortspell= #{nameZhShortSpell}, + givenname = #{givenName}, + middlename = #{middleName}, + familyname = #{familyName}, + honorificprefix = #{honorificPrefix}, + honorificsuffix = #{honorificSuffix}, + formattedname = #{formattedName} , + married = #{married}, + gender = #{gender}, + birthdate = #{birthDate}, + + picture = #{picture}, + + idtype = #{idType}, + idcardno = #{idCardNo}, + website = #{webSite}, + + locale = #{locale}, + timezone = #{timeZone}, + preferredlanguage= #{preferredLanguage}, + + windowsaccount = #{windowsAccount}, + + workcountry = #{workCountry}, + workregion = #{workRegion}, + worklocality = #{workLocality}, + workstreetaddress= #{workStreetAddress}, + workaddressformatted= #{workAddressFormatted}, + workemail = #{workEmail}, + workphonenumber = #{workPhoneNumber}, + workpostalcode = #{workPostalCode}, + workfax = #{workFax}, + + homecountry = #{homeCountry}, + homeregion = #{homeRegion}, + homelocality = #{homeLocality}, + homestreetaddress= #{homeStreetAddress}, + homeaddressformatted= #{homeAddressFormatted}, + homeemail = #{homeEmail}, + homephonenumber= #{homePhoneNumber}, + homepostalcode = #{homePostalCode}, + homefax = #{homeFax}, + + extraattribute = #{extraAttribute}, + + modifiedby = #{modifiedBy}, + modifieddate = current_timestamp + where + id = #{id} + + + \ No newline at end of file diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/postgresql/GroupMemberMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/postgresql/GroupMemberMapper.xml index 98719a1a0..d1c538275 100644 --- a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/postgresql/GroupMemberMapper.xml +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/postgresql/GroupMemberMapper.xml @@ -218,7 +218,7 @@ concat_ws('-','UD','${id}',u.id) id, '${id}' groupid, u.id memberid, - 'USER-DYNAMIC' type + 'USER-DYNAMIC' as type from mxk_userinfo u where not exists( select 1 from mxk_group_member gm diff --git a/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/postgresql/SynchronizersMapper.xml b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/postgresql/SynchronizersMapper.xml new file mode 100644 index 000000000..100e745c1 --- /dev/null +++ b/maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/postgresql/SynchronizersMapper.xml @@ -0,0 +1,25 @@ + + + + + + + and id = #{id} + + + and name like '%${name}%' + + + + + + + \ No newline at end of file diff --git a/maxkey-web-manage/src/main/resources/application.properties b/maxkey-web-manage/src/main/resources/application.properties index 3a90781e1..61f8c854d 100644 --- a/maxkey-web-manage/src/main/resources/application.properties +++ b/maxkey-web-manage/src/main/resources/application.properties @@ -34,20 +34,37 @@ spring.servlet.multipart.max-file-size=4194304 #server.servlet.encoding.force= ############################################################################ -#database configuration # +#database configuration +# supported database +# mysql +# highgo +# postgresql ############################################################################ +spring.datasource.type=com.alibaba.druid.pool.DruidDataSource +#mysql spring.datasource.username=root spring.datasource.password=maxkey spring.datasource.url=jdbc:mysql://localhost/maxkey?autoReconnect=true&characterEncoding=UTF-8&serverTimezone=UTC spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.type=com.alibaba.druid.pool.DruidDataSource +#highgo +#spring.datasource.username=highgo +#spring.datasource.password=High@123 +#spring.datasource.url=jdbc:highgo://192.168.56.107:5866/highgo?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai +#spring.datasource.driver-class-name=com.highgo.jdbc.Driver +#postgresql +#spring.datasource.username=root +#spring.datasource.password=maxkey! +#spring.datasource.url=jdbc:postgresql://localhost/maxkey?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai +#spring.datasource.driver-class-name=org.postgresql.Driver + #mybatis mybatis.dialect=mysql mybatis.type-aliases-package=org.maxkey.entity,org.maxkey.entity.apps, mybatis.mapper-locations=classpath*:/org/maxkey/persistence/mapper/xml/${mybatis.dialect}/*.xml mybatis.table-column-snowflake-datacenter-id=1 mybatis.table-column-snowflake-machine-id=1 -mybatis.table-column-escape=true +mybatis.table-column-escape=false +mybatis.table-column-case=lowercase ############################################################################ #redis server configuration # diff --git a/maxkey-web-maxkey/src/main/resources/application-http.properties b/maxkey-web-maxkey/src/main/resources/application-http.properties index edb31fbcf..1154665f5 100644 --- a/maxkey-web-maxkey/src/main/resources/application-http.properties +++ b/maxkey-web-maxkey/src/main/resources/application-http.properties @@ -38,21 +38,37 @@ spring.servlet.multipart.max-file-size=4194304 #server.servlet.encoding.force=true ############################################################################ -#database configuration # +#database configuration +# supported database +# mysql +# highgo +# postgresql ############################################################################ -#datasource +spring.datasource.type=com.alibaba.druid.pool.DruidDataSource +#mysql spring.datasource.username=root spring.datasource.password=maxkey spring.datasource.url=jdbc:mysql://localhost/maxkey?autoReconnect=true&characterEncoding=UTF-8&serverTimezone=UTC spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.type=com.alibaba.druid.pool.DruidDataSource +#highgo +#spring.datasource.username=highgo +#spring.datasource.password=High@123 +#spring.datasource.url=jdbc:highgo://192.168.56.107:5866/highgo?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai +#spring.datasource.driver-class-name=com.highgo.jdbc.Driver +#postgresql +#spring.datasource.username=root +#spring.datasource.password=maxkey! +#spring.datasource.url=jdbc:postgresql://localhost/maxkey?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai +#spring.datasource.driver-class-name=org.postgresql.Driver + #mybatis mybatis.dialect=mysql mybatis.type-aliases-package=org.maxkey.entity,org.maxkey.entity.apps, mybatis.mapper-locations=classpath*:/org/maxkey/persistence/mapper/xml/${mybatis.dialect}/*.xml mybatis.table-column-snowflake-datacenter-id=1 mybatis.table-column-snowflake-machine-id=1 -mybatis.table-column-escape=true +mybatis.table-column-escape=false +mybatis.table-column-case=lowercase ############################################################################ #redis server configuration # diff --git a/maxkey-web-maxkey/src/main/resources/application-https.properties b/maxkey-web-maxkey/src/main/resources/application-https.properties index 33d22f557..6c792d389 100644 --- a/maxkey-web-maxkey/src/main/resources/application-https.properties +++ b/maxkey-web-maxkey/src/main/resources/application-https.properties @@ -38,21 +38,37 @@ server.ssl.key-store-type=JKS #server.servlet.encoding.force=true ############################################################################ -#database configuration # +#database configuration +# supported database +# mysql +# highgo +# postgresql ############################################################################ -#datasource +spring.datasource.type=com.alibaba.druid.pool.DruidDataSource +#mysql spring.datasource.username=root spring.datasource.password=maxkey spring.datasource.url=jdbc:mysql://localhost/maxkey?autoReconnect=true&characterEncoding=UTF-8&serverTimezone=UTC spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.type=com.alibaba.druid.pool.DruidDataSource +#highgo +#spring.datasource.username=highgo +#spring.datasource.password=High@123 +#spring.datasource.url=jdbc:highgo://192.168.56.107:5866/highgo?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai +#spring.datasource.driver-class-name=com.highgo.jdbc.Driver +#postgresql +#spring.datasource.username=root +#spring.datasource.password=maxkey! +#spring.datasource.url=jdbc:postgresql://localhost/maxkey?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai +#spring.datasource.driver-class-name=org.postgresql.Driver + #mybatis mybatis.dialect=mysql mybatis.type-aliases-package=org.maxkey.entity,org.maxkey.entity.apps, mybatis.mapper-locations=classpath*:/org/maxkey/persistence/mapper/xml/${mybatis.dialect}/*.xml mybatis.table-column-snowflake-datacenter-id=1 mybatis.table-column-snowflake-machine-id=1 -mybatis.table-column-escape=true +mybatis.table-column-escape=false +mybatis.table-column-case=lowercase ############################################################################ #redis server configuration #