|
@@ -6,7 +6,7 @@
|
|
|
<!--@Table degree_registration-->
|
|
|
<id column="id_" jdbcType="INTEGER" property="id"/>
|
|
|
<result column="user_id_" property="userId"/>
|
|
|
- <result column="sporadic_id_" jdbcType="INTEGER" property="sporadicId"/>
|
|
|
+ <result column="degree_id_" property="degreeId"/>
|
|
|
<result column="organ_id_" jdbcType="INTEGER" property="organId"/>
|
|
|
<result column="order_no_" jdbcType="VARCHAR" property="orderNo"/>
|
|
|
<result column="trans_no_" jdbcType="VARCHAR" property="transNo"/>
|
|
@@ -15,7 +15,7 @@
|
|
|
<result column="idcard_" jdbcType="VARCHAR" property="idcard"/>
|
|
|
<result column="city_" jdbcType="VARCHAR" property="city"/>
|
|
|
<result column="school_" jdbcType="VARCHAR" property="school"/>
|
|
|
- <result column="subject_" jdbcType="VARCHAR" property="subject"/>
|
|
|
+ <result column="subject_id_" property="subjectId"/>
|
|
|
<result column="level_" jdbcType="VARCHAR" property="level"/>
|
|
|
<result column="theory_cert_" jdbcType="VARCHAR" property="theoryCert"/>
|
|
|
<result column="mobile_" jdbcType="VARCHAR" property="mobile"/>
|
|
@@ -24,12 +24,10 @@
|
|
|
<result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
<result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
|
<result column="status_" jdbcType="TINYINT" property="status"/>
|
|
|
- <result column="activity_tag_" property="activityTag"/>
|
|
|
- <result column="degree_type_" property="degreeType"/>
|
|
|
<result column="certificate_type_" property="certificateType"/>
|
|
|
<result column="tenant_id_" property="tenantId" />
|
|
|
<result column="type_" property="type" />
|
|
|
- <result column="degree_id_" property="degreeId" />
|
|
|
+ <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="get" parameterType="java.lang.Integer" resultMap="DegreeRegistration">
|
|
@@ -133,32 +131,32 @@
|
|
|
<insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.DegreeRegistration"
|
|
|
useGeneratedKeys="true">
|
|
|
<!--@mbg.generated-->
|
|
|
- insert into degree_registration (user_id_,sporadic_id_,organ_id_,order_no_, name_, gender_,
|
|
|
+ insert into degree_registration (user_id_,degree_id_,organ_id_,order_no_, name_, gender_,
|
|
|
idcard_, city_, school_,
|
|
|
- subject_,level_, theory_cert_,mobile_,
|
|
|
+ subject_id_,level_, theory_cert_,mobile_,
|
|
|
money_, memo_, create_time_,
|
|
|
- update_time_, status_, activity_tag_,degree_type_,certificate_type_,tenant_id_,type_)
|
|
|
- values (#{userId},#{sporadicId,jdbcType=INTEGER},#{organId,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR},
|
|
|
+ update_time_, status_,certificate_type_,tenant_id_,type_)
|
|
|
+ values (#{userId},#{degreeId},#{organId,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR},
|
|
|
#{idcard,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{school,jdbcType=VARCHAR},
|
|
|
- #{subject,jdbcType=VARCHAR},#{level,jdbcType=VARCHAR},
|
|
|
+ #{subjectId},#{level,jdbcType=VARCHAR},
|
|
|
#{theoryCert,jdbcType=VARCHAR},#{mobile,jdbcType=VARCHAR},#{money,jdbcType=DECIMAL}, #{memo,jdbcType=VARCHAR},
|
|
|
- #{createTime}, #{updateTime}, #{status,jdbcType=TINYINT}, #{activityTag}, #{degreeType},#{certificateType},#{tenantId},#{type})
|
|
|
+ #{createTime}, #{updateTime}, #{status,jdbcType=TINYINT},#{certificateType},#{tenantId},#{type})
|
|
|
</insert>
|
|
|
<insert id="batchInsert">
|
|
|
- INSERT INTO degree_registration (user_id_,sporadic_id_,organ_id_,order_no_, name_, gender_,
|
|
|
+ INSERT INTO degree_registration (user_id_,degree_id_,organ_id_,order_no_, name_, gender_,
|
|
|
idcard_, city_, school_,
|
|
|
- subject_,level_, theory_cert_,mobile_,
|
|
|
+ subject_id_,level_, theory_cert_,mobile_,
|
|
|
money_, memo_, create_time_,
|
|
|
- update_time_, status_, activity_tag_,degree_type_,certificate_type_,tenant_id_,type_)
|
|
|
+ update_time_, status_,certificate_type_,tenant_id_,type_)
|
|
|
VALUE
|
|
|
<foreach collection="degreeRegistrationList" separator="," item="degreeRegistration">
|
|
|
- (#{degreeRegistration.userId},#{degreeRegistration.sporadicId,jdbcType=INTEGER},#{degreeRegistration.organId,jdbcType=INTEGER},
|
|
|
+ (#{degreeRegistration.userId},#{degreeRegistration.degreeId,jdbcType=INTEGER},#{degreeRegistration.organId,jdbcType=INTEGER},
|
|
|
#{degreeRegistration.orderNo,jdbcType=VARCHAR}, #{degreeRegistration.name,jdbcType=VARCHAR}, #{degreeRegistration.gender,jdbcType=VARCHAR},
|
|
|
#{degreeRegistration.idcard,jdbcType=VARCHAR}, #{degreeRegistration.city,jdbcType=VARCHAR}, #{degreeRegistration.school,jdbcType=VARCHAR},
|
|
|
- #{degreeRegistration.subject,jdbcType=VARCHAR},#{degreeRegistration.level,jdbcType=VARCHAR},
|
|
|
+ #{degreeRegistration.subjectId},#{degreeRegistration.level,jdbcType=VARCHAR},
|
|
|
#{degreeRegistration.theoryCert,jdbcType=VARCHAR},#{degreeRegistration.mobile,jdbcType=VARCHAR},#{degreeRegistration.money,jdbcType=DECIMAL}, #{degreeRegistration.memo,jdbcType=VARCHAR},
|
|
|
#{degreeRegistration.createTime}, #{degreeRegistration.updateTime}, #{degreeRegistration.status,jdbcType=TINYINT},
|
|
|
- #{degreeRegistration.activityTag}, #{degreeRegistration.degreeType},#{degreeRegistration.certificateType},#{degreeRegistration.tenantId},#{degreeRegistration.type})
|
|
|
+ #{degreeRegistration.certificateType},#{degreeRegistration.tenantId},#{degreeRegistration.type})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.DegreeRegistration">
|
|
@@ -168,14 +166,11 @@
|
|
|
<if test="userId != null">
|
|
|
user_id_ = #{userId},
|
|
|
</if>
|
|
|
- <if test="degreeType != null">
|
|
|
- degree_type_ = #{degreeType},
|
|
|
- </if>
|
|
|
<if test="organId != null">
|
|
|
organ_id_ = #{organId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="sporadicId != null">
|
|
|
- sporadic_id_ = #{sporadicId,jdbcType=INTEGER},
|
|
|
+ <if test="degreeId != null">
|
|
|
+ degree_id_ = #{degreeId},
|
|
|
</if>
|
|
|
<if test="orderNo != null">
|
|
|
order_no_ = #{orderNo,jdbcType=VARCHAR},
|
|
@@ -198,8 +193,8 @@
|
|
|
<if test="school != null">
|
|
|
school_ = #{school,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="subject != null">
|
|
|
- subject_ = #{subject,jdbcType=VARCHAR},
|
|
|
+ <if test="subjectId != null">
|
|
|
+ subject_id_ = #{subjectId},
|
|
|
</if>
|
|
|
<if test="level != null">
|
|
|
level_ = #{level,jdbcType=VARCHAR},
|
|
@@ -222,9 +217,6 @@
|
|
|
<if test="status != null">
|
|
|
status_ = #{status,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="activityTag != null">
|
|
|
- activity_tag_ = #{activityTag},
|
|
|
- </if>
|
|
|
<if test="certificateType != null">
|
|
|
certificate_type_ = #{certificateType},
|
|
|
</if>
|
|
@@ -240,14 +232,11 @@
|
|
|
<if test="degree.userId != null">
|
|
|
user_id_ = #{degree.userId},
|
|
|
</if>
|
|
|
- <if test="degree.degreeType != null">
|
|
|
- degree_type_ = #{degree.degreeType},
|
|
|
- </if>
|
|
|
<if test="degree.organId != null">
|
|
|
organ_id_ = #{degree.organId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="degree.sporadicId != null">
|
|
|
- sporadic_id_ = #{degree.sporadicId,jdbcType=INTEGER},
|
|
|
+ <if test="degree.degreeId != null">
|
|
|
+ degree_id_ = #{degree.degreeId},
|
|
|
</if>
|
|
|
<if test="degree.orderNo != null">
|
|
|
order_no_ = #{degree.orderNo,jdbcType=VARCHAR},
|
|
@@ -270,8 +259,8 @@
|
|
|
<if test="degree.school != null">
|
|
|
school_ = #{degree.school,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="degree.subject != null">
|
|
|
- subject_ = #{degree.subject,jdbcType=VARCHAR},
|
|
|
+ <if test="degree.subjectId != null">
|
|
|
+ subject_id_ = #{degree.subjectId},
|
|
|
</if>
|
|
|
<if test="degree.level != null">
|
|
|
level_ = #{degree.level,jdbcType=VARCHAR},
|
|
@@ -294,9 +283,6 @@
|
|
|
<if test="degree.status != null">
|
|
|
status_ = #{degree.status,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="degree.activityTag != null">
|
|
|
- activity_tag_ = #{degree.activityTag},
|
|
|
- </if>
|
|
|
<if test="degree.certificateType != null">
|
|
|
certificate_type_ = #{degree.certificateType},
|
|
|
</if>
|
|
@@ -338,24 +324,9 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getUserLevelDegrees" resultMap="DegreeRegistration">
|
|
|
- SELECT * FROM degree_registration
|
|
|
- WHERE user_id_ = #{userId}
|
|
|
- AND activity_tag_=#{activityTag}
|
|
|
- <if test="degreeType != null">
|
|
|
- AND degree_type_ = #{degreeType}
|
|
|
- </if>
|
|
|
- <if test="status != null">
|
|
|
- AND status_ = #{status}
|
|
|
- </if>
|
|
|
- <if test="subject != null and subject != ''">
|
|
|
- AND subject_ = #{subject}
|
|
|
- </if>
|
|
|
- <if test="sporadicId != null and sporadicId != ''">
|
|
|
- AND FIND_IN_SET(sporadic_id_,#{sporadicId})
|
|
|
- </if>
|
|
|
- <if test="level != null and level != ''">
|
|
|
- AND sporadic_id_ IS NULL AND FIND_IN_SET(level_,#{level})
|
|
|
- </if>
|
|
|
+ select * from degree_registration
|
|
|
+ where user_id_ = #{userId} and degree_id_ = #{degreeId} and degree_type_ = #{degreeType}
|
|
|
+ AND FIND_IN_SET(level_,#{levels}) AND subject_id_ = #{subjectId} LIMIT 1
|
|
|
</select>
|
|
|
<select id="getLockByOrderId" resultMap="DegreeRegistration">
|
|
|
SELECT * FROM degree_registration WHERE order_no_ = #{orderNo} FOR UPDATE
|
|
@@ -363,8 +334,4 @@
|
|
|
<select id="findByByOrderId" resultMap="DegreeRegistration">
|
|
|
SELECT * FROM degree_registration WHERE order_no_ = #{orderNo}
|
|
|
</select>
|
|
|
-
|
|
|
- <select id="selectByDegreeId" resultMap="DegreeRegistration">
|
|
|
- SELECT * FROM degree_registration WHERE degree_id_ = #{degreeId}
|
|
|
- </select>
|
|
|
</mapper>
|