Browse Source

曲目排序规则调整

zouxuan 5 months ago
parent
commit
186106294c

+ 3 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/ActivityEvaluationMapper.xml

@@ -137,7 +137,9 @@
             )
             <include refid="com.yonge.cooleshow.biz.dal.dao.MusicSheetDao.QueryInfo"/>
         </where>
-        order by t.id_ desc
+        ORDER BY CONVERT(t.music_sheet_name_ USING gbk) COLLATE gbk_chinese_ci,
+        t.music_sheet_name_ COLLATE utf8mb4_bin,
+        t.music_sheet_name_ REGEXP '^[0-9]' DESC, t.create_time_ DESC
     </select>
 
     <!--活动老师信息-->

+ 15 - 4
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml

@@ -388,14 +388,24 @@
             <if test="param.id != null">
                 <if test="param.type == 2">
                     and amr.album_id_ = #{param.id}
-                    order by amr.sort_number_ desc, t.id_ desc
+                    order by amr.sort_number_ desc,
+                    CONVERT(t.music_sheet_name_ USING gbk) COLLATE gbk_chinese_ci,
+                    t.music_sheet_name_ COLLATE utf8mb4_bin,
+                    t.music_sheet_name_ REGEXP '^[0-9]' DESC, t.create_time_ DESC
                 </if>
                 <if test="param.type == 1">
                     and t.id_ not in(select amr2.music_sheet_id_  from album_music_relate amr2
                         where amr2.album_id_ = #{param.id})
-                    order by t.id_ desc
+                    ORDER BY CONVERT(t.music_sheet_name_ USING gbk) COLLATE gbk_chinese_ci,
+                    t.music_sheet_name_ COLLATE utf8mb4_bin,
+                    t.music_sheet_name_ REGEXP '^[0-9]' DESC, t.create_time_ DESC
                 </if>
             </if>
+            <if test="param.id == null">
+                ORDER BY CONVERT(t.music_sheet_name_ USING gbk) COLLATE gbk_chinese_ci,
+                t.music_sheet_name_ COLLATE utf8mb4_bin,
+                t.music_sheet_name_ REGEXP '^[0-9]' DESC, t.create_time_ DESC
+            </if>
         </where>
     </select>
 
@@ -528,7 +538,6 @@
             group by msar.music_sheet_id_
         </if>
         order by
-
         <choose>
             <when test="param.musicSortType != null and param.musicSortType.code == 'TOP'">
                 t.top_flag_ desc, t.sort_number_ desc,
@@ -545,7 +554,9 @@
                 </if>
             </otherwise>
         </choose>
-        t.id_ desc
+        CONVERT(t.music_sheet_name_ USING gbk) COLLATE gbk_chinese_ci,
+        t.music_sheet_name_ COLLATE utf8mb4_bin,
+        t.music_sheet_name_ REGEXP '^[0-9]' DESC, t.create_time_ DESC
     </select>
 
     <select id="selectMyMusicPage" resultType="com.yonge.cooleshow.biz.dal.vo.MusicSheetVo">