<?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.inkasso.factoring.creditmanagement.dao.EnterpriseMapper">

    <select id="findSupplierInfo" resultType="com.inkasso.factoring.creditmanagement.entity.Enterprise">
        select
            a.id,b.corporate_name,b.social_credit_code, legal_representative,
            b.major_shareholders,b.start_sate,b.registered_capital,b.capital_currency,b.address,b.business_address, b.gmt_create
            from c_supplier_info a left join c_enterprise b on  a.c_enterprise_id = b.id
        <where>
            <if test="sysUserId != null">
                AND a.sys_user_id = #{sysUserId}
            </if>
        </where>
    </select>
    <select id="findEnterpriseInfo" resultType="com.inkasso.factoring.creditmanagement.entity.Enterprise">
        select
        a.*
        from  c_enterprise a left join c_supplier_info b on  b.c_enterprise_id = a.id
        <where>
            <if test="cSupplierId != null">
                AND b.id = #{cSupplierId}
            </if>
        </where>
    </select>

</mapper>
