<?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.tmerclub.cloud.group.mapper.GroupTeamMapper">
  <resultMap id="groupTeamMap" type="com.tmerclub.cloud.group.model.GroupTeam">
    <id column="group_team_id" property="groupTeamId" />
    <result column="shop_id" property="shopId"/>
    <result column="group_activity_id" property="groupActivityId"/>
    <result column="group_spu_id" property="groupSpuId"/>
    <result column="join_num" property="joinNum"/>
    <result column="status" property="status"/>
    <result column="total_price" property="totalPrice"/>
    <result column="start_time" property="startTime"/>
    <result column="end_time" property="endTime"/>
    <result column="create_time" property="createTime"/>
    <result column="share_user_id" property="shareUserId"/>
    <result column="update_time" property="updateTime"/>
  </resultMap>

  <sql id="Vo_Column_List">
    `group_team_id`,`shop_id`,`group_activity_id`,`group_spu_id`,`join_num`,`status`,`total_price`,`start_time`,`end_time`,`create_time`,`share_user_id`,`update_time`
  </sql>

  <select id="listToMongodb" resultType="com.tmerclub.cloud.group.bo.mongo.MongoGroupTeamBO">
    SELECT gt.*
    FROM group_team gt
    order by gt.create_time
    limit #{start}, #{size}
  </select>
</mapper>
