PtlAgreementMapper.xml 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ydtech.modules.protocol.dao.PtlAgreementMapper">
  6. <resultMap id="BaseResultMap" type="com.ydtech.modules.protocol.entity.po.PtlAgreement">
  7. <id property="id" column="id" jdbcType="BIGINT"/>
  8. <result property="companiesType" column="companies_type" jdbcType="INTEGER"/>
  9. <result property="agreementType" column="agreement_type" jdbcType="VARCHAR"/>
  10. <result property="agreementCode" column="agreement_code" jdbcType="VARCHAR"/>
  11. <result property="agreementName" column="agreement_name" jdbcType="VARCHAR"/>
  12. <result property="agreementAbbreviation" column="agreement_abbreviation" jdbcType="VARCHAR"/>
  13. <result property="insuranceCompany" column="insurance_company" jdbcType="VARCHAR"/>
  14. <result property="insuranceCompanyId" column="insurance_company_id" jdbcType="VARCHAR"/>
  15. <result property="partnerCompaniesId" column="partner_companies_id" jdbcType="VARCHAR"/>
  16. <result property="associationCompaniesId" column="association_companies_id" jdbcType="VARCHAR"/>
  17. <result property="startDate" column="start_date" jdbcType="DATE"/>
  18. <result property="endDate" column="end_date" jdbcType="DATE"/>
  19. <result property="moneyTime" column="money_time" jdbcType="INTEGER"/>
  20. <result property="matchType" column="match_type" jdbcType="VARCHAR"/>
  21. <result property="dockingPerson" column="docking_person" jdbcType="VARCHAR"/>
  22. <result property="dockingPhone" column="docking_phone" jdbcType="VARCHAR"/>
  23. <result property="withTax" column="with_tax" jdbcType="VARCHAR"/>
  24. <result property="moneyType" column="money_type" jdbcType="VARCHAR"/>
  25. <result property="validStatus" column="valid_status" jdbcType="VARCHAR"/>
  26. <result property="fileId" column="file_id" jdbcType="VARCHAR"/>
  27. <result property="auditContent" column="audit_content" jdbcType="VARCHAR"/>
  28. <result property="auditStatus" column="audit_status" jdbcType="TINYINT"/>
  29. <result property="creator" column="creator" jdbcType="VARCHAR"/>
  30. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  31. <result property="modifiedBy" column="modified_by" jdbcType="VARCHAR"/>
  32. <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
  33. </resultMap>
  34. <resultMap id="AgreementCompanyResultMap" type="com.ydtech.modules.protocol.entity.dto.PtlAgreementInsCompanyDto">
  35. <id property="id" column="id" jdbcType="VARCHAR"/>
  36. <result property="name" column="name" jdbcType="VARCHAR"/>
  37. <result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
  38. <result property="namesimple" column="namesimple" jdbcType="VARCHAR"/>
  39. <result property="remark" column="remark" jdbcType="VARCHAR"/>
  40. <result property="orderNum" column="order_num" jdbcType="INTEGER"/>
  41. <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
  42. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  43. <result property="lastUpdateBy" column="last_update_by" jdbcType="VARCHAR"/>
  44. <result property="lastUpdateTime" column="last_update_time" jdbcType="TIMESTAMP"/>
  45. <result property="cnName" column="cn_name" jdbcType="VARCHAR"/>
  46. <result property="logo" column="logo" jdbcType="VARCHAR"/>
  47. <collection property="agreement" ofType="com.ydtech.modules.protocol.entity.dto.PtlAgreementDto">
  48. <id property="id" column="agreement_id"/>
  49. <result property="agreementName" column="agreement_name"/>
  50. <result property="agreementName" column="underwriting_description"/>
  51. <result property="apiType" column="api_type"/>
  52. </collection>
  53. </resultMap>
  54. <sql id="Base_Column_List">
  55. id,agreement_type,agreement_code,
  56. agreement_name,agreement_abbreviation,insurance_company,
  57. start_date,end_date,money_time,
  58. match_type,docking_person,docking_phone,
  59. with_tax,money_type,cooperation_channels,
  60. valid_status,file_id,audit_status,
  61. creator,create_time,modified_by,
  62. update_time
  63. </sql>
  64. <select id="getAgreementCompany" resultMap="AgreementCompanyResultMap">
  65. select eic.*, pa.id, pa.underwriting_description as agreement_id, pa.agreement_name, paa.api_type
  66. from esm_ins_company as eic
  67. left join ptl_agreement as pa on pa.insurance_company_id = eic.id
  68. left join ptl_agreement_attribution as paa on paa.id = pa.id
  69. where (#{localDate} between start_date and end_date)
  70. and (paa.template_id is not null)
  71. and pa.id in (select distinct agreement_id
  72. from ptl_agreement_dept
  73. where dept_id = #{deptId})
  74. order by pa.serial_number
  75. </select>
  76. </mapper>