| | |
| | | </insert> |
| | | |
| | | <select id="list" resultType="com.mindskip.xzs.domain.vo.ExamTemplatesUserCountVO" parameterType="com.mindskip.xzs.viewmodel.admin.exam.ExamPaperPageRequestVM"> |
| | | 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 |
| | | SELECT |
| | | e.id as id, |
| | | count(u.user_id) as count, |
| | | u.user_id as userId |
| | | FROM |
| | | t_exam_templates e |
| | | left join `t_exam_templates_user_count` u on u.exam_templates_id = e.id <if test="userId != null">and u.user_id = #{userId}</if> |
| | | <where> |
| | | <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> |
| | |
| | | where c.templates_id = #{id} |
| | | </select> |
| | | |
| | | </mapper> |
| | | </mapper> |