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

    <resultMap type="org.dromara.system.domain.vo.SysTenantVo" id="SysTenantResult">
    </resultMap>

    <sql id="selectDeptVo">
        select t.id, t.tenant_id, t.contact_user_name, t.contact_phone, t.company_name, t.license_number, t.address, t.intro, t.domain, t.remark, t.package_id, t.expire_time, t.account_count, t.status, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
        from sys_tenant t
    </sql>

    <select id="selectVoListByUserName" resultMap="SysTenantResult">
        select t.id, t.tenant_id, t.contact_user_name, t.contact_phone, t.company_name, t.license_number, t.address, t.intro, t.domain, t.remark, t.package_id, t.expire_time, t.account_count, t.status, t.del_flag, t.create_dept, t.create_by, t.create_time, t.update_by, t.update_time
        from sys_tenant t
        left join sys_user s on t.tenant_id = s.tenant_id
        where t.del_flag = '0' and s.user_name = #{userName}
    </select>
</mapper>
