qirong
2023-11-28 99b29966852e4f8e1dfb2e444db4f86ce786a3b1
src/main/resources/mapper/ExamTemplatesUserCountMapper.xml
@@ -19,17 +19,23 @@
    </insert>
    <select id="list" resultType="com.mindskip.xzs.domain.vo.ExamTemplatesUserCountVO" parameterType="com.mindskip.xzs.viewmodel.admin.exam.ExamPaperPageRequestVM">
        SELECT exam_templates_id as id, count(*) as count, user_id as userId FROM `t_exam_templates_user_count`
        SELECT u.exam_templates_id as id, count(*) as count, u.user_id as userId FROM `t_exam_templates_user_count` u
        left join t_exam_templates e on u.exam_templates_id = e.id
        <where>
            <if test="templatesId != null">
                and exam_templates_id = #{templatesId}
            </if>
            <if test="userId != null">
                and user_id = #{userId}
            </if>
                <if test="templatesId != null">
                    and u.exam_templates_id = #{templatesId}
                </if>
                <if test="userId != null">
                    and u.user_id = #{userId}
                </if>
                <if test="status != null">
                    and e.status = 0
                </if>
                <if test="status == null">
                    and e.status is null
                </if>
        </where>
        GROUP BY exam_templates_id, user_id
        GROUP BY u.exam_templates_id, u.user_id
    </select>
    <select id="getByTemplatesIds" resultMap="BaseResultMap">