Browse Source

Merge branch 'zx_online_cbs' of http://git.dayaedu.com/yonge/cooleshow into test

zouxuan 1 năm trước cách đây
mục cha
commit
62c4eddb33

+ 4 - 3
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetAuthRecordMapper.xml

@@ -56,10 +56,10 @@
             su.del_flag_ = 0 AND
             ms.source_type_  = 'TEACHER'
             <if test="param.idAndName != null and param.idAndName != ''">
-                and (((su.id_ like concat('%',#{param.idAndName} ,'%')
+                AND ((su.id_ like concat('%',#{param.idAndName} ,'%')
                 or su.username_ like concat('%',#{param.idAndName},'%')
-                or ms.music_sheet_name_ like concat('%',#{param.idAndName},'%')
-                or su.phone_ like concat('%',#{param.idAndName},'%')) AND msar.audit_state_ = 'PASS') OR
+                or su.phone_ like concat('%',#{param.idAndName},'%')) OR
+                (ms.music_sheet_name_ like concat('%',#{param.idAndName},'%') AND msar.audit_state_ = 'PASS') OR
                 (JSON_UNQUOTE(JSON_EXTRACT(music_sheet_json_, '$.name')) LIKE CONCAT('%',#{param.idAndName},'%') AND msar.audit_state_ != 'PASS'))
             </if>
             <if test="param.auditName != null and param.auditName != ''">
@@ -93,6 +93,7 @@
                 and ms.exquisite_flag_ = #{param.exquisiteFlag}
             </if>
         </where>
+        group by msar.music_sheet_id_
         order by field(msar.audit_state_,'DOING') desc,  msar.update_time_ desc
     </select>
     <select id="findByMusicSheetIds" resultMap="BaseResultMap">

+ 28 - 5
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetMapper.xml

@@ -150,6 +150,9 @@
                 AND t.notation_ = #{param.notation}
             </if>
         </where>
+        <if test="param.auditStatus != null">
+            group by msar.music_sheet_id_
+        </if>
         order by
         <if test="param.sortByAlbumIdDesc != null">
             if(isnull(tam.id_),0,1),
@@ -165,11 +168,19 @@
             and t.music_sheet_type_ = #{param.musicSheetType}
         </if>
         <if test="param.idAndName != null and param.idAndName != ''">
-            and (((su.id_ like concat('%',#{param.idAndName} ,'%')
-            or su.username_ like concat('%',#{param.idAndName},'%')
-            or t.music_sheet_name_ like concat('%',#{param.idAndName},'%')
-            or su.phone_ like concat('%',#{param.idAndName},'%')) AND msar.audit_state_ = 'PASS') OR
-            (JSON_UNQUOTE(JSON_EXTRACT(music_sheet_json_, '$.name')) LIKE CONCAT('%',#{param.idAndName},'%') AND msar.audit_state_ != 'PASS'))
+            <if test="param.auditStatus != null">
+                AND ((su.id_ like concat('%',#{param.idAndName} ,'%')
+                or su.username_ like concat('%',#{param.idAndName},'%')
+                or su.phone_ like concat('%',#{param.idAndName},'%')) OR
+                (t.music_sheet_name_ like concat('%',#{param.idAndName},'%') AND msar.audit_state_ = 'PASS') OR
+                (JSON_UNQUOTE(JSON_EXTRACT(music_sheet_json_, '$.name')) LIKE CONCAT('%',#{param.idAndName},'%') AND msar.audit_state_ != 'PASS'))
+            </if>
+            <if test="param.auditStatus == null">
+                AND (su.id_ like concat('%',#{param.idAndName} ,'%')
+                or su.username_ like concat('%',#{param.idAndName},'%')
+                or su.phone_ like concat('%',#{param.idAndName},'%') OR
+                t.music_sheet_name_ like concat('%',#{param.idAndName},'%'))
+            </if>
         </if>
         <if test="param.search != null and param.search != ''">
             and (t.cbs_music_sheet_id_ like concat('%',#{param.search},'%') or
@@ -428,6 +439,9 @@
                 and #{param.auditVersion} = t.audit_version_
             </if>
         </where>
+        <if test="param.auditStatus != null">
+            group by msar.music_sheet_id_
+        </if>
         order by
 
         <choose>
@@ -482,6 +496,9 @@
                 AND mspr.course_music_album_id_ <choose><when test="param.courseGift == 0"> = </when><otherwise> > </otherwise> </choose> 0
             </if>
         </where>
+        <if test="param.auditStatus != null">
+            group by msar.music_sheet_id_
+        </if>
         order by  mspr.id_ desc
     </select>
 
@@ -510,6 +527,9 @@
                 and mf.user_id_ = #{param.studentId}
             </if>
         </where>
+        <if test="param.auditStatus != null">
+            group by msar.music_sheet_id_
+        </if>
         order by mf.id_ desc
     </select>
 
@@ -538,6 +558,9 @@
                 </foreach>
             </if>
         </where>
+        <if test="param.auditStatus != null">
+            group by msar.music_sheet_id_
+        </if>
         <if test="practiceMusicIdList != null and practiceMusicIdList.size() != 0">
             order by field(mspr.id_,
             <foreach collection="practiceMusicIdList" item="item" separator=",">