|
@@ -5,108 +5,129 @@
|
|
|
不要修改此文件。所有改动将在下次重新自动生成时丢失。
|
|
|
-->
|
|
|
<mapper namespace="com.keao.edu.user.dao.ExamRegistrationPaymentDao">
|
|
|
-
|
|
|
- <resultMap type="com.keao.edu.user.entity.ExamRegistrationPayment" id="ExamRegistrationPayment">
|
|
|
- <result column="id_" property="id" />
|
|
|
- <result column="exam_registration_id_" property="examRegistrationId" />
|
|
|
- <result column="student_id_" property="studentId" />
|
|
|
- <result column="examination_basic_id_" property="examinationBasicId" />
|
|
|
- <result column="order_no_" property="orderNo" />
|
|
|
- <result column="trans_no_" property="transNo" />
|
|
|
- <result column="mer_no_" property="merNo" />
|
|
|
- <result column="trans_amount_" property="transAmount" />
|
|
|
- <result column="trans_status_" property="transStatus" />
|
|
|
- <result column="trans_successed_time_" property="transSuccessedTime" />
|
|
|
- <result column="create_time_" property="createTime" />
|
|
|
- <result column="update_time_" property="updateTime" />
|
|
|
- <result column="tenant_id_" property="tenantId" />
|
|
|
- </resultMap>
|
|
|
-
|
|
|
- <!-- 根据主键查询一条记录 -->
|
|
|
- <select id="get" resultMap="ExamRegistrationPayment" >
|
|
|
- SELECT * FROM exam_registration_payment WHERE id_ = #{id}
|
|
|
- </select>
|
|
|
-
|
|
|
- <!-- 全查询 -->
|
|
|
- <select id="findAll" resultMap="ExamRegistrationPayment">
|
|
|
- SELECT * FROM exam_registration_payment ORDER BY id_
|
|
|
- </select>
|
|
|
-
|
|
|
- <!-- 向数据库增加一条记录 -->
|
|
|
- <insert id="insert" parameterType="com.keao.edu.user.entity.ExamRegistrationPayment" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- <!--
|
|
|
- <selectKey resultClass="int" keyProperty="id" >
|
|
|
- SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
- </selectKey>
|
|
|
- -->
|
|
|
- INSERT INTO exam_registration_payment (id_,exam_registration_id_,student_id_,examination_basic_id_,order_no_,trans_no_,mer_no_,trans_amount_,trans_status_,trans_successed_time_,create_time_,update_time_,tenant_id_)
|
|
|
- VALUES(#{id},#{examRegistrationId},#{studentId},#{examinationBasicId},#{orderNo},#{transNo},#{transAmount},#{transStatus},#{merNo},#{transSuccessedTime},NOW(),NOW(),#{tenantId})
|
|
|
- </insert>
|
|
|
-
|
|
|
- <!-- 根据主键查询一条记录 -->
|
|
|
- <update id="update" parameterType="com.keao.edu.user.entity.ExamRegistrationPayment">
|
|
|
- UPDATE exam_registration_payment
|
|
|
- <set>
|
|
|
- <if test="examinationBasicId != null">
|
|
|
- examination_basic_id_ = #{examinationBasicId},
|
|
|
- </if>
|
|
|
- <if test="orderNo != null">
|
|
|
- order_no_ = #{orderNo},
|
|
|
- </if>
|
|
|
- <if test="id != null">
|
|
|
- id_ = #{id},
|
|
|
- </if>
|
|
|
- <if test="tenantId != null">
|
|
|
- tenant_id_ = #{tenantId},
|
|
|
- </if>
|
|
|
- <if test="examRegistrationId != null">
|
|
|
- exam_registration_id_ = #{examRegistrationId},
|
|
|
- </if>
|
|
|
- <if test="studentId != null">
|
|
|
- student_id_ = #{studentId},
|
|
|
- </if>
|
|
|
- <if test="transSuccessedTime != null">
|
|
|
- trans_successed_time_ = #{transSuccessedTime},
|
|
|
- </if>
|
|
|
- <if test="transNo != null">
|
|
|
- trans_no_ = #{transNo},
|
|
|
- </if>
|
|
|
- <if test="merNo != null">
|
|
|
- mer_no_ = #{merNo},
|
|
|
- </if>
|
|
|
- <if test="transStatus != null">
|
|
|
- trans_status_ = #{transStatus},
|
|
|
- </if>
|
|
|
- <if test="transAmount != null">
|
|
|
- trans_amount_ = #{transAmount},
|
|
|
- </if>
|
|
|
- update_time_ = NOW()
|
|
|
- </set> WHERE id_ = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <!-- 根据主键删除一条记录 -->
|
|
|
- <delete id="delete" >
|
|
|
- DELETE FROM exam_registration_payment WHERE id_ = #{id}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <!-- 分页查询 -->
|
|
|
- <select id="queryPage" resultMap="ExamRegistrationPayment" parameterType="map">
|
|
|
- SELECT * FROM exam_registration_payment ORDER BY id_ <include refid="global.limit"/>
|
|
|
- </select>
|
|
|
-
|
|
|
- <!-- 查询当前表的总记录数 -->
|
|
|
- <select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(*) FROM exam_registration_payment
|
|
|
- </select>
|
|
|
|
|
|
- <!-- 获取项目用户未支付的订单 -->
|
|
|
+ <resultMap type="com.keao.edu.user.entity.ExamRegistrationPayment" id="ExamRegistrationPayment">
|
|
|
+ <result column="id_" property="id"/>
|
|
|
+ <result column="exam_registration_id_" property="examRegistrationId"/>
|
|
|
+ <result column="student_id_" property="studentId"/>
|
|
|
+ <result column="examination_basic_id_" property="examinationBasicId"/>
|
|
|
+ <result column="order_no_" property="orderNo"/>
|
|
|
+ <result column="pay_type_" property="payType"/>
|
|
|
+ <result column="trans_no_" property="transNo"/>
|
|
|
+ <result column="mer_no_" property="merNo"/>
|
|
|
+ <result column="pay_channel_" property="payChannel"/>
|
|
|
+ <result column="trans_amount_" property="transAmount"/>
|
|
|
+ <result column="trans_status_" property="transStatus"/>
|
|
|
+ <result column="trans_successed_time_" property="transSuccessedTime"/>
|
|
|
+ <result column="create_time_" property="createTime"/>
|
|
|
+ <result column="update_time_" property="updateTime"/>
|
|
|
+ <result column="tenant_id_" property="tenantId"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <select id="get" resultMap="ExamRegistrationPayment">
|
|
|
+ SELECT *
|
|
|
+ FROM exam_registration_payment
|
|
|
+ WHERE id_ = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 全查询 -->
|
|
|
+ <select id="findAll" resultMap="ExamRegistrationPayment">
|
|
|
+ SELECT *
|
|
|
+ FROM exam_registration_payment
|
|
|
+ ORDER BY id_
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 向数据库增加一条记录 -->
|
|
|
+ <insert id="insert" parameterType="com.keao.edu.user.entity.ExamRegistrationPayment" useGeneratedKeys="true"
|
|
|
+ keyColumn="id" keyProperty="id">
|
|
|
+ <!--
|
|
|
+ <selectKey resultClass="int" keyProperty="id" >
|
|
|
+ SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
|
|
|
+ </selectKey>
|
|
|
+ -->
|
|
|
+ INSERT INTO exam_registration_payment
|
|
|
+ (id_,exam_registration_id_,student_id_,examination_basic_id_,order_no_,trans_no_,mer_no_,trans_amount_,trans_status_,trans_successed_time_,create_time_,update_time_,tenant_id_)
|
|
|
+ VALUES(#{id},#{examRegistrationId},#{studentId},#{examinationBasicId},#{orderNo},#{transNo},#{transAmount},#{transStatus},#{merNo},#{transSuccessedTime},NOW(),NOW(),#{tenantId})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
+ <update id="update" parameterType="com.keao.edu.user.entity.ExamRegistrationPayment">
|
|
|
+ UPDATE exam_registration_payment
|
|
|
+ <set>
|
|
|
+ <if test="examinationBasicId != null">
|
|
|
+ examination_basic_id_ = #{examinationBasicId},
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null">
|
|
|
+ order_no_ = #{orderNo},
|
|
|
+ </if>
|
|
|
+ <if test="id != null">
|
|
|
+ id_ = #{id},
|
|
|
+ </if>
|
|
|
+ <if test="tenantId != null">
|
|
|
+ tenant_id_ = #{tenantId},
|
|
|
+ </if>
|
|
|
+ <if test="examRegistrationId != null">
|
|
|
+ exam_registration_id_ = #{examRegistrationId},
|
|
|
+ </if>
|
|
|
+ <if test="studentId != null">
|
|
|
+ student_id_ = #{studentId},
|
|
|
+ </if>
|
|
|
+ <if test="transSuccessedTime != null">
|
|
|
+ trans_successed_time_ = #{transSuccessedTime},
|
|
|
+ </if>
|
|
|
+ <if test="transNo != null">
|
|
|
+ trans_no_ = #{transNo},
|
|
|
+ </if>
|
|
|
+ <if test="payChannel != null">
|
|
|
+ pay_channel_ = #{pay_channel_},
|
|
|
+ </if>
|
|
|
+ <if test="merNo != null">
|
|
|
+ mer_no_ = #{merNo},
|
|
|
+ </if>
|
|
|
+ <if test="transStatus != null">
|
|
|
+ trans_status_ = #{transStatus},
|
|
|
+ </if>
|
|
|
+ <if test="transAmount != null">
|
|
|
+ trans_amount_ = #{transAmount},
|
|
|
+ </if>
|
|
|
+ update_time_ = NOW()
|
|
|
+ </set>
|
|
|
+ WHERE id_ = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 根据主键删除一条记录 -->
|
|
|
+ <delete id="delete">
|
|
|
+ DELETE
|
|
|
+ FROM exam_registration_payment
|
|
|
+ WHERE id_ = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <!-- 分页查询 -->
|
|
|
+ <select id="queryPage" resultMap="ExamRegistrationPayment" parameterType="map">
|
|
|
+ SELECT * FROM exam_registration_payment ORDER BY id_
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询当前表的总记录数 -->
|
|
|
+ <select id="queryCount" resultType="int">
|
|
|
+ SELECT COUNT(*)
|
|
|
+ FROM exam_registration_payment
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 获取项目用户未支付的订单 -->
|
|
|
<select id="getExamIngOrder" resultMap="ExamRegistrationPayment">
|
|
|
- SELECT * FROM exam_registration_payment WHERE student_id_=#{userId}
|
|
|
- AND examination_basic_id_ = #{examinationBasicId} AND trans_status_ = 'ING'
|
|
|
- </select>
|
|
|
+ SELECT *
|
|
|
+ FROM exam_registration_payment
|
|
|
+ WHERE student_id_ = #{userId}
|
|
|
+ AND examination_basic_id_ = #{examinationBasicId}
|
|
|
+ AND trans_status_ = 'ING'
|
|
|
+ </select>
|
|
|
|
|
|
- <!-- 根据订单号获取订单 -->
|
|
|
- <select id="getByOrderNo" resultMap="ExamRegistrationPayment">
|
|
|
- SELECT * FROM exam_registration_payment WHERE order_no_ = #{orderNo}
|
|
|
- </select>
|
|
|
+ <!-- 根据订单号获取订单 -->
|
|
|
+ <select id="getByOrderNo" resultMap="ExamRegistrationPayment">
|
|
|
+ SELECT *
|
|
|
+ FROM exam_registration_payment
|
|
|
+ WHERE order_no_ = #{orderNo} FOR UPDATE
|
|
|
+ </select>
|
|
|
</mapper>
|