CProjectInformationMapper.xml 5.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.creditmanagement.dao.ProjectInformationMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.inkasso.factoring.creditmanagement.entity.ProjectInformation">
  6. <id column="id" property="id"/>
  7. <result column="c_supplier_info_id" property="cSupplierInfoId"/>
  8. <result column="business_number" property="businessNumber"/>
  9. <result column="project_type" property="projectType"/>
  10. <result column="project_name" property="projectName"/>
  11. <result column="c_enterprise_id" property="cEnterpriseId"/>
  12. <result column="company_for_project" property="companyForProject"/>
  13. <result column="project_address" property="projectAddress"/>
  14. <result column="project_cycle" property="projectCycle"/>
  15. <result column="project_nature" property="projectNature"/>
  16. <result column="project_nature_detail" property="projectNatureDetail"/>
  17. <result column="goods_category" property="goodsCategory"/>
  18. <result column="goods_category_detail" property="goodsCategoryDetail"/>
  19. <result column="purpose" property="purpose"/>
  20. <result column="financial_funds" property="financialFunds"/>
  21. <result column="bank_loans" property="bankLoans"/>
  22. <result column="foreign_capital" property="foreignCapital"/>
  23. <result column="raise_independently" property="raiseIndependently"/>
  24. <result column="special_fund" property="specialFund"/>
  25. <result column="other_funds" property="otherFunds"/>
  26. <result column="unknown" property="unknown"/>
  27. <result column="bidding" property="bidding"/>
  28. <result column="cooperation_amount" property="cooperationAmount"/>
  29. <result column="peak_value" property="peakValue"/>
  30. <result column="estimated_accounting_period" property="estimatedAccountingPeriod"/>
  31. <result column="high_peak_usage" property="highPeakUsage"/>
  32. <result column="status" property="status"/>
  33. <result column="user_create" property="userCreate"/>
  34. <result column="user_modified" property="userModified"/>
  35. <result column="gmt_create" property="gmtCreate"/>
  36. <result column="gmt_modified" property="gmtModified"/>
  37. </resultMap>
  38. <!-- 通用查询结果列 -->
  39. <sql id="Base_Column_List">
  40. id
  41. , c_supplier_info_id, business_number, project_type, project_name, c_enterprise_id, company_for_project, project_address, project_cycle, project_nature, project_nature_detail, goods_category, goods_category_detail, purpose, financial_funds, bank_loans, foreign_capital, raise_independently, special_fund, other_funds, unknown, bidding, cooperation_amount, peak_value, estimated_accounting_period, high_peak_usage, status, user_create, user_modified, gmt_create, gmt_modified
  42. </sql>
  43. <select id="getUserBiddingProjects"
  44. resultType="com.inkasso.factoring.creditmanagement.entity.vo.UserBiddingProjectsVo">
  45. SELECT c.id AS project_information_id,
  46. c.project_name,
  47. c.business_number,
  48. t2.corporate_name AS main_enterprise, -- 主企业
  49. t4.corporate_name AS enterprise -- 核心企业
  50. FROM c_project_information c
  51. LEFT JOIN c_supplier_info t1 ON t1.id = c.c_supplier_info_id
  52. LEFT JOIN c_enterprise t2 ON t2.id = t1.c_enterprise_id
  53. LEFT JOIN c_project_core_enterprise t3 ON t3.c_project_information_id = c.id
  54. LEFT JOIN c_enterprise t4 ON t4.id = t3.c_enterprise_id
  55. -- 需求变更 项目为准入时 支持发起 招投标流程
  56. -- LEFT JOIN credit_resolution t5 ON t5.c_project_information_id = c.id
  57. WHERE t1.sys_user_id = #{value}
  58. AND c.bidding = 1
  59. -- AND c.`status` = 'c_project_and_enterprise_status_4' -- 通过
  60. -- AND t5.`status` = 'project_init_completed'
  61. AND c.already_bidding = 0
  62. order by c.gmt_modified desc
  63. </select>
  64. <select id="getLocalPurchCompletedProject"
  65. resultType="com.inkasso.factoring.creditmanagement.entity.ProjectInformation">
  66. SELECT t2.*
  67. FROM c_purch_contract_management c
  68. LEFT JOIN c_project_information t2 ON t2.business_number = c.business_number
  69. LEFT JOIN c_supplier_info t3 ON t3.id = c.c_supplier_info_id
  70. WHERE c.contract_status = 'project_init_completed'
  71. AND t3.sys_user_id = #{userId}
  72. </select>
  73. <select id="getLocalCreditResolutionCompletedProject"
  74. resultType="com.inkasso.factoring.creditmanagement.entity.ProjectInformation">
  75. SELECT
  76. t1.*
  77. FROM
  78. c_project_information t1
  79. LEFT JOIN credit_resolution t2 ON t2.c_project_information_id = t1.id
  80. LEFT JOIN c_purch_contract_management t3 ON t1.business_number = t3.business_number
  81. LEFT JOIN c_supplier_info t4 ON t4.id = t3.c_supplier_info_id
  82. WHERE
  83. t2.`status` = 'project_init_completed'
  84. AND t3.contract_status = 'project_init_completed'
  85. AND t4.sys_user_id = #{userId}
  86. </select>
  87. </mapper>