domain ->entity,SQL -> lowercase

domain ->entity,SQL ->  lowercase
This commit is contained in:
MaxKey
2021-04-19 20:03:30 +08:00
parent b4d7911afc
commit 5f21d81346
272 changed files with 1259 additions and 1246 deletions

View File

@@ -21,7 +21,7 @@
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.Accounts;
import org.maxkey.entity.Accounts;
/**
* @author Crystal.sea

View File

@@ -21,7 +21,7 @@
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.apps.AppsAdapters;
import org.maxkey.entity.apps.AppsAdapters;
/**
* @author Crystal.sea

View File

@@ -21,7 +21,7 @@
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.apps.AppsCasDetails;
import org.maxkey.entity.apps.AppsCasDetails;
/**
* @author Crystal.sea

View File

@@ -21,7 +21,7 @@
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.apps.AppsFormBasedDetails;
import org.maxkey.entity.apps.AppsFormBasedDetails;
/**
* @author Crystal.sea

View File

@@ -21,7 +21,7 @@
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.apps.AppsJwtDetails;
import org.maxkey.entity.apps.AppsJwtDetails;
/**
* @author Crystal.sea

View File

@@ -24,8 +24,8 @@ import java.util.List;
import org.apache.ibatis.annotations.Update;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.apps.Apps;
import org.maxkey.domain.apps.UserApps;
import org.maxkey.entity.apps.Apps;
import org.maxkey.entity.apps.UserApps;
/**
* @author Crystal.sea

View File

@@ -21,7 +21,7 @@
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.apps.AppsSAML20Details;
import org.maxkey.entity.apps.AppsSAML20Details;
/**
* @author Crystal.sea

View File

@@ -21,7 +21,7 @@
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.apps.AppsTokenBasedDetails;
import org.maxkey.entity.apps.AppsTokenBasedDetails;
/**
* @author Crystal.sea

View File

@@ -23,8 +23,8 @@ package org.maxkey.persistence.mapper;
import java.util.List;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.GroupMember;
import org.maxkey.domain.Groups;
import org.maxkey.entity.GroupMember;
import org.maxkey.entity.Groups;
/**
* @author Crystal.sea

View File

@@ -23,7 +23,7 @@ package org.maxkey.persistence.mapper;
import java.util.List;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.GroupPrivileges;
import org.maxkey.entity.GroupPrivileges;
/**
* @author Crystal.sea

View File

@@ -23,7 +23,7 @@ package org.maxkey.persistence.mapper;
import java.util.List;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.Groups;
import org.maxkey.entity.Groups;
/**
* @author Crystal.sea

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.HistoryLoginApps;
import org.maxkey.entity.HistoryLoginApps;
/**
* @author Crystal.sea

View File

@@ -19,7 +19,7 @@ package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.HistoryLogin;
import org.maxkey.entity.HistoryLogin;
/**
* @author Crystal.sea

View File

@@ -21,7 +21,7 @@
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.HistoryLogs;
import org.maxkey.entity.HistoryLogs;
/**
* @author Crystal.sea

View File

@@ -21,7 +21,7 @@
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.Notices;
import org.maxkey.entity.Notices;
/**
* @author Crystal.sea

View File

@@ -17,7 +17,7 @@
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.Organizations;
import org.maxkey.entity.Organizations;
public interface OrganizationsMapper extends IJpaBaseMapper<Organizations> {

View File

@@ -21,7 +21,7 @@
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.PasswordPolicy;
import org.maxkey.entity.PasswordPolicy;
/**
* @author Crystal.sea

View File

@@ -23,8 +23,8 @@ package org.maxkey.persistence.mapper;
import java.util.List;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.Registration;
import org.maxkey.domain.UserInfo;
import org.maxkey.entity.Registration;
import org.maxkey.entity.UserInfo;
/**
* @author Crystal.sea

View File

@@ -21,7 +21,7 @@
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.Resources;
import org.maxkey.entity.Resources;
/**
* @author Crystal.sea

View File

@@ -23,8 +23,8 @@ package org.maxkey.persistence.mapper;
import java.util.List;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.RoleMember;
import org.maxkey.domain.Roles;
import org.maxkey.entity.RoleMember;
import org.maxkey.entity.Roles;
/**
* @author Crystal.sea

View File

@@ -23,8 +23,8 @@ package org.maxkey.persistence.mapper;
import java.util.List;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.RolePermissions;
import org.maxkey.domain.Roles;
import org.maxkey.entity.RolePermissions;
import org.maxkey.entity.Roles;
/**
* @author Crystal.sea

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.UserInfoAdjoint;
import org.maxkey.entity.UserInfoAdjoint;
/**

View File

@@ -19,7 +19,7 @@ package org.maxkey.persistence.mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.domain.UserInfo;
import org.maxkey.entity.UserInfo;
/**

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.Accounts;
import org.maxkey.entity.Accounts;
import org.maxkey.persistence.mapper.AccountsMapper;
import org.springframework.stereotype.Repository;

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.apps.AppsAdapters;
import org.maxkey.entity.apps.AppsAdapters;
import org.maxkey.persistence.mapper.AppsAdaptersMapper;
import org.springframework.stereotype.Repository;

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.apps.AppsCasDetails;
import org.maxkey.entity.apps.AppsCasDetails;
import org.maxkey.persistence.mapper.AppsCasDetailsMapper;
import org.springframework.stereotype.Repository;

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.apps.AppsFormBasedDetails;
import org.maxkey.entity.apps.AppsFormBasedDetails;
import org.maxkey.persistence.mapper.AppsFormBasedDetailsMapper;
import org.springframework.stereotype.Repository;

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.apps.AppsJwtDetails;
import org.maxkey.entity.apps.AppsJwtDetails;
import org.maxkey.persistence.mapper.AppsJwtDetailsMapper;
import org.springframework.stereotype.Repository;

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.apps.AppsSAML20Details;
import org.maxkey.entity.apps.AppsSAML20Details;
import org.maxkey.persistence.mapper.AppsSaml20DetailsMapper;
import org.springframework.stereotype.Repository;

View File

@@ -24,8 +24,8 @@ import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.ehcache.UserManagedCache;
import org.ehcache.config.builders.ExpiryPolicyBuilder;
import org.ehcache.config.builders.UserManagedCacheBuilder;
import org.maxkey.domain.apps.Apps;
import org.maxkey.domain.apps.UserApps;
import org.maxkey.entity.apps.Apps;
import org.maxkey.entity.apps.UserApps;
import org.maxkey.persistence.mapper.AppsMapper;
import org.springframework.stereotype.Repository;

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.apps.AppsTokenBasedDetails;
import org.maxkey.entity.apps.AppsTokenBasedDetails;
import org.maxkey.persistence.mapper.AppsTokenBasedDetailsMapper;
import org.springframework.stereotype.Repository;

View File

@@ -18,8 +18,8 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.GroupMember;
import org.maxkey.domain.Groups;
import org.maxkey.entity.GroupMember;
import org.maxkey.entity.Groups;
import org.maxkey.persistence.mapper.GroupMemberMapper;
import org.springframework.stereotype.Repository;

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.GroupPrivileges;
import org.maxkey.entity.GroupPrivileges;
import org.maxkey.persistence.mapper.GroupPrivilegesMapper;
import org.springframework.stereotype.Repository;

View File

@@ -22,7 +22,7 @@ import java.time.LocalTime;
import java.util.List;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.Groups;
import org.maxkey.entity.Groups;
import org.maxkey.persistence.mapper.GroupsMapper;
import org.maxkey.util.StringUtils;
import org.slf4j.Logger;

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.HistoryLoginApps;
import org.maxkey.entity.HistoryLoginApps;
import org.maxkey.persistence.mapper.HistoryLoginAppsMapper;
import org.springframework.stereotype.Repository;

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.HistoryLogin;
import org.maxkey.entity.HistoryLogin;
import org.maxkey.persistence.mapper.HistoryLoginMapper;
import org.springframework.stereotype.Repository;

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.HistoryLogs;
import org.maxkey.entity.HistoryLogs;
import org.maxkey.persistence.mapper.HistoryLogsMapper;
import org.springframework.stereotype.Repository;

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.Notices;
import org.maxkey.entity.Notices;
import org.maxkey.persistence.mapper.NoticesMapper;
import org.springframework.stereotype.Repository;

View File

@@ -33,7 +33,7 @@ import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.maxkey.domain.Organizations;
import org.maxkey.entity.Organizations;
import org.maxkey.persistence.kafka.KafkaIdentityAction;
import org.maxkey.persistence.kafka.KafkaIdentityTopic;
import org.maxkey.persistence.kafka.KafkaPersistService;

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.PasswordPolicy;
import org.maxkey.entity.PasswordPolicy;
import org.maxkey.persistence.mapper.PasswordPolicyMapper;
import org.springframework.stereotype.Repository;

View File

@@ -20,8 +20,8 @@ package org.maxkey.persistence.service;
import java.util.List;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.Registration;
import org.maxkey.domain.UserInfo;
import org.maxkey.entity.Registration;
import org.maxkey.entity.UserInfo;
import org.maxkey.persistence.mapper.RegistrationMapper;
import org.springframework.stereotype.Repository;

View File

@@ -20,7 +20,7 @@ package org.maxkey.persistence.service;
import java.util.List;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.Resources;
import org.maxkey.entity.Resources;
import org.maxkey.persistence.mapper.ResourcesMapper;
import org.springframework.stereotype.Repository;

View File

@@ -18,8 +18,8 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.RoleMember;
import org.maxkey.domain.Roles;
import org.maxkey.entity.RoleMember;
import org.maxkey.entity.Roles;
import org.maxkey.persistence.mapper.RoleMemberMapper;
import org.springframework.stereotype.Repository;

View File

@@ -20,8 +20,8 @@ package org.maxkey.persistence.service;
import java.util.List;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.RolePermissions;
import org.maxkey.domain.Roles;
import org.maxkey.entity.RolePermissions;
import org.maxkey.entity.Roles;
import org.maxkey.persistence.mapper.RolesMapper;
import org.maxkey.util.StringUtils;
import org.slf4j.Logger;

View File

@@ -18,7 +18,7 @@
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.domain.UserInfoAdjoint;
import org.maxkey.entity.UserInfoAdjoint;
import org.maxkey.persistence.mapper.UserInfoAdjointMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@@ -38,8 +38,8 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.maxkey.constants.ConstantsStatus;
import org.maxkey.crypto.ReciprocalUtils;
import org.maxkey.crypto.password.PasswordReciprocal;
import org.maxkey.domain.ChangePassword;
import org.maxkey.domain.UserInfo;
import org.maxkey.entity.ChangePassword;
import org.maxkey.entity.UserInfo;
import org.maxkey.persistence.db.PasswordPolicyValidator;
import org.maxkey.persistence.kafka.KafkaIdentityAction;
import org.maxkey.persistence.kafka.KafkaIdentityTopic;

View File

@@ -4,27 +4,27 @@
<sql id="where_statement">
<if test="id != null and id != ''">
AND ID = #{id}
and id = #{id}
</if>
<if test="appId != null and appId != ''">
AND APPID = #{appId}
and appid = #{appId}
</if>
<if test="username != null and username != ''">
AND USERNAME = #{username}
and username = #{username}
</if>
<if test="relatedUsername != null and relatedUsername != ''">
AND RELATEDUSERNAME = #{relatedUsername}
and relatedusername = #{relatedUsername}
</if>
</sql>
<select id="queryPageResults" parameterType="Accounts" resultType="Accounts">
SELECT
select
*
FROM
MXK_ACCOUNTS
WHERE
from
mxk_accounts
where
(1=1)
<include refid="where_statement"/>
</select>

View File

@@ -4,27 +4,27 @@
<sql id="where_statement">
<if test="id != null and id != ''">
AND ID = #{id}
and id = #{id}
</if>
<if test="name != null and name != ''">
AND NAME LIKE '%${name}%'
and name like '%${name}%'
</if>
<if test="protocol != null and protocol != ''">
AND PROTOCOL = #{protocol}
and protocol = #{protocol}
</if>
</sql>
<select id="queryPageResults" parameterType="AppsAdapters" resultType="AppsAdapters">
SELECT
select
*
FROM
MXK_APPS_ADAPTERS
WHERE
from
mxk_apps_adapters
where
(1=1)
<include refid="where_statement"/>
ORDER BY SORTINDEX
order by sortindex
</select>
</mapper>

View File

@@ -2,17 +2,17 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.maxkey.persistence.mapper.AppsCasDetailsMapper">
<select id="getAppDetails" parameterType="string" resultType="AppsCasDetails">
SELECT
select
*
FROM
MXK_APPS_CAS_DETAILS CD,
MXK_APPS APP
WHERE
STATUS = 1
AND CD.ID = APP.ID
AND (
APP.ID = #{value}
OR LOWER(CD.SERVICE) = LOWER(SUBSTRING(#{value},1,LENGTH(CD.SERVICE)))
from
mxk_apps_cas_details cd,
mxk_apps app
where
status = 1
and cd.id = app.id
and (
app.id = #{value}
or lower(cd.service) = lower(substring(#{value},1,length(cd.service)))
)
</select>
</mapper>

View File

@@ -3,15 +3,15 @@
<mapper namespace="org.maxkey.persistence.mapper.AppsFormBasedDetailsMapper">
<select id="getAppDetails" parameterType="string" resultType="AppsFormBasedDetails">
SELECT
select
*
FROM
MXK_APPS_FORM_BASED_DETAILS FBD,
MXK_APPS APP
WHERE
APP.ID = #{value}
AND FBD.ID = #{value}
AND FBD.ID = APP.ID
AND STATUS = 1
from
mxk_apps_form_based_details fbd,
mxk_apps app
where
app.id = #{value}
and fbd.id = #{value}
and fbd.id = app.id
and status = 1
</select>
</mapper>

View File

@@ -3,16 +3,16 @@
<mapper namespace="org.maxkey.persistence.mapper.AppsJwtDetailsMapper">
<select id="getAppDetails" parameterType="string" resultType="AppsJwtDetails">
SELECT
select
*
FROM
MXK_APPS_JWT_DETAILS JD,
MXK_APPS APP
WHERE
APP.ID = #{value}
AND JD.ID = #{value}
AND JD.ID = APP.ID
AND STATUS = 1
from
mxk_apps_jwt_details jd,
mxk_apps app
where
app.id = #{value}
and jd.id = #{value}
and jd.id = app.id
and status = 1
</select>
</mapper>

View File

@@ -4,77 +4,77 @@
<sql id="where_statement">
<if test="id != null and id != ''">
AND ID = #{id}
and id = #{id}
</if>
<if test="name != null and name != ''">
AND NAME LIKE '%${name}%'
and name like '%${name}%'
</if>
<if test="protocol != null and protocol != ''">
AND PROTOCOL = #{protocol}
and protocol = #{protocol}
</if>
<if test="credential != null and credential != ''">
AND CREDENTIAL = #{credential}
and credential = #{credential}
</if>
<if test="category != null and category != ''">
AND CATEGORY = #{category}
and category = #{category}
</if>
<if test="vendor != null and vendor != ''">
AND VENDOR = #{vendor}
and vendor = #{vendor}
</if>
</sql>
<select id="queryPageResults" parameterType="Apps" resultType="Apps">
SELECT
select
*
FROM
MXK_APPS
WHERE
from
mxk_apps
where
(1=1)
<include refid="where_statement"/>
ORDER BY SORTINDEX
order by sortindex
</select>
<insert id="insertApp" parameterType="Apps">
INSERT INTO MXK_APPS(
ID,
NAME,
ICON,
LOGINURL,
PROTOCOL,
CATEGORY,
SECRET,
DESCRIPTION,
VENDOR,
VENDORURL,
insert into mxk_apps(
id,
name,
icon,
loginurl,
protocol,
category,
secret,
description,
vendor,
vendorurl,
CREDENTIAL,
SHAREDUSERNAME,
SHAREDPASSWORD,
SYSTEMUSERATTR,
credential,
sharedusername,
sharedpassword,
systemuserattr,
ISEXTENDATTR,
EXTENDATTR,
USERPROPERTYS,
isextendattr,
extendattr,
userpropertys,
ISSIGNATURE,
issignature,
ISADAPTER,
ADAPTER,
isadapter,
adapter,
PRINCIPAL,
CREDENTIALS,
principal,
credentials,
VISIBLE,
visible,
SORTINDEX,
sortindex,
CREATEDBY,
CREATEDDATE,
createdby,
createddate,
STATUS
)VALUES(
status
)values(
#{id},
#{name},
#{icon},
@@ -114,75 +114,75 @@
</insert>
<update id="updateApp" parameterType="Apps" >
UPDATE MXK_APPS SET
NAME = #{name},
update mxk_apps set
name = #{name},
<if test="icon != null">
ICON = #{icon},
icon = #{icon},
</if>
LOGINURL = #{loginUrl},
PROTOCOL = #{protocol},
CATEGORY = #{category},
SECRET = #{secret},
DESCRIPTION = #{description},
VENDOR = #{vendor},
VENDORURL = #{vendorUrl},
loginurl = #{loginUrl},
protocol = #{protocol},
category = #{category},
secret = #{secret},
description = #{description},
vendor = #{vendor},
vendorurl = #{vendorUrl},
CREDENTIAL = #{credential},
SHAREDUSERNAME = #{sharedUsername},
SHAREDPASSWORD = #{sharedPassword},
SYSTEMUSERATTR = #{systemUserAttr},
credential = #{credential},
sharedusername = #{sharedUsername},
sharedpassword = #{sharedPassword},
systemuserattr = #{systemUserAttr},
<!--
ISEXTENDATTR = #{isExtendAttr},
EXTENDATTR = #{extendAttr},
isextendattr = #{isExtendAttr},
extendattr = #{extendAttr},
-->
USERPROPERTYS = #{userPropertys},
ISSIGNATURE = #{isSignature},
userpropertys = #{userPropertys},
issignature = #{isSignature},
<if test="adapter != null">
ISADAPTER = #{isAdapter},
ADAPTER = #{adapter},
isadapter = #{isAdapter},
adapter = #{adapter},
</if>
PRINCIPAL = #{principal},
CREDENTIALS = #{credentials},
VISIBLE = #{visible},
SORTINDEX = #{sortIndex},
principal = #{principal},
credentials = #{credentials},
visible = #{visible},
sortindex = #{sortIndex},
MODIFIEDBY = #{modifiedBy},
MODIFIEDDATE = #{modifiedDate},
modifiedby = #{modifiedBy},
modifieddate = #{modifiedDate},
STATUS = #{status}
WHERE
status = #{status}
where
ID = #{id}
</update>
<select id="queryMyApps" parameterType="UserApps" resultType="UserApps">
SELECT DISTINCT
APP.*
FROM
MXK_APPS APP,MXK_GROUP_PRIVILEGES GP,MXK_GROUPS G
WHERE
APP.ID=GP.APPID
AND GP.GROUPID=G.ID
AND APP.VISIBLE != 0
AND (
G.ID='ROLE_ALL_USER'
OR G.ID IN(
SELECT
GM.GROUPID
FROM
MXK_GROUP_MEMBER GM,MXK_USERINFO U
WHERE GM.MEMBERID = U.ID
select distinct
app.*
from
mxk_apps app,mxk_group_privileges gp,mxk_groups g
where
app.id=gp.appid
and gp.groupid=g.id
and app.visible != 0
and (
g.id='ROLE_ALL_USER'
or g.id in(
select
gm.groupid
from
mxk_group_member gm,mxk_userinfo u
where gm.memberid = u.id
<if test="userId != null and userId != ''">
AND U.ID = #{userId}
and u.id = #{userId}
</if>
<if test="username != null and username != ''">
AND U.USERNAME = #{username}
and u.username = #{username}
</if>
)
)
<if test="name != null and name != ''">
AND NAME = #{name}
and name = #{name}
</if>
ORDER BY SORTINDEX
order by sortindex
</select>
</mapper>

View File

@@ -3,32 +3,32 @@
<mapper namespace="org.maxkey.persistence.mapper.AppsSaml20DetailsMapper">
<select id="getAppDetails" parameterType="string" resultType="AppsSaml20Details">
SELECT
SVD.CERTISSUER,
SVD.CERTSUBJECT,
SVD.CERTEXPIRATION,
SVD.KEYSTORE,
SVD.SPACSURL ,
SVD.ISSUER,
SVD.ENTITYID,
SVD.AUDIENCE,
SVD.VALIDITYINTERVAL ,
SVD.NAMEIDFORMAT,
SVD.ENCRYPTED,
SVD.BINDING,
SVD.NAMEIDCONVERT,
SVD.SIGNATURE,
SVD.DIGESTMETHOD,
SVD.METAURL,
APP.*
FROM
MXK_APPS_SAML_V20_DETAILS SVD,
MXK_APPS APP
WHERE
APP.ID = #{value}
AND SVD.ID = #{value}
AND SVD.ID = APP.ID
AND APP.STATUS = 1
select
svd.certissuer,
svd.certsubject,
svd.certexpiration,
svd.keystore,
svd.spacsurl ,
svd.issuer,
svd.entityid,
svd.audience,
svd.validityinterval ,
svd.nameidformat,
svd.encrypted,
svd.binding,
svd.nameidconvert,
svd.signature,
svd.digestmethod,
svd.metaurl,
app.*
from
mxk_apps_saml_v20_details svd,
mxk_apps app
where
app.id = #{value}
and svd.id = #{value}
and svd.id = app.id
and app.status = 1
</select>
</mapper>

View File

@@ -3,16 +3,16 @@
<mapper namespace="org.maxkey.persistence.mapper.AppsTokenBasedDetailsMapper">
<select id="getAppDetails" parameterType="string" resultType="AppsTokenBasedDetails">
SELECT
select
*
FROM
MXK_APPS_TOKEN_BASED_DETAILS TBD,
MXK_APPS APP
WHERE
APP.ID = #{value}
AND TBD.ID = #{value}
AND TBD.ID = APP.ID
AND STATUS = 1
from
mxk_apps_token_based_details tbd,
mxk_apps app
where
app.id = #{value}
and tbd.id = #{value}
and tbd.id = app.id
and status = 1
</select>
</mapper>

View File

@@ -4,257 +4,257 @@
<sql id="where_statement">
<if test="id != null and id != ''">
AND ID = #{id}
and id = #{id}
</if>
<if test="name != null and name != ''">
AND NAME = #{name}
and name = #{name}
</if>
</sql>
<!-- GROUP_MEMBER User Member-->
<select id="allMemberInGroup" parameterType="GroupMember" resultType="GroupMember">
SELECT DISTINCT
U.ID,
U.USERNAME,
U.USERTYPE,
U.WINDOWSACCOUNT,
select distinct
u.id,
u.username,
u.usertype,
u.windowsaccount,
U.DISPLAYNAME ,
U.NICKNAME ,
U.NAMEZHSPELL,
U.NAMEZHSHORTSPELL,
U.GIVENNAME ,
U.MIDDLENAME ,
U.FAMILYNAME ,
u.displayname ,
u.nickname ,
u.namezhspell,
u.namezhshortspell,
u.givenname ,
u.middlename ,
u.familyname ,
U.GENDER,
u.gender,
U.AUTHNTYPE,
U.MOBILE,
U.EMAIL,
U.WORKEMAIL,
U.WORKPHONENUMBER,
u.authntype,
u.mobile,
u.email,
u.workemail,
u.workphonenumber,
U.EMPLOYEENUMBER,
U.DIVISION,
U.COSTCENTER,
U.ORGANIZATION,
U.DEPARTMENTID,
U.DEPARTMENT,
U.JOBTITLE,
U.JOBLEVEL,
u.employeenumber,
u.division,
u.costcenter,
u.organization,
u.departmentid,
u.department,
u.jobtitle,
u.joblevel,
U.CREATEDBY,
U.CREATEDDATE,
U.MODIFIEDBY,
U.MODIFIEDDATE,
u.createdby,
u.createddate,
u.modifiedby,
u.modifieddate,
U.STATUS
FROM
MXK_USERINFO U
WHERE 1 = 1
u.status
from
mxk_userinfo u
where 1 = 1
</select>
<select id="memberInGroup" parameterType="GroupMember" resultType="GroupMember">
SELECT DISTINCT
GM.ID,
U.USERNAME,
U.USERTYPE,
U.WINDOWSACCOUNT,
select distinct
gm.id,
u.username,
u.usertype,
u.windowsaccount,
U.DISPLAYNAME ,
U.NICKNAME ,
U.NAMEZHSPELL,
U.NAMEZHSHORTSPELL,
U.GIVENNAME ,
U.MIDDLENAME ,
U.FAMILYNAME ,
u.displayname ,
u.nickname ,
u.namezhspell,
u.namezhshortspell,
u.givenname ,
u.middlename ,
u.familyname ,
U.GENDER,
u.gender,
U.AUTHNTYPE,
U.MOBILE,
U.EMAIL,
U.WORKEMAIL,
U.WORKPHONENUMBER,
u.authntype,
u.mobile,
u.email,
u.workemail,
u.workphonenumber,
U.EMPLOYEENUMBER,
U.DIVISION,
U.COSTCENTER,
U.ORGANIZATION,
U.DEPARTMENTID,
U.DEPARTMENT,
U.JOBTITLE,
U.JOBLEVEL,
u.employeenumber,
u.division,
u.costcenter,
u.organization,
u.departmentid,
u.department,
u.jobtitle,
u.joblevel,
U.CREATEDBY,
U.CREATEDDATE,
U.MODIFIEDBY,
U.MODIFIEDDATE,
u.createdby,
u.createddate,
u.modifiedby,
u.modifieddate,
U.STATUS
FROM
MXK_USERINFO U,
`MXK_GROUPS` G,
MXK_GROUP_MEMBER GM
WHERE 1 = 1
u.status
from
mxk_userinfo u,
`mxk_groups` g,
mxk_group_member gm
where 1 = 1
<if test="groupId != null and groupId != ''">
AND GM.GROUPID = #{groupId}
AND G.ID = #{groupId}
and gm.groupid = #{groupId}
and g.id = #{groupId}
</if>
<if test="groupName != null and groupName != ''">
AND G.NAME = #{groupName}
and g.name = #{groupName}
</if>
<if test="username != null and username != ''">
AND U.USERNAME = #{username}
and u.username = #{username}
</if>
<if test="displayName != null and displayName != ''">
AND U.DISPLAYNAME LIKE '%${displayName}%'
and u.displayname like '%${displayName}%'
</if>
AND GM.TYPE IN( 'USER','USER-DYNAMIC')
AND GM.GROUPID = G.ID
AND GM.MEMBERID = U.ID
and gm.type in( 'USER','USER-DYNAMIC')
and gm.groupid = g.id
and gm.memberid = u.id
</select>
<select id="memberNotInGroup" parameterType="GroupMember" resultType="GroupMember">
SELECT DISTINCT
U.ID,
U.USERNAME,
U.USERTYPE,
U.WINDOWSACCOUNT,
select distinct
u.id,
u.username,
u.usertype,
u.windowsaccount,
U.DISPLAYNAME ,
U.NICKNAME ,
U.NAMEZHSPELL,
U.NAMEZHSHORTSPELL,
U.GIVENNAME ,
U.MIDDLENAME ,
U.FAMILYNAME ,
u.displayname ,
u.nickname ,
u.namezhspell,
u.namezhshortspell,
u.givenname ,
u.middlename ,
u.familyname ,
U.GENDER,
u.gender,
U.AUTHNTYPE,
U.MOBILE,
U.EMAIL,
U.WORKEMAIL,
U.WORKPHONENUMBER,
u.authntype,
u.mobile,
u.email,
u.workemail,
u.workphonenumber,
U.EMPLOYEENUMBER,
U.DIVISION,
U.COSTCENTER,
U.ORGANIZATION,
U.DEPARTMENTID,
U.DEPARTMENT,
U.JOBTITLE,
U.JOBLEVEL,
u.employeenumber,
u.division,
u.costcenter,
u.organization,
u.departmentid,
u.department,
u.jobtitle,
u.joblevel,
U.CREATEDBY,
U.CREATEDDATE,
U.MODIFIEDBY,
U.MODIFIEDDATE,
u.createdby,
u.createddate,
u.modifiedby,
u.modifieddate,
U.STATUS
FROM
MXK_USERINFO U
WHERE
U.ID NOT IN(
SELECT GM.MEMBERID
FROM `MXK_GROUPS` G,MXK_GROUP_MEMBER GM
WHERE 1 = 1
u.status
from
mxk_userinfo u
where
u.id not in(
select gm.memberid
from `mxk_groups` g,mxk_group_member gm
where 1 = 1
<if test="groupId != null and groupId != ''">
AND GM.GROUPID = #{groupId}
AND G.ID = #{groupId}
and gm.groupid = #{groupId}
and g.id = #{groupId}
</if>
<if test="groupName != null and groupName != ''">
AND G.NAME = #{groupName}
and g.name = #{groupName}
</if>
AND GM.TYPE IN( 'USER','USER-DYNAMIC')
AND GM.GROUPID = G.ID
and gm.type in( 'USER','USER-DYNAMIC')
and gm.groupid = g.id
)
<if test="username != null and username != ''">
AND U.USERNAME = #{username}
and u.username = #{username}
</if>
<if test="displayName != null and displayName != ''">
AND U.DISPLAYNAME LIKE '%${displayName}%'
and u.displayname like '%${displayName}%'
</if>
</select>
<!-- GROUP_MEMBER Group Member-->
<select id="groupMemberInGroup" parameterType="GroupMember" resultType="Groups">
SELECT DISTINCT
IG.*
FROM
`MXK_GROUPS` IG,
`MXK_GROUPS` G,
MXK_GROUP_MEMBER GM
WHERE
select distinct
ig.*
from
`mxk_groups` ig,
`mxk_groups` g,
mxk_group_member gm
where
1 = 1
AND GM.GROUPID = G.ID
AND GM.MEMBERID = IG.ID
AND GM.TYPE = 'GROUP'
and gm.groupid = g.id
and gm.memberid = ig.id
and gm.type = 'GROUP'
<if test="groupId != null and groupId != ''">
AND GM.GROUPID = #{groupId}
AND G.ID = #{groupId}
and gm.groupid = #{groupId}
and g.id = #{groupId}
</if>
<if test="groupName != null and groupName != ''">
AND G.NAME = #{groupName}
and g.name = #{groupName}
</if>
</select>
<update id="addDynamicGroupMember" parameterType="Groups" >
INSERT INTO MXK_GROUP_MEMBER(
ID,
GROUPID,
MEMBERID,
TYPE
insert into mxk_group_member(
id,
groupid,
memberid,
type
)
SELECT
CONCAT_WS('-','UD','${id}',U.ID) ID,
'${id}' GROUPID,
U.ID MEMBERID,
select
concat_ws('-','UD','${id}',u.id) id,
'${id}' groupid,
u.id memberid,
'USER-DYNAMIC' 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'
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'
)
<if test="filters != null and filters != ''">
AND (${filters})
and (${filters})
</if>
<if test="orgIdsList != null and orgIdsList != ''">
AND U.DEPARTMENTID IN( ${orgIdsList})
and u.departmentid in( ${orgIdsList})
</if>
</update>
<delete id="deleteDynamicGroupMember" parameterType="Groups" >
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
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
<if test="filters != null and filters != ''">
AND (${filters})
and (${filters})
</if>
<if test="orgIdsList != null and orgIdsList != ''">
AND U.DEPARTMENTID IN ( ${orgIdsList})
and u.departmentid in ( ${orgIdsList})
</if>
)
</delete>
<delete id="deleteByGroupId" parameterType="string" >
DELETE FROM MXK_GROUP_MEMBER GM
WHERE GM.GROUPID=#{value}
delete from mxk_group_member gm
where gm.groupid=#{value}
</delete>
</mapper>

View File

@@ -4,56 +4,56 @@
<sql id="where_statement">
<if test="id != null and id != ''">
AND APPS.ID = #{id}
and apps.id = #{id}
</if>
<if test="name != null and name != ''">
AND APPS.NAME LIKE '%${name}%'
and apps.name like '%${name}%'
</if>
<if test="protocol != null and protocol != ''">
AND APPS.PROTOCOL = #{protocol}
and apps.protocol = #{protocol}
</if>
<if test="category != null and category != ''">
AND APPS.CATEGORY = #{category}
and apps.category = #{category}
</if>
</sql>
<!-- AppGroup -->
<select id="appsInGroup" parameterType="GroupPrivileges" resultType="GroupPrivileges">
SELECT
GP.ID,
GP.GROUPID,
GP.APPID,
APPS.NAME,
APPS.ICON,
APPS.LOGINURL,
APPS.PROTOCOL,
APPS.CATEGORY,
APPS.DESCRIPTION,
APPS.VENDOR,
APPS.VENDORURL
FROM
MXK_APPS APPS,
MXK_GROUP_PRIVILEGES GP
WHERE
GP.APPID=APPS.ID
AND GP.GROUPID = #{groupId}
select
gp.id,
gp.groupid,
gp.appid,
apps.name,
apps.icon,
apps.loginurl,
apps.protocol,
apps.category,
apps.description,
apps.vendor,
apps.vendorurl
from
mxk_apps apps,
mxk_group_privileges gp
where
gp.appid=apps.id
and gp.groupid = #{groupId}
<include refid="where_statement"/>
</select>
<select id="appsNotInGroup" parameterType="GroupPrivileges" resultType="GroupPrivileges">
SELECT
select
*
FROM
MXK_APPS APPS
WHERE
from
mxk_apps apps
where
1 = 1
AND APPS.ID NOT IN(
SELECT
APPID
FROM
MXK_GROUP_PRIVILEGES
WHERE
GROUPID = #{groupId}
and apps.id not in(
select
appid
from
mxk_group_privileges
where
groupid = #{groupId}
)
<include refid="where_statement"/>
</select>

View File

@@ -4,51 +4,51 @@
<sql id="where_statement">
<if test="id != null and id != ''">
AND ID = #{id}
and id = #{id}
</if>
<if test="name != null and name != ''">
AND NAME LIKE '%${name}%'
and name like '%${name}%'
</if>
</sql>
<select id="queryPageResults" parameterType="Groups" resultType="Groups">
SELECT
select
*
FROM
`MXK_GROUPS`
WHERE
from
`mxk_groups`
where
(1=1)
<include refid="where_statement"/>
</select>
<select id="queryDynamicGroups" parameterType="Groups" resultType="Groups">
SELECT
select
*
FROM
`MXK_GROUPS`
WHERE
DYNAMIC = '1'
from
`mxk_groups`
where
dynamic = '1'
<include refid="where_statement"/>
</select>
<update id="logisticDelete" parameterType="Groups" >
UPDATE `MXK_GROUPS` SET
STATUS = '2'
WHERE 1 = 1
update `mxk_groups` set
status = '2'
where 1 = 1
<if test="id != null">
AND ID = #{id}
and id = #{id}
</if>
<if test="name != name">
ADN NAME = #{name}
and name = #{name}
</if>
</update>
<update id="logisticBatchDelete" parameterType="java.util.List">
UPDATE `MXK_GROUPS` SET STATUS='2' WHERE ID IN
update `mxk_groups` set status='2' where id in
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>

View File

@@ -4,51 +4,51 @@
<sql id="dao_where_statement">
<if test="id != null and id != ''">
AND ID = #{id}
and id = #{id}
</if>
<if test="sessionId != null and sessionId != ''">
AND SESSIONID = #{sessionId}
and sessionid = #{sessionId}
</if>
<if test="appId != null and appId != ''">
AND APPID = #{appId}
and appid = #{appId}
</if>
<if test="appName != null and appName != ''">
AND APPNAME LIKE CONCAT('%',#{appName},'%')
and appname like concat('%',#{appName},'%')
</if>
<if test="uid != null and uid != ''">
AND UID = #{uid}
and uid = #{uid}
</if>
<if test="username != null and username != ''">
AND USERNAME LIKE CONCAT('%',#{username},'%')
and username like concat('%',#{username},'%')
</if>
<if test="displayName != null and displayName != ''">
AND DISPLAYNAME LIKE CONCAT('%',#{displayName},'%')
and displayname like concat('%',#{displayName},'%')
</if>
<if test="startDate != null and startDate != ''">
AND LOGINTIME >= #{startDate}
and logintime >= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
AND #{endDate} >= LOGINTIME
and #{endDate} >= logintime
</if>
</sql>
<select id="queryPageResults" parameterType="HistoryLoginApps" resultType="HistoryLoginApps">
SELECT
ID,
SESSIONID,
APPID,
APPNAME,
UID,
USERNAME,
DISPLAYNAME,
DATE_FORMAT(LOGINTIME, '%Y-%m-%d %H:%i:%s') AS LOGINTIME
select
id,
sessionid,
appid,
appname,
uid,
username,
displayname,
date_format(logintime, '%Y-%m-%d %H:%i:%s') as logintime
FROM MXK_HISTORY_LOGIN_APPS
WHERE 1 = 1
from mxk_history_login_apps
where 1 = 1
<include refid="dao_where_statement"/>
ORDER BY LOGINTIME DESC
order by logintime desc
</select>

View File

@@ -4,69 +4,69 @@
<sql id="dao_where_statement">
<if test="id != null and id != ''">
AND ID = #{id}
and id = #{id}
</if>
<if test="uid != null and uid != ''">
AND UID = #{uid}
and uid = #{uid}
</if>
<if test="username != null and username != '' ">
AND LOWER(USERNAME) LIKE LOWER(CONCAT('%',#{username},'%'))
and lower(username) like lower(concat('%',#{username},'%'))
</if>
<if test="message != null and message != '' ">
AND LOWER(MESSAGE) LIKE LOWER(CONCAT('%',#{message},'%'))
and lower(message) like lower(concat('%',#{message},'%'))
</if>
<if test="displayName != null and displayName != '' ">
AND LOWER(DISPLAYNAME) LIKE LOWER(CONCAT('%',#{displayName},'%'))
and lower(displayname) like lower(concat('%',#{displayName},'%'))
</if>
<if test="startDate != null and startDate != ''">
AND LOGINTIME >= #{startDate}
and logintime >= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
AND #{endDate} >= LOGINTIME
and #{endDate} >= logintime
</if>
<if test="sessionId != null and sessionId != ''">
AND SESSIONID = #{sessionId}
and sessionid = #{sessionId}
</if>
<if test="loginType != null and loginType != ''">
AND LOGINTYPE = #{loginType}
and logintype = #{loginType}
</if>
<if test="sourceIp != null and sourceIp != ''">
AND SOURCEIP = #{sourceIp}
and sourceip = #{sourceIp}
</if>
</sql>
<select id="queryPageResults" parameterType="HistoryLogin" resultType="HistoryLogin">
SELECT
ID,
SESSIONID,
UID,
USERNAME,
DISPLAYNAME,
LOGINTYPE,
MESSAGE,
CODE,
PROVIDER,
SOURCEIP,
BROWSER,
PLATFORM,
APPLICATION,
LOGINURL,
DATE_FORMAT(LOGINTIME, '%Y-%m-%d %H:%i:%s') AS LOGINTIME,
DATE_FORMAT(LOGOUTTIME, '%Y-%m-%d %H:%i:%s') AS LOGOUTTIME
FROM MXK_HISTORY_LOGIN
WHERE 1 = 1
select
id,
sessionid,
uid,
username,
displayname,
logintype,
message,
code,
provider,
sourceip,
browser,
platform,
application,
loginurl,
date_format(logintime, '%Y-%m-%d %H:%i:%s') as logintime,
date_format(logouttime, '%Y-%m-%d %H:%i:%s') as logouttime
from mxk_history_login
where 1 = 1
<include refid="dao_where_statement"/>
ORDER BY LOGINTIME DESC
order by logintime desc
</select>
<update id="logout" parameterType="java.lang.String" >
UPDATE MXK_HISTORY_LOGIN SET
LOGOUTTIME = current_timestamp()
WHERE
SESSIONID = #{value}
update mxk_history_login set
logouttime = current_timestamp()
where
sessionid = #{value}
</update>
</mapper>

View File

@@ -4,52 +4,52 @@
<sql id="where_statement">
<if test="id != null and id != ''">
AND ID = #{id}
and id = #{id}
</if>
<if test="serviceName != null and serviceName != '' ">
AND LOWER(SERVICENAME) LIKE LOWER(CONCAT('%',#{serviceName},'%'))
and lower(servicename) like lower(concat('%',#{serviceName},'%'))
</if>
<if test="message != null and message != '' ">
AND LOWER(MESSAGE) LIKE LOWER(CONCAT('%',#{message},'%'))
and lower(message) like lower(concat('%',#{message},'%'))
</if>
<if test="startDate != null and startDate != '' ">
AND CREATEDDATE BETWEEN #{startDate} AND #{endDate}
and createddate between #{startDate} and #{endDate}
</if>
<if test="createdBy != null and createdBy != ''">
AND CREATEDBY = #{createdBy}
and createdby = #{createdBy}
</if>
<if test="username != null and username != ''">
AND LOWER(USERNAME) LIKE LOWER(CONCAT('%',#{username},'%'))
and lower(username) like lower(concat('%',#{username},'%'))
</if>
<if test="messageType != null and messageType != ''">
AND MESSAGETYPE = #{messageType}
and messagetype = #{messageType}
</if>
<if test="operateType != null and operateType != ''">
AND OPERATETYPE = #{operateType}
and operatetype = #{operateType}
</if>
</sql>
<select id="queryPageResults" parameterType="HistoryLogs" resultType="HistoryLogs">
SELECT
ID,
TID,
TNAME,
SERVICENAME ,
CODE,
MESSAGE ,
CONTENT,
OPERATETYPE,
MESSAGETYPE,
USERNAME,
CREATEDDATE,
CREATEDBY
FROM MXK_HISTORY_LOGS
WHERE 1 = 1
select
id,
tid,
tname,
servicename ,
code,
message ,
content,
operatetype,
messagetype,
username,
createddate,
createdby
from mxk_history_logs
where 1 = 1
<include refid="where_statement"/>
ORDER BY CREATEDDATE DESC
order by createddate desc
</select>
</mapper>

View File

@@ -4,33 +4,33 @@
<sql id="where_statement">
<if test="id != null and id != ''">
AND ID = #{id}
and id = #{id}
</if>
<if test="title != null and title != ''">
AND TITLE LIKE '%${title}%'
and title like '%${title}%'
</if>
</sql>
<select id="queryPageResults" parameterType="Notices" resultType="Notices">
SELECT
select
*
FROM
MXK_NOTICES
WHERE
from
mxk_notices
where
(1=1)
<include refid="where_statement"/>
ORDER BY MODIFIEDDATE DESC
order by modifieddate desc
</select>
<select id="queryLastedNotices" parameterType="Notices" resultType="Notices">
SELECT
select
*
FROM
MXK_NOTICES
ORDER BY MODIFIEDDATE DESC
LIMIT 1
from
mxk_notices
order by modifieddate desc
limit 1
</select>
</mapper>

View File

@@ -4,16 +4,16 @@
<sql id="dao_where_statement">
<if test="id != null and id != ''">
AND ID = #{id}
and id = #{id}
</if>
<if test="name != null and name != '' ">
AND NAME like '%#{name}%'
and name like '%#{name}%'
</if>
<if test="parentId != null and parentId != '' ">
AND PARENTID = #{parentId}
and parentid = #{parentId}
</if>
<if test="parentName != null and parentName != ''">
AND PARENTNAME like '%#{parentName}%'
and parentname like '%#{parentName}%'
</if>
</sql>
@@ -21,28 +21,28 @@
<select id="queryPageResults" parameterType="Organizations" resultType="Organizations">
SELECT
select
*
FROM MXK_ORGANIZATIONS
WHERE 1 = 1
from mxk_organizations
where 1 = 1
<include refid="dao_where_statement"/>
</select>
<update id="logisticDelete" parameterType="Organizations" >
UPDATE MXK_ORGANIZATIONS SET STATUS = '2'
WHERE 1 = 1
update mxk_organizations set status = '2'
where 1 = 1
<if test="id != null and id != '' ">
AND ID = #{id}
and id = #{id}
</if>
<if test="name != name">
ADN NAME = #{name}
and name = #{name}
</if>
<if test="enable != null">
ADN STATUS = '1'
and status = '1'
</if>
<if test="codePath != null">
ADN CODEPATH = #{codePath}
and codepath = #{codePath}
</if>
</update>

View File

@@ -3,21 +3,21 @@
<mapper namespace="org.maxkey.persistence.mapper.RegistrationMapper">
<select id="queryUserInfoByEmail" parameterType="string" resultType="UserInfo">
SELECT
ID,
EMAIL
FROM
USERINFO
WHERE
EMAIL = #{value}
UNION
SELECT
ID,
WORKEMAIL EAMIL
FROM
MXK_REGISTRATION
WHERE
WORKEMAIL = #{value}
select
id,
email
from
userinfo
where
email = #{value}
union
select
id,
workemail eamil
from
mxk_registration
where
workemail = #{value}
</select>
</mapper>

View File

@@ -3,70 +3,81 @@
<mapper namespace="org.maxkey.persistence.mapper.ReportMapper" >
<!-- DAY COUNT 一天访问量 -->
<select id="analysisDay" parameterType="String" resultType="Integer">
SELECT
COUNT(ID) REPORTCOUNT
FROM MXK_history_login
WHERE
DATE(LOGINTIME) =curdate()
select
count(id) reportcount
from mxk_history_login
where
date(logintime) =curdate()
</select>
<!-- 本月新用户统计 -->
<select id="analysisNewUsers" parameterType="String" resultType="Integer">
SELECT COUNT(*) REPORTCOUNT FROM MXK_USERINFO
WHERE
last_day(CREATEDDATE) =last_day(curdate())
select
count(*) reportcount
from mxk_userinfo
where
last_day(createddate) =last_day(curdate())
</select>
<!-- 在线用户统计 -->
<select id="analysisOnlineUsers" parameterType="String" resultType="Integer">
SELECT COUNT(*) REPORTCOUNT FROM MXK_USERINFO
WHERE
LASTLOGINTIME -LASTLOGOFFTIME
select
count(*) reportcount
from mxk_userinfo
where
lastlogintime -lastlogofftime
</select>
<!-- 30天活跃用户统计 -->
<select id="analysisActiveUsers" parameterType="String" resultType="Integer">
SELECT COUNT(*) REPORTCOUNT FROM MXK_USERINFO
WHERE
DATE(LASTLOGINTIME) >date_add(curdate(), interval - day(curdate()) -31 day)
select
count(*) reportcount
from mxk_userinfo
where
date(lastlogintime) >date_add(curdate(), interval - day(curdate()) -31 day)
</select>
<!-- DAY HOUR COUNT 当天每小时 -->
<select id="analysisDayHour" parameterType="String" resultType="Map">
SELECT
COUNT(ID) REPORTCOUNT, HOUR(LOGINTIME) REPORTSTRING
FROM MXK_history_login
WHERE
DATE(LOGINTIME) =curdate()
GROUP BY REPORTSTRING
ORDER BY REPORTSTRING
select
count(id) reportcount,
hour(logintime) reportstring
from mxk_history_login
where
date(logintime) =curdate()
group by reportstring
order by reportstring
</select>
<!-- 30 DAY COUNT 最近30天每天访问量-->
<select id="analysisMonth" parameterType="String" resultType="Map">
SELECT
COUNT(ID) REPORTCOUNT, DATE(LOGINTIME) REPORTSTRING
FROM MXK_history_login
WHERE
DATE(LOGINTIME) >date_add(curdate(), interval - day(curdate()) -31 day)
GROUP BY REPORTSTRING
ORDER BY REPORTSTRING
select
count(id) reportcount,
date(logintime) reportstring
from mxk_history_login
where
date(logintime) >date_add(curdate(), interval - day(curdate()) -31 day)
group by reportstring
order by reportstring
</select>
<!-- 30天浏览器的访问统计 -->
<select id="analysisBrowser" parameterType="Map" resultType="Map">
SELECT
COUNT(ID) REPORTCOUNT, BROWSER REPORTSTRING
FROM MXK_history_login
WHERE
DATE(LOGINTIME) >date_add(curdate(), interval - day(curdate()) -31 day)
GROUP BY REPORTSTRING
ORDER BY REPORTCOUNT DESC
select
count(id) reportcount,
browser reportstring
from mxk_history_login
where
date(logintime) >date_add(curdate(), interval - day(curdate()) -31 day)
group by reportstring
order by reportcount desc
</select>
<!-- 30天应用单点登录的访问统计 -->
<select id="analysisApp" parameterType="Map" resultType="Map">
SELECT COUNT(ID) REPORTCOUNT,APPNAME
FROM MXK_HISTORY_LOGIN_APPS
WHERE
DATE(LOGINTIME) >date_add(curdate(), interval - day(curdate()) -31 day)
GROUP BY APPNAME ORDER BY REPORTCOUNT DESC
select
count(id) reportcount,
appname
from mxk_history_login_apps
where
date(logintime) >date_add(curdate(), interval - day(curdate()) -31 day)
group by appname order by reportcount desc
</select>
</mapper>

View File

@@ -4,48 +4,48 @@
<sql id="where_statement">
<if test="id != null and id != ''">
AND RES.ID = #{id}
and res.id = #{id}
</if>
<if test="appId != null and appId != ''">
AND RES.APPID = #{appId}
and res.appid = #{appId}
</if>
<if test="parentId != null and parentId != ''">
AND RES.PARENTID = #{parentId}
and res.parentid = #{parentId}
</if>
<if test="name != null and name != ''">
AND RES.NAME LIKE '%${name}%'
and res.name like '%${name}%'
</if>
</sql>
<select id="queryPageResults" parameterType="Resources" resultType="Resources">
SELECT
RES.*,APP.NAME APPNAME
FROM
MXK_RESOURCES RES, MXK_APPS APP
WHERE
(1=1) AND RES.APPID=APP.ID
select
res.*,app.name appname
from
mxk_resources res, mxk_apps app
where
(1=1) and res.appid=app.id
<include refid="where_statement"/>
ORDER BY RES.SORTINDEX
order by res.sortindex
</select>
<update id="logisticDelete" parameterType="Resources" >
UPDATE MXK_RESOURCES SET
STATUS = '2'
WHERE 1 = 1
update mxk_resources set
status = '2'
where 1 = 1
<if test="id != null">
AND ID = #{id}
and id = #{id}
</if>
<if test="name != name">
ADN NAME = #{name}
and name = #{name}
</if>
</update>
<update id="logisticBatchDelete" parameterType="java.util.List">
UPDATE MXK_RESOURCES SET STATUS='2' WHERE ID IN
update mxk_resources set status='2' where id in
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>

View File

@@ -4,258 +4,258 @@
<sql id="where_statement">
<if test="id != null and id != ''">
AND ID = #{id}
and id = #{id}
</if>
<if test="name != null and name != ''">
AND NAME = #{name}
and name = #{name}
</if>
</sql>
<!-- ROLE_MEMBER User Member-->
<select id="allMemberInRole" parameterType="RoleMember" resultType="RoleMember">
SELECT DISTINCT
U.ID,
U.USERNAME,
U.USERTYPE,
U.WINDOWSACCOUNT,
select distinct
u.id,
u.username,
u.usertype,
u.windowsaccount,
U.DISPLAYNAME ,
U.NICKNAME ,
U.NAMEZHSPELL,
U.NAMEZHSHORTSPELL,
U.GIVENNAME ,
U.MIDDLENAME ,
U.FAMILYNAME ,
u.displayname ,
u.nickname ,
u.namezhspell,
u.namezhshortspell,
u.givenname ,
u.middlename ,
u.familyname ,
U.GENDER,
u.gender,
U.AUTHNTYPE,
U.MOBILE,
U.EMAIL,
U.WORKEMAIL,
U.WORKPHONENUMBER,
u.authntype,
u.mobile,
u.email,
u.workemail,
u.workphonenumber,
U.EMPLOYEENUMBER,
U.DIVISION,
U.COSTCENTER,
U.ORGANIZATION,
U.DEPARTMENTID,
U.DEPARTMENT,
U.JOBTITLE,
U.JOBLEVEL,
u.employeenumber,
u.division,
u.costcenter,
u.organization,
u.departmentid,
u.department,
u.jobtitle,
u.joblevel,
U.CREATEDBY,
U.CREATEDDATE,
U.MODIFIEDBY,
U.MODIFIEDDATE,
u.createdby,
u.createddate,
u.modifiedby,
u.modifieddate,
U.STATUS
FROM
MXK_USERINFO U
WHERE 1 = 1
u.status
from
mxk_userinfo u
where 1 = 1
</select>
<select id="memberInRole" parameterType="RoleMember" resultType="RoleMember">
SELECT DISTINCT
RM.ID,
U.USERNAME,
U.USERTYPE,
U.WINDOWSACCOUNT,
select distinct
rm.id,
u.username,
u.usertype,
u.windowsaccount,
U.DISPLAYNAME ,
U.NICKNAME ,
U.NAMEZHSPELL,
U.NAMEZHSHORTSPELL,
U.GIVENNAME ,
U.MIDDLENAME ,
U.FAMILYNAME ,
u.displayname ,
u.nickname ,
u.namezhspell,
u.namezhshortspell,
u.givenname ,
u.middlename ,
u.familyname ,
U.GENDER,
u.gender,
U.AUTHNTYPE,
U.MOBILE,
U.EMAIL,
U.WORKEMAIL,
U.WORKPHONENUMBER,
u.authntype,
u.mobile,
u.email,
u.workemail,
u.workphonenumber,
U.EMPLOYEENUMBER,
U.DIVISION,
U.COSTCENTER,
U.ORGANIZATION,
U.DEPARTMENTID,
U.DEPARTMENT,
U.JOBTITLE,
U.JOBLEVEL,
u.employeenumber,
u.division,
u.costcenter,
u.organization,
u.departmentid,
u.department,
u.jobtitle,
u.joblevel,
U.CREATEDBY,
U.CREATEDDATE,
U.MODIFIEDBY,
U.MODIFIEDDATE,
u.createdby,
u.createddate,
u.modifiedby,
u.modifieddate,
U.STATUS
FROM
MXK_USERINFO U,
MXK_ROLES R,
MXK_ROLE_MEMBER RM
WHERE 1 = 1
u.status
from
mxk_userinfo u,
mxk_roles r,
mxk_role_member rm
where 1 = 1
<if test="roleId != null and roleId != ''">
AND RM.ROLEID = #{roleId}
AND R.ID = #{roleId}
and rm.roleid = #{roleId}
and r.id = #{roleId}
</if>
<if test="roleName != null and roleName != ''">
AND R.NAME = #{roleName}
and r.name = #{roleName}
</if>
<if test="username != null and username != ''">
AND U.USERNAME = #{username}
and u.username = #{username}
</if>
<if test="displayName != null and displayName != ''">
AND U.DISPLAYNAME LIKE '%${displayName}%'
and u.displayname like '%${displayName}%'
</if>
AND RM.TYPE IN( 'USER','USER-DYNAMIC')
AND RM.ROLEID = R.ID
AND RM.MEMBERID = U.ID
and rm.type in( 'USER','USER-DYNAMIC')
and rm.roleid = r.id
and rm.memberid = u.id
</select>
<select id="memberNotInRole" parameterType="RoleMember" resultType="RoleMember">
SELECT DISTINCT
U.ID,
U.USERNAME,
U.USERTYPE,
U.WINDOWSACCOUNT,
select distinct
u.id,
u.username,
u.usertype,
u.windowsaccount,
U.DISPLAYNAME ,
U.NICKNAME ,
U.NAMEZHSPELL,
U.NAMEZHSHORTSPELL,
U.GIVENNAME ,
U.MIDDLENAME ,
U.FAMILYNAME ,
u.displayname ,
u.nickname ,
u.namezhspell,
u.namezhshortspell,
u.givenname ,
u.middlename ,
u.familyname ,
U.GENDER,
u.gender,
U.AUTHNTYPE,
U.MOBILE,
U.EMAIL,
U.WORKEMAIL,
U.WORKPHONENUMBER,
u.authntype,
u.mobile,
u.email,
u.workemail,
u.workphonenumber,
U.EMPLOYEENUMBER,
U.DIVISION,
U.COSTCENTER,
U.ORGANIZATION,
U.DEPARTMENTID,
U.DEPARTMENT,
U.JOBTITLE,
U.JOBLEVEL,
u.employeenumber,
u.division,
u.costcenter,
u.organization,
u.departmentid,
u.department,
u.jobtitle,
u.joblevel,
U.CREATEDBY,
U.CREATEDDATE,
U.MODIFIEDBY,
U.MODIFIEDDATE,
u.createdby,
u.createddate,
u.modifiedby,
u.modifieddate,
U.STATUS
FROM
MXK_USERINFO U
WHERE
U.ID NOT IN(
SELECT RM.MEMBERID
FROM MXK_ROLES R,MXK_ROLE_MEMBER RM
WHERE 1 = 1
u.status
from
mxk_userinfo u
where
u.id not in(
select rm.memberid
from mxk_roles r,mxk_role_member rm
where 1 = 1
<if test="roleId != null and roleId != ''">
AND RM.ROLEID = #{roleId}
AND R.ID = #{roleId}
and rm.roleid = #{roleId}
and r.id = #{roleId}
</if>
<if test="roleName != null and roleName != ''">
AND R.NAME = #{roleName}
and r.name = #{roleName}
</if>
AND RM.TYPE IN( 'USER','USER-DYNAMIC')
AND RM.ROLEID = R.ID
and rm.type in( 'USER','USER-DYNAMIC')
and rm.roleid = r.id
)
<if test="username != null and username != ''">
AND U.USERNAME = #{username}
and u.username = #{username}
</if>
<if test="displayName != null and displayName != ''">
AND U.DISPLAYNAME LIKE '%${displayName}%'
and u.displayname like '%${displayName}%'
</if>
</select>
<!-- ROLE_MEMBER Roles Member-->
<select id="roleMemberInRole" parameterType="RoleMember" resultType="Roles">
SELECT DISTINCT
IR.*
FROM
MXK_ROLES IR,
MXK_ROLES R,
MXK_ROLE_MEMBER RM
WHERE
select distinct
ir.*
from
mxk_roles ir,
mxk_roles r,
mxk_role_member rm
where
1 = 1
AND RM.GROUPID = R.ID
AND RM.MEMBERID = IR.ID
AND RM.TYPE IN( 'USER','USER-DYNAMIC')
and rm.groupid = r.id
and rm.memberid = ir.id
and rm.type in( 'USER','USER-DYNAMIC')
<if test="roleId != null and roleId != ''">
AND RM.ROLEID = #{roleId}
AND R.ID = #{roleId}
and rm.roleid = #{roleId}
and r.id = #{roleId}
</if>
<if test="roleName != null and roleName != ''">
AND R.NAME = #{roleName}
and r.name = #{roleName}
</if>
</select>
<update id="addDynamicRoleMember" parameterType="Roles" >
INSERT INTO MXK_ROLE_MEMBER(
ID,
ROLEID,
MEMBERID,
TYPE
insert into mxk_role_member(
id,
roleid,
memberid,
type
)
SELECT
CONCAT_WS('-','UD','${id}',U.ID) ID,
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'
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'
)
<if test="filters != null and filters != ''">
${filters}
</if>
<if test="orgIdsList != null and orgIdsList != ''">
AND U.DEPARTMENTID IN( ${orgIdsList})
and u.departmentid in( ${orgIdsList})
</if>
</update>
<delete id="deleteDynamicRoleMember" parameterType="Roles" >
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
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
<if test="filters != null and filters != ''">
${filters}
</if>
<if test="orgIdsList != null and orgIdsList != ''">
AND U.DEPARTMENTID IN( ${orgIdsList})
and u.departmentid in( ${orgIdsList})
</if>
)
</delete>
<delete id="deleteByRoleId" parameterType="string" >
DELETE FROM MXK_ROLE_MEMBER RM
WHERE RM.ROLEID=#{value}
delete from mxk_role_member rm
where rm.roleid=#{value}
</delete>
</mapper>

View File

@@ -4,49 +4,49 @@
<sql id="where_statement">
<if test="id != null and id != ''">
AND ID = #{id}
and id = #{id}
</if>
<if test="name != null and name != ''">
AND NAME LIKE '%${name}%'
and name like '%${name}%'
</if>
</sql>
<select id="queryDynamicRoles" parameterType="Roles" resultType="Roles">
SELECT
select
*
FROM
`MXK_GROUPS`
WHERE
DYNAMIC = '1'
from
`mxk_groups`
where
dynamic = '1'
<include refid="where_statement"/>
</select>
<select id="queryPageResults" parameterType="Roles" resultType="Roles">
SELECT
select
*
FROM
MXK_ROLES
WHERE
from
mxk_roles
where
(1=1)
<include refid="where_statement"/>
</select>
<update id="logisticDelete" parameterType="Roles" >
UPDATE MXK_ROLES SET
STATUS = '2'
WHERE 1 = 1
update mxk_roles set
status = '2'
where 1 = 1
<if test="id != null">
AND ID = #{id}
and id = #{id}
</if>
<if test="name != name">
ADN NAME = #{name}
and name = #{name}
</if>
</update>
<update id="logisticBatchDelete" parameterType="java.util.List">
UPDATE MXK_ROLES SET STATUS='2' WHERE ID IN
update mxk_roles set status='2' where id in
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
@@ -54,34 +54,34 @@
<select id="queryRolePermissions" parameterType="RolePermissions" resultType="RolePermissions">
SELECT
select
*
FROM
MXK_ROLE_PERMISSIONS
WHERE
STATUS = 1
from
mxk_role_permissions
where
status = 1
<if test="id != null and id != ''">
AND ID = #{id}
and id = #{id}
</if>
<if test="roleId != null and roleId != ''">
AND ROLEID = #{roleId}
and roleid = #{roleId}
</if>
<if test="appId != null and appId != ''">
AND APPID = #{appId}
and appid = #{appId}
</if>
</select>
<update id="logisticDeleteRolePermissions" parameterType="java.util.List">
UPDATE MXK_ROLE_PERMISSIONS SET STATUS=9 WHERE ID IN
update mxk_role_permissions set status=9 where id in
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item.id}
</foreach>
</update>
<insert id="insertRolePermissions" parameterType="java.util.List">
INSERT INTO MXK_ROLE_PERMISSIONS ( ID,APPID,ROLEID,RESOURCEID,STATUS)
VALUES
insert into mxk_role_permissions ( id,appid,roleid,resourceid,status)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.id},#{item.appId},#{item.roleId},#{item.resourceId},#{item.status})
</foreach>

View File

@@ -4,41 +4,41 @@
<sql id="where_statement">
<if test="id != null and id != ''">
AND ID = #{id}
and id = #{id}
</if>
<if test="userId != null and userId != ''">
AND USERID = #{userId}
and userid = #{userId}
</if>
</sql>
<select id="queryPageResults" parameterType="UserInfoAdjoint" resultType="UserInfoAdjoint">
SELECT
select
*
FROM
MXK_USERINFO_ADJUNCT
WHERE
from
mxk_userinfo_adjunct
where
(1=1)
<include refid="where_statement"/>
</select>
<update id="logisticDelete" parameterType="UserInfoAdjoint" >
UPDATE MXK_USERINFO_ADJUNCT SET
STATUS = '2'
WHERE 1 = 1
update mxk_userinfo_adjunct set
status = '2'
where 1 = 1
<if test="id != null">
AND ID = #{id}
and id = #{id}
</if>
<if test="name != name">
ADN NAME = #{name}
and NAME = #{name}
</if>
</update>
<update id="logisticBatchDelete" parameterType="java.util.List">
UPDATE MXK_USERINFO_ADJUNCT SET STATUS='2' WHERE ID IN
update mxk_userinfo_adjunct set status='2' where id in
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>

View File

@@ -3,250 +3,250 @@
<mapper namespace="org.maxkey.persistence.mapper.UserInfoMapper">
<select id="loadByUsername" parameterType="string" resultType="UserInfo">
SELECT
select
*
FROM
MXK_USERINFO
WHERE USERNAME = #{value}
from
mxk_userinfo
where username = #{value}
</select>
<select id="queryPageResults" parameterType="UserInfo" resultType="UserInfo">
SELECT
ID,
USERNAME,
USERTYPE,
WINDOWSACCOUNT,
select
id,
username,
usertype,
windowsaccount,
DISPLAYNAME ,
NICKNAME ,
NAMEZHSPELL,
NAMEZHSHORTSPELL,
GIVENNAME ,
MIDDLENAME ,
FAMILYNAME ,
displayname ,
nickname ,
namezhspell,
namezhshortspell,
givenname ,
middlename ,
familyname ,
GENDER,
gender,
AUTHNTYPE,
MOBILE,
EMAIL,
WORKEMAIL,
WORKPHONENUMBER,
authntype,
mobile,
email,
workemail,
workphonenumber,
EMPLOYEENUMBER,
DIVISION,
COSTCENTER,
ORGANIZATION,
DEPARTMENTID,
DEPARTMENT,
JOBTITLE,
JOBLEVEL,
employeenumber,
division,
costcenter,
organization,
departmentid,
department,
jobtitle,
joblevel,
CREATEDBY,
CREATEDDATE,
MODIFIEDBY,
MODIFIEDDATE,
createdby,
createddate,
modifiedby,
modifieddate,
STATUS
FROM
MXK_USERINFO
WHERE
status
from
mxk_userinfo
where
(1=1)
<if test="username != null and username != ''">
AND USERNAME = #{username}
and username = #{username}
</if>
<if test="employeeNumber != null and employeeNumber != ''">
AND EMPLOYEENUMBER = #{employeeNumber}
and employeenumber = #{employeeNumber}
</if>
<if test="userType != null and userType != ''">
AND USERTYPE = #{userType}
and usertype = #{userType}
</if>
<if test="displayName != null and displayName != ''">
AND DISPLAYNAME LIKE '%${displayName}%'
and displayname like '%${displayName}%'
</if>
<if test="departmentId != null and departmentId != ''">
AND DEPARTMENTID = #{departmentId}
and departmentid = #{departmentId}
</if>
ORDER BY SORTORDER
order by sortorder
</select>
<update id="locked" parameterType="UserInfo" >
UPDATE MXK_USERINFO SET
update mxk_userinfo set
<if test="isLocked != null">
ISLOCKED = #{isLocked},
islocked = #{isLocked},
</if>
MODIFIEDDATE = current_timestamp
WHERE
ID = #{id}
modifieddate = current_timestamp
where
id = #{id}
</update>
<update id="lockout" parameterType="UserInfo" >
UPDATE MXK_USERINFO SET
update mxk_userinfo set
<if test="isLocked != null">
ISLOCKED = #{isLocked},
BADPWDCOUNT = 0,
islocked = #{isLocked},
badpwdcount = 0,
</if>
UNLOCKDATE = current_timestamp,
MODIFIEDDATE = current_timestamp
WHERE
ID = #{id}
unlockdate = current_timestamp,
modifieddate = current_timestamp
where
id = #{id}
</update>
<update id="changePassword" parameterType="UserInfo" >
UPDATE MXK_USERINFO SET
update mxk_userinfo set
<if test="password != null">
PASSWORD = #{password},
DECIPHERABLE = #{decipherable},
password = #{password},
decipherable = #{decipherable},
</if>
PASSWORDSETTYPE = 0,
PASSWORDLASTSETTIME = current_timestamp
WHERE
ID = #{id}
passwordsettype = 0,
passwordlastsettime = current_timestamp
where
id = #{id}
</update>
<update id="changeSharedSecret" parameterType="UserInfo" >
UPDATE MXK_USERINFO SET
update mxk_userinfo set
<if test="sharedSecret != null">
SHAREDSECRET = #{sharedSecret},
SHAREDCOUNTER = #{sharedCounter},
sharedsecret = #{sharedSecret},
sharedcounter = #{sharedCounter},
</if>
MODIFIEDDATE = current_timestamp
WHERE
ID = #{id}
modifieddate = current_timestamp
where
id = #{id}
</update>
<update id="changeAppLoginPassword" parameterType="UserInfo" >
UPDATE MXK_USERINFO SET
update mxk_userinfo set
<if test="appLoginPassword != null">
APPLOGINPASSWORD = #{appLoginPassword},
apploginpassword = #{appLoginPassword},
</if>
MODIFIEDDATE = current_timestamp
WHERE
ID = #{id}
modifieddate = current_timestamp
where
id = #{id}
</update>
<update id="updateProtectedApps" parameterType="UserInfo" >
UPDATE MXK_USERINFO SET
update mxk_userinfo set
<if test="protectedApps != null">
PROTECTEDAPPS = #{protectedApps},
protectedapps = #{protectedApps},
</if>
MODIFIEDDATE = current_timestamp
WHERE
ID = #{id}
modifieddate = current_timestamp
where
id = #{id}
</update>
<update id="changePasswordQuestion" parameterType="UserInfo" >
UPDATE MXK_USERINFO SET
update mxk_userinfo set
<if test="passwordAnswer != null">
PASSWORDQUESTION = #{passwordQuestion},
PASSWORDANSWER = #{passwordAnswer},
passwordquestion = #{passwordQuestion},
passwordanswer = #{passwordAnswer},
</if>
MODIFIEDDATE = current_timestamp
WHERE
ID = #{id}
modifieddate = current_timestamp
where
id = #{id}
</update>
<update id="changeAuthnType" parameterType="UserInfo" >
UPDATE MXK_USERINFO SET
update mxk_userinfo set
<if test="authnType != null">
AUTHNTYPE = #{authnType},
authntype = #{authnType},
</if>
MODIFIEDDATE = current_timestamp
WHERE
ID = #{id}
modifieddate = current_timestamp
where
id = #{id}
</update>
<update id="changeEmail" parameterType="UserInfo" >
UPDATE MXK_USERINFO SET
update mxk_userinfo set
<if test="email != null">
EMAIL = #{email},
email = #{email},
</if>
<if test="emailVerified != null">
EMAILVERIFIED = #{emailVerified},
emailverified = #{emailVerified},
</if>
<if test="theme != null">
THEME = #{theme},
theme = #{theme},
</if>
MODIFIEDDATE = current_timestamp
WHERE
ID = #{id}
modifieddate = current_timestamp
where
id = #{id}
</update>
<update id="changeMobile" parameterType="UserInfo" >
UPDATE MXK_USERINFO SET
update mxk_userinfo set
<if test="mobile != null">
MOBILE = #{mobile},
mobile = #{mobile},
</if>
<if test="mobileVerified != null">
MOBILEVERIFIED = #{mobileVerified},
mobileverified = #{mobileVerified},
</if>
MODIFIEDDATE = current_timestamp
WHERE
ID = #{id}
modifieddate = current_timestamp
where
id = #{id}
</update>
<update id="logisticBatchDelete" parameterType="java.util.List">
UPDATE MXK_USERINFO SET STATUS='2' WHERE ID IN
update mxk_userinfo set status='2' where id in
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<update id="updateProfile" parameterType="UserInfo" >
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},
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},
<if test="picture != null">
PICTURE = #{picture},
picture = #{picture},
</if>
IDTYPE = #{idType},
IDCARDNO = #{idCardNo},
WEBSITE = #{webSite},
idtype = #{idType},
idcardno = #{idCardNo},
website = #{webSite},
LOCALE = #{locale},
TIMEZONE = #{timeZone},
PREFERREDLANGUAGE= #{preferredLanguage},
locale = #{locale},
timezone = #{timeZone},
preferredlanguage= #{preferredLanguage},
WINDOWSACCOUNT = #{windowsAccount},
windowsaccount = #{windowsAccount},
WORKCOUNTRY = #{workCountry},
WORKREGION = #{workRegion},
WORKLOCALITY = #{workLocality},
WORKSTREETADDRESS= #{workStreetAddress},
WORKADDRESSFORMATTED= #{workAddressFormatted},
WORKEMAIL = #{workEmail},
WORKPHONENUMBER = #{workPhoneNumber},
WORKPOSTALCODE = #{workPostalCode},
WORKFAX = #{workFax},
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},
homecountry = #{homeCountry},
homeregion = #{homeRegion},
homelocality = #{homeLocality},
homestreetaddress= #{homeStreetAddress},
homeaddressformatted= #{homeAddressFormatted},
homeemail = #{homeEmail},
homephonenumber= #{homePhoneNumber},
homepostalcode = #{homePostalCode},
homefax = #{homeFax},
EXTRAATTRIBUTE = #{extraAttribute},
extraattribute = #{extraAttribute},
MODIFIEDBY = #{modifiedBy},
MODIFIEDDATE = current_timestamp
WHERE
ID = #{id}
modifiedby = #{modifiedBy},
modifieddate = current_timestamp
where
id = #{id}
</update>
</mapper>

View File

@@ -22,7 +22,7 @@ import java.util.Date;
import org.apache.mybatis.jpa.util.WebContext;
import org.junit.Before;
import org.junit.Test;
import org.maxkey.domain.Accounts;
import org.maxkey.entity.Accounts;
import org.maxkey.persistence.service.AccountsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@@ -22,7 +22,7 @@ import java.util.Date;
import org.apache.mybatis.jpa.util.WebContext;
import org.junit.Before;
import org.junit.Test;
import org.maxkey.domain.apps.Apps;
import org.maxkey.entity.apps.Apps;
import org.maxkey.persistence.service.AppsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@@ -25,7 +25,7 @@ import java.util.List;
import org.apache.mybatis.jpa.util.WebContext;
import org.junit.Before;
import org.junit.Test;
import org.maxkey.domain.apps.AppsFormBasedDetails;
import org.maxkey.entity.apps.AppsFormBasedDetails;
import org.maxkey.persistence.service.AppsFormBasedDetailsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;