|
@@ -1,252 +1,262 @@
|
|
|
-<?xml version="1.0" encoding="UTF-8"?>
|
|
|
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
-<mapper namespace="org.maxkey.persistence.mapper.UserInfoMapper">
|
|
|
-
|
|
|
- <select id="loadByUsername" parameterType="string" resultType="UserInfo">
|
|
|
- select
|
|
|
- *
|
|
|
- from
|
|
|
- mxk_userinfo
|
|
|
- where username = #{value}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="queryPageResults" parameterType="UserInfo" resultType="UserInfo">
|
|
|
- select
|
|
|
- id,
|
|
|
- username,
|
|
|
- usertype,
|
|
|
- windowsaccount,
|
|
|
-
|
|
|
- displayname ,
|
|
|
- nickname ,
|
|
|
- namezhspell,
|
|
|
- namezhshortspell,
|
|
|
- givenname ,
|
|
|
- middlename ,
|
|
|
- familyname ,
|
|
|
-
|
|
|
- gender,
|
|
|
-
|
|
|
- authntype,
|
|
|
- mobile,
|
|
|
- email,
|
|
|
- workemail,
|
|
|
- workphonenumber,
|
|
|
-
|
|
|
- employeenumber,
|
|
|
- division,
|
|
|
- costcenter,
|
|
|
- organization,
|
|
|
- departmentid,
|
|
|
- department,
|
|
|
- jobtitle,
|
|
|
- joblevel,
|
|
|
-
|
|
|
-
|
|
|
- createdby,
|
|
|
- createddate,
|
|
|
- modifiedby,
|
|
|
- modifieddate,
|
|
|
-
|
|
|
- status
|
|
|
- from
|
|
|
- mxk_userinfo
|
|
|
- where
|
|
|
- (1=1)
|
|
|
- <if test="username != null and username != ''">
|
|
|
- and username = #{username}
|
|
|
- </if>
|
|
|
- <if test="employeeNumber != null and employeeNumber != ''">
|
|
|
- and employeenumber = #{employeeNumber}
|
|
|
- </if>
|
|
|
- <if test="userType != null and userType != ''">
|
|
|
- and usertype = #{userType}
|
|
|
- </if>
|
|
|
- <if test="displayName != null and displayName != ''">
|
|
|
- and displayname like '%${displayName}%'
|
|
|
- </if>
|
|
|
- <if test="departmentId != null and departmentId != ''">
|
|
|
- and departmentid = #{departmentId}
|
|
|
- </if>
|
|
|
- order by sortorder
|
|
|
- </select>
|
|
|
-
|
|
|
- <update id="locked" parameterType="UserInfo" >
|
|
|
- update mxk_userinfo set
|
|
|
- <if test="isLocked != null">
|
|
|
- islocked = #{isLocked},
|
|
|
- </if>
|
|
|
- modifieddate = current_timestamp
|
|
|
- where
|
|
|
- id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <update id="lockout" parameterType="UserInfo" >
|
|
|
- update mxk_userinfo set
|
|
|
- <if test="isLocked != null">
|
|
|
- islocked = #{isLocked},
|
|
|
- badpwdcount = 0,
|
|
|
- </if>
|
|
|
- unlockdate = current_timestamp,
|
|
|
- modifieddate = current_timestamp
|
|
|
- where
|
|
|
- id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <update id="changePassword" parameterType="UserInfo" >
|
|
|
- update mxk_userinfo set
|
|
|
- <if test="password != null">
|
|
|
- password = #{password},
|
|
|
- decipherable = #{decipherable},
|
|
|
- </if>
|
|
|
- passwordsettype = 0,
|
|
|
- passwordlastsettime = current_timestamp
|
|
|
- where
|
|
|
- id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <update id="changeSharedSecret" parameterType="UserInfo" >
|
|
|
- update mxk_userinfo set
|
|
|
- <if test="sharedSecret != null">
|
|
|
- sharedsecret = #{sharedSecret},
|
|
|
- sharedcounter = #{sharedCounter},
|
|
|
- </if>
|
|
|
- modifieddate = current_timestamp
|
|
|
- where
|
|
|
- id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <update id="changeAppLoginPassword" parameterType="UserInfo" >
|
|
|
- update mxk_userinfo set
|
|
|
- <if test="appLoginPassword != null">
|
|
|
- apploginpassword = #{appLoginPassword},
|
|
|
- </if>
|
|
|
- modifieddate = current_timestamp
|
|
|
- where
|
|
|
- id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <update id="updateProtectedApps" parameterType="UserInfo" >
|
|
|
- update mxk_userinfo set
|
|
|
- <if test="protectedApps != null">
|
|
|
- protectedapps = #{protectedApps},
|
|
|
- </if>
|
|
|
- modifieddate = current_timestamp
|
|
|
- where
|
|
|
- id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <update id="changePasswordQuestion" parameterType="UserInfo" >
|
|
|
- update mxk_userinfo set
|
|
|
- <if test="passwordAnswer != null">
|
|
|
- passwordquestion = #{passwordQuestion},
|
|
|
- passwordanswer = #{passwordAnswer},
|
|
|
- </if>
|
|
|
- modifieddate = current_timestamp
|
|
|
- where
|
|
|
- id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <update id="changeAuthnType" parameterType="UserInfo" >
|
|
|
- update mxk_userinfo set
|
|
|
- <if test="authnType != null">
|
|
|
- authntype = #{authnType},
|
|
|
- </if>
|
|
|
- modifieddate = current_timestamp
|
|
|
- where
|
|
|
- id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <update id="changeEmail" parameterType="UserInfo" >
|
|
|
- update mxk_userinfo set
|
|
|
- <if test="email != null">
|
|
|
- email = #{email},
|
|
|
- </if>
|
|
|
- <if test="emailVerified != null">
|
|
|
- emailverified = #{emailVerified},
|
|
|
- </if>
|
|
|
- <if test="theme != null">
|
|
|
- theme = #{theme},
|
|
|
- </if>
|
|
|
- modifieddate = current_timestamp
|
|
|
- where
|
|
|
- id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <update id="changeMobile" parameterType="UserInfo" >
|
|
|
- update mxk_userinfo set
|
|
|
- <if test="mobile != null">
|
|
|
- mobile = #{mobile},
|
|
|
- </if>
|
|
|
- <if test="mobileVerified != null">
|
|
|
- mobileverified = #{mobileVerified},
|
|
|
- </if>
|
|
|
- modifieddate = current_timestamp
|
|
|
- where
|
|
|
- id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <update id="logisticBatchDelete" parameterType="java.util.List">
|
|
|
- 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},
|
|
|
- <if test="picture != null">
|
|
|
- picture = #{picture},
|
|
|
- </if>
|
|
|
- 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}
|
|
|
- </update>
|
|
|
-
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="org.maxkey.persistence.mapper.UserInfoMapper">
|
|
|
+
|
|
|
+ <select id="queryPageResults" parameterType="UserInfo" resultType="UserInfo">
|
|
|
+ select
|
|
|
+ id,
|
|
|
+ username,
|
|
|
+ usertype,
|
|
|
+ windowsaccount,
|
|
|
+
|
|
|
+ displayname ,
|
|
|
+ nickname ,
|
|
|
+ namezhspell,
|
|
|
+ namezhshortspell,
|
|
|
+ givenname ,
|
|
|
+ middlename ,
|
|
|
+ familyname ,
|
|
|
+
|
|
|
+ gender,
|
|
|
+
|
|
|
+ authntype,
|
|
|
+ mobile,
|
|
|
+ email,
|
|
|
+ workemail,
|
|
|
+ workphonenumber,
|
|
|
+
|
|
|
+ employeenumber,
|
|
|
+ division,
|
|
|
+ costcenter,
|
|
|
+ organization,
|
|
|
+ departmentid,
|
|
|
+ department,
|
|
|
+ jobtitle,
|
|
|
+ joblevel,
|
|
|
+
|
|
|
+
|
|
|
+ createdby,
|
|
|
+ createddate,
|
|
|
+ modifiedby,
|
|
|
+ modifieddate,
|
|
|
+
|
|
|
+ status
|
|
|
+ from
|
|
|
+ mxk_userinfo
|
|
|
+ where instid = #{instId}
|
|
|
+ <if test="username != null and username != ''">
|
|
|
+ and username = #{username}
|
|
|
+ </if>
|
|
|
+ <if test="employeeNumber != null and employeeNumber != ''">
|
|
|
+ and employeenumber = #{employeeNumber}
|
|
|
+ </if>
|
|
|
+ <if test="userType != null and userType != ''">
|
|
|
+ and usertype = #{userType}
|
|
|
+ </if>
|
|
|
+ <if test="displayName != null and displayName != ''">
|
|
|
+ and displayname like '%${displayName}%'
|
|
|
+ </if>
|
|
|
+ <if test="departmentId != null and departmentId != ''">
|
|
|
+ and departmentid = #{departmentId}
|
|
|
+ </if>
|
|
|
+ order by sortorder,id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="updateLocked" parameterType="UserInfo">
|
|
|
+ update mxk_userinfo set
|
|
|
+ <if test="isLocked != null">
|
|
|
+ islocked = #{isLocked},
|
|
|
+ </if>
|
|
|
+ modifieddate = current_timestamp
|
|
|
+ where
|
|
|
+ id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateLockout" parameterType="UserInfo">
|
|
|
+ update mxk_userinfo set
|
|
|
+ <if test="isLocked != null">
|
|
|
+ islocked = #{isLocked},
|
|
|
+ badpwdcount = 0,
|
|
|
+ </if>
|
|
|
+ unlockdate = current_timestamp,
|
|
|
+ modifieddate = current_timestamp
|
|
|
+ where
|
|
|
+ id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updatePassword" parameterType="UserInfo">
|
|
|
+ update mxk_userinfo set
|
|
|
+ <if test="password != null">
|
|
|
+ password = #{password},
|
|
|
+ decipherable = #{decipherable},
|
|
|
+ passwordsettype =#{passwordSetType},
|
|
|
+ </if>
|
|
|
+ passwordlastsettime = current_timestamp
|
|
|
+ where
|
|
|
+ id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateSharedSecret" parameterType="UserInfo">
|
|
|
+ update mxk_userinfo set
|
|
|
+ <if test="sharedSecret != null">
|
|
|
+ sharedsecret = #{sharedSecret},
|
|
|
+ sharedcounter = #{sharedCounter},
|
|
|
+ </if>
|
|
|
+ modifieddate = current_timestamp
|
|
|
+ where
|
|
|
+ id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateAppLoginPassword" parameterType="UserInfo">
|
|
|
+ update mxk_userinfo set
|
|
|
+ <if test="appLoginPassword != null">
|
|
|
+ apploginpassword = #{appLoginPassword},
|
|
|
+ </if>
|
|
|
+ modifieddate = current_timestamp
|
|
|
+ where
|
|
|
+ id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateProtectedApps" parameterType="UserInfo">
|
|
|
+ update mxk_userinfo set
|
|
|
+ <if test="protectedApps != null">
|
|
|
+ protectedapps = #{protectedApps},
|
|
|
+ </if>
|
|
|
+ modifieddate = current_timestamp
|
|
|
+ where
|
|
|
+ id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updatePasswordQuestion" parameterType="UserInfo">
|
|
|
+ update mxk_userinfo set
|
|
|
+ <if test="passwordAnswer != null">
|
|
|
+ passwordquestion = #{passwordQuestion},
|
|
|
+ passwordanswer = #{passwordAnswer},
|
|
|
+ </if>
|
|
|
+ modifieddate = current_timestamp
|
|
|
+ where
|
|
|
+ id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateAuthnType" parameterType="UserInfo">
|
|
|
+ update mxk_userinfo set
|
|
|
+ <if test="authnType != null">
|
|
|
+ authntype = #{authnType},
|
|
|
+ </if>
|
|
|
+ modifieddate = current_timestamp
|
|
|
+ where
|
|
|
+ id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateEmail" parameterType="UserInfo">
|
|
|
+ update mxk_userinfo set
|
|
|
+ <if test="email != null">
|
|
|
+ email = #{email},
|
|
|
+ </if>
|
|
|
+ <if test="emailVerified != null">
|
|
|
+ emailverified = #{emailVerified},
|
|
|
+ </if>
|
|
|
+ <if test="theme != null">
|
|
|
+ theme = #{theme},
|
|
|
+ </if>
|
|
|
+ modifieddate = current_timestamp
|
|
|
+ where
|
|
|
+ id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateMobile" parameterType="UserInfo">
|
|
|
+ update mxk_userinfo set
|
|
|
+ <if test="mobile != null">
|
|
|
+ mobile = #{mobile},
|
|
|
+ </if>
|
|
|
+ <if test="mobileVerified != null">
|
|
|
+ mobileverified = #{mobileVerified},
|
|
|
+ </if>
|
|
|
+ modifieddate = current_timestamp
|
|
|
+ where
|
|
|
+ id = #{id}
|
|
|
+ </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},
|
|
|
+ <if test="picture != null">
|
|
|
+ picture = #{picture},
|
|
|
+ </if>
|
|
|
+ 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}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="findDeptsByUserId" parameterType="string" resultType="Organizations">
|
|
|
+ select o.*, 1 isPrimary
|
|
|
+ from mxk_organizations o,
|
|
|
+ mxk_userinfo u
|
|
|
+ where o.instid = #{instId}
|
|
|
+ and u.instid = #{instId}
|
|
|
+ and o.id = u.departmentid
|
|
|
+ and u.id = #{value}
|
|
|
+
|
|
|
+ union all
|
|
|
+
|
|
|
+ select o.*, 0 isPrimary
|
|
|
+ from mxk_organizations o,
|
|
|
+ mxk_userinfo_adjunct ua
|
|
|
+ where o.instid = #{instId}
|
|
|
+ and ua.instid = #{instId}
|
|
|
+ and o.id = ua.departmentid
|
|
|
+ and ua.userid = #{value}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findAdjointsByUserId" parameterType="string" resultType="UserInfoAdjoint">
|
|
|
+ select *
|
|
|
+ from mxk_userinfo_adjunct
|
|
|
+ where userid = #{value}
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|