<?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.dsk.biz.mapper.ContactInfoMapper">

    <select id="selectPageList" resultType="com.dsk.biz.domain.vo.ContactInfoListVo">
        select
            cc.id, cc.customer_id, cc.business_id, bi.project_name, cc.name, cc.sex, cc.role,
            cc.position, cc.contact_information, cc.company_id, cc.uip_id, cc.company_name, cc.remark,
            cc.update_by
        from contact_info cc
        left join business_info bi on cc.business_id = bi.id
        <where>
            <if test="dto.customerId != null and dto.customerId !='' "> and (cc.customer_id = #{dto.customerId} or bi.customer_id = #{dto.customerId})</if>
            <if test="dto.businessId != null "> and cc.business_id = #{dto.businessId} </if>
        </where>
        order by cc.create_time desc
    </select>

</mapper>

