|
@@ -119,45 +119,45 @@
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
<select id="findByGroupIds" resultMap="Group">
|
|
<select id="findByGroupIds" resultMap="Group">
|
|
- ( SELECT o.id_ organ_id_,o.name_ organ_name_,g.id_, g.name_ group_name_, 'MUSIC' group_type_
|
|
|
|
|
|
+ SELECT cg.music_group_id_ group_id_,cg.group_type_,cg.id_ class_group_id_,g.name_ group_name_,g.organ_id_,o.name_ organ_name_,cg.name_ class_group_name_
|
|
FROM music_group g
|
|
FROM music_group g
|
|
- LEFT JOIN organization o ON g.organ_id_ = o.id_
|
|
|
|
- WHERE g.id_ IN
|
|
|
|
- <foreach collection="groups" item="group" open="(" close=")" separator=",">
|
|
|
|
- <if test="group != null and group.groupType == @com.ym.mec.biz.dal.enums.GroupType@MUSIC">
|
|
|
|
- #{group.id}
|
|
|
|
- </if>
|
|
|
|
- <if test="group == null">
|
|
|
|
- #{group}
|
|
|
|
- </if>
|
|
|
|
|
|
+ LEFT JOIN class_group cg ON cg.music_group_id_=g.id_
|
|
|
|
+ LEFT JOIN organization o ON o.id_=g.organ_id_
|
|
|
|
+ WHERE cg.group_type_='MUSIC'
|
|
|
|
+ AND cg.id_ IN
|
|
|
|
+ <foreach collection="classGroupIds" item="classGroupId" separator="," open="(" close=")">
|
|
|
|
+ #{classGroupId}
|
|
</foreach>
|
|
</foreach>
|
|
- )
|
|
|
|
- UNION
|
|
|
|
- ( SELECT o.id_ organ_id_,o.name_ organ_name_,g.id_, g.name_ group_name_, 'VIP' group_type_
|
|
|
|
- FROM vip_group g LEFT JOIN organization o ON g.organ_id_ = o.id_
|
|
|
|
- WHERE g.id_ IN
|
|
|
|
- <foreach collection="groups" item="group" open="(" close=")" separator=",">
|
|
|
|
- <if test="group != null and group.groupType == @com.ym.mec.biz.dal.enums.GroupType@VIP">
|
|
|
|
- #{group.id}
|
|
|
|
- </if>
|
|
|
|
- <if test="group == null">
|
|
|
|
- #{group}
|
|
|
|
- </if>
|
|
|
|
|
|
+ UNION ALL
|
|
|
|
+ SELECT cg.music_group_id_ group_id_,cg.group_type_,cg.id_ class_group_id_,cg.name_ group_name_,g.organ_id_,o.name_ organ_name_,cg.name_ class_group_name_
|
|
|
|
+ FROM vip_group g
|
|
|
|
+ LEFT JOIN class_group cg ON cg.music_group_id_=g.id_
|
|
|
|
+ LEFT JOIN organization o ON o.id_=g.organ_id_
|
|
|
|
+ WHERE cg.group_type_='VIP'
|
|
|
|
+ AND cg.id_ IN
|
|
|
|
+ <foreach collection="classGroupIds" item="classGroupId" separator="," open="(" close=")">
|
|
|
|
+ #{classGroupId}
|
|
</foreach>
|
|
</foreach>
|
|
- )
|
|
|
|
- UNION
|
|
|
|
- ( SELECT o.id_ organ_id_,o.name_ organ_name_,g.id_, g.name_ group_name_, 'PRACTICE' group_type_
|
|
|
|
- FROM practice_group g LEFT JOIN organization o ON g.organ_id_ = o.id_
|
|
|
|
- WHERE g.id_ IN
|
|
|
|
- <foreach collection="groups" item="group" open="(" close=")" separator=",">
|
|
|
|
- <if test="group != null and group.groupType == @com.ym.mec.biz.dal.enums.GroupType@PRACTICE">
|
|
|
|
- #{group.id}
|
|
|
|
- </if>
|
|
|
|
- <if test="group == null">
|
|
|
|
- #{group}
|
|
|
|
- </if>
|
|
|
|
|
|
+ UNION ALL
|
|
|
|
+ SELECT cg.music_group_id_ group_id_,cg.group_type_,cg.id_ class_group_id_,cg.name_ group_name_,g.organ_id_,o.name_ organ_name_,cg.name_ class_group_name_
|
|
|
|
+ FROM practice_group g
|
|
|
|
+ LEFT JOIN class_group cg ON cg.music_group_id_=g.id_
|
|
|
|
+ LEFT JOIN organization o ON o.id_=g.organ_id_
|
|
|
|
+ WHERE cg.group_type_='PRACTICE'
|
|
|
|
+ AND cg.id_ IN
|
|
|
|
+ <foreach collection="classGroupIds" item="classGroupId" separator="," open="(" close=")">
|
|
|
|
+ #{classGroupId}
|
|
|
|
+ </foreach>
|
|
|
|
+ UNION ALL
|
|
|
|
+ SELECT cg.music_group_id_ group_id_,cg.group_type_,cg.id_ class_group_id_,cg.name_ group_name_,g.organ_id_,o.name_ organ_name_,cg.name_ class_group_name_
|
|
|
|
+ FROM courses_group g
|
|
|
|
+ LEFT JOIN class_group cg ON cg.music_group_id_=g.id_
|
|
|
|
+ LEFT JOIN organization o ON o.id_=g.organ_id_
|
|
|
|
+ WHERE cg.group_type_='COMM'
|
|
|
|
+ AND cg.id_ IN
|
|
|
|
+ <foreach collection="classGroupIds" item="classGroupId" separator="," open="(" close=")">
|
|
|
|
+ #{classGroupId}
|
|
</foreach>
|
|
</foreach>
|
|
- )
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|