ProjectReportDataDao.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  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.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao">
  4. <sql id="projectReportDataColumns">
  5. a.id AS "id",
  6. a.create_by AS "createBy.id",
  7. a.create_date AS "createDate",
  8. a.update_by AS "updateBy.id",
  9. a.update_date AS "updateDate",
  10. a.remarks AS "remarks",
  11. a.del_flag AS "delFlag",
  12. a.company_id AS "companyId",
  13. a.office_id AS "officeId",
  14. a.project_id AS "project.id",
  15. a.name AS "name",
  16. a.number AS "number",
  17. a.type AS "type",
  18. a.achievement_type AS "achievementType",
  19. a.review_standard AS "reviewStandard",
  20. a.sign_cost_one AS "signCostOne.id",
  21. a.sign_cost_two AS "signCostTwo.id",
  22. a.master AS "master.id",
  23. a.report_date AS "reportDate",
  24. a.file_status AS "fileStatus",
  25. a.status AS "status",
  26. a.invalid_status AS "invalidStatus",
  27. a.report_type AS "reportType",
  28. a.process_instance_id AS "processInstanceId",
  29. a.invalid_process_instance_id AS "invalidProcessInstanceId",
  30. m.name AS "master.name",
  31. a.number_path as "numberPath",
  32. a.update_process_instance_id as "upId",
  33. a.review_fee AS "reviewFee",
  34. a.approval_fee AS "approvalFee",
  35. a.contract_fee AS "contractFee",
  36. a.verify_fee AS "verifyFee",
  37. a.verify_rate AS "verifyRate",
  38. a.consult_fee AS "consultFee",
  39. a.building_fee AS "buildingFee",
  40. a.install_fee AS "installFee"
  41. </sql>
  42. <sql id="projectReportDataJoins">
  43. LEFT JOIN sys_user m ON m.id = a.master
  44. </sql>
  45. <select id="get" resultType="ProjectReportData" >
  46. SELECT
  47. <include refid="projectReportDataColumns"/>
  48. FROM project_report_data a
  49. <include refid="projectReportDataJoins"/>
  50. WHERE a.id = #{id}
  51. </select>
  52. <select id="findByNum" resultType="ProjectReportData" >
  53. SELECT
  54. <include refid="projectReportDataColumns"/>
  55. FROM project_report_data a
  56. <include refid="projectReportDataJoins"/>
  57. WHERE a.number = #{number}
  58. </select>
  59. <select id="getNoInvalid" resultType="ProjectReportData" >
  60. SELECT
  61. a.id AS "id",
  62. a.create_by AS "createBy.id",
  63. a.create_date AS "createDate",
  64. a.update_by AS "updateBy.id",
  65. a.update_date AS "updateDate",
  66. a.remarks AS "remarks",
  67. a.del_flag AS "delFlag",
  68. a.company_id AS "companyId",
  69. a.office_id AS "officeId",
  70. a.project_id AS "project.id",
  71. a.name AS "name",
  72. a.number AS "number",
  73. a.type AS "type",
  74. a.achievement_type AS "achievementType",
  75. a.review_standard AS "reviewStandard",
  76. a.sign_cost_one AS "signCostOne.id",
  77. a.sign_cost_two AS "signCostTwo.id",
  78. a.master AS "master.id",
  79. a.report_date AS "reportDate",
  80. a.file_status AS "fileStatus",
  81. a.status AS "status",
  82. a.report_type AS "reportType",
  83. a.process_instance_id AS "processInstanceId",
  84. m.name AS "master.name",
  85. a.number_path as "numberPath",
  86. a.review_fee AS "reviewFee",
  87. a.approval_fee AS "approvalFee",
  88. a.contract_fee AS "contractFee",
  89. a.verify_fee AS "verifyFee",
  90. a.verify_rate AS "verifyRate",
  91. a.consult_fee AS "consultFee",
  92. a.building_fee AS "buildingFee",
  93. a.install_fee AS "installFee"
  94. FROM project_report_data a
  95. <include refid="projectReportDataJoins"/>
  96. WHERE a.id = #{id}
  97. </select>
  98. <select id="getNumber" resultType="ProjectReportData" >
  99. SELECT
  100. a.id AS "id",
  101. a.number AS "number"
  102. FROM project_report_data a
  103. WHERE
  104. a.del_flag = #{DEL_FLAG_NORMAL}
  105. AND a.project_id = #{project.id}
  106. ORDER BY a.number DESC
  107. limit 1
  108. </select>
  109. <select id="getChangeId" resultType="java.lang.String" >
  110. SELECT
  111. a.id AS "id"
  112. FROM project_report_change a
  113. WHERE
  114. a.del_flag = '0'
  115. AND a.report_id = #{id}
  116. ORDER BY a.before_count DESC
  117. limit 1
  118. </select>
  119. <select id="findList" resultType="ProjectReportData" >
  120. SELECT
  121. <include refid="projectReportDataColumns"/>
  122. FROM project_report_data a
  123. <include refid="projectReportDataJoins"/>
  124. <where>
  125. a.del_flag = #{DEL_FLAG_NORMAL}
  126. <if test="project != null and project.id != null and project.id != ''">
  127. AND a.project_id = #{project.id}
  128. </if>
  129. <if test="type != null and type != ''">
  130. AND a.type = #{type}
  131. </if>
  132. <if test="name != null and name != ''">
  133. AND a.name like
  134. <if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
  135. <if test="dbName == 'mysql'">CONCAT('%', #{name}, '%')</if>
  136. </if>
  137. <if test="number != null and number != ''">
  138. AND a.number = #{number}
  139. </if>
  140. <if test="status != null and status != ''">
  141. AND a.status = #{status}
  142. </if>
  143. <if test="master!=null and master.id != null and master.id != ''">
  144. AND a.master = #{master.id}
  145. </if>
  146. <if test="startDate != null and startDate != ''">
  147. AND a.report_date &gt;= #{startDate}
  148. </if>
  149. <if test="endDate != null and endDate != ''">
  150. AND a.report_date &lt;= #{endDate}
  151. </if>
  152. </where>
  153. <choose>
  154. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  155. ORDER BY ${page.orderBy}
  156. </when>
  157. <otherwise>
  158. ORDER BY a.update_date DESC
  159. </otherwise>
  160. </choose>
  161. </select>
  162. <select id="findInfoList" resultType="ProjectReportData" >
  163. SELECT
  164. <include refid="projectReportDataColumns"/>,
  165. wci.contract_num AS "contractNum",
  166. wci.name AS "contractName",
  167. wct.name AS "clientName",
  168. o.top_company AS "officeName",
  169. uo.name AS "signCostOne.name",
  170. ut.name AS "signCostTwo.name",
  171. r.project_name AS "project.projectName",
  172. r.project_id AS "project.projectId"
  173. FROM project_report_data a
  174. <include refid="projectReportDataJoins"/>
  175. LEFT JOIN sys_office o ON o.id = a.office_id
  176. LEFT JOIN sys_user uo ON uo.id = a.sign_cost_one
  177. LEFT JOIN sys_user ut ON ut.id = a.sign_cost_two
  178. LEFT JOIN project_records r ON r.id = a.project_id
  179. LEFT JOIN work_contract_info wci on r.contract_id = wci.id
  180. LEFT JOIN work_client_info wct on wci.client_id = wct.id
  181. <where>
  182. a.del_flag = #{DEL_FLAG_NORMAL}
  183. <if test="project != null and project.id != null and project.id != ''">
  184. AND a.project_id = #{project.id}
  185. </if>
  186. <if test="type != null and type != ''">
  187. AND a.type = #{type}
  188. </if>
  189. <if test="name != null and name != ''">
  190. AND a.name like
  191. <if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
  192. <if test="dbName == 'mysql'">CONCAT('%', #{name}, '%')</if>
  193. </if>
  194. <if test="number != null and number != ''">
  195. AND a.number like
  196. <if test="dbName == 'oracle'">'%'||#{number}||'%'</if>
  197. <if test="dbName == 'mysql'">CONCAT('%', #{number}, '%')</if>
  198. </if>
  199. <if test="status != null and status != ''">
  200. AND a.status = #{status}
  201. </if>
  202. <if test="achievementType != null and achievementType != ''">
  203. AND a.achievement_type = #{achievementType}
  204. </if>
  205. <if test="signCostOne!=null and signCostOne.id != null and signCostOne.id != ''">
  206. AND a.sign_cost_one = #{signCostOne.id}
  207. </if>
  208. <if test="signCostTwo!=null and signCostTwo.id != null and signCostTwo.id != ''">
  209. AND a.sign_cost_two = #{signCostTwo.id}
  210. </if>
  211. <if test="master!=null and master.id != null and master.id != ''">
  212. AND a.master = #{master.id}
  213. </if>
  214. <if test="reviewStandard != null and reviewStandard != ''">
  215. AND a.review_standard = #{reviewStandard}
  216. </if>
  217. <if test="startDate != null and startDate != ''">
  218. AND a.report_date &gt;= #{startDate}
  219. </if>
  220. <if test="endDate != null and endDate != ''">
  221. AND a.report_date &lt;= #{endDate}
  222. </if>
  223. <if test="fileStatus != null and fileStatus != ''">
  224. AND a.file_status = #{fileStatus}
  225. </if>
  226. <if test="officeId != null and officeId != ''">
  227. AND a.office_id = #{officeId}
  228. </if>
  229. <if test="createStartDate != null and createStartDate != ''">
  230. AND a.create_date &gt;= #{createStartDate}
  231. </if>
  232. <if test="createEndDate != null and createEndDate != ''">
  233. AND a.create_date &lt;= #{createEndDate}
  234. </if>
  235. <if test="project!=null and project.projectName != null and project.projectName != ''">
  236. AND r.project_name like
  237. <if test="dbName == 'oracle'">'%'||#{project.projectName}||'%'</if>
  238. <if test="dbName == 'mysql'">CONCAT('%', #{project.projectName}, '%')</if>
  239. </if>
  240. <if test="contractNum != null and contractNum != ''">
  241. AND wci.contract_num like
  242. <if test="dbName == 'oracle'">'%'||#{contractNum}||'%'</if>
  243. <if test="dbName == 'mysql'">CONCAT('%', #{contractNum}, '%')</if>
  244. </if>
  245. <if test="clientName != null and clientName != ''">
  246. AND wct.name like
  247. <if test="dbName == 'oracle'">'%'||#{clientName}||'%'</if>
  248. <if test="dbName == 'mysql'">CONCAT('%', #{clientName}, '%')</if>
  249. </if>
  250. <if test="projectMasterId != null and projectMasterId != ''">
  251. AND #{projectMasterId} in (select user_id from work_project_user pm WHERE pm.project_id = a.project_id AND is_master = '1' AND pm.del_flag = '0')
  252. </if>
  253. ${sqlMap.dsf}
  254. </where>
  255. <choose>
  256. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  257. ORDER BY ${page.orderBy}
  258. </when>
  259. <otherwise>
  260. ORDER BY a.update_date DESC
  261. </otherwise>
  262. </choose>
  263. </select>
  264. <select id="findInfoListByStatus" resultType="ProjectReportData" >
  265. SELECT
  266. <include refid="projectReportDataColumns"/>,
  267. wci.contract_num AS "contractNum",
  268. wci.name AS "contractName",
  269. wct.name AS "clientName",
  270. o.name AS "officeName",
  271. uo.name AS "signCostOne.name",
  272. ut.name AS "signCostTwo.name",
  273. r.project_name AS "project.projectName",
  274. r.project_id AS "project.projectId"
  275. FROM project_report_data a
  276. <include refid="projectReportDataJoins"/>
  277. LEFT JOIN sys_office o ON o.id = a.office_id
  278. LEFT JOIN sys_user uo ON uo.id = a.sign_cost_one
  279. LEFT JOIN sys_user ut ON ut.id = a.sign_cost_two
  280. LEFT JOIN project_records r ON r.id = a.project_id
  281. LEFT JOIN work_contract_info wci on r.contract_id = wci.id
  282. LEFT JOIN work_client_info wct on wci.client_id = wct.id
  283. <where>
  284. a.del_flag = #{DEL_FLAG_NORMAL}
  285. <if test="project != null and project.id != null and project.id != ''">
  286. AND a.project_id = #{project.id}
  287. </if>
  288. <if test="type != null and type != ''">
  289. AND a.type = #{type}
  290. </if>
  291. <if test="name != null and name != ''">
  292. AND a.name like
  293. <if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
  294. <if test="dbName == 'mysql'">CONCAT('%', #{name}, '%')</if>
  295. </if>
  296. <if test="number != null and number != ''">
  297. AND a.number like
  298. <if test="dbName == 'oracle'">'%'||#{number}||'%'</if>
  299. <if test="dbName == 'mysql'">CONCAT('%', #{number}, '%')</if>
  300. </if>
  301. <if test="achievementType != null and achievementType != ''">
  302. AND a.achievement_type = #{achievementType}
  303. </if>
  304. <if test="signCostOne!=null and signCostOne.id != null and signCostOne.id != ''">
  305. AND a.sign_cost_one = #{signCostOne.id}
  306. </if>
  307. <if test="signCostTwo!=null and signCostTwo.id != null and signCostTwo.id != ''">
  308. AND a.sign_cost_two = #{signCostTwo.id}
  309. </if>
  310. <!--<if test="master!=null and master.id != null and master.id != ''">-->
  311. <!--AND a.master = #{master.id}-->
  312. <!--</if>-->
  313. <if test="reviewStandard != null and reviewStandard != ''">
  314. AND a.review_standard = #{reviewStandard}
  315. </if>
  316. <if test="startDate != null and startDate != ''">
  317. AND a.report_date &gt;= #{startDate}
  318. </if>
  319. <if test="endDate != null and endDate != ''">
  320. AND a.report_date &lt;= #{endDate}
  321. </if>
  322. <if test="fileStatus != null and fileStatus != ''">
  323. AND a.file_status = #{fileStatus}
  324. </if>
  325. <if test="officeId != null and officeId != ''">
  326. AND a.office_id = #{officeId}
  327. </if>
  328. <if test="createStartDate != null and createStartDate != ''">
  329. AND a.create_date &gt;= #{createStartDate}
  330. </if>
  331. <if test="createEndDate != null and createEndDate != ''">
  332. AND a.create_date &lt;= #{createEndDate}
  333. </if>
  334. <if test="project!=null and project.projectName != null and project.projectName != ''">
  335. AND r.project_name like
  336. <if test="dbName == 'oracle'">'%'||#{project.projectName}||'%'</if>
  337. <if test="dbName == 'mysql'">CONCAT('%', #{project.projectName}, '%')</if>
  338. </if>
  339. <if test="contractNum != null and contractNum != ''">
  340. AND wci.contract_num like
  341. <if test="dbName == 'oracle'">'%'||#{contractNum}||'%'</if>
  342. <if test="dbName == 'mysql'">CONCAT('%', #{contractNum}, '%')</if>
  343. </if>
  344. <if test="clientName != null and clientName != ''">
  345. AND wct.name like
  346. <if test="dbName == 'oracle'">'%'||#{clientName}||'%'</if>
  347. <if test="dbName == 'mysql'">CONCAT('%', #{clientName}, '%')</if>
  348. </if>
  349. <if test="projectMasterId != null and projectMasterId != ''">
  350. AND #{projectMasterId} in (select user_id from work_project_user pm WHERE pm.project_id = a.project_id AND is_master = '1' AND pm.del_flag = '0')
  351. </if>
  352. AND a.status in ('5','7')
  353. AND a.create_by = #{createBy.id}
  354. ${sqlMap.dsf}
  355. </where>
  356. <choose>
  357. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  358. ORDER BY ${page.orderBy}
  359. </when>
  360. <otherwise>
  361. ORDER BY a.update_date DESC
  362. </otherwise>
  363. </choose>
  364. </select>
  365. <select id="findInvalidList" resultType="ProjectReportData" >
  366. SELECT
  367. <include refid="projectReportDataColumns"/>
  368. FROM project_report_data a
  369. <include refid="projectReportDataJoins"/>
  370. <where>
  371. a.del_flag = #{DEL_FLAG_NORMAL} AND a.status IN ('6','7')
  372. <if test="project != null and project.id != null and project.id != ''">
  373. AND a.project_id = #{project.id}
  374. </if>
  375. <if test="type != null and type != ''">
  376. AND a.type = #{type}
  377. </if>
  378. <if test="name != null and name != ''">
  379. AND a.name like
  380. <if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
  381. <if test="dbName == 'mysql'">CONCAT('%', #{name}, '%')</if>
  382. </if>
  383. <if test="number != null and number != ''">
  384. AND a.number = #{number}
  385. </if>
  386. <if test="master!=null and master.id != null and master.id != ''">
  387. AND a.master = #{master.id}
  388. </if>
  389. <if test="startDate != null and startDate != ''">
  390. AND a.report_date &gt;= #{startDate}
  391. </if>
  392. <if test="endDate != null and endDate != ''">
  393. AND a.report_date &lt;= #{endDate}
  394. </if>
  395. </where>
  396. <choose>
  397. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  398. ORDER BY ${page.orderBy}
  399. </when>
  400. <otherwise>
  401. ORDER BY a.update_date DESC
  402. </otherwise>
  403. </choose>
  404. </select>
  405. <select id="findAllList" resultType="ProjectReportData" >
  406. SELECT
  407. <include refid="projectReportDataColumns"/>
  408. FROM project_report_data a
  409. <include refid="projectReportDataJoins"/>
  410. <where>
  411. a.del_flag = #{DEL_FLAG_NORMAL}
  412. </where>
  413. <choose>
  414. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  415. ORDER BY ${page.orderBy}
  416. </when>
  417. <otherwise>
  418. ORDER BY a.update_date DESC
  419. </otherwise>
  420. </choose>
  421. </select>
  422. <insert id="insert">
  423. INSERT INTO project_report_data(
  424. id,
  425. create_by,
  426. create_date,
  427. update_by,
  428. update_date,
  429. remarks,
  430. del_flag,
  431. company_id,
  432. office_id,
  433. project_id,
  434. name,
  435. number,
  436. type,
  437. achievement_type,
  438. review_standard,
  439. sign_cost_one,
  440. sign_cost_two,
  441. master,
  442. report_date,
  443. file_status,
  444. status,
  445. invalid_status,
  446. report_type,
  447. number_path,
  448. review_fee,
  449. approval_fee,
  450. contract_fee,
  451. verify_fee,
  452. verify_rate,
  453. consult_fee,
  454. building_fee,
  455. install_fee
  456. ) VALUES (
  457. #{id},
  458. #{createBy.id},
  459. #{createDate},
  460. #{updateBy.id},
  461. #{updateDate},
  462. #{remarks},
  463. #{delFlag},
  464. #{companyId},
  465. #{officeId},
  466. #{project.id},
  467. #{name},
  468. #{number},
  469. #{type},
  470. #{achievementType},
  471. #{reviewStandard},
  472. #{signCostOne.id},
  473. #{signCostTwo.id},
  474. #{master.id},
  475. #{reportDate},
  476. #{fileStatus},
  477. #{status},
  478. #{invalidStatus},
  479. #{reportType},
  480. #{numberPath},
  481. #{reviewFee},
  482. #{approvalFee},
  483. #{contractFee},
  484. #{verifyFee},
  485. #{verifyRate},
  486. #{consultFee},
  487. #{buildingFee},
  488. #{installFee}
  489. )
  490. </insert>
  491. <update id="update">
  492. UPDATE project_report_data SET
  493. update_by = #{updateBy.id},
  494. update_date = #{updateDate},
  495. remarks = #{remarks},
  496. company_id = #{companyId},
  497. office_id = #{officeId},
  498. project_id = #{project.id},
  499. name = #{name},
  500. number = #{number},
  501. type = #{type},
  502. achievement_type = #{achievementType},
  503. review_standard = #{reviewStandard},
  504. sign_cost_one = #{signCostOne.id},
  505. sign_cost_two = #{signCostTwo.id},
  506. master = #{master.id},
  507. report_date = #{reportDate},
  508. status = #{status},
  509. invalid_status = #{invalidStatus},
  510. report_type = #{reportType},
  511. number_path = #{numberPath},
  512. review_fee = #{reviewFee},
  513. approval_fee = #{approvalFee},
  514. contract_fee = #{contractFee},
  515. verify_fee = #{verifyFee},
  516. verify_rate = #{verifyRate},
  517. consult_fee = #{consultFee},
  518. building_fee = #{buildingFee},
  519. install_fee = #{installFee}
  520. WHERE id = #{id}
  521. </update>
  522. <update id="updateFileStatus">
  523. UPDATE project_report_data SET
  524. file_status = #{fileStatus}
  525. WHERE id = #{id}
  526. </update>
  527. <update id="saveInvalid">
  528. UPDATE project_report_data SET
  529. update_by = #{updateBy.id},
  530. update_date = #{updateDate},
  531. remarks = #{remarks},
  532. <if test="invalidStatus != null and invalidStatus != ''">
  533. invalid_status = #{invalidStatus},
  534. </if>
  535. status = #{status}
  536. WHERE id = #{id}
  537. </update>
  538. <!--物理删除-->
  539. <update id="delete">
  540. DELETE FROM project_report_data
  541. WHERE id = #{id}
  542. </update>
  543. <!--逻辑删除-->
  544. <update id="deleteByLogic">
  545. UPDATE project_report_data SET
  546. del_flag = #{DEL_FLAG_DELETE}
  547. WHERE id = #{id}
  548. </update>
  549. <!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
  550. <select id="findUniqueByProperty" resultType="ProjectReportData" statementType="STATEMENT">
  551. select * FROM project_report_data where ${propertyName} = '${value}'
  552. </select>
  553. <update id="updateProcessInstanceId">
  554. UPDATE project_report_data SET
  555. process_instance_id = #{processInstanceId}
  556. WHERE id = #{id}
  557. </update>
  558. <!-- 获取流程ID -->
  559. <select id="getByProcessInstanceId" resultType="ProjectReportData" >
  560. SELECT
  561. <include refid="projectReportDataColumns"/>
  562. FROM project_report_data a
  563. <include refid="projectReportDataJoins"/>
  564. WHERE a.process_instance_id = #{processInstanceId}
  565. </select>
  566. <update id="updateInvalidProcessInstanceId">
  567. UPDATE project_report_data SET
  568. invalid_process_instance_id = #{invalidProcessInstanceId}
  569. WHERE id = #{id}
  570. </update>
  571. <update id="deleteReportDataInfo">
  572. DELETE FROM project_report_content WHERE report_id = #{reportId} AND type = '1'
  573. </update>
  574. <update id="deleteReportDataBased">
  575. DELETE FROM project_report_content WHERE report_id = #{reportId} AND type = '3'
  576. </update>
  577. <update id="deleteContentChange">
  578. DELETE FROM project_content_change WHERE info_id = #{infoId}
  579. </update>
  580. <update id="reportNumber">
  581. UPDATE project_report_data SET
  582. number = #{number},number_path = #{url}
  583. WHERE id = #{reportId}
  584. </update>
  585. <!-- 获取流程ID -->
  586. <select id="getByInvalidProcessInstanceId" resultType="ProjectReportData" >
  587. SELECT
  588. <include refid="projectReportDataColumns"/>
  589. FROM project_report_data a
  590. <include refid="projectReportDataJoins"/>
  591. WHERE a.invalid_process_instance_id = #{invalidProcessInstanceId}
  592. </select>
  593. <update id="updateUpId">
  594. update project_report_data
  595. set update_process_instance_id = #{upId}
  596. <where>
  597. id = #{id}
  598. </where>
  599. </update>
  600. <select id="findByProjectId" parameterType="String" resultType="ProjectReportData">
  601. SELECT
  602. <include refid="projectReportDataColumns"/>
  603. FROM project_report_data a
  604. <include refid="projectReportDataJoins"/>
  605. <where>
  606. project_id = #{projectId}
  607. </where>
  608. </select>
  609. <select id="getInvoiceByProjectId" resultType="com.jeeplus.modules.workinvoice.entity.WorkInvoice">
  610. select a.id as "id",
  611. a.process_instance_id as "processInstanceId",
  612. a.number as "number",
  613. a.project_id as "projectId",
  614. a.money as "money",
  615. a.invoice_date as "invoiceDate",
  616. a.invoice_state as "invoiceState",
  617. a.create_date as "createDate",
  618. b.number as "workAccountNumber",
  619. b.tax_money as "taxMoney",
  620. w.name as "client.name"
  621. from work_invoice a
  622. left join work_invoice_detail b on a.id=b.invoice_id
  623. left join work_client_info w on w.id = a.client_id
  624. where a.project_id = #{projectId}
  625. order by a.invoice_date desc, b.create_by asc,a.create_by asc
  626. </select>
  627. </mapper>