| | |
| | | </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"> |