InvestmentOpportunityMapper.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  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.ruoyi.invest.mapper.InvestmentOpportunityMapper">
  6. <resultMap type="TProjectPool" id="TProjectPoolResult">
  7. <result property="id" column="id" />
  8. <result property="procInstId" column="proc_inst_id" />
  9. <result property="projectName" column="project_name" />
  10. <result property="projectGroup" column="project_group" />
  11. <result property="recordDate" column="record_date" />
  12. <result property="projectCode" column="project_code" />
  13. <result property="channel" column="channel" />
  14. <result property="contactDate" column="contact_date" />
  15. <result property="projectDate" column="project_date" />
  16. <result property="decisionDate" column="decision_date" />
  17. <result property="industry" column="industry" />
  18. <result property="company" column="company" />
  19. <result property="description" column="description" />
  20. <result property="projectContacts" column="project_contacts" />
  21. <result property="investHead" column="invest_head" />
  22. <result property="previousFinancing" column="previous_financing" />
  23. <result property="financingStage" column="financing_stage" />
  24. <result property="financingCondition" column="financing_condition" />
  25. <result property="financingMoney" column="financing_money" />
  26. <result property="financingDate" column="financing_date" />
  27. <result property="investSparkle" column="invest_sparkle" />
  28. <result property="investValuation" column="invest_valuation" />
  29. <result property="investMoney" column="invest_money" />
  30. <result property="investType" column="invest_type" />
  31. <result property="investPloy" column="invest_ploy" />
  32. <result property="investWorth" column="invest_worth" />
  33. <result property="shareholding" column="shareholding" />
  34. <result property="projectStage" column="project_stage" />
  35. <result property="projectState" column="project_state" />
  36. <result property="mark" column="mark" />
  37. <result property="approvalFlag" column="approval_flag" />
  38. <result property="investigateFlag" column="investigate_flag" />
  39. <result property="decisionFlag" column="decision_flag" />
  40. <result property="delFlag" column="del_flag" />
  41. <result property="createBy" column="create_by" />
  42. <result property="createTime" column="create_time" />
  43. <result property="updateBy" column="update_by" />
  44. <result property="updateTime" column="update_time" />
  45. <result property="taskDefKey" column="taskDefKey"/>
  46. <association property="tProjectCompany" javaType="TProjectCompany" resultMap="TProjectCompanyResult" />
  47. <association property="tProjectContacts" javaType="TProjectContacts" resultMap="TProjectContactsResult" />
  48. <association property="tProjectChannel" javaType="TProjectChannel" resultMap="TProjectChannelResult" />
  49. <association property="tProjectReview" javaType="TProjectReview" resultMap="TProjectReviewResult" />
  50. </resultMap>
  51. <resultMap type="TProjectPoolVo" id="TProjectPoolVoResult">
  52. <result property="id" column="id" />
  53. <result property="procInstId" column="proc_inst_id" />
  54. <result property="projectName" column="project_name" />
  55. <result property="projectGroup" column="project_group" />
  56. <result property="recordDate" column="record_date" />
  57. <result property="projectCode" column="project_code" />
  58. <result property="channel" column="channel" />
  59. <result property="contactDate" column="contact_date" />
  60. <result property="projectDate" column="project_date" />
  61. <result property="decisionDate" column="decision_date" />
  62. <result property="industry" column="industry" />
  63. <result property="company" column="company" />
  64. <result property="description" column="description" />
  65. <result property="projectContacts" column="project_contacts" />
  66. <result property="investHead" column="invest_head" />
  67. <result property="previousFinancing" column="previous_financing" />
  68. <result property="financingStage" column="financing_stage" />
  69. <result property="financingCondition" column="financing_condition" />
  70. <result property="financingMoney" column="financing_money" />
  71. <result property="financingDate" column="financing_date" />
  72. <result property="investSparkle" column="invest_sparkle" />
  73. <result property="investValuation" column="invest_valuation" />
  74. <result property="investMoney" column="invest_money" />
  75. <result property="investType" column="invest_type" />
  76. <result property="investPloy" column="invest_ploy" />
  77. <result property="investWorth" column="invest_worth" />
  78. <result property="shareholding" column="shareholding" />
  79. <result property="projectStage" column="project_stage" />
  80. <result property="projectState" column="project_state" />
  81. <result property="mark" column="mark" />
  82. <result property="approvalFlag" column="approval_flag" />
  83. <result property="investigateFlag" column="investigate_flag" />
  84. <result property="decisionFlag" column="decision_flag" />
  85. <result property="delFlag" column="del_flag" />
  86. <result property="createBy" column="create_by" />
  87. <result property="createTime" column="create_time" />
  88. <result property="updateBy" column="update_by" />
  89. <result property="updateTime" column="update_time" />
  90. <result property="status" column="status" />
  91. <result property="taskName" column="taskName"/>
  92. <result property="taskId" column="taskId"/>
  93. <result property="taskCreateTiem" column="taskCreateTiem"/>
  94. <result property="assignee" column="assignee"/>
  95. <result property="assigneeName" column="assigneeName"/>
  96. <result property="taskDefKey" column="taskDefKey"/>
  97. <result property="procDefId" column="procDefId"/>
  98. <result property="procInsId" column="procInsId"/>
  99. <result property="startUserId" column="startUserId"/>
  100. <result property="startUserName" column="startUserName"/>
  101. <result property="startDeptName" column="startDeptName"/>
  102. <result property="executionId" column="executionId"/>
  103. <result property="deployId" column="deployId"/>
  104. <association property="tProjectCompany" javaType="TProjectCompany" resultMap="TProjectCompanyResult" />
  105. <association property="tProjectContacts" javaType="TProjectContacts" resultMap="TProjectContactsResult" />
  106. <association property="tProjectChannel" javaType="TProjectChannel" resultMap="TProjectChannelResult" />
  107. <association property="tProjectReview" javaType="TProjectReview" resultMap="TProjectReviewResult" />
  108. </resultMap>
  109. <resultMap type="TProjectCompany" id="TProjectCompanyResult">
  110. <result property="companyId" column="companyId" />
  111. <result property="companyName" column="company_name" />
  112. <result property="projectPoolId" column="project_pool_id" />
  113. <result property="companyCode" column="company_code" />
  114. <result property="filingTime" column="filing_time" />
  115. <result property="startTime" column="start_time" />
  116. <result property="endTime" column="end_time" />
  117. <result property="registeredCapital" column="registered_capital" />
  118. <result property="registeredAddress" column="registered_address" />
  119. <result property="paidCapital" column="paid_capital" />
  120. <result property="businessAddress" column="business_address" />
  121. <result property="actualBod" column="actual_bod" />
  122. <result property="phone" column="phone" />
  123. <result property="type" column="type" />
  124. </resultMap>
  125. <resultMap type="TProjectContacts" id="TProjectContactsResult">
  126. <result property="id" column="id" />
  127. <result property="name" column="name" />
  128. <result property="position" column="position" />
  129. <result property="contact" column="contact" />
  130. </resultMap>
  131. <resultMap type="TProjectChannel" id="TProjectChannelResult">
  132. <result property="channelName" column="channel_name" />
  133. <result property="channelCode" column="channel_code" />
  134. <result property="channelType" column="channel_type" />
  135. <result property="channelGroup" column="channel_group" />
  136. <result property="channelBlurb" column="channel_blurb" />
  137. <result property="contacts" column="contacts" />
  138. <result property="telephone" column="telephone" />
  139. <result property="address" column="address" />
  140. <result property="channelHead" column="channel_head" />
  141. </resultMap>
  142. <resultMap type="TProjectReview" id="TProjectReviewResult">
  143. <!--<result property="id" column="id" />-->
  144. <result property="reviewId" column="reviewId" />
  145. <result property="context" column="context" />
  146. <result property="reviewPerson" column="review_person" />
  147. <result property="reviewPersonId" column="review_person_id" />
  148. </resultMap>
  149. <sql id="selectTProjectPoolVo">
  150. select a.id,a.proc_inst_id,a.project_name, d.channel_group project_group, a.record_date, a.project_code, a.channel, a.contact_date, a.project_date, a.decision_date, a.industry, a.company, a.description, a.project_contacts, a.invest_head, a.previous_financing, a.financing_stage, a.financing_condition, a.financing_money, a.financing_date, a.invest_sparkle, a.invest_valuation, a.invest_money, a.invest_type, a.invest_ploy, a.invest_worth, a.shareholding, a.project_stage, a.project_state, a.mark, a.approval_flag, a.investigate_flag, a.decision_flag, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time,
  151. b.id companyId, b.company_name, b.project_pool_id, b.filing_time, b.company_code, b.start_time, b.end_time, b.registered_capital, b.registered_address, b.paid_capital, b.business_address, b.actual_bod, b.phone, b.type,
  152. c.id, c.name, c.position, c.contact,
  153. d.channel_name, d.channel_code, d.channel_type, d.channel_group, d.channel_blurb, d.contacts, d.telephone, d.address, d.channel_head
  154. from t_project_pool a
  155. left join t_project_company b ON a.id = b.project_pool_id
  156. left join t_project_contacts c ON a.project_contacts = c.id
  157. left join t_project_channel d ON a.channel = d.id
  158. </sql>
  159. <sql id="selectTProjectPoolReviewVo">
  160. select a.id,a.proc_inst_id, a.project_name, d.channel_group project_group, a.record_date, a.project_code, a.channel, a.contact_date, a.project_date, a.decision_date, a.industry, a.company, a.description, a.project_contacts, a.invest_head, a.previous_financing, a.financing_stage, a.financing_condition, a.financing_money, a.financing_date, a.invest_sparkle, a.invest_valuation, a.invest_money, a.invest_type, a.invest_ploy, a.invest_worth, a.shareholding, a.project_stage, a.project_state, a.mark, a.approval_flag, a.investigate_flag, a.decision_flag, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time,
  161. b.id companyId, b.company_name, b.project_pool_id, b.filing_time, b.company_code, b.start_time, b.end_time, b.registered_capital, b.registered_address, b.paid_capital, b.business_address, b.actual_bod, b.phone, b.type,
  162. c.id, c.name, c.position, c.contact,
  163. d.channel_name, d.channel_code, d.channel_type, d.channel_group, d.channel_blurb, d.contacts, d.telephone, d.address, d.channel_head,
  164. r.id, r.context, r.review_person, r.review_person_id
  165. from t_project_pool a
  166. left join t_project_company b ON a.id = b.project_pool_id
  167. left join t_project_contacts c ON a.project_contacts = c.id
  168. left join t_project_channel d ON a.channel = d.id
  169. left join t_project_review r ON a.id = r.project_pool_id AND r.review_person_id = #{createBy}
  170. </sql>
  171. <!--<sql id="selectTProjectPoolFlowableVo">
  172. select a.id,a.proc_inst_id,a.project_name, d.channel_group project_group, a.record_date, a.project_code, a.channel, a.contact_date, a.project_date, a.decision_date, a.industry, a.company, a.description, a.project_contacts, a.invest_head, a.previous_financing, a.financing_stage, a.financing_condition, a.financing_money, a.financing_date, a.invest_sparkle, a.invest_valuation, a.invest_money, a.invest_type, a.invest_ploy, a.invest_worth, a.shareholding, a.project_stage, a.project_state, a.mark, a.approval_flag, a.investigate_flag, a.decision_flag, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time,
  173. b.id companyId, b.company_name, b.project_pool_id, b.filing_time, b.company_code, b.start_time, b.end_time, b.registered_capital, b.registered_address, b.paid_capital, b.business_address, b.actual_bod, b.phone, b.type,
  174. c.id, c.name, c.position, c.contact,
  175. d.channel_name, d.channel_code, d.channel_type, d.channel_group, d.channel_blurb, d.contacts, d.telephone, d.address, d.channel_head
  176. from t_project_pool a
  177. left join t_project_company b ON a.id = b.project_pool_id
  178. left join t_project_contacts c ON a.project_contacts = c.id
  179. left join t_project_channel d ON a.channel = d.id
  180. </sql>-->
  181. <sql id="where_sql">
  182. <if test="projectPool.projectName != null and projectPool.projectName != ''"> and a.project_name like concat('%', #{projectPool.projectName}, '%')</if>
  183. <if test="projectPool.projectGroup != null and projectPool.projectGroup != ''"> and a.project_group = #{projectPool.projectGroup}</if>
  184. <if test="projectPool.projectCode != null and projectPool.projectCode != ''"> and a.project_code = #{projectPool.projectCode}</if>
  185. <if test="projectPool.channel != null and projectPool.channel != ''"> and a.channel = #{projectPool.channel}</if>
  186. <if test="projectPool.contactDate != null "> and a.contact_date = #{projectPool.contactDate}</if>
  187. <if test="projectPool.projectDate != null "> and a.project_date = #{projectPool.projectDate}</if>
  188. <if test="projectPool.decisionDate != null "> and a.decision_date = #{projectPool.decisionDate}</if>
  189. <if test="projectPool.industry != null and projectPool.industry != ''"> and a.industry = #{projectPool.industry}</if>
  190. <if test="projectPool.company != null and projectPool.company != ''"> and b.company_name like concat('%', #{projectPool.company}, '%')</if>
  191. <if test="projectPool.projectContacts != null and projectPool.projectContacts != ''"> and c.name like concat('%', #{projectPool.projectContacts}, '%')</if>
  192. <if test="projectPool.investHead != null and projectPool.investHead != ''"> and a.invest_head like concat('%', #{projectPool.investHead}, '%')</if>
  193. <if test="projectPool.previousFinancing != null and projectPool.previousFinancing != ''"> and a.previous_financing = #{projectPool.previousFinancing}</if>
  194. <if test="projectPool.financingStage != null and projectPool.financingStage != ''"> and a.financing_stage = #{projectPool.financingStage}</if>
  195. <if test="projectPool.financingMoney != null and projectPool.financingMoney != ''"> and a.financing_money = #{projectPool.financingMoney}</if>
  196. <if test="projectPool.financingDate != null "> and a.financing_date = #{projectPool.financingDate}</if>
  197. <if test="projectPool.investValuation != null and projectPool.investValuation != ''"> and a.invest_valuation = #{projectPool.investValuation}</if>
  198. <if test="projectPool.investMoney != null and projectPool.investMoney != ''"> and a.invest_money = #{projectPool.investMoney}</if>
  199. <if test="projectPool.investType != null and projectPool.investType != ''"> and a.invest_type = #{projectPool.investType}</if>
  200. <if test="projectPool.investPloy != null and projectPool.investPloy != ''"> and a.invest_ploy = #{projectPool.investPloy}</if>
  201. <if test="projectPool.investWorth != null and projectPool.investWorth != ''"> and a.invest_worth = #{projectPool.investWorth}</if>
  202. <if test="projectPool.projectStage != null and projectPool.projectStage != ''"> and a.project_stage = #{projectPool.projectStage}</if>
  203. <if test="projectPool.projectState != null and projectPool.projectState != ''"> and a.project_state = #{projectPool.projectState}</if>
  204. <if test="projectPool.delFlag != null and projectPool.delFlag != ''"> and a.del_flag = #{projectPool.delFlag}</if>
  205. </sql>
  206. <select id="selectTProjectList" parameterType="TProjectPool" resultMap="TProjectPoolResult">
  207. <include refid="selectTProjectPoolVo"/>
  208. <where>
  209. a.project_state != '1'
  210. <if test="projectName != null and projectName != ''"> and a.project_name like concat('%', #{projectName}, '%')</if>
  211. <if test="projectGroup != null and projectGroup != ''"> and a.project_group = #{projectGroup}</if>
  212. <if test="projectCode != null and projectCode != ''"> and a.project_code = #{projectCode}</if>
  213. <if test="channel != null and channel != ''"> and a.channel = #{channel}</if>
  214. <if test="contactDate != null "> and a.contact_date = #{contactDate}</if>
  215. <if test="projectDate != null "> and a.project_date = #{projectDate}</if>
  216. <if test="decisionDate != null "> and a.decision_date = #{decisionDate}</if>
  217. <if test="industry != null and industry != ''"> and a.industry = #{industry}</if>
  218. <if test="company != null and company != ''"> and b.company_name like concat('%', #{company}, '%')</if>
  219. <if test="projectContacts != null and projectContacts != ''"> and c.name like concat('%', #{projectContacts}, '%')</if>
  220. <if test="investHead != null and investHead != ''"> and a.invest_head like concat('%', #{investHead}, '%')</if>
  221. <if test="previousFinancing != null and previousFinancing != ''"> and a.previous_financing = #{previousFinancing}</if>
  222. <if test="financingStage != null and financingStage != ''"> and a.financing_stage = #{financingStage}</if>
  223. <if test="financingMoney != null and financingMoney != ''"> and a.financing_money = #{financingMoney}</if>
  224. <if test="financingDate != null "> and a.financing_date = #{financingDate}</if>
  225. <if test="investValuation != null and investValuation != ''"> and a.invest_valuation = #{investValuation}</if>
  226. <if test="investMoney != null and investMoney != ''"> and a.invest_money = #{investMoney}</if>
  227. <if test="investType != null and investType != ''"> and a.invest_type = #{investType}</if>
  228. <if test="investPloy != null and investPloy != ''"> and a.invest_ploy = #{investPloy}</if>
  229. <if test="investWorth != null and investWorth != ''"> and a.invest_worth = #{investWorth}</if>
  230. <if test="projectStage != null and projectStage != ''"> and a.project_stage = #{projectStage}</if>
  231. <if test="projectState != null and projectState != ''"> and a.project_state = #{projectState}</if>
  232. <if test="delFlag != null and delFlag != ''"> and a.del_flag = #{delFlag}</if>
  233. </where>
  234. </select>
  235. <select id="getMyTaskList" resultMap="TProjectPoolVoResult">
  236. select a.id,a.proc_inst_id,a.project_name, d.channel_group project_group, a.record_date, a.project_code, a.channel, a.contact_date, a.project_date, a.decision_date, a.industry, a.company, a.description, a.project_contacts,
  237. a.invest_head, a.previous_financing, a.financing_stage, a.financing_condition, a.financing_money, a.financing_date, a.invest_sparkle, a.invest_valuation, a.invest_money, a.invest_type, a.invest_ploy, a.invest_worth, a.shareholding,
  238. a.project_stage, a.project_state, a.mark, a.approval_flag, a.investigate_flag, a.decision_flag, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.status,
  239. b.id companyId, b.company_name, b.project_pool_id, b.filing_time, b.company_code, b.start_time, b.end_time, b.registered_capital, b.registered_address, b.paid_capital, b.business_address, b.actual_bod, b.phone, b.type,
  240. c.id, c.name, c.position, c.contact,
  241. d.channel_name, d.channel_code, d.channel_type, d.channel_group, d.channel_blurb, d.contacts, d.telephone, d.address, d.channel_head,
  242. p.PROC_INST_ID_ as 'procInsId',
  243. p.PROC_DEF_ID_ as 'procDefId',
  244. date_format(p.START_TIME_, '%Y-%m-%d %H:%i:%s') as 'applyTime',
  245. date_format(p.END_TIME_, '%Y-%m-%d %H:%i:%s') as 'endTime',
  246. p.START_USER_ID_ AS 'startUserId',
  247. uu.nick_name AS 'startUserName',
  248. dd.dept_name AS 'startDeptName',
  249. t.NAME_ as 'taskName',
  250. t.TASK_DEF_KEY_ as 'taskDefKey',
  251. DATE_FORMAT(t.CREATE_TIME_ ,'%Y-%m-%d %H:%i') as 'taskCreateTiem',
  252. t.ASSIGNEE_ AS 'assignee',
  253. ui.nick_name AS 'assigneeName',
  254. t.ID_ as 'taskId',
  255. t.EXECUTION_ID_ AS 'executionId',
  256. rp.DEPLOYMENT_ID_ AS 'deployId'
  257. from t_project_pool a
  258. left join t_project_company b ON a.id = b.project_pool_id
  259. left join t_project_contacts c ON a.project_contacts = c.id
  260. left join t_project_channel d ON a.channel = d.id
  261. left join ACT_HI_PROCINST p on a.proc_inst_id = p.PROC_INST_ID_
  262. LEFT JOIN (SELECT * FROM sys_user LIMIT 100000) uu ON p.START_USER_ID_ = uu.user_id
  263. LEFT JOIN (SELECT * FROM sys_dept LIMIT 100000) dd ON uu.dept_id = dd.dept_id
  264. left join ACT_RU_TASK t on a.proc_inst_id = t.PROC_INST_ID_
  265. left join (select * from sys_user limit 100000) ui on t.ASSIGNEE_ = ui.user_id
  266. left join ACT_RU_IDENTITYLINK ru on ru.TASK_ID_ = t.ID_
  267. left join ACT_ID_MEMBERSHIP m on m.GROUP_ID_ = ru.GROUP_ID_ and m.USER_ID_ = #{userId}
  268. LEFT JOIN act_re_procdef rp ON t.PROC_DEF_ID_ = rp.ID_
  269. where
  270. (t.ASSIGNEE_ = #{userId}
  271. or (t.ASSIGNEE_ is null AND ru.TYPE_ = 'candidate'
  272. AND (ru.USER_ID_ = #{userId}
  273. OR ru.GROUP_ID_ IN (
  274. select g.ID_ from ACT_ID_GROUP g, ACT_ID_MEMBERSHIP membership where g.ID_ = membership.GROUP_ID_ AND
  275. membership.USER_ID_ = #{userId} )
  276. )
  277. )
  278. )
  279. and a.del_flag="0"
  280. <include refid="where_sql"></include>
  281. </select>
  282. <select id="getMyDoneTaskList" resultMap="TProjectPoolVoResult">
  283. select a.id,a.proc_inst_id,a.project_name, d.channel_group project_group, a.record_date, a.project_code, a.channel, a.contact_date, a.project_date, a.decision_date, a.industry, a.company, a.description, a.project_contacts,
  284. a.invest_head, a.previous_financing, a.financing_stage, a.financing_condition, a.financing_money, a.financing_date, a.invest_sparkle, a.invest_valuation, a.invest_money, a.invest_type, a.invest_ploy, a.invest_worth, a.shareholding,
  285. a.project_stage, a.project_state, a.mark, a.approval_flag, a.investigate_flag, a.decision_flag, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.status,
  286. b.id companyId, b.company_name, b.project_pool_id, b.filing_time, b.company_code, b.start_time, b.end_time, b.registered_capital, b.registered_address, b.paid_capital, b.business_address, b.actual_bod, b.phone, b.type,
  287. c.id contactId, c.name, c.position, c.contact,
  288. d.channel_name, d.channel_code, d.channel_type, d.channel_group, d.channel_blurb, d.contacts, d.telephone, d.address, d.channel_head,
  289. p.PROC_INST_ID_ as 'procInsId',
  290. p.PROC_DEF_ID_ as 'procDefId',
  291. date_format(p.START_TIME_, '%Y-%m-%d %H:%i:%s') as 'applyTime',
  292. date_format(p.END_TIME_, '%Y-%m-%d %H:%i:%s') as 'endTime',
  293. p.START_USER_ID_ AS 'startUserId',
  294. uu.nick_name AS 'startUserName',
  295. dd.dept_name AS 'startDeptName',
  296. ht.ID_ AS 'taskId',
  297. ht.NAME_ AS 'taskName',
  298. ht.ASSIGNEE_ AS 'assignee',
  299. ui.nick_name AS 'assigneeName',
  300. rp.DEPLOYMENT_ID_ AS 'deployId'
  301. from t_project_pool a
  302. left join t_project_company b ON a.id = b.project_pool_id
  303. left join t_project_contacts c ON a.project_contacts = c.id
  304. left join t_project_channel d ON a.channel = d.id
  305. left join ACT_HI_TASKINST ht on a.proc_inst_id = ht.PROC_INST_ID_
  306. left join ACT_HI_PROCINST p on a.proc_inst_id = p.PROC_INST_ID_
  307. LEFT JOIN (SELECT * FROM sys_user LIMIT 100000) uu ON p.START_USER_ID_ = uu.user_id
  308. LEFT JOIN (SELECT * FROM sys_dept LIMIT 100000) dd ON uu.dept_id = dd.dept_id
  309. left join (select * from sys_user limit 100000) ui on ht.ASSIGNEE_ = ui.user_id
  310. left join ACT_RU_TASK t on a.proc_inst_id = t.PROC_INST_ID_
  311. left join act_re_procdef rp ON t.PROC_DEF_ID_ = rp.ID_
  312. where
  313. ht.ASSIGNEE_ = #{userId}
  314. AND ht.END_TIME_ IS NOT NULL
  315. and a.del_flag="0"
  316. <include refid="where_sql"></include>
  317. GROUP BY a.id
  318. ORDER BY ht.END_TIME_ DESC;
  319. </select>
  320. <select id="getMyList" resultMap="TProjectPoolVoResult">
  321. select a.id,a.proc_inst_id,a.project_name, d.channel_group project_group, a.record_date, a.project_code, a.channel, a.contact_date, a.project_date, a.decision_date, a.industry, a.company, a.description, a.project_contacts,
  322. a.invest_head, a.previous_financing, a.financing_stage, a.financing_condition, a.financing_money, a.financing_date, a.invest_sparkle, a.invest_valuation, a.invest_money, a.invest_type, a.invest_ploy, a.invest_worth, a.shareholding,
  323. a.project_stage, a.project_state, a.mark, a.approval_flag, a.investigate_flag, a.decision_flag, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.status,
  324. b.id companyId, b.company_name, b.project_pool_id, b.filing_time, b.company_code, b.start_time, b.end_time, b.registered_capital, b.registered_address, b.paid_capital, b.business_address, b.actual_bod, b.phone, b.type,
  325. c.id contactId, c.name, c.position, c.contact,
  326. d.channel_name, d.channel_code, d.channel_type, d.channel_group, d.channel_blurb, d.contacts, d.telephone, d.address, d.channel_head,
  327. u.nick_name as 'applyUserName',
  328. p.PROC_INST_ID_ as 'procInsId',
  329. p.PROC_DEF_ID_ as 'procDefId',
  330. date_format(p.START_TIME_, '%Y-%m-%d %H:%i:%s') as 'applyTime',
  331. date_format(p.END_TIME_, '%Y-%m-%d %H:%i:%s') as 'endTime',
  332. p.START_USER_ID_ AS 'startUserId',
  333. uu.nick_name AS 'startUserName',
  334. dd.dept_name AS 'startDeptName',
  335. t.NAME_ as 'taskName',
  336. t.TASK_DEF_KEY_ as 'taskDefKey',
  337. DATE_FORMAT(t.CREATE_TIME_ ,'%Y-%m-%d %H:%i') as 'taskCreateTiem',
  338. t.ASSIGNEE_ as 'assignee',
  339. GROUP_CONCAT(DISTINCT ui.nick_name SEPARATOR '\r\n') as 'assigneeName',
  340. t.ID_ as 'taskId',
  341. t.EXECUTION_ID_ AS 'executionId',
  342. rp.DEPLOYMENT_ID_ AS 'deployId'
  343. from t_project_pool a
  344. left join t_project_company b ON a.id = b.project_pool_id
  345. left join t_project_contacts c ON a.project_contacts = c.id
  346. left join t_project_channel d ON a.channel = d.id
  347. left join ACT_HI_PROCINST p on a.proc_inst_id = p.PROC_INST_ID_
  348. LEFT JOIN (SELECT * FROM sys_user LIMIT 100000) uu ON p.START_USER_ID_ = uu.user_id
  349. LEFT JOIN (SELECT * FROM sys_dept LIMIT 100000) dd ON uu.dept_id = dd.dept_id
  350. left join sys_user u on a.create_by = u.user_id
  351. left join ACT_RU_TASK t on a.proc_inst_id = t.PROC_INST_ID_
  352. left join (select * from sys_user limit 100000) ui on t.ASSIGNEE_ = ui.user_id
  353. left join ACT_RU_IDENTITYLINK ru on ru.TASK_ID_ = t.ID_
  354. left join ACT_ID_MEMBERSHIP m on m.GROUP_ID_ = ru.GROUP_ID_ and m.USER_ID_ = #{userId}
  355. left join act_re_procdef rp ON t.PROC_DEF_ID_ = rp.ID_
  356. where a.create_by = #{userId} and a.proc_inst_id is not null and a.proc_inst_id != ''
  357. and a.del_flag="0"
  358. <include refid="where_sql"></include>
  359. GROUP BY a.id
  360. </select>
  361. <!--<select id="selectTProjectPoolById" parameterType="String" resultMap="TProjectPoolResult">
  362. <include refid="selectTProjectPoolVo"/>
  363. where a.id = #{id}
  364. </select>-->
  365. <select id="selectTProjectPoolByProcInstId" parameterType="java.lang.String" resultMap="TProjectPoolResult">
  366. select a.id,a.proc_inst_id,a.project_name, d.channel_group project_group, a.record_date, a.project_code, a.channel, a.contact_date, a.project_date, a.decision_date, a.industry, a.company, a.description, a.project_contacts, a.invest_head, a.previous_financing, a.financing_stage, a.financing_condition, a.financing_money, a.financing_date, a.invest_sparkle, a.invest_valuation, a.invest_money, a.invest_type, a.invest_ploy, a.invest_worth, a.shareholding, a.project_stage, a.project_state, a.mark, a.approval_flag, a.investigate_flag, a.decision_flag, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time,
  367. b.id companyId, b.company_name, b.project_pool_id, b.filing_time, b.company_code, b.start_time, b.end_time, b.registered_capital, b.registered_address, b.paid_capital, b.business_address, b.actual_bod, b.phone, b.type,
  368. c.id contactId, c.name, c.position, c.contact,
  369. d.channel_name, d.channel_code, d.channel_type, d.channel_group, d.channel_blurb, d.contacts, d.telephone, d.address, d.channel_head,
  370. r.id reviewId, r.context, r.review_person, r.review_person_id,
  371. t.TASK_DEF_KEY_ as 'taskDefKey'
  372. from t_project_pool a
  373. left join t_project_company b ON a.id = b.project_pool_id
  374. left join t_project_contacts c ON a.project_contacts = c.id
  375. left join t_project_channel d ON a.channel = d.id
  376. left join t_project_review r ON a.id = r.project_pool_id
  377. left join ACT_RU_TASK t on a.proc_inst_id = t.PROC_INST_ID_
  378. left join (select * from sys_user limit 100000) ui on t.ASSIGNEE_ = ui.user_id
  379. left join sys_user u on a.create_by = u.user_id
  380. where a.proc_inst_id = #{procInstId,jdbcType=VARCHAR}
  381. GROUP BY a.id
  382. </select>
  383. </mapper>