企业初始化
This commit is contained in:
@@ -398,4 +398,73 @@
|
||||
where
|
||||
user_id = #{userId}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="batchInsertOrUpdate" parameterType="java.util.List">
|
||||
insert into enterprise_user_${eid} (
|
||||
id,
|
||||
user_id,
|
||||
`name`,
|
||||
mobile,
|
||||
email,
|
||||
active,
|
||||
order_in_depts,
|
||||
main_admin,
|
||||
is_admin,
|
||||
is_boss,
|
||||
dingId,
|
||||
unionid,
|
||||
is_leader_in_depts,
|
||||
is_hide,
|
||||
departments,
|
||||
`position`,
|
||||
avatar,
|
||||
jobnumber,
|
||||
extattr,
|
||||
roles,
|
||||
is_leader,
|
||||
create_time
|
||||
) values
|
||||
|
||||
<foreach collection="list" item="it" separator=",">
|
||||
|
||||
(
|
||||
#{it.id, jdbcType=VARCHAR},
|
||||
#{it.userId, jdbcType=VARCHAR},
|
||||
#{it.name, jdbcType=VARCHAR},
|
||||
#{it.mobile, jdbcType=VARCHAR},
|
||||
#{it.email, jdbcType=VARCHAR},
|
||||
#{it.active, jdbcType=BOOLEAN},
|
||||
#{it.orderInDepts, jdbcType=VARCHAR},
|
||||
#{it.mainAdmin, jdbcType=BOOLEAN},
|
||||
#{it.isAdmin, jdbcType=BOOLEAN},
|
||||
#{it.isBoss, jdbcType=BOOLEAN},
|
||||
#{it.dingid, jdbcType=VARCHAR},
|
||||
#{it.unionid, jdbcType=VARCHAR},
|
||||
#{it.isLeaderInDepts, jdbcType=VARCHAR},
|
||||
#{it.isHide, jdbcType=BOOLEAN},
|
||||
#{it.departments, jdbcType=VARCHAR},
|
||||
#{it.position, jdbcType=VARCHAR},
|
||||
#{it.avatar, jdbcType=VARCHAR},
|
||||
#{it.jobnumber, jdbcType=VARCHAR},
|
||||
#{it.extattr, jdbcType=VARCHAR},
|
||||
#{it.roles, jdbcType=VARCHAR},
|
||||
#{it.isLeader, jdbcType=BOOLEAN},
|
||||
sysdate()
|
||||
)
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
departments=values(departments),
|
||||
`name`=values(name),
|
||||
main_admin=values(main_admin),
|
||||
is_admin=values(is_admin),
|
||||
mobile = values(mobile),
|
||||
order_in_depts=values(order_in_depts),
|
||||
is_leader_in_depts=values(is_leader_in_depts),
|
||||
avatar=values(avatar),
|
||||
active=values(active),
|
||||
`position`=values(position),
|
||||
roles=values(roles),
|
||||
jobnumber=values(jobnumber)
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -60,4 +60,13 @@
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<insert id="insertBatchUserRole">
|
||||
insert ignore into enterprise_user_role_${eid}
|
||||
(role_id, user_id ,create_time)
|
||||
values
|
||||
<foreach collection="userRoles" item="userRole" separator=",">
|
||||
(#{userRole.roleId}, #{userRole.userId} ,#{userRole.createTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -180,4 +180,21 @@
|
||||
c.priority is null, c.priority, position_type desc
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="getRoleByRoleEnum" resultMap="BaseResultMap">
|
||||
select
|
||||
id as id,
|
||||
role_name as roleName,
|
||||
role_auth as roleAuth,
|
||||
is_internal as isInternal,
|
||||
`source` as source,
|
||||
priority as priority,
|
||||
app_menu as appMenu,
|
||||
position_type as positionType,
|
||||
role_enum as roleEnum
|
||||
from
|
||||
sys_role_${eid}
|
||||
where
|
||||
role_enum = #{roleEnum}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user