|  | @@ -161,6 +161,11 @@
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <resultMap id="ChildrenStatisticsDetailDtoMap" type="com.ym.mec.biz.dal.dto.ChildrenStatisticsDetailDto">
 | 
	
		
			
				|  |  | +        <result property="organName" column="organ_name_"/>
 | 
	
		
			
				|  |  | +        <result property="cooperationOrganName" column="cooperation_organ_name_"/>
 | 
	
		
			
				|  |  | +        <result property="musicGroupName" column="music_group_name_"/>
 | 
	
		
			
				|  |  | +        <result property="currentClass" column="current_class_"/>
 | 
	
		
			
				|  |  | +        <result property="realName" column="real_name_"/>
 | 
	
		
			
				|  |  |          <result property="username" column="username_"/>
 | 
	
		
			
				|  |  |          <result property="userId" column="user_id_"/>
 | 
	
		
			
				|  |  |          <result property="isReserve" column="is_reserve_"/>
 | 
	
	
		
			
				|  | @@ -190,6 +195,33 @@
 | 
	
		
			
				|  |  |          ORDER BY cdr.create_time_ DESC
 | 
	
		
			
				|  |  |          <include refid="global.limit"/>
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  | +    <select id="exportStatisticsDetail" resultMap="ChildrenStatisticsDetailDtoMap">
 | 
	
		
			
				|  |  | +        SELECT o.name_ organ_name_,co.name_ cooperation_organ_name_,mg.name_ music_group_name_,cdr.user_id_,
 | 
	
		
			
				|  |  | +               su.username_,su.phone_,s.name_ subject_name_,st.current_class_,sut.real_name_,cdr.is_reserve_,cdd.grade_level_,cdd.theory_level_,
 | 
	
		
			
				|  |  | +               CASE WHEN cdd.vip_1v1_price_ > 0 OR cdd.vip_1v2_price_ > 0 THEN 1 ELSE 0 END buy_vip_flag_,
 | 
	
		
			
				|  |  | +               CASE WHEN cdd.theory_course_price_ > 0 THEN 1 ELSE 0 END buy_theory_course_flag_,cdd.total_amount_
 | 
	
		
			
				|  |  | +        FROM children_day_reserve cdr
 | 
	
		
			
				|  |  | +                 LEFT JOIN children_day_degree_info cdd ON cdr.id_ = cdd.reserve_id_
 | 
	
		
			
				|  |  | +                 LEFT JOIN organization o ON o.id_ = cdr.organ_id_
 | 
	
		
			
				|  |  | +                 LEFT JOIN cooperation_organ co ON co.id_ = cdr.cooperation_organ_id_
 | 
	
		
			
				|  |  | +                 LEFT JOIN music_group mg ON mg.id_ = cdr.music_group_id_
 | 
	
		
			
				|  |  | +                 LEFT JOIN student st ON st.user_id_ = cdr.user_id_
 | 
	
		
			
				|  |  | +                 LEFT JOIN sys_user sut ON sut.id_ = st.teacher_id_
 | 
	
		
			
				|  |  | +                 LEFT JOIN sys_user su ON su.id_ = cdr.user_id_
 | 
	
		
			
				|  |  | +                 LEFT JOIN `subject` s ON s.id_ = cdd.subject_id_
 | 
	
		
			
				|  |  | +        <where>
 | 
	
		
			
				|  |  | +            <if test="cooperationId != null">
 | 
	
		
			
				|  |  | +                AND cdr.cooperation_organ_id_ = #{cooperationId}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="musicGroupId != null and musicGroupId != ''">
 | 
	
		
			
				|  |  | +                AND cdr.music_group_id_ = #{musicGroupId}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="organId != null">
 | 
	
		
			
				|  |  | +                AND FIND_IN_SET(cdr.organ_id_,#{organId})
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +        </where>
 | 
	
		
			
				|  |  | +        ORDER BY cdr.organ_id_,cdr.create_time_ DESC
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  |      <sql id="queryChildrenStatisticsDetailSql">
 | 
	
		
			
				|  |  |          <where>
 | 
	
		
			
				|  |  |              <if test="search != null and search != ''">
 | 
	
	
		
			
				|  | @@ -208,34 +240,34 @@
 | 
	
		
			
				|  |  |                  AND cdd.subject_id_ = #{subjectId}
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |              <if test="gradeFlag != null">
 | 
	
		
			
				|  |  | -                <if test="gradeFlag == 'true'">
 | 
	
		
			
				|  |  | +                <if test="gradeFlag == 1">
 | 
	
		
			
				|  |  |                      AND cdd.grade_level_ IS NOT NULL
 | 
	
		
			
				|  |  |                  </if>
 | 
	
		
			
				|  |  | -                <if test="gradeFlag != 'false'">
 | 
	
		
			
				|  |  | +                <if test="gradeFlag == 0">
 | 
	
		
			
				|  |  |                      AND cdd.grade_level_ IS NULL
 | 
	
		
			
				|  |  |                  </if>
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |              <if test="theoryFlag != null">
 | 
	
		
			
				|  |  | -                <if test="theoryFlag == 'true'">
 | 
	
		
			
				|  |  | +                <if test="theoryFlag == 1">
 | 
	
		
			
				|  |  |                      AND cdd.theory_level_ IS NOT NULL
 | 
	
		
			
				|  |  |                  </if>
 | 
	
		
			
				|  |  | -                <if test="theoryFlag != 'false'">
 | 
	
		
			
				|  |  | +                <if test="theoryFlag == 0">
 | 
	
		
			
				|  |  |                      AND cdd.theory_level_ IS NULL
 | 
	
		
			
				|  |  |                  </if>
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |              <if test="vipFlag != null">
 | 
	
		
			
				|  |  | -                <if test="vipFlag == 'true'">
 | 
	
		
			
				|  |  | +                <if test="vipFlag == 1">
 | 
	
		
			
				|  |  |                      AND (cdd.vip_1v1_price_ > 0 OR cdd.vip_1v2_price_ > 0)
 | 
	
		
			
				|  |  |                  </if>
 | 
	
		
			
				|  |  | -                <if test="vipFlag != 'false'">
 | 
	
		
			
				|  |  | +                <if test="vipFlag == 0">
 | 
	
		
			
				|  |  |                      AND (cdd.vip_1v1_price_ <= 0 OR cdd.vip_1v2_price_ <= 0)
 | 
	
		
			
				|  |  |                  </if>
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  |              <if test="theoryPriceFlag != null">
 | 
	
		
			
				|  |  | -                <if test="theoryPriceFlag == 'true'">
 | 
	
		
			
				|  |  | +                <if test="theoryPriceFlag == 1">
 | 
	
		
			
				|  |  |                      AND cdd.theory_course_price_ > 0
 | 
	
		
			
				|  |  |                  </if>
 | 
	
		
			
				|  |  | -                <if test="theoryPriceFlag != 'false'">
 | 
	
		
			
				|  |  | +                <if test="theoryPriceFlag == 0">
 | 
	
		
			
				|  |  |                      AND cdd.theory_course_price_ <= 0
 | 
	
		
			
				|  |  |                  </if>
 | 
	
		
			
				|  |  |              </if>
 |