| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ydtech.modules.protocol.dao.PtlAgreementMapper">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.protocol.entity.po.PtlAgreement">
- <id property="id" column="id" jdbcType="BIGINT"/>
- <result property="companiesType" column="companies_type" jdbcType="INTEGER"/>
- <result property="agreementType" column="agreement_type" jdbcType="VARCHAR"/>
- <result property="agreementCode" column="agreement_code" jdbcType="VARCHAR"/>
- <result property="agreementName" column="agreement_name" jdbcType="VARCHAR"/>
- <result property="agreementAbbreviation" column="agreement_abbreviation" jdbcType="VARCHAR"/>
- <result property="insuranceCompany" column="insurance_company" jdbcType="VARCHAR"/>
- <result property="insuranceCompanyId" column="insurance_company_id" jdbcType="VARCHAR"/>
- <result property="partnerCompaniesId" column="partner_companies_id" jdbcType="VARCHAR"/>
- <result property="associationCompaniesId" column="association_companies_id" jdbcType="VARCHAR"/>
- <result property="startDate" column="start_date" jdbcType="DATE"/>
- <result property="endDate" column="end_date" jdbcType="DATE"/>
- <result property="moneyTime" column="money_time" jdbcType="INTEGER"/>
- <result property="matchType" column="match_type" jdbcType="VARCHAR"/>
- <result property="dockingPerson" column="docking_person" jdbcType="VARCHAR"/>
- <result property="dockingPhone" column="docking_phone" jdbcType="VARCHAR"/>
- <result property="withTax" column="with_tax" jdbcType="VARCHAR"/>
- <result property="moneyType" column="money_type" jdbcType="VARCHAR"/>
- <result property="validStatus" column="valid_status" jdbcType="VARCHAR"/>
- <result property="fileId" column="file_id" jdbcType="VARCHAR"/>
- <result property="auditContent" column="audit_content" jdbcType="VARCHAR"/>
- <result property="auditStatus" column="audit_status" jdbcType="TINYINT"/>
- <result property="creator" column="creator" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="modifiedBy" column="modified_by" jdbcType="VARCHAR"/>
- <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
- </resultMap>
- <resultMap id="AgreementCompanyResultMap" type="com.ydtech.modules.protocol.entity.dto.PtlAgreementInsCompanyDto">
- <id property="id" column="id" jdbcType="VARCHAR"/>
- <result property="name" column="name" jdbcType="VARCHAR"/>
- <result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
- <result property="namesimple" column="namesimple" jdbcType="VARCHAR"/>
- <result property="remark" column="remark" jdbcType="VARCHAR"/>
- <result property="orderNum" column="order_num" jdbcType="INTEGER"/>
- <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="lastUpdateBy" column="last_update_by" jdbcType="VARCHAR"/>
- <result property="lastUpdateTime" column="last_update_time" jdbcType="TIMESTAMP"/>
- <result property="cnName" column="cn_name" jdbcType="VARCHAR"/>
- <result property="logo" column="logo" jdbcType="VARCHAR"/>
- <collection property="agreement" ofType="com.ydtech.modules.protocol.entity.dto.PtlAgreementDto">
- <id property="id" column="agreement_id"/>
- <result property="agreementName" column="agreement_name"/>
- <result property="underwritingDescription" column="underwriting_description"/>
- <result property="apiType" column="api_type"/>
- </collection>
- </resultMap>
- <sql id="Base_Column_List">
- id,agreement_type,agreement_code,
- agreement_name,agreement_abbreviation,insurance_company,
- start_date,end_date,money_time,
- match_type,docking_person,docking_phone,
- with_tax,money_type,cooperation_channels,
- valid_status,file_id,audit_status,
- creator,create_time,modified_by,
- update_time
- </sql>
- <select id="getAgreementCompany" resultMap="AgreementCompanyResultMap">
- select eic.*, pa.id as agreement_id, pa.agreement_name, paa.api_type, pa.underwriting_description
- from esm_ins_company as eic
- left join ptl_agreement as pa on pa.insurance_company_id = eic.id
- left join ptl_agreement_attribution as paa on paa.id = pa.id
- where (#{localDate} between start_date and end_date)
- and (paa.template_id is not null)
- and pa.id in (select distinct agreement_id
- from ptl_agreement_dept
- <if test="deptId != null and deptId != ''">
- where dept_id = #{deptId}
- </if>
- )
- order by pa.serial_number
- </select>
- </mapper>
|