insert into ex_paper_student(paper_id,student_id,create_id) values
(#{item.paperId},#{item.studentId},#{item.createId})
update ex_paper_student set completed=#{completed}
where id in
#{item}
select count(1) from ex_paper_student where paper_id=#{paperId}
select count(1) from ex_paper_student where paper_id=#{paperId} and student_id=#{studentId}
select a.*,e.name as create_name,b.phone as student_phone,b.name as student_name,c.name as paper_name,c.code as paper_code,c.limited,c.limit_time,c.deadline,d.name as category_name
,(select question_id from ex_student_answer where paper_id=a.paper_id and student_id=#{studentId} order by id desc limit 1) as question_id
from ex_paper_student a
left join ex_student b on a.student_id=b.id
left join ex_exam_paper c on c.id=a.paper_id
left join sys_category d on d.id=c.category_id
left join sys_user e on e.id =a.create_id
and c.del_flag=0
and a.paper_id=#{paperId}
and b.name like concat('%',#{studentName},'%')
and b.phone like concat('%',#{studentPhone},'%')
and a.student_id = #{studentId}
and a.state = #{state}
order by a.passed desc,a.id desc
select a.*,b.id as student_id,b.phone as student_phone,b.name as student_name,c.name as paper_name,c.single_num,c.multi_num,c.judge_num,c.easy_num,c.single_score,c.multi_score,c.judge_score,c.easy_score from ex_paper_student a
left join ex_student b on a.student_id=b.id
left join ex_exam_paper c on c.id=a.paper_id
where a.id=#{paperStudentId}
select a.*,b.id as student_id,b.phone as student_phone,b.name as student_name,c.name as paper_name from ex_paper_student a
left join ex_student b on a.student_id=b.id
left join ex_exam_paper c on c.id=a.paper_id
where a.id=#{paperStudentId}
select a.*,b.id as student_id,b.phone as student_phone,b.name as student_name from ex_paper_student a
left join ex_student b on a.student_id=b.id
left join ex_exam_paper c on c.id=a.paper_id
where a.paper_id=#{paperId} and a.student_id=#{studentId}
select a.id,a.question_type,a.bank_id,a.company_id,a.status,
a.answer,c.passed as answer_passed,c.score as answer_score,
a.title,a.privatize,a.content,
c.id as answer_id,c.paper_id as answer_paper_id,c.student_id as answer_student_id,c.question_id as answer_question_id,c.answer as answer_answer
from ex_question a
inner join ex_paper_question b on a.id=b.question_id
left join ex_student_answer c on c.question_id=a.id and c.student_id=#{studentId} and c.paper_id=#{paperId}
where b.paper_id=#{paperId}
order by a.question_type asc,a.id desc
select a.*,b.name as paper_name,c.id as company_id,c.name as company_name from ex_paper_student a
left join ex_exam_paper b on b.id=a.paper_id
left join sys_company c on c.id=b.company_id
select a.*, b.name as paper_name,b.limited,b.limit_time,b.deadline,b.single_num,b.multi_num,b.judge_num,b.easy_num
from ex_paper_student a
inner join ex_exam_paper b on b.id=a.paper_id
where a.state=0 limit #{startIndex},#{pageSize}