<?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.cool.store.mapper.TransferLogMapper">
  <resultMap id="BaseResultMap" type="com.cool.store.entity.TransferLogDO">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="line_id" jdbcType="BIGINT" property="lineId" />
    <result column="partner_id" jdbcType="BIGINT" property="partnerId" />
    <result column="from_user_id" jdbcType="VARCHAR" property="fromUserId" />
    <result column="to_user_id" jdbcType="VARCHAR" property="toUserId" />
    <result column="type" jdbcType="TINYINT" property="type" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
    <result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
  </resultMap>


  <select id="getTransferLogList" resultType="com.cool.store.dto.TransferLogDTO">
    select
     b.user_id as fromUserId     ,
     b.name as fromUserName  ,
     b.mobile as fromUserMobile  ,
     c.user_id as toUserId     ,
     c.name as toUserName  ,
     c.mobile as toUserMobile  ,
     a.type as type
    from
    xfsg_transfer_log a
    left join enterprise_user_${enterpriseId} b on b.user_id = a.from_user_id
    left join enterprise_user_${enterpriseId} c on c.user_id = a.to_user_id  where a.line_id = #{lindId}
  </select>

</mapper>