<?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.zcloud.basic.info.persistence.mapper.UserCorpMapper">

    <select id="getInfoByUserId" resultType="com.zcloud.basic.info.persistence.dataobject.UserCorpDO">
        select uc.*, ci.corp_name as corpinfoName, di.name as departmentName
        from user_corp uc
                 left join corp_info ci on uc.corpinfo_id = ci.id
                 left join department di on uc.department_id = di.id
        where uc.user_id =     #{userId}
          and uc.corpinfo_id = #{corpinfoId}
          and uc.delete_enum = 'FALSE'
    </select>
</mapper>

