tyr/tyr-server/src/main/resources/mapper/SaasRoleUserRelationMapper.xml
2024-03-14 16:38:37 +08:00

22 lines
1000 B
XML

<?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="cn.axzo.tyr.server.repository.mapper.SaasRoleUserRelationMapper">
<select id="batListCleanRelation" resultType="cn.axzo.tyr.server.repository.entity.SaasRoleUserRelation">
SELECT DISTINCT ou_id AS ouId, workspace_id AS workspaceId,
natural_person_id AS naturalPersonId,
identity_id AS identityId, identity_type AS identityType
FROM saas_role_user_relation
WHERE is_delete = 0
<if test="param.ouId !=0 and param.ouId != null">
AND ou_id = #{param.ouId}
</if>
<if test="param.workspaceId !=0 and param.workspaceId != null">
AND workspace_id = #{param.workspaceId}
</if>
<if test="param.personId !=0 and param.personId != null">
AND natural_person_id = #{param.personId}
</if>
</select>
</mapper>