|  | @@ -271,4 +271,115 @@
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          )
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <select id="selectStudentOrderPage" resultType="com.yonge.cooleshow.biz.dal.vo.StudentMusicSheetOrderVo">
 | 
	
		
			
				|  |  | +        select mspr.music_sheet_id_ as musicSheetId
 | 
	
		
			
				|  |  | +        ,ms.music_sheet_name_ as musicSheetName
 | 
	
		
			
				|  |  | +        ,ms.composer_ as composer
 | 
	
		
			
				|  |  | +        ,ms.music_tag_ as musicTag
 | 
	
		
			
				|  |  | +        ,(select group_concat(mt.name_) from music_tag mt
 | 
	
		
			
				|  |  | +        where find_in_set(mt.id_,ms.music_tag_) and mt.del_flag_ = 0) as musicTagNames
 | 
	
		
			
				|  |  | +        ,mspr.purchase_price_ as purchasePrice
 | 
	
		
			
				|  |  | +        ,mspr.order_no_ as orderNo
 | 
	
		
			
				|  |  | +        ,mspr.purchase_time_ as purchaseTime
 | 
	
		
			
				|  |  | +        from music_sheet_purchase_record mspr
 | 
	
		
			
				|  |  | +        left join music_sheet ms on mspr.music_sheet_id_ = ms.id_
 | 
	
		
			
				|  |  | +        <where>
 | 
	
		
			
				|  |  | +            mspr.order_status_ = '${@ com.yonge.cooleshow.biz.dal.enums.YesOrNoEnum@YES}'
 | 
	
		
			
				|  |  | +            <if test="param.idAndName != null and param.idAndName != ''">
 | 
	
		
			
				|  |  | +                and (ms.id_ like concat('%',#{param.idAndName} ,'%')
 | 
	
		
			
				|  |  | +                    or ms.music_sheet_name_ like concat('%',#{param.idAndName},'%'))
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="param.studentId != null">
 | 
	
		
			
				|  |  | +                and mspr.student_id_ = #{param.studentId}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="param.orderNo != null and param.orderNo != ''">
 | 
	
		
			
				|  |  | +                and mspr.order_no_ = #{param.orderNo}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="param.musicTagList != null and param.musicTagList.size() != 0">
 | 
	
		
			
				|  |  | +                and
 | 
	
		
			
				|  |  | +                <foreach collection="param.musicTagList" separator="and" item="item">
 | 
	
		
			
				|  |  | +                    find_in_set(#{item},ms.music_tag_)
 | 
	
		
			
				|  |  | +                </foreach>
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="param.startTime != null">
 | 
	
		
			
				|  |  | +                and mspr.purchase_time_ > #{param.startTime}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="param.endTime != null">
 | 
	
		
			
				|  |  | +                and mspr.purchase_time_ < #{param.endTime}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +        </where>
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <select id="selectTeacherPage" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherMusicSheetVo">
 | 
	
		
			
				|  |  | +        select ms.id_ as musicSheetId
 | 
	
		
			
				|  |  | +        ,ms.music_sheet_name_ as musicSheetName
 | 
	
		
			
				|  |  | +        ,ms.composer_ as composer
 | 
	
		
			
				|  |  | +        ,ms.music_tag_ as musicTag
 | 
	
		
			
				|  |  | +        ,(select group_concat(mt.name_) from music_tag mt
 | 
	
		
			
				|  |  | +        where find_in_set(mt.id_,ms.music_tag_) and mt.del_flag_ = 0) as musicTagNames
 | 
	
		
			
				|  |  | +        ,ms.play_speed_ as playSpeed
 | 
	
		
			
				|  |  | +        ,ms.music_price_ as musicPrice
 | 
	
		
			
				|  |  | +        ,ms.create_time_ as createTime
 | 
	
		
			
				|  |  | +        ,ms.audit_status_ as auditStatus
 | 
	
		
			
				|  |  | +        ,su.username_ as auditName
 | 
	
		
			
				|  |  | +        from music_sheet ms
 | 
	
		
			
				|  |  | +        left join music_sheet_auth_record msar on ms.id_ = msar.music_sheet_id_
 | 
	
		
			
				|  |  | +        left join sys_user su on msar.verify_user_id_ = su.id_
 | 
	
		
			
				|  |  | +        <where>
 | 
	
		
			
				|  |  | +            <if test="param.idAndName != null and param.idAndName != ''">
 | 
	
		
			
				|  |  | +                and (ms.id_ like concat('%',#{param.idAndName} ,'%')
 | 
	
		
			
				|  |  | +                or ms.music_sheet_name_ like concat('%',#{param.idAndName},'%')
 | 
	
		
			
				|  |  | +                or ms.composer_ like concat('%',#{param.idAndName},'%'))
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="param.teacherId != null">
 | 
	
		
			
				|  |  | +                and ms.create_by_ = #{param.teacherId}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="param.startTime != null">
 | 
	
		
			
				|  |  | +                and ms.create_by_ > #{param.startTime}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="param.endTime != null">
 | 
	
		
			
				|  |  | +                and ms.create_by_ < #{param.endTime}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +        </where>
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <select id="selectAuditPage" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherMusicSheetVo">
 | 
	
		
			
				|  |  | +        select
 | 
	
		
			
				|  |  | +        ms.create_by_ as teacherId
 | 
	
		
			
				|  |  | +        ,su.username_ as username
 | 
	
		
			
				|  |  | +        ,su.phone_ as phone
 | 
	
		
			
				|  |  | +        ,ms.id_ as musicSheetId
 | 
	
		
			
				|  |  | +        ,ms.music_sheet_name_ as musicSheetName
 | 
	
		
			
				|  |  | +        ,ms.composer_ as composer
 | 
	
		
			
				|  |  | +        ,ms.music_tag_ as musicTag
 | 
	
		
			
				|  |  | +        ,(select group_concat(mt.name_) from music_tag mt
 | 
	
		
			
				|  |  | +        where find_in_set(mt.id_,ms.music_tag_) and mt.del_flag_ = 0) as musicTagNames
 | 
	
		
			
				|  |  | +        ,ms.play_speed_ as playSpeed
 | 
	
		
			
				|  |  | +        ,ms.music_price_ as musicPrice
 | 
	
		
			
				|  |  | +        ,ms.create_time_ as createTime
 | 
	
		
			
				|  |  | +        ,ms.audit_status_ as auditStatus
 | 
	
		
			
				|  |  | +        ,su.username_ as auditName
 | 
	
		
			
				|  |  | +        from music_sheet ms
 | 
	
		
			
				|  |  | +        left join sys_user su on su.id_ = ms.create_by_
 | 
	
		
			
				|  |  | +        left join music_sheet_auth_record msar on ms.id_ = msar.music_sheet_id_
 | 
	
		
			
				|  |  | +        left join sys_user su2 on msar.verify_user_id_ = su2.id_
 | 
	
		
			
				|  |  | +        <where>
 | 
	
		
			
				|  |  | +            ms.user_id_ > 0
 | 
	
		
			
				|  |  | +            <if test="param.idAndName != null and param.idAndName != ''">
 | 
	
		
			
				|  |  | +                and (su.id_ like concat('%',#{param.idAndName} ,'%')
 | 
	
		
			
				|  |  | +                or su.username_ like concat('%',#{param.idAndName},'%')
 | 
	
		
			
				|  |  | +                or su.phone_ like concat('%',#{param.idAndName},'%'))
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="param.auditName != null and param.auditName != ''">
 | 
	
		
			
				|  |  | +                and su2.username_ like concat('%',#{param.auditName},'%')
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="param.startTime != null">
 | 
	
		
			
				|  |  | +                and ms.create_by_ > #{param.startTime}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="param.endTime != null">
 | 
	
		
			
				|  |  | +                and ms.create_by_ < #{param.endTime}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +        </where>
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  |  </mapper>
 |