<?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="com.cmeeting.mapper.primary.AuthMapper">

    <select id="getAuthByTargetId" resultType="com.cmeeting.pojo.CoreModulePermissions">
        SELECT
        id,
        type,
        user_type AS userType,
        source,
        rel_id AS relId,
        create_time AS createTime,
        update_time AS updateTime,
        target_id AS targetId,
        tenant_id AS tenantId
        FROM
        core_module_permission
        WHERE
        user_type = 2
        and target_id = #{targetId}
        <if test="tenantId != null and tenantId != ''">
            AND tenant_id = #{tenantId}
        </if>

    </select>
</mapper>