|
@@ -122,7 +122,7 @@
|
|
|
u.id AS userId,
|
|
|
u.gmt_create AS userGmtCreate,
|
|
|
u.username AS userName,
|
|
|
- u.linkman AS linKman,
|
|
|
+ u.linkman AS linkman,
|
|
|
u.email AS email,
|
|
|
org.id AS orgId,
|
|
|
org.gmt_create AS orgGmtCreate,
|
|
@@ -132,9 +132,9 @@
|
|
|
org.address as orgAddress,
|
|
|
org.parent_id as orgParent_id,
|
|
|
org.sub_num as orgSub_num,
|
|
|
- u.position as autPosition,
|
|
|
+ u.position as position,
|
|
|
aut.is_reject as autIsReject,
|
|
|
- aut.status as autStatus
|
|
|
+ u.auth_status as authStatus
|
|
|
FROM sys_user u
|
|
|
LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
|
|
|
LEFT JOIN sys_organization org ON uorg.organization_id = org.id
|
|
@@ -143,8 +143,8 @@
|
|
|
<if test="userInfo.orgName != null">
|
|
|
AND org.name LIKE CONCAT('%', #{userInfo.orgName}, '%')
|
|
|
</if>
|
|
|
- <if test="userInfo.autStatus != null">
|
|
|
- AND aut.status = #{userInfo.autStatus}
|
|
|
+ <if test="userInfo.authStatus != null">
|
|
|
+ AND u.auth_status = #{userInfo.authStatus}
|
|
|
</if>
|
|
|
ORDER BY u.gmt_create DESC
|
|
|
</select>
|
|
@@ -238,22 +238,25 @@
|
|
|
AND r.user_id= #{map.userId}
|
|
|
</update>
|
|
|
<update id="auditUserInfoAll" parameterType="java.util.Map">
|
|
|
- UPDATE sys_user_authentication
|
|
|
+ UPDATE sys_user_authentication a, sys_user u
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
- <if test="auditMap.gmtModified !=null">gmt_modified=#{auditMap.gmtModified},</if>
|
|
|
- <if test="auditMap.modifier != null">modifier=#{auditMap.modifier},</if>
|
|
|
- <if test="auditMap.isReject != null">is_reject = #{auditMap.isReject} ,</if>
|
|
|
- <if test="auditMap.certificationDate != null">certification_date = #{auditMap.certificationDate},</if>
|
|
|
- <if test="auditMap.rejectType != null">reject_type =#{auditMap.rejectType},</if>
|
|
|
- <if test="auditMap.rejectComment != null">reject_comment= #{auditMap.rejectComment},
|
|
|
- </if>
|
|
|
- <if test="auditMap.status != null">STATUS= #{auditMap.status}</if>
|
|
|
+ <if test="auditMap.gmtModified !=null">a.gmt_modified=#{auditMap.gmtModified},</if>
|
|
|
+ <if test="auditMap.modifier != null">a.modifier=#{auditMap.modifier},</if>
|
|
|
+ <if test="auditMap.isReject != null">a.is_reject = #{auditMap.isReject} ,</if>
|
|
|
+ <if test="auditMap.certificationDate != null">a.certification_date = #{auditMap.certificationDate},</if>
|
|
|
+ <if test="auditMap.rejectType != null">a.reject_type =#{auditMap.rejectType},</if>
|
|
|
+ <if test="auditMap.rejectComment != null">a.reject_comment= #{auditMap.rejectComment},</if>
|
|
|
+ <if test="auditMap.status != null">a.STATUS= #{auditMap.status}</if>
|
|
|
+ <if test="auditMap.authStatus != null">u.auth_status = #{auditMap.authStatus}</if>
|
|
|
+ <if test="auditMap.passauthTime != null">u.passauth_time = #{auditMap.passauthTime},</if>
|
|
|
+ <if test="auditMap.gmtModified !=null">u.gmt_modified=#{auditMap.gmtModified},</if>
|
|
|
+ <if test="auditMap.modifier != null">u.modifier=#{auditMap.modifier},</if>
|
|
|
</trim>
|
|
|
WHERE
|
|
|
is_deleted = "N"
|
|
|
- AND user_id = #{auditMap.userId}
|
|
|
- AND order_num = #{auditMap.orderNum}
|
|
|
-
|
|
|
+ AND a.user_id = #{auditMap.userId}
|
|
|
+ AND a.order_num = #{auditMap.orderNum}
|
|
|
+ AND u.id = #{auditMap.userId}
|
|
|
</update>
|
|
|
|
|
|
<select id="dependentuserInfoByTime" parameterType="java.util.Map"
|
|
@@ -262,9 +265,9 @@
|
|
|
SELECT
|
|
|
u.id AS userId,
|
|
|
u.gmt_create AS userGmtCreate,
|
|
|
- u.gmt_modified AS userGmtModified,
|
|
|
+ u.passauth_time AS passauthTime,
|
|
|
u.username AS userName,
|
|
|
- u.linkman AS linKman,
|
|
|
+ u.linkman AS linkman,
|
|
|
u.email AS email,
|
|
|
org.id AS orgId,
|
|
|
org.gmt_create AS orgGmtCreate,
|
|
@@ -274,13 +277,11 @@
|
|
|
org.address as orgAddress,
|
|
|
org.parent_id as orgParent_id,
|
|
|
org.sub_num as orgSub_num,
|
|
|
- u.position as autPosition,
|
|
|
- aut.is_reject as autIsReject,
|
|
|
- aut.status as autStatus
|
|
|
+ u.position as position,
|
|
|
+ u.auth_status as authStatus
|
|
|
FROM sys_user u
|
|
|
LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
|
|
|
LEFT JOIN sys_organization org ON uorg.organization_id = org.id
|
|
|
- LEFT JOIN sys_user_authentication aut ON u.id = aut.user_id
|
|
|
WHERE
|
|
|
u.is_deleted = 'N'
|
|
|
AND u.TYPE = "0"
|
|
@@ -290,8 +291,8 @@
|
|
|
<if test="userExport.userName != null">
|
|
|
AND u.username LIKE CONCAT('%', #{userExport.userName}, '%')
|
|
|
</if>
|
|
|
- <if test="userExport.autStatus != null">
|
|
|
- AND aut.status = #{userExport.autStatus}
|
|
|
+ <if test="userExport.authStatus != null">
|
|
|
+ AND u.auth_status = #{userExport.authStatus}
|
|
|
</if>
|
|
|
<if test="userExport.startTime != null and userExport.endTime != null">
|
|
|
AND u.gmt_create BETWEEN #{userExport.startTime} and #{userExport.endTime}
|
|
@@ -303,21 +304,20 @@
|
|
|
u.id AS userId,
|
|
|
u.gmt_create AS userGmtCreate,
|
|
|
u.username AS userName,
|
|
|
- u.linkman AS linKman,
|
|
|
+ u.linkman AS linkman,
|
|
|
u.email AS email,
|
|
|
org.id AS orgId,
|
|
|
org.name AS orgName,
|
|
|
- aut.status AS autStatus
|
|
|
+ u.auth_status AS authStatus
|
|
|
FROM sys_user u
|
|
|
LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
|
|
|
LEFT JOIN sys_organization org ON uorg.organization_id = org.id
|
|
|
- LEFT JOIN sys_user_authentication aut ON u.id = aut.user_id
|
|
|
WHERE u.is_deleted = 'N' AND u.TYPE = 0
|
|
|
<if test="userInformation.userName != null">
|
|
|
AND u.username LIKE CONCAT('%', #{userInformation.userName}, '%')
|
|
|
</if>
|
|
|
- <if test="userInformation.autStatus != null">
|
|
|
- AND aut.status = #{userInformation.autStatus}
|
|
|
+ <if test="userInformation.authStatus != null">
|
|
|
+ AND u.auth_status = #{userInformation.authStatus}
|
|
|
</if>
|
|
|
<if test="userInformation.startTime != null and userInformation.endTime != null">
|
|
|
AND u.gmt_create BETWEEN #{userInformation.startTime} and #{userInformation.endTime}
|
|
@@ -328,7 +328,7 @@
|
|
|
<!-- <select id="queryMechanismInformation(jiude)" resultType="com.diagbot.dto.OrganizationDTO">
|
|
|
SELECT
|
|
|
u.id AS userId,
|
|
|
- u.linkman AS linKman,
|
|
|
+ u.linkman AS linkman,
|
|
|
org.id AS orgId,
|
|
|
org.gmt_create AS orgGmtCreate,
|
|
|
org.name AS orgName,
|
|
@@ -345,8 +345,8 @@
|
|
|
<if test="mechanism.orgName != null">
|
|
|
AND org.name LIKE CONCAT('%', #{mechanism.orgName}, '%')
|
|
|
</if>
|
|
|
- <if test="mechanism.autStatus != null">
|
|
|
- AND aut.status = #{mechanism.autStatus}
|
|
|
+ <if test="mechanism.authStatus != null">
|
|
|
+ AND u.auth_status = #{mechanism.authStatus}
|
|
|
</if>
|
|
|
<if test="mechanism.startTime != null and mechanism.endTime != null">
|
|
|
AND u.gmt_create BETWEEN #{mechanism.startTime} and #{mechanism.endTime}
|
|
@@ -363,20 +363,19 @@
|
|
|
org.type AS orgType,
|
|
|
org.address AS orgAddress,
|
|
|
u.linkman AS linkman,
|
|
|
- aut.status AS autStatus,
|
|
|
- org.parent_id AS orgParent_id,
|
|
|
- org.sub_num AS orgSub_num
|
|
|
+ u.auth_status AS authStatus,
|
|
|
+ org.parent_id AS orgParentId,
|
|
|
+ org.sub_num AS orgSubNum
|
|
|
FROM
|
|
|
sys_organization org
|
|
|
LEFT JOIN sys_user_organization uorg ON org.id = uorg.organization_id
|
|
|
LEFT JOIN sys_user u ON uorg.user_id = u.id
|
|
|
- LEFT JOIN sys_user_authentication aut ON u.id = aut.user_id
|
|
|
WHERE org.is_deleted = 'N'
|
|
|
<if test="mechanism.orgName != null">
|
|
|
AND org.name LIKE CONCAT('%', #{mechanism.orgName}, '%')
|
|
|
</if>
|
|
|
- <if test="mechanism.autStatus != null">
|
|
|
- AND aut.status = #{mechanism.autStatus}
|
|
|
+ <if test="mechanism.authStatus != null">
|
|
|
+ AND u.auth_status = #{mechanism.authStatus}
|
|
|
</if>
|
|
|
<if test="mechanism.startTime != null and mechanism.endTime != null">
|
|
|
AND org.gmt_create BETWEEN #{mechanism.startTime} and #{mechanism.endTime}
|
|
@@ -389,7 +388,7 @@
|
|
|
u.id AS userId,
|
|
|
u.gmt_create AS userGmtCreate,
|
|
|
u.username AS userName,
|
|
|
- u.linkman AS linKman,
|
|
|
+ u.linkman AS linkman,
|
|
|
u.email AS email,
|
|
|
org.id AS orgId,
|
|
|
org.gmt_create AS orgGmtCreate,
|
|
@@ -398,14 +397,13 @@
|
|
|
org.principal AS orgPrincipal,
|
|
|
org.address AS orgAddress,
|
|
|
org.parent_id AS orgParent_id,
|
|
|
- org.sub_num AS orgSub_num,
|
|
|
- aut.certification_date AS certificationDate,
|
|
|
- u.position AS autPosition,
|
|
|
- aut.status AS autStatus
|
|
|
+ org.sub_num AS orgSubNum,
|
|
|
+ u.passauth_time AS passauthTime,
|
|
|
+ u.position AS position,
|
|
|
+ u.auth_status AS authStatus
|
|
|
FROM sys_user u
|
|
|
LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
|
|
|
LEFT JOIN sys_organization org ON uorg.organization_id = org.id
|
|
|
- LEFT JOIN sys_user_authentication aut ON u.id = aut.user_id
|
|
|
WHERE u.is_deleted = 'N' AND u.TYPE = 0
|
|
|
<if test="userOrg.orgName != null">
|
|
|
AND org.name LIKE CONCAT('%', #{userOrg.orgName}, '%')
|
|
@@ -416,73 +414,80 @@
|
|
|
<if test="userOrg.startTime != null and userOrg.endTime != null">
|
|
|
AND u.gmt_create BETWEEN #{userOrg.startTime} and #{userOrg.endTime}
|
|
|
</if>
|
|
|
- AND aut.status = 1
|
|
|
+ AND u.auth_status = 1
|
|
|
ORDER BY u.gmt_create DESC
|
|
|
</select>
|
|
|
<select id="queryAuthentication" resultType="com.diagbot.dto.AuthenticationDTO">
|
|
|
- SELECT
|
|
|
- u.id AS userId,
|
|
|
- u.gmt_create AS userGmtCreate,
|
|
|
- u.username AS userName,
|
|
|
- u.linkman AS linKman,
|
|
|
- u.email AS email,
|
|
|
- org.id AS orgId,
|
|
|
- org.gmt_create AS orgGmtCreate,
|
|
|
- org.name AS orgName,
|
|
|
- org.type AS orgType,
|
|
|
- org.principal AS orgPrincipal,
|
|
|
- org.address AS orgAddress,
|
|
|
- org.parent_id AS orgParent_id,
|
|
|
- org.sub_num AS orgSub_num,
|
|
|
- u.position AS autPosition,
|
|
|
- aut.status AS autStatus
|
|
|
- FROM sys_user u
|
|
|
- LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
|
|
|
- LEFT JOIN sys_organization org ON uorg.organization_id = org.id
|
|
|
- LEFT JOIN sys_user_authentication aut ON u.id = aut.user_id
|
|
|
- WHERE u.is_deleted = 'N' AND u.TYPE = 0
|
|
|
- <if test="authen.orgName != null">
|
|
|
- AND org.name LIKE CONCAT('%', #{authen.orgName}, '%')
|
|
|
- </if>
|
|
|
- <if test="authen.userName != null">
|
|
|
- AND u.username LIKE CONCAT('%', #{authen.userName}, '%')
|
|
|
- </if>
|
|
|
- <if test="authen.startTime != null and authen.endTime != null">
|
|
|
- AND u.gmt_create BETWEEN #{authen.startTime} and #{authen.endTime}
|
|
|
- </if>
|
|
|
- AND aut.status = 2
|
|
|
- ORDER BY u.gmt_create DESC
|
|
|
+ SELECT
|
|
|
+ u.id AS userId,
|
|
|
+ aut.gmt_create AS autGmtCreate,
|
|
|
+ u.username AS userName,
|
|
|
+ u.linkman AS linkman,
|
|
|
+ u.email AS email,
|
|
|
+ org.id AS orgId,
|
|
|
+ org.gmt_create AS orgGmtCreate,
|
|
|
+ org.name AS orgName,
|
|
|
+ org.type AS orgType,
|
|
|
+ org.principal AS orgPrincipal,
|
|
|
+ org.address AS orgAddress,
|
|
|
+ org.parent_id AS orgParentId,
|
|
|
+ org.sub_num AS orgSubNum,
|
|
|
+ u.position AS position,
|
|
|
+ u.auth_status AS authStatus,
|
|
|
+ aut.order_num AS orderNum,
|
|
|
+ aut.status AS status
|
|
|
+ FROM sys_user_authentication aut
|
|
|
+ JOIN sys_user u ON u.id = aut.user_id
|
|
|
+ JOIN sys_user_organization uorg ON u.id = uorg.user_id
|
|
|
+ JOIN sys_organization org ON uorg.organization_id = org.id
|
|
|
+ WHERE u.is_deleted = 'N' AND aut.is_deleted = 'N' AND u.TYPE = 0 AND
|
|
|
+ aut.status = 0
|
|
|
+ <if test="authen.orgName != null">
|
|
|
+ AND org.name LIKE CONCAT('%', #{authen.orgName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="authen.userName != null">
|
|
|
+ AND u.username LIKE CONCAT('%', #{authen.userName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="authen.startTime != null and authen.endTime != null">
|
|
|
+ AND aut.gmt_create BETWEEN #{authen.startTime} and #{authen.endTime}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ ORDER BY aut.gmt_create DESC
|
|
|
+ <!-- SELECT u.id AS userId, u.gmt_create AS userGmtCreate, u.username AS
|
|
|
+ userName, u.linkman AS linKman, u.email AS email, org.id AS orgId, org.gmt_create
|
|
|
+ AS orgGmtCreate, org.name AS orgName, org.type AS orgType, org.principal
|
|
|
+ AS orgPrincipal, org.address AS orgAddress, org.parent_id AS orgParent_id,
|
|
|
+ org.sub_num AS orgSub_num, u.position AS autPosition, u.auth_status AS authStatus
|
|
|
+ FROM sys_user u LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
|
|
|
+ LEFT JOIN sys_organization org ON uorg.organization_id = org.id WHERE u.is_deleted
|
|
|
+ = 'N' AND u.TYPE = 0 <if test="authen.orgName != null"> AND org.name LIKE
|
|
|
+ CONCAT('%', #{authen.orgName}, '%') </if> <if test="authen.userName != null">
|
|
|
+ AND u.username LIKE CONCAT('%', #{authen.userName}, '%') </if> <if test="authen.startTime
|
|
|
+ != null and authen.endTime != null"> AND u.gmt_create BETWEEN #{authen.startTime}
|
|
|
+ and #{authen.endTime} </if> AND u.auth_status = 2 ORDER BY u.gmt_create DESC -->
|
|
|
</select>
|
|
|
<update id="updateUserInfo" parameterType="java.util.Map">
|
|
|
UPDATE
|
|
|
sys_user a
|
|
|
- JOIN sys_user_authentication b ON a.id = b.user_id
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
- <if test="amendUserInfo.linKman != null">
|
|
|
- a.linkman = #{amendUserInfo.linKman},
|
|
|
+ <if test="amendUserInfo.linkman != null">
|
|
|
+ a.linkman = #{amendUserInfo.linkman},
|
|
|
</if>
|
|
|
<if test="amendUserInfo.email != null">
|
|
|
a.email = #{amendUserInfo.email},
|
|
|
</if>
|
|
|
- <if test="amendUserInfo.autPosition != null">
|
|
|
- b.position = #{amendUserInfo.autPosition},
|
|
|
+ <if test="amendUserInfo.position != null">
|
|
|
+ a.position = #{amendUserInfo.position},
|
|
|
</if>
|
|
|
<if test="amendUserInfo.gmtModified != null">
|
|
|
a.gmt_modified =#{amendUserInfo.gmtModified},
|
|
|
</if>
|
|
|
- <if test="amendUserInfo.gmtModified != null">
|
|
|
- b.gmt_modified = #{amendUserInfo.gmtModified},
|
|
|
- </if>
|
|
|
<if test="amendUserInfo.modifier != null">
|
|
|
a.modifier = #{amendUserInfo.modifier},
|
|
|
</if>
|
|
|
- <if test="amendUserInfo.modifier != null">
|
|
|
- b.modifier = #{amendUserInfo.modifier}
|
|
|
- </if>
|
|
|
</trim>
|
|
|
WHERE
|
|
|
a.is_deleted = "N"
|
|
|
- AND b.is_deleted = "N"
|
|
|
AND a.id = #{amendUserInfo.userId}
|
|
|
</update>
|
|
|
<update id="updateOrganizations" parameterType="java.util.Map">
|
|
@@ -494,8 +499,8 @@
|
|
|
<if test="amendOrg.type != null">
|
|
|
a.type = #{amendOrg.type},
|
|
|
</if>
|
|
|
- <if test="amendOrg.subMum != null">
|
|
|
- a.sub_num = #{amendOrg.subMum},
|
|
|
+ <if test="amendOrg.orgSubNum != null">
|
|
|
+ a.sub_num = #{amendOrg.orgSubNum},
|
|
|
</if>
|
|
|
<if test="amendOrg.gmtModified != null">
|
|
|
a.gmt_modified =#{amendOrg.gmtModified},
|
|
@@ -515,7 +520,7 @@
|
|
|
u.gmt_create AS userGmtCreate,
|
|
|
u.gmt_modified AS userGmtModified,
|
|
|
u.username AS userName,
|
|
|
- u.linkman AS linKman,
|
|
|
+ u.linkman AS linkman,
|
|
|
u.email AS email,
|
|
|
org.id AS orgId,
|
|
|
org.gmt_create AS orgGmtCreate,
|
|
@@ -523,11 +528,11 @@
|
|
|
org.type AS orgType,
|
|
|
org.principal AS orgPrincipal,
|
|
|
org.address AS orgAddress,
|
|
|
- org.parent_id AS orgParent_id,
|
|
|
- org.sub_num AS orgSub_num,
|
|
|
- u.position AS autPosition,
|
|
|
+ org.parent_id AS orgParentId,
|
|
|
+ org.sub_num AS orgSubNum,
|
|
|
+ u.position AS position,
|
|
|
aut.is_reject AS autIsReject,
|
|
|
- aut.status AS autStatus
|
|
|
+ u.auth_status AS authStatus
|
|
|
FROM
|
|
|
sys_organization org
|
|
|
LEFT JOIN sys_user_organization uorg ON org.id = uorg.organization_id
|
|
@@ -542,4 +547,41 @@
|
|
|
</if>
|
|
|
ORDER BY org.gmt_create DESC
|
|
|
</select>
|
|
|
+ <select id="exportKema" resultType="com.diagbot.dto.AuthenticationDTO">
|
|
|
+ SELECT
|
|
|
+ u.id AS userId,
|
|
|
+ aut.gmt_create AS autGmtCreate,
|
|
|
+ u.username AS userName,
|
|
|
+ u.linkman AS linkman,
|
|
|
+ u.email AS email,
|
|
|
+ org.id AS orgId,
|
|
|
+ org.gmt_create AS orgGmtCreate,
|
|
|
+ org.name AS orgName,
|
|
|
+ org.type AS orgType,
|
|
|
+ org.principal AS orgPrincipal,
|
|
|
+ org.address AS orgAddress,
|
|
|
+ org.parent_id AS orgParentId,
|
|
|
+ org.sub_num AS orgSubNum,
|
|
|
+ u.position AS position,
|
|
|
+ u.auth_status AS authStatus,
|
|
|
+ aut.order_num AS orderNum,
|
|
|
+ aut.status AS status
|
|
|
+ FROM sys_user_authentication aut
|
|
|
+ JOIN sys_user u ON u.id = aut.user_id
|
|
|
+ JOIN sys_user_organization uorg ON u.id = uorg.user_id
|
|
|
+ JOIN sys_organization org ON uorg.organization_id = org.id
|
|
|
+ WHERE u.is_deleted = 'N' AND aut.is_deleted = 'N' AND u.TYPE = 0 AND
|
|
|
+ aut.status = 0
|
|
|
+ <if test="exportKema.orgName != null">
|
|
|
+ AND org.name LIKE CONCAT('%', #{exportKema.orgName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="exportKema.userName != null">
|
|
|
+ AND u.username LIKE CONCAT('%', #{exportKema.userName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="exportKema.startTime != null and exportKema.endTime != null">
|
|
|
+ AND aut.gmt_create BETWEEN #{exportKema.startTime} and #{exportKema.endTime}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ ORDER BY aut.gmt_create DESC
|
|
|
+ </select>
|
|
|
</mapper>
|