<?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.jeecg.modules.system.mapper.SysTenantMapper">

    <select id="queryByClient" resultType="org.jeecg.modules.system.entity.SysTenant">
        select * from sys_tenant
        where client_id = #{clientId}
        and client_secret = #{clientSecret}
    </select>
    <select id="getTenantByPermissionId" resultType="org.jeecg.modules.system.entity.SysTenant">
        SELECT * FROM sys_tenant a
            LEFT JOIN sys_permission b ON a.id = b.tenant_id
        WHERE b.id =#{id}
    </select>
</mapper>