hjl
2024-06-06 81714ac84eb9cf515c0dbf701b5b87d02bafb6bd
ruoyi-service/ruoyi-study/src/main/resources/mapper/sutdy/TStudyMapper.xml
@@ -25,7 +25,8 @@
               COALESCE(SUM(g.integral), 0) AS totalIntegral,
               s.week,
               s.title,
               s.quarter,s.id
               s.quarter,
               s.id
        FROM t_study s
                 LEFT JOIN t_study_answer sa ON s.id = sa.studyId
                 LEFT JOIN t_study_induction si ON s.id = si.studyId
@@ -34,6 +35,14 @@
                 LEFT JOIN t_study_pair sp ON s.id = sp.studyId
                 LEFT JOIN t_story_listen sl ON s.id = sl.studyId
                 LEFT JOIN t_game g ON s.id = g.studyId
        GROUP BY s.week, s.title, s.quarter,s.id;
        <where>
            <if test="quarter != null">
                s.quarter = #{quarter}
            </if>
            <if test="type != null">
                and s.type = #{type}
            </if>
        </where>
        GROUP BY s.week, s.title, s.quarter, s.id;
    </select>
</mapper>