ContractInfoMapper.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  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="org.springblade.manager.mapper.ContractInfoMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="contractInfoResultMap" type="org.springblade.manager.vo.ContractInfoVO">
  6. <result column="id" property="id"/>
  7. <result column="create_time" property="createTime"/>
  8. <result column="create_user" property="createUser"/>
  9. <result column="create_dept" property="createDept"/>
  10. <result column="update_user" property="updateUser"/>
  11. <result column="update_time" property="updateTime"/>
  12. <result column="status" property="status"/>
  13. <result column="is_deleted" property="isDeleted"/>
  14. <result column="contract_name" property="contractName"/>
  15. <result column="contract_type" property="contractType"/>
  16. <result column="p_id" property="pId"/>
  17. <result column="project_name" property="projectName"/>
  18. <result column="contract_number" property="contractNumber"/>
  19. <result column="contractor_unit_name" property="contractorUnitName"/>
  20. <result column="construction_unit_name" property="constructionUnitName"/>
  21. <result column="supervision_unit_name" property="supervisionUnitName"/>
  22. <result column="laboratory_name" property="laboratoryName"/>
  23. <result column="contractor_join_time" property="contractorJoinTime"/>
  24. <result column="plan_start_time" property="planStartTime"/>
  25. <result column="plan_end_time" property="planEndTime"/>
  26. <result column="actual_start_time" property="actualStartTime"/>
  27. <result column="actual_end_time" property="actualEndTime"/>
  28. <result column="start_file_url" property="startFileUrl"/>
  29. <result column="contract_amount" property="contractAmount"/>
  30. <result column="contract_amount" property="contractAmount"/>
  31. <result column="project_place" property="projectPlace"/>
  32. <result column="start_station" property="startStation"/>
  33. <result column="end_station" property="endStation"/>
  34. <result column="filer" property="filer"/>
  35. <result column="reviewer" property="reviewer"/>
  36. <result column="prefix" property="prefix"/>
  37. <result column="security_level" property="securityLevel"/>
  38. <result column="storage_period" property="storagePeriod"/>
  39. <result column="is_electronic_signature" property="isElectronicSignature"/>
  40. <result column="is_test_module" property="isTestModule"/>
  41. <result column="is_reference_number" property="isReferenceNumber"/>
  42. <result column="isTestRecord" property="is_test_record"/>
  43. </resultMap>
  44. <resultMap id="contractInfoResultMap1" type="org.springblade.manager.vo.ContractlnfoCountVO">
  45. <result column="contract_name" property="contractName"/>
  46. <result column="contract_counts" property="contractCounts"/>
  47. </resultMap>
  48. <resultMap id="treeNodeResultMap" type="org.springblade.manager.vo.TreeNodeVO">
  49. <id column="id" property="id"/>
  50. <result column="parent_id" property="parentId"/>
  51. <result column="title" property="title"/>
  52. <result column="value" property="value"/>
  53. <result column="key" property="key"/>
  54. <result column="has_children" property="hasChildren"/>
  55. <result column="type" property="type"/>
  56. <result column="primaryKeyId" property="primaryKeyId"/>
  57. <result column="wbsType" property="wbsType"/>
  58. <result column="partition_code" property="partitionCode"/>
  59. <result column="old_id" property="oldId"/>
  60. <result column="contractIdRelation" property="contractIdRelation"/>
  61. <result column="major_data_type" property="majorDataType"/>
  62. </resultMap>
  63. <resultMap id="treeNodeResultMap6" type="org.springblade.manager.vo.WbsTreeContractVO6">
  64. <id column="id" property="id"/>
  65. <result column="parentId" property="parentId"/>
  66. <result column="primaryKeyId" property="pKeyId"/>
  67. <result column="title" property="title"/>
  68. <result column="value" property="value"/>
  69. <result column="key" property="key"/>
  70. <result column="has_children" property="hasChildren"/>
  71. <result column="node_type" property="nodeType"/>
  72. <result column="major_data_type" property="majorDataType"/>
  73. <result column="old_id" property="oldId"/>
  74. <result column="sort" property="sort"/>
  75. </resultMap>
  76. <resultMap id="treeNodeResultMap2" type="org.springblade.manager.vo.WbsTreeContractVO">
  77. <id column="id" property="id"/>
  78. <result column="parentId" property="parentId"/>
  79. <result column="title" property="title"/>
  80. <result column="value" property="value"/>
  81. <result column="key" property="key"/>
  82. <result column="has_children" property="hasChildren"/>
  83. <result column="type" property="type"/>
  84. <result column="primaryKeyId" property="primaryKeyId"/>
  85. <result column="wbsType" property="wbsType"/>
  86. <result column="partition_code" property="partitionCode"/>
  87. <result column="old_id" property="oldId"/>
  88. <result column="nodeName" property="nodeName"/>
  89. <result column="fullName" property="fullName"/>
  90. <result column="contractId" property="contractId"/>
  91. <result column="isTestRecord" property="is_test_record"/>
  92. </resultMap>
  93. <resultMap id="resultMap2" type="org.springblade.manager.vo.ContractInfoVO">
  94. <id column="id" property="id"/>
  95. <collection property="idList" ofType="org.springblade.manager.vo.WbsTreeContractVO3">
  96. <id column="id" property="id"/>
  97. <result property="pkeyId" column="pkeyId"/>
  98. <result property="contractId" column="contractId"/>
  99. <result property="contractIdRelation" column="contractIdRelation"/>
  100. </collection>
  101. </resultMap>
  102. <insert id="insertContractRelationJLYZ">
  103. insert into m_contract_relation_jlyz (id, contract_id_jlyz, contract_id_sg)
  104. values (#{id}, #{contractId}, #{contractIdSG})
  105. </insert>
  106. <delete id="deleteContractRelationJLYZ">
  107. delete
  108. from m_contract_relation_jlyz
  109. where contract_id_jlyz = #{id}
  110. </delete>
  111. <select id="selectContractByProjectIds" resultMap="contractInfoResultMap">
  112. select id, p_id, contract_name, contract_number, contract_type from m_contract_info where is_deleted = 0 and
  113. p_id in
  114. <foreach collection="ids" item="pId" open="(" separator="," close=")">
  115. #{pId}
  116. </foreach>
  117. </select>
  118. <update id="updatePasswordByUserId">
  119. update blade_user
  120. set password = #{password}
  121. where id = #{userId}
  122. </update>
  123. <update id="deleteFile">
  124. update blade_attach
  125. set is_deleted = 1
  126. where link = #{url}
  127. and `status` = 1
  128. </update>
  129. <select id="selectContractInfoPage" resultMap="contractInfoResultMap">
  130. select c.*, p.project_name as project_name
  131. from m_contract_info c
  132. INNER JOIN m_project_info p on c.p_id = p.id
  133. where c.is_deleted = 0
  134. </select>
  135. <select id="selectContractInfoCount" resultMap="contractInfoResultMap1">
  136. select c.contract_name, count(*) as contract_counts
  137. from m_contract_info c
  138. where c.is_deleted = 0
  139. GROUP BY c.p_id
  140. </select>
  141. <select id="selectContractInfoPageByPid" resultMap="contractInfoResultMap">
  142. select c.*, p.project_name as project_name
  143. from m_contract_info c
  144. INNER JOIN m_project_info p on c.p_id = p.id
  145. where p.id = #{pid}
  146. and c.is_deleted = 0
  147. </select>
  148. <select id="findJobByRoleId" resultType="org.springblade.manager.vo.CRolePostVO">
  149. select p.id, p.post_name
  150. from blade_post p
  151. INNER JOIN m_role_post m ON p.id = m.p_id
  152. INNER JOIN blade_role r ON r.id = m.r_id
  153. WHERE p.is_deleted = 0
  154. and p.`status` = 1
  155. and r.id = #{id}
  156. </select>
  157. <select id="findAllUserByCondition" resultType="org.springblade.system.user.vo.UserVO2">
  158. SELECT
  159. u.id as uId,mpau.id,pi.project_name,ci.contract_name,u.id as uid,u.`name`,u.account,u.plaintext_password as
  160. "password",u.`phone`
  161. FROM
  162. blade_user u
  163. INNER JOIN m_project_assignment_user mpau ON u.id = mpau.user_id
  164. INNER JOIN m_contract_info ci ON ci.id = mpau.contract_id
  165. INNER JOIN m_project_info pi ON pi.id = mpau.project_id
  166. INNER JOIN blade_role r ON r.id = mpau.role_id
  167. WHERE mpau.is_deleted = 0 AND mpau.`status` = 1
  168. AND pi.id = #{Values.pId}
  169. <if test="Values.cId != null and Values.cId != '' ">
  170. AND ci.id = #{Values.cId}
  171. </if>
  172. <if test="Values.rId !=null and Values.rId !='' ">
  173. AND r.id = #{Values.rId}
  174. </if>
  175. </select>
  176. <select id="findUserListByCondition" resultType="org.springblade.system.user.vo.UserVO3">
  177. SELECT
  178. mpau.id,
  179. u.`name`,
  180. u.account,
  181. (select dict_value from blade_dict_biz where id = mpau.post_id) as postName,
  182. (select contract_name from m_contract_info where id = mpau.contract_id) as contractName,
  183. u.`password`,
  184. u.`phone`
  185. FROM
  186. blade_user u
  187. INNER JOIN m_project_assignment_user mpau ON u.id = mpau.user_id
  188. INNER JOIN m_project_info pi ON pi.id = mpau.project_id
  189. WHERE
  190. mpau.is_deleted = 0
  191. AND mpau.`status` = 1
  192. AND mpau.project_id = #{Values.pId}
  193. AND mpau.post_id = #{Values.rId}
  194. <if test="Values.cId != null and Values.cId != '' ">
  195. AND mpau.contract_id = #{Values.cId}
  196. </if>
  197. </select>
  198. <select id="findUserInfoByCondition" resultType="org.springblade.system.user.entity.User">
  199. SELECT `name`,`account`,`password` FROM blade_user
  200. WHERE is_deleted = 0 AND `status` = 1
  201. AND role_id = #{rId}
  202. AND post_id = #{pId}
  203. <if test=" userName != null and userName != '' ">
  204. AND `name` = #{userName}
  205. </if>
  206. </select>
  207. <select id="findUserList" resultType="org.springblade.system.user.entity.User">
  208. select `id`, `name`, account, `password`
  209. from blade_user
  210. WHERE is_deleted = 0
  211. and `status` = 1
  212. order by create_time
  213. </select>
  214. <select id="tree" resultMap="treeNodeResultMap">
  215. SELECT
  216. p_key_id AS primaryKeyId,
  217. wbs_type AS wbsType,
  218. id,
  219. parent_id,
  220. IFNULL(if(length(trim(full_name)) > 0, full_name, node_name),node_name) AS title,
  221. type AS "type",
  222. node_type AS nodeType,
  223. id AS "value",
  224. id AS "key",
  225. partition_code,
  226. old_id,
  227. major_data_type,
  228. sort
  229. FROM
  230. m_wbs_tree_contract
  231. WHERE
  232. is_deleted = 0
  233. AND STATUS = 1
  234. /* major_data_type = 5是日志类型,日志类型不需要直接在划分树上体现 */
  235. AND (major_data_type != 5 or major_data_type is null)
  236. AND type = 1
  237. <if test="wbsId!=null and wbsId!=''">
  238. and wbs_id = #{wbsId}
  239. </if>
  240. <if test="projectId !=null and projectId!=''">
  241. and project_id = #{projectId}
  242. </if>
  243. <if test="contractId!=null and contractId!=''">
  244. and contract_id = #{contractId}
  245. </if>
  246. <if test="wbsType != null and wbsType != ''">
  247. and wbs_type = #{wbsType}
  248. </if>
  249. <if test="parentId != null and parentId != ''">
  250. and parent_id = #{parentId}
  251. </if>
  252. ORDER BY sort
  253. </select>
  254. <select id="tree2" resultMap="treeNodeResultMap2">
  255. SELECT
  256. d.p_key_id AS "primaryKeyId",
  257. d.wbs_type AS "wbsType",
  258. d.id,
  259. d.parent_id AS "parentId",
  260. d.node_name AS title,
  261. d.node_name AS "nodeName",
  262. d.full_name AS "fullName",
  263. d.import_matching_info AS "importMatchingInfo",
  264. d.type AS "type",
  265. d.node_type AS "nodeType",
  266. d.id AS "value",
  267. d.id AS "key",
  268. partition_code,
  269. old_id,
  270. sort
  271. FROM m_wbs_tree_contract d
  272. WHERE
  273. d.is_deleted = 0
  274. AND d.status = 1
  275. AND d.type = 1
  276. <if test="wbsId!=null and wbsId!=''">
  277. and wbs_id = #{wbsId}
  278. </if>
  279. <if test="projectId !=null and projectId!=''">
  280. and project_id = #{projectId}
  281. </if>
  282. <if test="contractId!=null and contractId!=''">
  283. and contract_id = #{contractId}
  284. </if>
  285. /*不查询客户端新增或者复制的节点 old_id = null*/
  286. AND old_id is null
  287. ORDER BY d.sort
  288. </select>
  289. <select id="tree3" resultType="org.springblade.manager.vo.WbsTreeContractVO">
  290. SELECT
  291. d.p_key_id AS "primaryKeyId",
  292. d.wbs_type AS "wbsType",
  293. d.id,
  294. d.parent_id AS "parentId",
  295. IFNULL(if(length(trim(full_name)) > 0, full_name, node_name),node_name) AS title,
  296. d.node_name AS "nodeName",
  297. d.full_name AS "fullName",
  298. d.import_matching_info AS "importMatchingInfo",
  299. d.type AS "type",
  300. d.node_type AS "nodeType",
  301. d.id AS "value",
  302. d.id AS "key",
  303. partition_code,
  304. old_id,
  305. sort
  306. FROM m_wbs_tree_contract d
  307. WHERE
  308. d.is_deleted = 0
  309. AND d.status = 1
  310. AND d.type = 1
  311. <if test="wbsId!=null and wbsId!=''">
  312. and wbs_id = #{wbsId}
  313. </if>
  314. <if test="projectId !=null and projectId!=''">
  315. and project_id = #{projectId}
  316. </if>
  317. <if test="contractId!=null and contractId!=''">
  318. and contract_id = #{contractId}
  319. </if>
  320. <if test="wbsType != null and wbsType != ''">
  321. and wbs_type = #{wbsType}
  322. </if>
  323. <if test="parentId != null and parentId != ''">
  324. and parent_id = #{parentId}
  325. </if>
  326. /*改变划分节点,暂时未说明是否新增到新增、复制节点下,默认可以修改 old_id != null*/
  327. /*AND old_id is null*/
  328. ORDER BY d.sort
  329. </select>
  330. <select id="selectByCondition" resultMap="resultMap2">
  331. SELECT t.p_key_id AS "pKeyId",
  332. t.contract_id AS "contractId",
  333. t.contract_id_relation AS "contractIdRelation",
  334. c.*
  335. FROM m_contract_info c
  336. INNER JOIN m_wbs_tree_contract t ON c.id = t.contract_id
  337. WHERE c.id = #{contractInfo.id}
  338. AND t.parent_id = 0
  339. </select>
  340. <select id="selectLists" resultType="org.springblade.manager.vo.WbsTreeContractVO3">
  341. SELECT full_name AS "fullName",
  342. id AS "id",
  343. p_key_id AS "pKeyId",
  344. contract_id AS "contractId",
  345. contract_id_relation AS "contractIdRelation"
  346. FROM m_wbs_tree_contract
  347. WHERE contract_id = #{contractInfo.id}
  348. AND contract_type = #{contractType}
  349. AND parent_id = 0
  350. AND status = 1
  351. AND is_deleted = 0
  352. </select>
  353. <select id="selectByContractRelationJlyz" resultType="org.springblade.manager.entity.ContractRelationJlyz">
  354. SELECT contract_id_sg AS "id", contract_id_jlyz
  355. FROM m_contract_relation_jlyz
  356. WHERE contract_id_jlyz = #{id}
  357. </select>
  358. <select id="selectContractIdByProjectId" resultType="org.springblade.manager.entity.ContractInfo">
  359. SELECT id
  360. FROM m_contract_info
  361. WHERE p_id = #{project_id}
  362. AND contract_type = 1
  363. AND is_deleted = 0
  364. AND status =
  365. 1
  366. </select>
  367. <select id="getContractListByProjectId" resultType="org.springblade.manager.entity.ContractInfo">
  368. SELECT *
  369. FROM m_contract_info
  370. WHERE p_id = #{projectId}
  371. AND is_deleted = 0
  372. AND status = 1
  373. </select>
  374. <select id="tree4" resultType="org.springblade.manager.vo.WbsTreeContractVO">
  375. SELECT
  376. d.*
  377. /*,(select CASE WHEN count(1) > 0 THEN 1 ELSE 0 END from m_wbs_tree_contract c where c.parent_id = d.id and
  378. c.contract_id = d.contract_id and c.is_deleted = 0 ) AS "has_children"*/
  379. FROM m_wbs_tree_contract d
  380. WHERE
  381. d.is_deleted = 0
  382. AND d.status = 1
  383. AND d.type = 1
  384. <if test="contractId!=null and contractId!=''">
  385. AND contract_id = #{contractId}
  386. </if>
  387. <if test="parentId != null and parentId != ''">
  388. AND (FIND_IN_SET(#{parentId},ancestors) OR p_key_id = #{parentId})
  389. </if>
  390. ORDER BY d.create_time,d.sort
  391. </select>
  392. <select id="selectContractUserInfo" resultType="org.springblade.manager.entity.SaveUserInfoByProject">
  393. select *
  394. from m_project_assignment_user
  395. where contract_id = #{contractId}
  396. and is_deleted = 0
  397. and status = 1
  398. </select>
  399. <select id="userListByIds" resultType="org.springblade.system.user.vo.UserContractInfoVO">
  400. select id as userId,`name` as userName from blade_user where id in
  401. <foreach collection="ids" item="ids" index="ids" open="(" separator="," close=")">
  402. #{ids}
  403. </foreach>
  404. </select>
  405. <select id="tree5" resultType="org.springblade.manager.vo.WbsTreeContractTreeAllVO">
  406. SELECT d.p_key_id AS "primaryKeyId",
  407. d.id,
  408. d.parent_id AS "parentId",
  409. IFNULL(if(length(trim(full_name)) > 0, full_name, node_name), node_name) AS title,
  410. partition_code,
  411. node_type,
  412. sort,
  413. d.contract_id AS contractIdRelation,
  414. d.type,
  415. d.major_data_type AS majorDataType,
  416. d.create_time
  417. FROM m_wbs_tree_contract d
  418. WHERE contract_id = #{contractId}
  419. AND d.type = 1
  420. AND d.status = 1
  421. AND d.is_deleted = 0
  422. ORDER BY d.sort, title, d.create_time
  423. </select>
  424. <select id="tree6" resultMap="treeNodeResultMap6">
  425. SELECT
  426. d.p_key_id AS "primaryKeyId",
  427. d.id,
  428. d.parent_id AS "parentId",
  429. IFNULL(if(length(trim(full_name)) > 0, full_name, node_name),node_name) AS title,
  430. d.node_name AS "nodeName",
  431. d.full_name AS "fullName",
  432. d.node_type ,
  433. d.id AS "value",
  434. d.id AS "key",
  435. old_id,
  436. major_data_type,
  437. sort
  438. FROM m_wbs_tree_contract d
  439. WHERE
  440. d.is_deleted = 0
  441. AND d.status = 1
  442. AND d.type = 1
  443. <if test="wbsId!=null and wbsId!=''">
  444. and wbs_id = #{wbsId}
  445. </if>
  446. <if test="projectId !=null and projectId!=''">
  447. and project_id = #{projectId}
  448. </if>
  449. <if test="contractId!=null and contractId!=''">
  450. and contract_id = #{contractId}
  451. </if>
  452. ORDER BY d.sort, title, d.create_time
  453. </select>
  454. <select id="trialRelationTree" resultType="org.springblade.manager.vo.TrialRecordZJTreeVO">
  455. SELECT d.p_key_id AS "primaryKeyId",
  456. d.id AS id,
  457. IFNULL(if(length(trim(d.full_name)) > 0, d.full_name, d.node_name), d.node_name) AS fullName,
  458. d.parent_id AS "parentId"
  459. FROM m_wbs_tree_contract d
  460. WHERE d.is_deleted = 0
  461. AND d.status = 1
  462. AND d.type = 1
  463. AND wbs_type = 1
  464. AND project_id = #{projectId}
  465. AND contract_id = #{contractId}
  466. AND wbs_id = #{wbsId}
  467. ORDER BY d.sort, d.create_time
  468. </select>
  469. <select id="trialRelationTreeLazy" resultType="org.springblade.manager.vo.TrialRecordZJTreeLazyVO">
  470. SELECT d.p_key_id AS "primaryKeyId",
  471. d.node_type AS "nodeType",
  472. d.type AS "type",
  473. d.major_data_type AS "majorDataType",
  474. d.id AS id,
  475. IFNULL(if(length(trim(d.full_name)) > 0, d.full_name, d.node_name), d.node_name) AS fullName,
  476. d.parent_id AS "parentId",
  477. (select case when count(1) > 0 then 1 else 0 end
  478. from m_wbs_tree_contract
  479. where parent_id = d.id
  480. and is_deleted = 0
  481. and project_id = #{projectId}
  482. and contract_id = #{contractId}
  483. and wbs_id = #{wbsId}
  484. and type = 1
  485. ) AS "status"
  486. FROM m_wbs_tree_contract d
  487. WHERE d.is_deleted = 0
  488. AND d.status = 1
  489. AND d.type = 1
  490. AND wbs_type = 1
  491. AND project_id = #{projectId}
  492. AND contract_id = #{contractId}
  493. AND wbs_id = #{wbsId}
  494. AND parent_id = #{id}
  495. AND node_type in (1, 2, 3, 4, 5, 6)
  496. ORDER BY d.sort, d.create_time
  497. </select>
  498. <select id="getAllContractByType" resultType="org.springblade.manager.vo.WbsTreeContractVO2">
  499. select id as contractId,contract_name as contractName
  500. from m_contract_info where is_deleted = 0 and p_id = #{projectId}
  501. and contract_type = 1
  502. <if test="contractType == 3">
  503. union all
  504. select id as contractId,contract_name as contractName
  505. from m_contract_info where is_deleted = 0 and p_id = #{projectId}
  506. and contract_type = 2
  507. </if>
  508. </select>
  509. <select id="getContractInfoByContractId" resultType="org.springblade.manager.entity.ContractInfo">
  510. SELECT distinct * from m_contract_info where id in(SELECT contract_id_sg from m_contract_relation_jlyz where contract_id_jlyz=#{contractId}) or id=#{contractId}
  511. </select>
  512. <select id="findAllUserAndRoleList1" resultType="org.springblade.manager.vo.RoleSignPfxUserVO1">
  513. SELECT
  514. r.id as roleId,r.role_name as roleName FROM
  515. blade_role r
  516. INNER JOIN m_project_assignment_user mpau ON r.id = mpau.role_id
  517. INNER JOIN m_contract_info ci ON ci.id = mpau.contract_id
  518. WHERE mpau.is_deleted = 0 AND mpau.`status` = 1
  519. AND ci.id=#{contractId}
  520. <if test="roleId == null">
  521. And r.parent_id!=0
  522. </if>
  523. <if test="roleId!=null">
  524. And r.parent_id=#{roleId}
  525. </if>
  526. </select>
  527. <select id="findAllUserAndRoleList2" resultType="org.springblade.manager.vo.RoleSignPfxUserVO2">
  528. SELECT
  529. u.id as certificateUserId, u.`name` as certificateUserName
  530. FROM
  531. blade_user u
  532. INNER JOIN m_project_assignment_user mpau ON u.id = mpau.user_id
  533. INNER JOIN m_contract_info ci ON ci.id = mpau.contract_id
  534. INNER JOIN blade_role r ON r.id = mpau.role_id
  535. WHERE mpau.is_deleted = 0 AND mpau.`status` = 1
  536. AND ci.id=#{contractId}
  537. <if test="roleId != null">
  538. And r.id=#{roleId}
  539. </if>
  540. </select>
  541. </mapper>