PtlAgreementHistoryMapper.xml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.PtlAgreementHistoryMapper">
  6. <select id="pageHistory" resultType="HashMap">
  7. SELECT
  8. iah.id,
  9. iah.batch,
  10. iah.agreement_id,
  11. iah.companies_type,
  12. iah.agreement_type,
  13. iah.agreement_code,
  14. iah.agreement_name,
  15. iah.agreement_abbreviation,
  16. iah.partner_companies_id,
  17. iah.association_companies_id,
  18. iah.insurance_company,
  19. iah.insurance_company_id,
  20. iah.start_date,
  21. iah.end_date,
  22. iah.money_time,
  23. iah.match_type,
  24. iah.docking_person,
  25. iah.docking_phone,
  26. iah.with_tax,
  27. iah.money_type,
  28. iah.valid_status,
  29. iah.file_id,
  30. iah.audit_content,
  31. iah.audit_status,
  32. iah.serial_number,
  33. iah.creator,
  34. iah.create_time,
  35. iah.modified_by,
  36. iah.update_time,
  37. iah.underwriting_description,
  38. iah.is_tax_source,
  39. iah.operator_type,
  40. iah.operator,
  41. iah.operator_time,
  42. iaah.batch,
  43. iaah.ins_company_id,
  44. iaah.ins_company_name,
  45. iaah.template_id,
  46. iaah.api_type,
  47. iaah.fields,
  48. iaah.username,
  49. iaah.password,
  50. su.name
  51. FROM
  52. ptl_agreement_history iah
  53. LEFT JOIN ptl_agreement_attribution_history iaah ON iah.batch = iaah.batch
  54. LEFT JOIN sys_user su ON iah.operator = su.id
  55. WHERE
  56. iah.agreement_id = #{vo.agreementId}
  57. <if test="vo.operatorType != null and vo.operatorType != ''">
  58. AND iah.operator_type = #{vo.operatorType}
  59. </if>
  60. <if test="vo.operator != null and vo.operator != ''">
  61. AND su.name = #{vo.operator}
  62. </if>
  63. <if test="vo.operatorStartTime != null and vo.operatorStartTime != ''">
  64. AND DATE(iah.operator_time) between #{vo.operatorStartTime} AND #{vo.operatorEndTime}
  65. </if>
  66. </select>
  67. <select id="getCostHistoryDetail" resultType="com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsNewHistory">
  68. SELECT
  69. papcnh.*,
  70. su.name AS modifierName
  71. FROM
  72. ptl_agreement_product_costs_new_history AS papcnh
  73. JOIN
  74. sys_user AS su
  75. ON
  76. papcnh.modifier = su.id
  77. WHERE
  78. papcnh.agreement_id = #{agreementProductQueryVo.agreementId}
  79. <if test="agreementProductQueryVo.operatorType != null and agreementProductQueryVo.operatorType != ''">
  80. AND papcnh.operator_type = #{agreementProductQueryVo.operatorType}
  81. </if>
  82. <if test="agreementProductQueryVo.operator != null and agreementProductQueryVo.operator != ''">
  83. AND su.name = #{agreementProductQueryVo.operator}
  84. </if>
  85. <if test="agreementProductQueryVo.operatorStartTime != null and agreementProductQueryVo.operatorStartTime != ''">
  86. and DATE(papcnh.operator_time) &gt;= #{agreementProductQueryVo.operatorStartTime, jdbcType=DATE}
  87. </if>
  88. <if test="agreementProductQueryVo.operatorEndTime != null and agreementProductQueryVo.operatorEndTime != ''">
  89. and DATE(papcnh.operator_time) &lt;= #{agreementProductQueryVo.operatorEndTime, jdbcType=DATE}
  90. </if>
  91. </select>
  92. </mapper>