|
@@ -4,13 +4,13 @@
|
|
|
这个文件是自动生成的。
|
|
|
不要修改此文件。所有改动将在下次重新自动生成时丢失。
|
|
|
-->
|
|
|
-<mapper namespace="com.keao.edu.user.dao.ExamAgencyRelationDao">
|
|
|
+<mapper namespace="com.keao.edu.user.dao.ExamOrganizationRelationDao">
|
|
|
|
|
|
- <resultMap type="com.keao.edu.user.entity.ExamAgencyRelation" id="ExamAgencyRelation">
|
|
|
+ <resultMap type="com.keao.edu.user.entity.ExamOrganizationRelation" id="ExamOrganizationRelation">
|
|
|
<result column="id_" property="id" />
|
|
|
|
|
|
<result column="examination_basic_id_" property="examinationBasicId" />
|
|
|
- <result column="agency_id_" property="agencyId" />
|
|
|
+ <result column="organ_id_" property="organId" />
|
|
|
<result column="settlement_type_" property="settlementType" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler" />
|
|
|
<result column="share_profit_amount_" property="shareProfitAmount" />
|
|
|
<result column="total_registration_student_num_" property="totalRegistrationStudentNum"/>
|
|
@@ -22,37 +22,37 @@
|
|
|
<result column="tenant_id_" property="tenantId" />
|
|
|
</resultMap>
|
|
|
|
|
|
- <resultMap id="ExamAgencyRelationExtraDto" type="com.keao.edu.user.dto.ExamAgencyRelationExtraDto" extends="ExamAgencyRelation">
|
|
|
- <result column="agency_name_" property="agencyName"/>
|
|
|
+ <resultMap id="ExamOrganizationRelationExtraDto" type="com.keao.edu.user.dto.ExamOrganizationRelationExtraDto" extends="ExamOrganizationRelation">
|
|
|
+ <result column="organ_name_" property="organizationName"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
- <select id="get" resultMap="ExamAgencyRelation" >
|
|
|
- SELECT * FROM exam_agency_relation WHERE id_ = #{id}
|
|
|
+ <select id="get" resultMap="ExamOrganizationRelation" >
|
|
|
+ SELECT * FROM exam_organization_relation WHERE id_ = #{id}
|
|
|
</select>
|
|
|
|
|
|
<!-- 全查询 -->
|
|
|
- <select id="findAll" resultMap="ExamAgencyRelation">
|
|
|
- SELECT * FROM exam_agency_relation WHERE tenant_id_#{tenantId} ORDER BY id_
|
|
|
+ <select id="findAll" resultMap="ExamOrganizationRelation">
|
|
|
+ SELECT * FROM exam_organization_relation WHERE tenant_id_#{tenantId} ORDER BY id_
|
|
|
</select>
|
|
|
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
|
- <insert id="insert" parameterType="com.keao.edu.user.entity.ExamAgencyRelation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- INSERT INTO exam_agency_relation (examination_basic_id_,agency_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},#{agencyId},#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{shareProfitAmount},#{totalRegistrationStudentNum},#{totalPaymentAmount},#{url},#{sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{tenantId})
|
|
|
+ <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>
|
|
|
|
|
|
- <insert id="batchInsert" parameterType="com.keao.edu.user.entity.ExamAgencyRelation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
- INSERT INTO exam_agency_relation (examination_basic_id_,agency_id_,settlement_type_,share_profit_amount_,total_registration_student_num_,total_payment_amount_,url_,send_url_flag_,create_time_,update_time_,tenant_id_)
|
|
|
+ <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_)
|
|
|
VALUES
|
|
|
- <foreach collection="examAgencyRelations" item="examAgencyRelation" separator=",">
|
|
|
- (#{examAgencyRelation.examinationBasicId},#{examAgencyRelation.agencyId},#{examAgencyRelation.settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{examAgencyRelation.shareProfitAmount},#{examAgencyRelation.totalRegistrationStudentNum},#{examAgencyRelation.totalPaymentAmount},#{examAgencyRelation.url},#{examAgencyRelation.sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{examAgencyRelation.tenantId})
|
|
|
+ <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})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
- <update id="update" parameterType="com.keao.edu.user.entity.ExamAgencyRelation">
|
|
|
- UPDATE exam_agency_relation
|
|
|
+ <update id="update" parameterType="com.keao.edu.user.entity.ExamOrganizationRelation">
|
|
|
+ UPDATE exam_organization_relation
|
|
|
<set>
|
|
|
<if test="examinationBasicId != null">
|
|
|
examination_basic_id_ = #{examinationBasicId},
|
|
@@ -81,8 +81,8 @@
|
|
|
<if test="totalPaymentAmount != null">
|
|
|
total_payment_amount_ = #{totalPaymentAmount},
|
|
|
</if>
|
|
|
- <if test="agencyId != null">
|
|
|
- agency_id_ = #{agencyId},
|
|
|
+ <if test="organId != null">
|
|
|
+ organ_id_ = #{organId},
|
|
|
</if>
|
|
|
<if test="settlementType != null">
|
|
|
settlement_type_ = #{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
|
|
@@ -93,16 +93,16 @@
|
|
|
</set> WHERE id_ = #{id}
|
|
|
</update>
|
|
|
<update id="batchUpdateSendUrlFlag">
|
|
|
- UPDATE exam_agency_relation SET send_url_flag_=#{sendUrlFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
|
|
|
- WHERE examination_basic_id_=#{examId} AND agency_id_ IN
|
|
|
- <foreach collection="agencyIds" item="agencyId" separator="," open="(" close=")">
|
|
|
- #{agencyId}
|
|
|
+ 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
|
|
|
+ <foreach collection="organIds" item="organId" separator="," open="(" close=")">
|
|
|
+ #{organId}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
|
|
|
<!-- 根据主键删除一条记录 -->
|
|
|
<delete id="delete" >
|
|
|
- DELETE FROM exam_agency_relation WHERE id_ = #{id}
|
|
|
+ DELETE FROM exam_organization_relation WHERE id_ = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<sql id="queryCondition">
|
|
@@ -112,18 +112,18 @@
|
|
|
AND ear.settlement_type_=#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
|
|
|
</if>
|
|
|
<if test="search!=null">
|
|
|
- AND (ear.agency_id_=#{agencyId} OR a.name_ LIKE CONCAT(#{search}, '%'))
|
|
|
+ AND (ear.organ_id_=#{organId} OR a.name_ LIKE CONCAT(#{search}, '%'))
|
|
|
</if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
|
- <select id="queryPage" resultMap="ExamAgencyRelationExtraDto" parameterType="map">
|
|
|
+ <select id="queryPage" resultMap="ExamOrganizationRelationExtraDto" parameterType="map">
|
|
|
SELECT
|
|
|
ear.*,
|
|
|
- a.name_ agency_name_
|
|
|
- FROM agency a
|
|
|
- LEFT JOIN exam_agency_relation ear ON ear.agency_id_=a.id_
|
|
|
+ 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>
|
|
@@ -133,17 +133,17 @@
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(*) FROM agency a
|
|
|
- LEFT JOIN exam_agency_relation ear ON ear.agency_id_=a.id_
|
|
|
+ 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>
|
|
|
<include refid="queryCondition"/>
|
|
|
</select>
|
|
|
- <select id="getWithExam" resultMap="ExamAgencyRelation">
|
|
|
- SELECT * FROM exam_agency_relation WHERE examination_basic_id_=#{examId}
|
|
|
+ <select id="getWithExam" resultMap="ExamOrganizationRelation">
|
|
|
+ SELECT * FROM exam_organization_relation WHERE examination_basic_id_=#{examId}
|
|
|
</select>
|
|
|
- <select id="getAgencyIdsWithExam" resultType="int">
|
|
|
- SELECT agency_id_ FROM exam_agency_relation WHERE examination_basic_id_=#{examId} FOR UPDATE
|
|
|
+ <select id="getOrganIdsWithExam" resultType="int">
|
|
|
+ SELECT organ_id_ FROM exam_organization_relation WHERE examination_basic_id_=#{examId} FOR UPDATE
|
|
|
</select>
|
|
|
</mapper>
|