1.KeyCustomerFollowUp 实体
package com.xinmt.keycustomer.app.po.keycustomer;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
import com.app.common.entity.BaseEntity;
/**
* 客户跟进信息
* @author syn
*2018年5月9日
*
*/
public class KeyCustomerFollowUp extends BaseEntity{
private String followUpAddress;//跟进地址
private KeyCustomerInfo customer;
}
2.mapper.xml
<resultMap type="com.xinmt.keycustomer.app.po.keycustomer.KeyCustomerFollowUp" id="customerFollowUpMap">
<id property="id" column="id" />
<result column="contact_phone" property="contactPhone" jdbcType="VARCHAR" />
<result column="follow_up_title" property="followUpTitle" jdbcType="VARCHAR" />
<result column="follow_up_content" property="followUpContent" jdbcType="VARCHAR" />
<collection property="customer" ofType="com.xinmt.keycustomer.app.po.keycustomer.KeyCustomerInfo">
<id property="customerInfoId" column="customer_info_id" />
<result column="company_name" property="companyName" jdbcType="VARCHAR" />
<result column="contacts" property="contacts" jdbcType="VARCHAR" />
</collection>
<collection property="fileList" ofType="com.xinmt.keycustomer.app.po.keycustomer.FollowUpFile">
<id property="followUpId" column="follow_up_id" />
<result column="img_url" property="imgUrl" jdbcType="VARCHAR" />
<result column="voice_url" property="voiceUrl" jdbcType="VARCHAR" />
</collection>
</resultMap>
<select id="getById" resultMap="customerFollowUpMap" parameterType="java.lang.Long" >
select c.company_name,c.contacts, b.id,b.contact_phone,b.follow_up_content,b.follow_up_title,m.img_url,m.voice_url
from key_customer_follow_up b left join
follow_up_file m on b.id=m.follow_up_id
left join key_customer_info c on b.customer_info_id=c.id
where b.id = #{id,jdbcType=BIGINT}
</select>