|
@@ -0,0 +1,147 @@
|
|
|
+<?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.keao.edu.user.dao.ExamRegistrationDao">
|
|
|
+
|
|
|
+ <resultMap type="com.keao.edu.user.entity.ExamRegistration" id="ExamRegistration">
|
|
|
+ <result column="id_" property="id" />
|
|
|
+ <result column="examination_basic_id_" property="examinationBasicId" />
|
|
|
+ <result column="student_id_" property="studentId" />
|
|
|
+ <association property="sysUser" columnPrefix="sys_user_" resultMap="com.keao.edu.user.dao.SysUserDao.SysUser"/>
|
|
|
+ <result column="agency_id_" property="agencyId" />
|
|
|
+ <result column="subject_id_" property="subjectId" />
|
|
|
+ <association property="subject" columnPrefix="subject_" resultMap="com.keao.edu.user.dao.SubjectDao.Subject"/>
|
|
|
+ <result column="level_" property="level" />
|
|
|
+ <result column="song_json_" property="songJson" />
|
|
|
+ <result column="last_exam_level_" property="lastExamLevel" />
|
|
|
+ <result column="last_exam_certificate_url_" property="lastExamCertificateUrl" />
|
|
|
+ <result column="adviser_name_" property="adviserName" />
|
|
|
+ <result column="adviser_phone_" property="adviserPhone" />
|
|
|
+ <result column="card_no_" property="cardNo" />
|
|
|
+ <result column="status_" property="status" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ <result column="create_time_" property="createTime" />
|
|
|
+ <result column="update_time_" property="updateTime" />
|
|
|
+ <result column="tenant_id_" property="tenantId" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <select id="get" resultMap="ExamRegistration" >
|
|
|
+ SELECT * FROM exam_registration WHERE id_ = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 全查询 -->
|
|
|
+ <select id="findAll" resultMap="ExamRegistration">
|
|
|
+ SELECT * FROM exam_registration ORDER BY id_
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 向数据库增加一条记录 -->
|
|
|
+ <insert id="insert" parameterType="com.keao.edu.user.entity.ExamRegistration" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
+ INSERT INTO exam_registration (id_,examination_basic_id_,student_id_,agency_id_,subject_id_,level_,song_json_,last_exam_level_,last_exam_certificate_url_,adviser_name_,adviser_phone_,card_no_,status_,create_time_,update_time_,tenant_id_)
|
|
|
+ VALUES(#{id},#{examinationBasicId},#{studentId},#{agencyId},#{subjectId},#{level},#{songJson},#{lastExamLevel},#{lastExamCertificateUrl},#{adviserName},#{adviserPhone},#{cardNo},#{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(), NOW(),#{tenantId})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <update id="update" parameterType="com.keao.edu.user.entity.ExamRegistration">
|
|
|
+ UPDATE exam_registration
|
|
|
+ <set>
|
|
|
+ <if test="examinationBasicId != null">
|
|
|
+ examination_basic_id_ = #{examinationBasicId},
|
|
|
+ </if>
|
|
|
+ <if test="subjectId != null">
|
|
|
+ subject_id_ = #{subjectId},
|
|
|
+ </if>
|
|
|
+ <if test="adviserPhone != null">
|
|
|
+ adviser_phone_ = #{adviserPhone},
|
|
|
+ </if>
|
|
|
+ <if test="lastExamLevel != null">
|
|
|
+ last_exam_level_ = #{lastExamLevel},
|
|
|
+ </if>
|
|
|
+ <if test="id != null">
|
|
|
+ id_ = #{id},
|
|
|
+ </if>
|
|
|
+ <if test="tenantId != null">
|
|
|
+ tenant_id_ = #{tenantId},
|
|
|
+ </if>
|
|
|
+ <if test="level != null">
|
|
|
+ level_ = #{level},
|
|
|
+ </if>
|
|
|
+ <if test="agencyId != null">
|
|
|
+ agency_id_ = #{agencyId},
|
|
|
+ </if>
|
|
|
+ <if test="songJson != null">
|
|
|
+ song_json_ = #{songJson},
|
|
|
+ </if>
|
|
|
+ <if test="adviserName != null">
|
|
|
+ adviser_name_ = #{adviserName},
|
|
|
+ </if>
|
|
|
+ <if test="studentId != null">
|
|
|
+ student_id_ = #{studentId},
|
|
|
+ </if>
|
|
|
+ <if test="lastExamCertificateUrl != null">
|
|
|
+ last_exam_certificate_url_ = #{lastExamCertificateUrl},
|
|
|
+ </if>
|
|
|
+ <if test="cardNo!=null">
|
|
|
+ card_no_ =#{cardNo},
|
|
|
+ </if>
|
|
|
+ <if test="status!=null">
|
|
|
+ status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
+ update_time_ = NOW()
|
|
|
+ </set> WHERE id_ = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 根据主键删除一条记录 -->
|
|
|
+ <delete id="delete" >
|
|
|
+ DELETE FROM exam_registration WHERE id_ = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <sql id="queryCondition">
|
|
|
+ <where>
|
|
|
+ <if test="examId!=null">
|
|
|
+ AND er.examination_basic_id_ = #{examId}
|
|
|
+ </if>
|
|
|
+ <if test="agencyId!=null">
|
|
|
+ AND er.agency_id_ = #{agencyId}
|
|
|
+ </if>
|
|
|
+ <if test="subjectId!=null">
|
|
|
+ AND er.subject_id_ = #{subjectId}
|
|
|
+ </if>
|
|
|
+ <if test="level!=null">
|
|
|
+ AND er.level_ = #{level}
|
|
|
+ </if>
|
|
|
+ <if test="status!=null">
|
|
|
+ AND er.status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 分页查询 -->
|
|
|
+ <select id="queryPage" resultMap="ExamRegistration" parameterType="map">
|
|
|
+ SELECT
|
|
|
+ er.id_,
|
|
|
+ er.card_no_,
|
|
|
+ er.student_id_,
|
|
|
+ su.real_name_,
|
|
|
+ er.agency_id_,
|
|
|
+ er.subject_id_,
|
|
|
+ er.level_,
|
|
|
+ erp.trans_amount_,
|
|
|
+ er.status_
|
|
|
+ FROM
|
|
|
+ exam_registration er
|
|
|
+ LEFT JOIN sys_user su ON er.student_id_ = su.id_
|
|
|
+ LEFT JOIN exam_registration_payment erp ON er.id_ = erp.exam_registration_id_
|
|
|
+ <include refid="queryCondition"/>
|
|
|
+ ORDER BY er.id_
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询当前表的总记录数 -->
|
|
|
+ <select id="queryCount" resultType="int">
|
|
|
+ SELECT COUNT(*) FROM exam_registration
|
|
|
+ <include refid="queryCondition"/>
|
|
|
+ </select>
|
|
|
+</mapper>
|