|
@@ -8,7 +8,6 @@
|
|
|
|
|
|
<resultMap type="com.keao.edu.user.entity.ExamOrganizationRelation" id="ExamOrganizationRelation">
|
|
|
<result column="id_" property="id" />
|
|
|
-
|
|
|
<result column="examination_basic_id_" property="examinationBasicId" />
|
|
|
<result column="organ_id_" property="organId" />
|
|
|
<result column="settlement_type_" property="settlementType" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler" />
|
|
@@ -17,6 +16,7 @@
|
|
|
<result column="total_payment_amount_" property="totalPaymentAmount"/>
|
|
|
<result column="url_" property="url" />
|
|
|
<result column="send_url_flag_" property="sendUrlFlag" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler" />
|
|
|
+ <result column="is_allow_arrange_exam_" property="isAllowArrangeExam" 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" />
|
|
@@ -38,15 +38,15 @@
|
|
|
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
<insert id="insert" parameterType="com.keao.edu.user.entity.ExamOrganizationRelation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- INSERT INTO exam_organization_relation (examination_basic_id_,organ_id_,settlement_type_,share_profit_amount_,total_registration_student_num_,total_payment_amount_,url_,send_url_flag_,create_time_,update_time_,tenant_id_)
|
|
|
- VALUES(#{examinationBasicId},#{organId},#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{shareProfitAmount},#{totalRegistrationStudentNum},#{totalPaymentAmount},#{url},#{sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{tenantId})
|
|
|
+ INSERT INTO exam_organization_relation (examination_basic_id_,organ_id_,settlement_type_,share_profit_amount_,total_registration_student_num_,total_payment_amount_,url_,send_url_flag_,is_allow_arrange_exam_,create_time_,update_time_,tenant_id_)
|
|
|
+ VALUES(#{examinationBasicId},#{organId},#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{shareProfitAmount},#{totalRegistrationStudentNum},#{totalPaymentAmount},#{url},#{sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{isAllowArrangeExam,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{tenantId})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="batchInsert" parameterType="com.keao.edu.user.entity.ExamOrganizationRelation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- INSERT INTO exam_organization_relation (examination_basic_id_,organ_id_,settlement_type_,share_profit_amount_,total_registration_student_num_,total_payment_amount_,url_,send_url_flag_,create_time_,update_time_,tenant_id_)
|
|
|
+ INSERT INTO exam_organization_relation (examination_basic_id_,organ_id_,settlement_type_,share_profit_amount_,total_registration_student_num_,total_payment_amount_,url_,send_url_flag_,is_allow_arrange_exam_,create_time_,update_time_,tenant_id_)
|
|
|
VALUES
|
|
|
<foreach collection="examOrganizationRelations" item="examOrganizationRelation" separator=",">
|
|
|
- (#{examOrganizationRelation.examinationBasicId},#{examOrganizationRelation.organId},#{examOrganizationRelation.settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{examOrganizationRelation.shareProfitAmount},#{examOrganizationRelation.totalRegistrationStudentNum},#{examOrganizationRelation.totalPaymentAmount},#{examOrganizationRelation.url},#{examOrganizationRelation.sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{examOrganizationRelation.tenantId})
|
|
|
+ (#{examOrganizationRelation.examinationBasicId},#{examOrganizationRelation.organId},#{examOrganizationRelation.settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{examOrganizationRelation.shareProfitAmount},#{examOrganizationRelation.totalRegistrationStudentNum},#{examOrganizationRelation.totalPaymentAmount},#{examOrganizationRelation.url},#{examOrganizationRelation.sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{examOrganizationRelation.isAllowArrangeExam,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{examOrganizationRelation.tenantId})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
@@ -55,25 +55,25 @@
|
|
|
UPDATE exam_organization_relation
|
|
|
<set>
|
|
|
<if test="examinationBasicId != null">
|
|
|
- examination_basic_id_ = #{examinationBasicId},
|
|
|
+ examination_basic_id_ = #{examinationBasicId},
|
|
|
</if>
|
|
|
<if test="id != null">
|
|
|
- id_ = #{id},
|
|
|
+ id_ = #{id},
|
|
|
</if>
|
|
|
<if test="sendUrlFlag != null">
|
|
|
- send_url_flag_ = #{sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
|
|
|
+ send_url_flag_ = #{sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
+ <if test="isAllowArrangeExam != null">
|
|
|
+ is_allow_arrange_exam_ = #{isAllowArrangeExam,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
|
|
|
</if>
|
|
|
<if test="url != null">
|
|
|
- url_ = #{url},
|
|
|
+ url_ = #{url},
|
|
|
</if>
|
|
|
<if test="tenantId != null">
|
|
|
- tenant_id_ = #{tenantId},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">
|
|
|
- update_time_ = #{updateTime},
|
|
|
+ tenant_id_ = #{tenantId},
|
|
|
</if>
|
|
|
<if test="shareProfitAmount != null">
|
|
|
- share_profit_amount_ = #{shareProfitAmount},
|
|
|
+ share_profit_amount_ = #{shareProfitAmount},
|
|
|
</if>
|
|
|
<if test="totalRegistrationStudentNum != null">
|
|
|
total_registration_student_num_ = #{totalRegistrationStudentNum},
|
|
@@ -82,16 +82,54 @@
|
|
|
total_payment_amount_ = #{totalPaymentAmount},
|
|
|
</if>
|
|
|
<if test="organId != null">
|
|
|
- organ_id_ = #{organId},
|
|
|
+ organ_id_ = #{organId},
|
|
|
</if>
|
|
|
<if test="settlementType != null">
|
|
|
- settlement_type_ = #{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time_ = #{createTime},
|
|
|
+ settlement_type_ = #{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
|
|
|
</if>
|
|
|
+ update_time_ = NOW()
|
|
|
</set> WHERE id_ = #{id}
|
|
|
</update>
|
|
|
+
|
|
|
+ <update id="batchUpdate" parameterType="com.keao.edu.user.entity.ExamOrganizationRelation">
|
|
|
+ <foreach collection="examOrganizationRelations" item="eo" separator=";">
|
|
|
+ UPDATE exam_organization_relation
|
|
|
+ <set>
|
|
|
+ <if test="eo.examinationBasicId != null">
|
|
|
+ examination_basic_id_ = #{eo.examinationBasicId},
|
|
|
+ </if>
|
|
|
+ <if test="eo.sendUrlFlag != null">
|
|
|
+ send_url_flag_ = #{eo.sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
+ <if test="eo.isAllowArrangeExam != null">
|
|
|
+ is_allow_arrange_exam_ = #{eo.isAllowArrangeExam,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
+ <if test="eo.url != null">
|
|
|
+ url_ = #{eo.url},
|
|
|
+ </if>
|
|
|
+ <if test="eo.tenantId != null">
|
|
|
+ tenant_id_ = #{eo.tenantId},
|
|
|
+ </if>
|
|
|
+ <if test="eo.shareProfitAmount != null">
|
|
|
+ share_profit_amount_ = #{eo.shareProfitAmount},
|
|
|
+ </if>
|
|
|
+ <if test="eo.totalRegistrationStudentNum != null">
|
|
|
+ total_registration_student_num_ = #{eo.totalRegistrationStudentNum},
|
|
|
+ </if>
|
|
|
+ <if test="eo.totalPaymentAmount != null">
|
|
|
+ total_payment_amount_ = #{eo.totalPaymentAmount},
|
|
|
+ </if>
|
|
|
+ <if test="eo.organId != null">
|
|
|
+ organ_id_ = #{eo.organId},
|
|
|
+ </if>
|
|
|
+ <if test="eo.settlementType != null">
|
|
|
+ settlement_type_ = #{eo.settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
|
|
|
+ </if>
|
|
|
+ update_time_ = NOW()
|
|
|
+ </set> WHERE id_ = #{eo.id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
<update id="batchUpdateSendUrlFlag">
|
|
|
UPDATE exam_organization_relation SET send_url_flag_=#{sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
|
|
|
WHERE examination_basic_id_=#{examId} AND organ_id_ IN
|
|
@@ -108,7 +146,8 @@
|
|
|
<sql id="queryCondition">
|
|
|
<where>
|
|
|
ear.tenant_id_=#{tenantId}
|
|
|
- AND ear.orga_id_ IN
|
|
|
+ AND ear.examination_basic_id_=#{examId}
|
|
|
+ AND ear.organ_id_ IN
|
|
|
<foreach collection="organIds" item="organId" separator="," open="(" close=")">
|
|
|
#{organId}
|
|
|
</foreach>
|
|
@@ -126,22 +165,16 @@
|
|
|
SELECT
|
|
|
ear.*,
|
|
|
a.name_ organ_name_
|
|
|
- FROM organization a
|
|
|
- LEFT JOIN exam_organization_relation ear ON ear.organ_id_=a.id_
|
|
|
- <if test="examId!=null">
|
|
|
- AND ear.examination_basic_id_=#{examId}
|
|
|
- </if>
|
|
|
+ FROM exam_organization_relation ear
|
|
|
+ LEFT JOIN organization a ON ear.organ_id_=a.id_
|
|
|
<include refid="queryCondition"/>
|
|
|
ORDER BY id_ <include refid="global.limit"/>
|
|
|
</select>
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(*) FROM organ a
|
|
|
- LEFT JOIN exam_organization_relation ear ON ear.organ_id_=a.id_
|
|
|
- <if test="examId!=null">
|
|
|
- AND ear.examination_basic_id_=#{examId}
|
|
|
- </if>
|
|
|
+ SELECT COUNT(*) FROM exam_organization_relation ear
|
|
|
+ LEFT JOIN organization a ON ear.organ_id_=a.id_
|
|
|
<include refid="queryCondition"/>
|
|
|
</select>
|
|
|
|