CBiddingBasicInfoMapper.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.inkasso.factoring.biddingManagement.dao.CBiddingBasicInfoMapper">
  4. <resultMap id="BiddingBasicInfoResultVoResult"
  5. type="com.inkasso.factoring.biddingManagement.entity.vo.BiddingBasicInfoResultVo">
  6. <id column="id" jdbcType="BIGINT" property="id"/>
  7. <result column="business_number" property="businessNumber"/>
  8. <result column="project_name" property="projectName"/>
  9. <result column="enterprise" property="enterprise"/>
  10. <result column="main_enterprise" property="mainEnterprise"/>
  11. <result column="platform_name" property="platform"/>
  12. <result column="stage" property="stage"/>
  13. <result column="status" property="status"/>
  14. <result column="task_id" property="taskId" />
  15. </resultMap>
  16. <select id="findBySearch"
  17. resultType="com.inkasso.factoring.biddingManagement.entity.vo.BiddingBasicInfoResultVo"
  18. parameterType="com.inkasso.factoring.biddingManagement.entity.SearchBiddingBasic"
  19. resultMap="BiddingBasicInfoResultVoResult">
  20. SELECT
  21. c.id,
  22. t1.business_number,
  23. t1.project_name,
  24. t3.corporate_name AS main_enterprise,
  25. t5.corporate_name AS enterprise,
  26. t8.platform_name,
  27. c.stage,
  28. c.STATUS ,
  29. t7.historic_task_id task_id,
  30. t7.task_name
  31. FROM c_bidding_basic_info c
  32. LEFT JOIN c_project_information t1 ON t1.id = c.c_project_information_id
  33. LEFT JOIN c_supplier_info t2 ON t2.id = t1.c_supplier_info_id
  34. LEFT JOIN c_enterprise t3 ON t3.id = t2.c_enterprise_id
  35. LEFT JOIN c_project_core_enterprise t4 ON t4.c_project_information_id = t1.id
  36. LEFT JOIN c_enterprise t5 ON t5.id = t4.c_enterprise_id
  37. LEFT JOIN business_processing_log t6 ON t6.business_type = c.id
  38. LEFT JOIN trading_platform t8 ON t8.id = c.trading_platform_id
  39. LEFT JOIN ( SELECT m.* FROM (SELECT g.id, g.task_name, g.busness_key, g.business_type,g.historic_task_id
  40. FROM business_processing_log g where g.business_type = "BiddingBasicInfo" and g.end_time is null order by id desc limit 999999) m
  41. group BY m.busness_key ) t7 ON t7.busness_key = c.id
  42. <where>
  43. <if test="businessNumber != null and businessNumber !='' ">
  44. AND t1.business_number = #{businessNumber }
  45. </if>
  46. <if test="status != null and status !='' ">
  47. AND c.status = #{status}
  48. </if>
  49. <if test="fastSearch != null and fastSearch !='' ">
  50. AND (t1.project_name LIKE CONCAT('%',#{fastSearch},'%') or t3.corporate_name LIKE
  51. CONCAT('%',#{fastSearch},'%')
  52. or t5.corporate_name LIKE CONCAT('%',#{fastSearch},'%'))
  53. </if>
  54. AND t2.sys_user_id = #{userId}
  55. </where>
  56. ORDER BY c.gmt_modified DESC
  57. </select>
  58. <select id="getCreditProjectByBiddingId"
  59. resultType="com.inkasso.factoring.biddingManagement.entity.vo.BiddingBasicInfoResultVo">
  60. SELECT
  61. c.id,
  62. t1.business_number,
  63. t1.project_name,
  64. t3.corporate_name,
  65. t5.corporate_name AS main_enterprise,
  66. t8.platform_name AS platform_name,
  67. c.stage,
  68. c.status
  69. FROM c_bidding_basic_info c
  70. LEFT JOIN c_project_information t1 ON t1.id = c.c_project_information_id
  71. LEFT JOIN c_supplier_info t2 ON t2.id = t1.c_supplier_info_id
  72. LEFT JOIN c_enterprise t3 ON t3.id = t2.c_enterprise_id
  73. LEFT JOIN c_project_core_enterprise t4 ON t4.c_project_information_id = t1.id
  74. LEFT JOIN c_enterprise t5 ON t5.id = t4.c_enterprise_id
  75. LEFT JOIN trading_platform t8 ON t8.id = c.trading_platform_id
  76. WHERE c.id = #{value}
  77. </select>
  78. <select id="getBasicInfo"
  79. resultType="com.inkasso.factoring.creditmanagement.entity.vo.UserBiddingProjectsVo">
  80. SELECT c.id AS project_information_id,
  81. c.project_name,
  82. c.business_number,
  83. t2.corporate_name AS main_enterprise, -- 主企业
  84. t4.corporate_name AS enterprise -- 核心企业
  85. FROM c_project_information c
  86. LEFT JOIN c_bidding_basic_info m ON m.c_project_information_id = c.id
  87. LEFT JOIN c_supplier_info t1 ON t1.id = c.c_supplier_info_id
  88. LEFT JOIN c_enterprise t2 ON t2.id = t1.c_enterprise_id
  89. LEFT JOIN c_project_core_enterprise t3 ON t3.c_project_information_id = c.id
  90. LEFT JOIN c_enterprise t4 ON t4.id = t3.c_enterprise_id
  91. WHERE m.id = #{value}
  92. </select>
  93. </mapper>