RuoYi/ruoyi-exam/src/main/resources/mapper/exam/ExamUserExaminationMapper.xml

64 lines
3.5 KiB
XML
Raw Normal View History

2019-01-13 12:04:36 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.exam.mapper.ExamUserExaminationMapper">
<resultMap type="ExamUserExamination" id="ExamUserExaminationResult">
<result property="id" column="id" />
<result property="vipUserId" column="vip_user_id" />
<result property="examExaminationId" column="exam_examination_id" />
<result property="examPaperId" column="exam_paper_id" />
<result property="score" column="score" />
<result property="createBy" column="create_by" />
<result property="createDate" column="create_date" />
<result property="updateBy" column="update_by" />
<result property="updateDate" column="update_date" />
<result property="remarks" column="remarks" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectExamUserExaminationVo">
id, vip_user_id, exam_examination_id, exam_paper_id, score, create_by, create_date, update_by, update_date, remarks, del_flag </sql>
<select id="selectExamUserExaminationList" parameterType="ExamUserExamination" resultMap="ExamUserExaminationResult">
select
<include refid="selectExamUserExaminationVo"/>
from exam_user_examination
<where>
<if test="id != null "> and id = #{id}</if>
<if test="vipUserId != null "> and vip_user_id = #{vipUserId}</if>
<if test="examExaminationId != null "> and exam_examination_id = #{examExaminationId}</if>
<if test="examPaperId != null "> and exam_paper_id = #{examPaperId}</if>
<if test="score != null "> and score = #{score}</if>
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateBy != null and updateBy != '' "> and update_by = #{updateBy}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="remarks != null and remarks != '' "> and remarks = #{remarks}</if>
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
</where>
</select>
<select id="selectLastOne" resultMap="ExamUserExaminationResult">
select
<include refid="selectExamUserExaminationVo"/>
from exam_user_examination
<where>
<if test="id != null "> and id = #{id}</if>
<if test="vipUserId != null "> and vip_user_id = #{vipUserId}</if>
<if test="examExaminationId != null "> and exam_examination_id = #{examExaminationId}</if>
<if test="examPaperId != null "> and exam_paper_id = #{examPaperId}</if>
<if test="score != null "> and score = #{score}</if>
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateBy != null and updateBy != '' "> and update_by = #{updateBy}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="remarks != null and remarks != '' "> and remarks = #{remarks}</if>
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
</where>
order by create_date desc;
</select>
</mapper>