| | |
| | | <if test="type != null "> |
| | | and e.type= #{type} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | AND INSTR(name, #{name}) |
| | | </if> |
| | | </where> |
| | | group by e.id |
| | | </select> |
| | |
| | | where a.exam_paper_id = #{id} |
| | | </select> |
| | | |
| | | <select id="getRandomPaperExcelById" resultType="com.mindskip.xzs.domain.vo.PaperExcelVO" parameterType="java.lang.Integer"> |
| | | select u.real_name as name,a.create_user as userId,a.user_score as userScore,a.paper_score as paperScore |
| | | from t_exam_paper_answer a |
| | | inner join t_user u on u.id = a.create_user |
| | | inner join t_exam_templates_user_count uc ON a.exam_paper_id = uc.exam_paper_id AND uc.exam_templates_id = #{id} |
| | | where a.invalid = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="list" resultType="com.mindskip.xzs.domain.ExamPaper"> |
| | | select id, name, paper_type, create_time from t_exam_paper |
| | | where paper_type != 7 |
| | | select tep.id, name, paper_type, create_time from t_exam_paper tep left join t_user_department tud on tep.create_user = tud.user_id |
| | | where paper_type != 7 and tep.deleted = 0 |
| | | <if test="deptIds != null and deptIds.size() > 0"> |
| | | and dept_id in |
| | | <foreach collection="deptIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | and (tep.create_user = 2 |
| | | or tud.department_id in <foreach collection="deptIds" item="item" open="(" separator="," close=")"> #{item} </foreach> |
| | | ) |
| | | </if> |
| | | order by create_time desc |
| | | group by tep.id |
| | | order by tep.id desc |
| | | </select> |
| | | |
| | | <select id="template" resultType="com.mindskip.xzs.domain.ExamPaper"> |
| | | select id, name, paper_type, ctime as create_time from t_exam_templates |
| | | select tet.id, name, paper_type, ctime as create_time from t_exam_templates tet left join t_user_department tud on tet.create_user = tud.user_id |
| | | <if test="deptIds != null and deptIds.size() > 0"> |
| | | where dept_id in |
| | | <foreach collection="deptIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | where (tet.create_user = 2 |
| | | or tud.department_id in <foreach collection="deptIds" item="item" open="(" separator="," close=")"> #{item} </foreach> |
| | | ) |
| | | </if> |
| | | order by ctime desc |
| | | group by tet.id |
| | | order by tet.id desc |
| | | </select> |
| | | |
| | | <select id="selectStudent" resultType="com.mindskip.xzs.domain.vo.UserVO" parameterType="com.mindskip.xzs.domain.vo.UserVO"> |
| | |
| | | </select> |
| | | |
| | | <select id="getExamPaper" resultType="com.mindskip.xzs.domain.ExamPaper"> |
| | | select id, name, paper_type, create_time from t_exam_paper where paper_type != 7 order by create_time desc |
| | | select id, name, paper_type, create_time from t_exam_paper where paper_type != 7 and deleted = 0 order by create_time desc |
| | | </select> |
| | | |
| | | <select id="getTemplate" resultType="com.mindskip.xzs.domain.ExamPaper"> |