You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

555 lines
24 KiB

1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
12 months ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  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.spring.modules.request.mapper.RequestManageMapper">
  4. <select id="getRequestMainData" parameterType="com.spring.modules.request.vo.PlmRequestHeaderVo" resultType="com.spring.modules.request.vo.PlmRequestHeaderVo">
  5. SELECT
  6. a.site,
  7. a.bu,
  8. d.bu_desc,
  9. a.classification_no,
  10. a.classification_name,
  11. a.menu_id,
  12. c.name,
  13. a.workflow_id,
  14. b.workflowname,
  15. a.status,
  16. (case when a.status = 'Y' then '启用' else '停用' end) statusDesc,
  17. a.remark,
  18. a.create_by,
  19. a.create_date,
  20. a.update_by,
  21. a.update_date
  22. FROM plm_request_header a
  23. LEFT JOIN [VIEW_Process_management_OA_PLM] b ON a.workflow_id = b.workflowid
  24. LEFT JOIN sys_menu c ON a.menu_id = c.menu_id
  25. LEFT JOIN BU d ON a.site = d.site AND a.bu = d.bu_no
  26. <where>
  27. <if test = "query.site != null and query.site != ''">
  28. AND a.site like #{query.site}
  29. </if>
  30. <if test = "query.name != null and query.name != ''">
  31. AND c.name like #{query.name}
  32. </if>
  33. <if test = "query.status != null and query.status != ''">
  34. AND a.status = #{query.status}
  35. </if>
  36. <if test = "query.workflowId != null and query.workflowId != ''">
  37. AND a.workflow_id like #{query.workflowId}
  38. </if>
  39. <if test = "query.workflowname != null and query.workflowname != ''">
  40. AND b.workflowname like #{query.workflowname}
  41. </if>
  42. <if test = "query.classificationNo != null and query.classificationNo != ''">
  43. AND a.workflow_id like #{query.classificationNo}
  44. </if>
  45. </where>
  46. group by a.site, a.bu, d.bu_desc, a.classification_no, a.classification_name, a.menu_id, c.name, a.workflow_id,
  47. b.workflowname, a.status, a.remark, a.create_by, a.create_date, a.update_by, a.update_date
  48. </select>
  49. <select id="getRequestMainDataByList" parameterType="com.spring.modules.request.vo.PlmRequestHeaderVo" resultType="com.spring.modules.request.vo.PlmRequestHeaderVo">
  50. SELECT
  51. a.site,
  52. a.bu,
  53. d.bu_desc,
  54. a.classification_no,
  55. a.classification_name,
  56. a.menu_id,
  57. c.name,
  58. a.workflow_id,
  59. b.workflowname,
  60. a.status,
  61. (case when a.status = 'Y' then '启用' else '停用' end) statusDesc,
  62. a.remark,
  63. a.create_by,
  64. a.create_date,
  65. a.update_by,
  66. a.update_date
  67. FROM plm_request_header a
  68. LEFT JOIN [VIEW_Process_management_OA_PLM] b ON a.workflow_id = b.workflowid
  69. LEFT JOIN sys_menu c ON a.site = c.site AND a.menu_id = c.menu_id
  70. LEFT JOIN BU d ON a.site = d.site AND a.bu = d.bu_no
  71. <where>
  72. <if test = "query.site != null and query.site != ''">
  73. AND a.site like #{query.site}
  74. </if>
  75. <if test = "query.name != null and query.name != ''">
  76. AND c.name like #{query.name}
  77. </if>
  78. <if test = "query.workflowId != null and query.workflowId != ''">
  79. AND a.workflow_id like #{query.workflowId}
  80. </if>
  81. <if test = "query.classificationNo != null and query.classificationNo != ''">
  82. AND a.classification_no like #{query.classificationNo}
  83. </if>
  84. </where>
  85. group by a.site, a.bu, d.bu_desc, a.classification_no, a.classification_name, a.menu_id, c.name, a.workflow_id,
  86. b.workflowname, a.status, a.remark, a.create_by, a.create_date, a.update_by, a.update_date
  87. </select>
  88. <insert id="saveRequestHeader">
  89. INSERT INTO plm_request_header (site,bu,classification_no,classification_name,workflow_id,menu_id,status,create_date,create_by,remark)
  90. values(#{site},#{bu},#{classificationNo},#{classificationName},#{workflowId},#{menuId},#{status},#{createDate},#{createBy},#{remark})
  91. </insert>
  92. <update id="updateRequestHeader" parameterType="com.spring.modules.request.vo.PlmRequestHeaderVo">
  93. update plm_request_header
  94. set classification_name = #{classificationName},
  95. workflow_id = #{workflowId},
  96. menu_id = #{menuId},
  97. status = #{status},
  98. remark = #{remark},
  99. update_date = GETDATE(),
  100. update_by = #{updateBy}
  101. where classification_no = #{classificationNo}
  102. </update>
  103. <delete id="deleteRequestHeader">
  104. delete from plm_request_header
  105. where site = #{data.site} and classification_no = #{data.classificationNo}
  106. </delete>
  107. <delete id="deleteRequestNode">
  108. delete from plm_request_node
  109. where site = #{data.site} and classification_no = #{data.classificationNo}
  110. </delete>
  111. <delete id="deleteRequestNodeDetail">
  112. delete from plm_request_node_detail
  113. where site = #{data.site} and classification_no = #{data.classificationNo}
  114. </delete>
  115. <delete id="deleteRequestNodeAuthority">
  116. delete from plm_request_node_authority
  117. where site = #{data.site} and classification_no = #{data.classificationNo}
  118. </delete>
  119. <insert id="saveRequestNodeDetail">
  120. INSERT INTO plm_request_node_detail (site, bu, classification_no, node_id, node_name,
  121. create_date, create_by, remark, plm_field, oa_field, field_value,
  122. order_ref1, order_ref2, order_ref3, order_ref4, field_desc, workflow_id, plm_table, field_type, review)
  123. values
  124. <foreach item="data" index="index" collection="list" separator=",">
  125. (#{data.site}, #{data.bu},#{data.classificationNo},#{data.nodeId},#{data.nodeName},
  126. GETDATE(),#{data.createBy},#{data.remark},#{data.plmField},#{data.oaField},#{data.fieldValue}
  127. ,#{data.orderRef1},#{data.orderRef2},#{data.orderRef3},#{data.orderRef4},#{data.fieldDesc},#{data.workflowId}, #{data.plmTable}, #{data.fieldType}, #{data.review})
  128. </foreach>
  129. </insert>
  130. <delete id="deleteRequestNodeDetailByLine">
  131. delete from plm_request_node_detail
  132. where site = #{site} and workflow_id = #{workflowId}
  133. and node_id = #{nodeId}
  134. and classification_no = #{classificationNo}
  135. </delete>
  136. <select id="getRequestNodeData" resultType="com.spring.modules.request.vo.PlmRequestDetailVo">
  137. SELECT
  138. a.nodeid nodeId,
  139. a.nodename nodeName,
  140. a.nodeorder seqNo
  141. FROM VIEW_Process_management_OA_PLM a
  142. <where>
  143. <if test = "workflowId != null and workflowId != ''">
  144. AND a.workflowid like #{workflowId}
  145. </if>
  146. order by a.nodeorder
  147. </where>
  148. </select>
  149. <insert id="saveRequestNode">
  150. INSERT INTO plm_request_node (site,bu,classification_no,node_id,node_name,node_type,create_date,create_by,remark,workflow_id, seq_no, step_id, is_reject)
  151. values
  152. <foreach item="data" index="index" collection="list" separator=",">
  153. (#{data.site}, #{data.bu},#{data.classificationNo},#{data.nodeId},#{data.nodeName},#{data.nodeType},#{data.createDate}
  154. ,#{data.createBy},#{data.remark},#{data.workflowId},#{data.seqNo}, #{data.stepId}, 'Y')
  155. </foreach>
  156. </insert>
  157. <select id="getNodeInfoByWorkflow" parameterType="com.spring.modules.request.vo.PlmRequestDetailVo" resultType="com.spring.modules.request.vo.PlmRequestDetailVo">
  158. SELECT
  159. a.site,
  160. a.classification_no,
  161. a.workflow_id,
  162. c.workflowname,
  163. a.node_id,
  164. a.node_name,
  165. a.node_type,
  166. a.seq_no,
  167. a.is_reject,
  168. case when a.is_reject = 'Y' then '是' when a.is_reject = 'N' then '否' else '' end as isRejectDesc,
  169. a.countersignature_item
  170. FROM plm_request_node a
  171. LEFT JOIN plm_request_header b ON a.site = b.site and a.classification_no = b.classification_no and a.workflow_id = b.workflow_id
  172. LEFT JOIN VIEW_Process_management_OA_PLM c ON a.workflow_id = c.workflowid
  173. <where>
  174. <if test = "query.site != null and query.site != ''">
  175. AND a.site like #{query.site}
  176. </if>
  177. <if test = "query.classificationNo != null and query.classificationNo != ''">
  178. AND a.classification_no like #{query.classificationNo}
  179. </if>
  180. <if test = "query.workflowId != null and query.workflowId != ''">
  181. AND a.workflow_id like #{query.workflowId}
  182. </if>
  183. </where>
  184. group by a.site, a.classification_no, a.workflow_id, c.workflowname, a.node_id, a.node_name, a.node_type, a.seq_no, a.is_reject, a.countersignature_item
  185. order by a.seq_no
  186. </select>
  187. <select id="getNodeDetail" parameterType="com.spring.modules.request.vo.PlmRequestDetailVo" resultType="com.spring.modules.request.vo.PlmRequestDetailVo">
  188. select
  189. site,
  190. bu,
  191. classification_no,
  192. node_id,
  193. node_name,
  194. create_date,
  195. create_by,
  196. update_date,
  197. update_by,
  198. remark,
  199. plm_field,
  200. oa_field,
  201. field_value,
  202. field_desc,
  203. workflow_id,
  204. order_ref1,
  205. order_ref2,
  206. order_ref3,
  207. order_ref4,
  208. plm_table,
  209. field_type,
  210. review
  211. from
  212. plm_request_node_detail
  213. <where>
  214. <if test = "query.site != null and query.site != ''">
  215. AND site like #{query.site}
  216. </if>
  217. <if test = "query.classificationNo != null and query.classificationNo != ''">
  218. AND classification_no like #{query.classificationNo}
  219. </if>
  220. <if test = "query.workflowId != null and query.workflowId != ''">
  221. AND workflow_id like #{query.workflowId}
  222. </if>
  223. <if test = "query.nodeId != null and query.nodeId != ''">
  224. AND node_id like #{query.nodeId}
  225. </if>
  226. </where>
  227. </select>
  228. <select id="getTableList" parameterType="com.spring.modules.request.vo.TableDataVo" resultType="TableData">
  229. SELECT name as tableId
  230. FROM sys.tables where (name like #{data.tableType} + '%'
  231. <if test = "data.addTable != null and data.addTable.size() > 0">
  232. or name in (
  233. <foreach collection="data.addTable" item="item1" separator=",">
  234. #{item1}
  235. </foreach>
  236. )
  237. </if>
  238. )
  239. <if test = "data.passTable != null and data.passTable.size() > 0">
  240. AND name not in (
  241. <foreach collection="data.passTable" item="item2" separator=",">
  242. #{item2}
  243. </foreach>
  244. )
  245. </if>
  246. </select>
  247. <!-- <select id="getFieldList" parameterType="TableData" resultType="PlmFieldData">-->
  248. <!-- SELECT-->
  249. <!-- CONVERT(varchar(50), c.COLUMN_NAME) as fieldId,-->
  250. <!-- CONVERT(varchar(50), ep.value) as fieldName-->
  251. <!-- FROM INFORMATION_SCHEMA.COLUMNS c-->
  252. <!-- LEFT JOIN sys.extended_properties ep ON ep.major_id = OBJECT_ID(c.TABLE_SCHEMA + '.' + c.TABLE_NAME) AND ep.minor_id = c.ORDINAL_POSITION AND ep.name = 'MS_Description'-->
  253. <!-- WHERE c.TABLE_NAME = #{tableId} and CONVERT(varchar(50), ep.value) is not null and CONVERT(varchar(50), ep.value) <![CDATA[<>]]> ''-->
  254. <!-- </select>-->
  255. <select id="getFieldList" parameterType="TableData" resultType="PlmFieldData">
  256. SELECT
  257. col.name AS fieldId,
  258. case
  259. when tbl.name = 'plm_rohs' and col.name = 'valid_until_value' then '有效期数值/Valid Until Value'
  260. when tbl.name = 'plm_rohs' and col.name = 'valid_until' then '有效期单位/Valid Until Unit'
  261. else CONVERT(varchar(50), comm.value)
  262. end AS fieldName
  263. FROM
  264. sys.columns AS col
  265. INNER JOIN sys.tables AS tbl ON col.object_id = tbl.object_id
  266. INNER JOIN sys.schemas AS scm ON tbl.schema_id = scm.schema_id
  267. INNER JOIN sys.types AS typ ON col.user_type_id = typ.user_type_id
  268. LEFT JOIN sys.extended_properties AS comm ON comm.major_id = col.object_id AND comm.minor_id = col.column_id AND comm.name = N'MS_Description'
  269. WHERE
  270. tbl.name = #{tableId}
  271. and (
  272. (CONVERT(varchar(50), comm.value) is not null and CONVERT(varchar(50), comm.value) <![CDATA[<>]]> '')
  273. or (tbl.name = 'plm_rohs' and col.name in ('valid_until_value', 'valid_until'))
  274. )
  275. ORDER BY col.column_id
  276. </select>
  277. <select id="getAuthorityFieldList" parameterType="TableData" resultType="PlmFieldData">
  278. select
  279. a.fieldId,
  280. a.fieldName,
  281. isnull(b.update_flag,'N') updateFlag,
  282. #{tableId} as tableId,
  283. b.required
  284. from (SELECT
  285. col.name AS fieldId,
  286. case
  287. when tbl.name = 'plm_rohs' and col.name = 'valid_until_value' then '有效期数值/Valid Until Value'
  288. when tbl.name = 'plm_rohs' and col.name = 'valid_until' then '有效期单位/Valid Until Unit'
  289. else CONVERT(varchar(50), comm.value)
  290. end AS fieldName
  291. FROM
  292. sys.columns AS col
  293. INNER JOIN sys.tables AS tbl ON col.object_id = tbl.object_id
  294. INNER JOIN sys.schemas AS scm ON tbl.schema_id = scm.schema_id
  295. INNER JOIN sys.types AS typ ON col.user_type_id = typ.user_type_id
  296. LEFT JOIN sys.extended_properties AS comm ON comm.major_id = col.object_id AND comm.minor_id = col.column_id AND comm.name = N'MS_Description'
  297. WHERE
  298. tbl.name = #{tableId}) as a
  299. left join plm_request_node_authority as b on a.fieldId = b.field_id and b.site = #{site} and b.classification_no = #{classificationNo} and b.node_id = #{nodeId} and b.table_id = #{tableId}
  300. where a.fieldName is not null and a.fieldName <![CDATA[<>]]> ''
  301. </select>
  302. <delete id="deleteNodeAuthority" parameterType="TableData">
  303. delete from plm_request_node_authority
  304. where site = #{site} and bu = #{bu} and classification_no = #{classificationNo} and node_id = #{nodeId} and table_id = #{tableId}
  305. </delete>
  306. <insert id="saveNodeAuthority">
  307. INSERT INTO plm_request_node_authority
  308. (site, bu, classification_no, node_id, node_name, field_id, update_flag, create_date, create_by, table_id, required)
  309. values
  310. <foreach item="data" index="index" collection="list" separator=",">
  311. (#{data.site}, #{data.bu}, #{data.classificationNo}, #{data.nodeId}, #{data.nodeName}, #{data.fieldId}, #{data.updateFlag}, getDate(), #{data.createBy}, #{data.tableId}, #{data.required})
  312. </foreach>
  313. </insert>
  314. <update id="editNodeInfo" parameterType="com.spring.modules.request.vo.PlmRequestDetailVo">
  315. update plm_request_node
  316. set is_reject = #{isReject},
  317. update_date = GETDATE(),
  318. update_by = #{updateBy},
  319. countersignature_item = #{countersignatureItem}
  320. where classification_no = #{classificationNo} and site = #{site} and node_id = #{nodeId}
  321. </update>
  322. <select id="getProcessControlList" resultType="PlmProcessControllBaseData">
  323. select
  324. role_id,
  325. workflow_id,
  326. remark,
  327. #{nodeId} as node_id,
  328. #{site} as site
  329. from plm_process_controll_base
  330. where workflow_id = #{workflowId}
  331. </select>
  332. <select id="getProcessSelect" resultType="PlmProcessControllBaseData">
  333. select
  334. a.site,
  335. a.workflow_id,
  336. a.node_id,
  337. a.role_id,
  338. b.remark
  339. from plm_process_controll_value a
  340. left join plm_process_controll_base b on a.role_id = b.role_id and a.workflow_id = b.workflow_id
  341. where b.remark is not null
  342. and a.site = #{site} and a.workflow_id = #{workflowId} and a.node_id = #{nodeId}
  343. </select>
  344. <delete id="deleteProcessControlList">
  345. delete from plm_process_controll_value where site=#{site} and workflow_id=#{workflowId} and node_id=#{nodeId}
  346. </delete>
  347. <insert id="saveProcessControlList">
  348. insert into plm_process_controll_value(site,workflow_id,node_id,role_id)
  349. values (#{site},#{workflowId},#{nodeId},#{roleId})
  350. </insert>
  351. <update id="updateBMStage">
  352. update plm_technical_specification_sheet
  353. set stage = 'Mass Production'
  354. where site = #{site} and code_no = #{orderNo}
  355. </update>
  356. <select id="getBomAndRouteFromBM" resultType="PlmTechnicalSpecificationSheetData">
  357. select
  358. a.site,
  359. a.bom_type,
  360. a.eng_chg_level,
  361. a.bom_alternative_no,
  362. a.routing_type,
  363. a.routing_revision,
  364. a.routing_alternative_no,
  365. b.final_part_no
  366. from plm_technical_specification_sheet a
  367. left join plm_project_part b on a.site = b.site and a.test_part_no = b.test_part_no and a.project_id = b.project_id
  368. where a.site = #{site} and a.code_no = #{codeNo}
  369. </select>
  370. <select id="checkBomOfficialFlag" resultType="com.spring.modules.part.vo.BomDetailVo">
  371. select site from plm_bom_detail where site=#{site} and part_no=#{finalPartNo} and bom_type=#{bomType}
  372. and alternative_no=#{bomAlternativeNo} and eng_chg_level=#{engChgLevel,jdbcType=INTEGER}
  373. </select>
  374. <select id="checkRoutingOfficialFlag" resultType="com.spring.modules.part.vo.RoutingDetailVo">
  375. select site from plm_routing_detail where site=#{site} and part_no=#{finalPartNo} and routing_type=#{routingType}
  376. and alternative_no=#{routingAlternativeNo} and routing_revision=#{routingRevision,jdbcType=INTEGER}
  377. </select>
  378. <select id="getProcessFlowInformation" parameterType="com.spring.modules.change.vo.ProcessFormVo" resultType="com.spring.modules.change.vo.ProcessFormVo">
  379. SELECT
  380. a.site,
  381. a.bu,
  382. a.request_id,
  383. a.workflow_id,
  384. b.workflowname as workflowName,
  385. a.node_id,
  386. b.nodename as nodeName,
  387. a.domain_control_account,
  388. d.username as updateBy,
  389. a.document_no,
  390. dbo.get_display_no(a.site, a.document_no, a.document_type) as displayNo,
  391. a.document_type,
  392. a.seq_no,
  393. a.reject_flag,
  394. a.reject_node_id,
  395. a.node_conclusion,
  396. a.submit_date,
  397. a.submitted_by,
  398. a.create_date,
  399. a.create_by,
  400. a.update_date,
  401. a.id,
  402. a.is_remark,
  403. a.classification_no,
  404. a.step_id,
  405. a.menu_id,
  406. a.reject_opinion,
  407. dbo.get_document_status(a.site, a.document_no, a.document_type) as documentStatus,
  408. dbo.get_revision_no(a.site, a.document_no, a.document_type) as revisionNo
  409. FROM plm_process_form as a
  410. LEFT JOIN [VIEW_Process_management_OA_PLM] as b ON a.workflow_id = b.workflowid AND a.node_id = b.nodeid
  411. LEFT JOIN sys_user as d ON a.domain_control_account = d.domain_control_account
  412. <where>
  413. a.site = #{query.site} and a.is_remark = 0 and isnull(a.process_intervention_flag, ' ') <![CDATA[<>]]> 'Y'
  414. <if test = "query.documentNo != null and query.documentNo != ''">
  415. AND a.document_no like #{query.documentNo}
  416. </if>
  417. <if test = "query.workflowId != null and query.workflowId != ''">
  418. AND a.workflow_id like #{query.workflowId}
  419. </if>
  420. <if test = "query.workflowName != null and query.workflowName != ''">
  421. AND b.workflowname like #{query.workflowName}
  422. </if>
  423. <if test = "query.nodeId != null and query.nodeId != ''">
  424. AND a.node_id like #{query.nodeId}
  425. </if>
  426. <if test = "query.nodeName != null and query.nodeName != ''">
  427. AND b.nodename like #{query.nodeName}
  428. </if>
  429. <if test = "query.createBy != null and query.createBy != ''">
  430. AND a.create_by like #{query.createBy}
  431. </if>
  432. <if test = "query.updateBy != null and query.updateBy != ''">
  433. AND d.username like #{query.updateBy}
  434. </if>
  435. <if test = "query.documentStatus != null and query.documentStatus != ''">
  436. and dbo.get_document_status(a.site, a.document_no, a.document_type) = #{query.documentStatus}
  437. </if>
  438. </where>
  439. </select>
  440. <update id="updateProcessInterventionFlag" parameterType="com.spring.modules.change.vo.ProcessFormVo">
  441. update plm_process_form
  442. set process_intervention_flag = #{processInterventionFlag}
  443. where site = #{site} and document_no = #{documentNo} and request_id = #{requestId} and node_id = #{nodeId} and is_remark = 0
  444. </update>
  445. <update id="updateProcessInterventionFlag2" parameterType="com.spring.modules.change.vo.ProcessFormVo">
  446. update plm_process_form
  447. set process_intervention_flag = #{processInterventionFlag},
  448. is_remark = 1
  449. where site = #{site} and document_no = #{documentNo} and request_id = #{requestId} and node_id = #{nodeId} and is_remark = 0
  450. </update>
  451. <select id="getThePreviousProcessInfo" resultType="com.spring.modules.change.vo.ProcessFormVo">
  452. <!-- 2025-06-17 同一个流程有多个路线 导致不能按照顺序取stepId -->
  453. WITH OrderedData AS (
  454. SELECT site, bu, node_id, id, is_remark, step_id,
  455. ROW_NUMBER() OVER (ORDER BY id DESC) AS rn,
  456. LAG(step_id) OVER (ORDER BY id DESC) AS prev_step_id,
  457. update_by
  458. FROM plm_process_form
  459. WHERE site = #{site} AND document_no = #{documentNo} and ISNULL(process_intervention_flag ,' ') <![CDATA[<>]]> 'Y'
  460. ),
  461. Filtered AS (
  462. SELECT *
  463. FROM OrderedData
  464. WHERE step_id != prev_step_id OR prev_step_id IS NULL
  465. )
  466. SELECT site, bu, node_id, id, is_remark, step_id, update_by
  467. FROM Filtered
  468. ORDER BY rn OFFSET 1 ROW FETCH NEXT 1 ROW ONLY
  469. <!-- select-->
  470. <!-- site,-->
  471. <!-- bu,-->
  472. <!-- node_id,-->
  473. <!-- id,-->
  474. <!-- is_remark-->
  475. <!-- from plm_process_form-->
  476. <!-- where site = #{site} and bu = #{bu} and document_no = #{documentNo} and step_id = #{stepId} and ISNULL(process_intervention_flag ,' ') <![CDATA[<>]]> 'Y'-->
  477. </select>
  478. <update id="updateIsRemarkToZero">
  479. update plm_process_form
  480. set is_remark = 0
  481. where id = #{id}
  482. </update>
  483. <select id="getProcessSelect2" resultType="com.spring.modules.base.entity.PlmProcessControllBaseData">
  484. select
  485. a.site,
  486. a.workflow_id,
  487. a.node_id,
  488. a.role_id,
  489. b.remark
  490. from plm_process_controll_value a
  491. left join plm_process_controll_base b on a.role_id = b.role_id and a.workflow_id = b.workflow_id
  492. where b.remark is not null
  493. and a.site = #{site} and a.workflow_id = #{workflowId} and a.node_id = #{nodeId} and a.role_id = #{roleId}
  494. </select>
  495. <select id="getProcessFlowInformation2" resultType="com.spring.modules.change.vo.ProcessFormVo">
  496. EXEC dbo.get_process_form_infor #{site}, #{workflowId}, #{documentNo}, #{workflowName}, #{nodeId}, #{nodeName}, #{createBy}, #{updateBy}, #{documentType}, #{documentStatus}, #{page}, #{limit}
  497. </select>
  498. <update id="updateProcessNodeByIntervention1">
  499. update plm_process_form
  500. set node_conclusion = #{nodeConclusion2}
  501. where site = #{site} and document_no = #{documentNo} and is_remark = #{isRemark} and node_conclusion = #{nodeConclusion1}
  502. </update>
  503. <update id="updateProcessNodeByIntervention2">
  504. update plm_process_form
  505. set node_conclusion = #{nodeConclusion2},
  506. update_date = getDate(),
  507. update_by = #{userName}
  508. where site = #{site} and document_no = #{documentNo} and is_remark = #{isRemark} and (node_conclusion = #{nodeConclusion1} or node_conclusion = '')
  509. </update>
  510. <select id="getStepIdFromProcessForm" resultType="com.spring.modules.change.vo.ProcessFormVo">
  511. select
  512. step_id
  513. from plm_process_form
  514. where site = #{site} and document_no = #{documentNo} and is_remark = #{isRemark}
  515. </select>
  516. </mapper>