CProjectInformationMapper.xml 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. </mapper>