|
@@ -24,9 +24,8 @@
|
|
|
<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="certificate_type_" property="certificateType"/>
|
|
|
+ <result column="certificate_type_" property="certificateType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
<result column="tenant_id_" property="tenantId" />
|
|
|
- <result column="type_" property="type" />
|
|
|
<result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
</resultMap>
|
|
|
|
|
@@ -49,6 +48,9 @@
|
|
|
<if test="organId != null and organId != ''">
|
|
|
AND FIND_IN_SET(organ_id_,#{organId})
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ AND type_ = #{type}
|
|
|
+ </if>
|
|
|
<if test="status != null">
|
|
|
AND status_ = #{status}
|
|
|
</if>
|
|
@@ -58,9 +60,6 @@
|
|
|
<if test="id != null">
|
|
|
AND id_ = #{id}
|
|
|
</if>
|
|
|
- <if test="search != null and search != ''">
|
|
|
- AND (id_ = #{search} OR name_ LIKE CONCAT('%',#{search},'%') )
|
|
|
- </if>
|
|
|
<if test="orderNo != null">
|
|
|
AND order_no_ = #{orderNo}
|
|
|
</if>
|
|
@@ -80,12 +79,16 @@
|
|
|
AND city_ LIKE CONCAT('%', #{city},'%')
|
|
|
</if>
|
|
|
<if test="subject != null">
|
|
|
- AND subject_= #{subject}
|
|
|
+ AND subject_ = #{subject}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="subjectId != null">
|
|
|
+ AND subject_id_= #{subjectId}
|
|
|
</if>
|
|
|
<if test="mobile != null">
|
|
|
AND mobile_= #{mobile}
|
|
|
</if>
|
|
|
- <if test="level != null">
|
|
|
+ <if test="level != null and level != ''">
|
|
|
AND level_= #{level}
|
|
|
</if>
|
|
|
<if test="startTime != null">
|
|
@@ -94,6 +97,12 @@
|
|
|
<if test="endTime != null">
|
|
|
<![CDATA[AND DATE_FORMAT(create_time_,"%Y-%m-%d") <= #{endTime}]]>
|
|
|
</if>
|
|
|
+ <if test="search != null and search != ''">
|
|
|
+ and (user_id_ like concat('%',#{search},'%') or name_ like CONCAT('%',#{search},'%') or mobile_ like CONCAT('%',#{search},'%') )
|
|
|
+ </if>
|
|
|
+ <if test="degreeId != null ">
|
|
|
+ and degree_id_ = #{degreeId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
|
|
@@ -134,20 +143,19 @@
|
|
|
insert into degree_registration (user_id_,degree_id_,organ_id_,order_no_, name_, gender_,
|
|
|
idcard_, city_, school_,
|
|
|
subject_id_,level_, theory_cert_,mobile_,
|
|
|
- money_, memo_, create_time_,
|
|
|
- update_time_, status_,certificate_type_,tenant_id_,type_)
|
|
|
+ money_, memo_,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},
|
|
|
#{subjectId},#{level,jdbcType=VARCHAR},
|
|
|
#{theoryCert,jdbcType=VARCHAR},#{mobile,jdbcType=VARCHAR},#{money,jdbcType=DECIMAL}, #{memo,jdbcType=VARCHAR},
|
|
|
- #{createTime}, #{updateTime}, #{status,jdbcType=TINYINT},#{certificateType},#{tenantId},#{type})
|
|
|
+ #{status,jdbcType=TINYINT},#{certificateType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ #{tenantId},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
|
|
|
</insert>
|
|
|
<insert id="batchInsert">
|
|
|
INSERT INTO degree_registration (user_id_,degree_id_,organ_id_,order_no_, name_, gender_,
|
|
|
idcard_, city_, school_,
|
|
|
subject_id_,level_, theory_cert_,mobile_,
|
|
|
- money_, memo_, create_time_,
|
|
|
- update_time_, status_,certificate_type_,tenant_id_,type_)
|
|
|
+ money_, memo_,status_,certificate_type_,tenant_id_,type_)
|
|
|
VALUE
|
|
|
<foreach collection="degreeRegistrationList" separator="," item="degreeRegistration">
|
|
|
(#{degreeRegistration.userId},#{degreeRegistration.degreeId,jdbcType=INTEGER},#{degreeRegistration.organId,jdbcType=INTEGER},
|
|
@@ -155,8 +163,9 @@
|
|
|
#{degreeRegistration.idcard,jdbcType=VARCHAR}, #{degreeRegistration.city,jdbcType=VARCHAR}, #{degreeRegistration.school,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.certificateType},#{degreeRegistration.tenantId},#{degreeRegistration.type})
|
|
|
+ #{degreeRegistration.status,jdbcType=TINYINT},
|
|
|
+ #{degreeRegistration.certificateType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
+ #{degreeRegistration.tenantId},#{degreeRegistration.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.DegreeRegistration">
|
|
@@ -211,16 +220,12 @@
|
|
|
<if test="memo != null">
|
|
|
memo_ = #{memo,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time_ = #{createTime},
|
|
|
- </if>
|
|
|
<if test="status != null">
|
|
|
status_ = #{status,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="certificateType != null">
|
|
|
- certificate_type_ = #{certificateType},
|
|
|
+ certificate_type_ = #{certificateType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
</if>
|
|
|
- update_time_ = NOW()
|
|
|
</set>
|
|
|
where id_ = #{id,jdbcType=INTEGER} and tenant_id_ = #{tenantId}
|
|
|
</update>
|
|
@@ -277,16 +282,12 @@
|
|
|
<if test="degree.memo != null">
|
|
|
memo_ = #{degree.memo,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="degree.createTime != null">
|
|
|
- create_time_ = #{degree.createTime},
|
|
|
- </if>
|
|
|
<if test="degree.status != null">
|
|
|
status_ = #{degree.status,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="degree.certificateType != null">
|
|
|
- certificate_type_ = #{degree.certificateType},
|
|
|
+ certificate_type_ = #{degree.certificateType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
|
|
|
</if>
|
|
|
- update_time_ = NOW()
|
|
|
</set>
|
|
|
where id_ = #{degree.id,jdbcType=INTEGER} and tenant_id_ = #{degree.tenantId}
|
|
|
</foreach>
|
|
@@ -334,4 +335,11 @@
|
|
|
<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}
|
|
|
+ AND status_ = 1
|
|
|
+ </select>
|
|
|
</mapper>
|