<?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.kxs.system.biz.mapper.KxsBcqtTeamDetailMapper">

    <resultMap type="com.kxs.system.api.model.KxsBcqtTeamDetail" id="KxsBcqtTeamDetailMap">
        <result column="id" property="id" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="del_flag" property="delFlag" />
        <result column="version" property="version" />
        <result column="user_id" property="userId" />
        <result column="username" property="username" />
        <result column="user_code" property="userCode" />
        <result column="pos_activate_number" property="posActivateNumber" />
        <result column="lkb_activate_number" property="lkbActivateNumber" />
        <result column="gd_activate_number" property="gdActivateNumber" />
        <result column="captain_status" property="captainStatus" />
        <result column="end_flag" property="endFlag" />
        <result column="team_id" property="teamId" />

    </resultMap>
    <select id="getMyBcqtList" resultType="com.kxs.system.api.vo.kxsapp.camp.CampGetMyBcqtListVO">
        select
        kbt.id,kbt.team_name,kbt.start_time,kbt.end_time,kbt.status,kbt.captain_id,kbt.username,kbt.team_number,kbt.create_time
        from
            kxs_bcqt_team_detail kbtd
                left join kxs_bcqt_team kbt on kbtd.team_id = kbt.id
        <where>
            and kbtd.del_flag != 1
            and kbt.del_flag != 1
            and kbtd.user_id = #{userId}
        </where>
        order by
        kbt.create_time desc
    </select>

</mapper>
