<?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.bonus.core.account.v3.mapper.AccInfoMapper">
    <select id="getAccInfoVOByCustId" resultType="com.bonus.core.account.v3.web.vo.AccInfoVO">
        SELECT ai.id,
               ai.acc_id,
               ai.cust_id,
               ai.end_date,
               ai.acc_status,
               ci.cust_num,
               ci.cust_name,
               ci.mobile,
               ci.psn_type,
               cpt.psn_type_name,
               ci.org_id,
               co.org_full_name,
               ci.cust_third_id
          FROM acc_info ai
                   LEFT JOIN cust_info ci ON ci.cust_id = ai.cust_id
                   LEFT JOIN cust_psn_type cpt ON cpt.psn_type = ci.psn_type
                   LEFT JOIN cust_org co ON co.org_id = ci.org_id
        WHERE ai.cust_id = #{custId}
    </select>
</mapper>
