PrjAnnualbudgetDao.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  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.liang.dao.PrjAnnualbudgetDao">
  4. <resultMap type="com.liang.entity.PrjAnnualbudget" id="PrjAnnualbudgetMap">
  5. <result property="id" column="ID" jdbcType="INTEGER"/>
  6. <result property="rws" column="RWS" jdbcType="INTEGER"/>
  7. <result property="nf" column="NF" jdbcType="VARCHAR"/>
  8. <result property="sqr" column="SQR" jdbcType="INTEGER"/>
  9. <result property="sqsj" column="SQSJ" jdbcType="TIMESTAMP"/>
  10. <result property="spzt" column="SPZT" jdbcType="VARCHAR"/>
  11. <result property="kyfyxx" column="KYFYXX" jdbcType="VARCHAR"/>
  12. <result property="sm" column="SM" jdbcType="VARCHAR"/>
  13. <result property="rwsmc" column="RWSMC" jdbcType="VARCHAR"/>
  14. <result property="mc" column="MC" jdbcType="VARCHAR"/>
  15. <result property="xmmc" column="XMMC" jdbcType="VARCHAR"/>
  16. <result property="erpbh" column="ERPBH" jdbcType="VARCHAR"/>
  17. <result property="xmlx" column="XMLX" jdbcType="VARCHAR"/>
  18. <result property="xmfzr" column="XMFZR" jdbcType="INTEGER"/>
  19. <result property="ssbm" column="SSBM" jdbcType="INTEGER"/>
  20. <result property="xmzxq" column="XMZXQ" jdbcType="VARCHAR"/>
  21. </resultMap>
  22. <!--查询单个-->
  23. <select id="queryById" resultMap="PrjAnnualbudgetMap">
  24. SELECT DISTINCT a.*,
  25. t.XMLXMC,
  26. r.XM AS XMFZRXM,
  27. d.dept_name AS SSBMMC,
  28. u.name AS SQRXM,
  29. bd.XMZYS,
  30. p.DKYFZR,
  31. bd.YSJE,
  32. (
  33. SELECT STUFF(
  34. (
  35. SELECT ',' + XM
  36. FROM (
  37. SELECT xm
  38. FROM base_Person
  39. WHERE id IN (
  40. SELECT dkyfzrid
  41. FROM (
  42. SELECT DISTINCT zwmc,
  43. SUBSTRING(dkyfzr, number,
  44. CHARINDEX(',', dkyfzr + ',', number) -
  45. number) AS dkyfzrid
  46. FROM prj_Project WITH (nolock),
  47. master..spt_values
  48. WITH (nolock)
  49. WHERE
  50. number >= 1
  51. AND len(DKYFZR)
  52. > number
  53. AND SUBSTRING (',' + DKYFZR
  54. , number
  55. , 1) = ','
  56. AND ID = p.ID
  57. ) t
  58. )
  59. ) B FOR xml path ('') ),
  60. 1,
  61. 1,
  62. ''
  63. )
  64. ) AS DKYFZRXM
  65. FROM prj_AnnualBudget a
  66. LEFT JOIN base_ProjectType t ON t.XMLX = a.XMLX
  67. LEFT JOIN base_Person r ON r.ID = a.XMFZR
  68. LEFT JOIN sys_dept_info d ON d.dept_id = a.SSBM
  69. LEFT JOIN sys_user_info u ON u.user_id = a.SQR
  70. LEFT JOIN prj_Project p ON p.ID = a.RWS
  71. LEFT JOIN prj_AnnualBudgetDetail bd ON bd.NYS = a.ID AND bd.FJ = ''
  72. -- LEFT JOIN sta_BudgetApproval b ON b.erpbh = a.erpbh -- 添加 sta_BudgetApproval 表的左关联条件
  73. WHERE a.ID = #{id}
  74. -- AND a.nf = b.nf; -- 添加 where 条件,确保 a.nf 和 b.nf 匹配
  75. </select>
  76. <select id="getAnnualBudget" resultMap="PrjAnnualbudgetMap">
  77. select *
  78. from prj_AnnualBudget
  79. <where>
  80. <if test="id != null">
  81. and ID = #{id}
  82. </if>
  83. <if test="rws != null">
  84. and RWS = #{rws}
  85. </if>
  86. <if test="nf != null and nf != ''">
  87. and NF = #{nf}
  88. </if>
  89. </where>
  90. </select>
  91. <!--根据rwsID查询记录-->
  92. <select id="queryByRws" resultMap="PrjAnnualbudgetMap">
  93. select TOP 1 a.*, u.name as SQRXM
  94. from prj_AnnualBudget a
  95. left join
  96. sys_user_info u on u.user_id = a.SQR
  97. INNER JOIN sta_BudgetApproval s ON a.RWS = s.XMID
  98. where RWS = #{rws}
  99. AND a.NF = s.NF
  100. </select>
  101. <!--查询指定行数据-->
  102. <select id="queryAllByLimit" resultMap="PrjAnnualbudgetMap">
  103. select
  104. ID, RWS, NF, SQR, SQSJ, SPZT, KYFYXX, SM, RWSMC, MC, XMMC, ERPBH, XMLX, XMFZR, SSBM, XMZXQ
  105. from prj_AnnualBudget
  106. <where>
  107. <if test="id != null">
  108. and ID = #{id}
  109. </if>
  110. <if test="rws != null">
  111. and RWS = #{rws}
  112. </if>
  113. <if test="nf != null and nf != ''">
  114. and NF = #{nf}
  115. </if>
  116. <if test="sqr != null">
  117. and SQR = #{sqr}
  118. </if>
  119. <if test="sqsj != null">
  120. and SQSJ = #{sqsj}
  121. </if>
  122. <if test="spzt != null and spzt != ''">
  123. and SPZT = #{spzt}
  124. </if>
  125. <if test="kyfyxx != null and kyfyxx != ''">
  126. and KYFYXX = #{kyfyxx}
  127. </if>
  128. <if test="sm != null and sm != ''">
  129. and SM = #{sm}
  130. </if>
  131. <if test="rwsmc != null and rwsmc != ''">
  132. and RWSMC = #{rwsmc}
  133. </if>
  134. <if test="mc != null and mc != ''">
  135. and MC = #{mc}
  136. </if>
  137. <if test="xmmc != null and xmmc != ''">
  138. and XMMC = #{xmmc}
  139. </if>
  140. <if test="erpbh != null and erpbh != ''">
  141. and ERPBH = #{erpbh}
  142. </if>
  143. <if test="xmlx != null and xmlx != ''">
  144. and XMLX = #{xmlx}
  145. </if>
  146. <if test="xmfzr != null">
  147. and XMFZR = #{xmfzr}
  148. </if>
  149. <if test="ssbm != null">
  150. and SSBM = #{ssbm}
  151. </if>
  152. <if test="xmzxq != null and xmzxq != ''">
  153. and XMZXQ = #{xmzxq}
  154. </if>
  155. </where>
  156. limit #{pageable.offset}, #{pageable.pageSize}
  157. </select>
  158. <!--统计总行数-->
  159. <select id="count" resultType="java.lang.Long">
  160. select count(1)
  161. from prj_AnnualBudget
  162. <where>
  163. <if test="id != null">
  164. and ID = #{id}
  165. </if>
  166. <if test="rws != null">
  167. and RWS = #{rws}
  168. </if>
  169. <if test="nf != null and nf != ''">
  170. and NF = #{nf}
  171. </if>
  172. <if test="sqr != null">
  173. and SQR = #{sqr}
  174. </if>
  175. <if test="sqsj != null">
  176. and SQSJ = #{sqsj}
  177. </if>
  178. <if test="spzt != null and spzt != ''">
  179. and SPZT = #{spzt}
  180. </if>
  181. <if test="kyfyxx != null and kyfyxx != ''">
  182. and KYFYXX = #{kyfyxx}
  183. </if>
  184. <if test="sm != null and sm != ''">
  185. and SM = #{sm}
  186. </if>
  187. <if test="rwsmc != null and rwsmc != ''">
  188. and RWSMC = #{rwsmc}
  189. </if>
  190. <if test="mc != null and mc != ''">
  191. and MC = #{mc}
  192. </if>
  193. <if test="xmmc != null and xmmc != ''">
  194. and XMMC = #{xmmc}
  195. </if>
  196. <if test="erpbh != null and erpbh != ''">
  197. and ERPBH = #{erpbh}
  198. </if>
  199. <if test="xmlx != null and xmlx != ''">
  200. and XMLX = #{xmlx}
  201. </if>
  202. <if test="xmfzr != null">
  203. and XMFZR = #{xmfzr}
  204. </if>
  205. <if test="ssbm != null">
  206. and SSBM = #{ssbm}
  207. </if>
  208. <if test="xmzxq != null and xmzxq != ''">
  209. and XMZXQ = #{xmzxq}
  210. </if>
  211. </where>
  212. </select>
  213. <!--新增所有列-->
  214. <insert id="insert" keyProperty="id" useGeneratedKeys="true">
  215. if
  216. not exists (select ID from prj_AnnualBudget where RWS =
  217. #{rws}
  218. and
  219. NF
  220. =
  221. #{nf}
  222. )
  223. insert
  224. into
  225. prj_AnnualBudget
  226. (
  227. RWS,
  228. NF,
  229. SQR,
  230. SQSJ,
  231. SPZT,
  232. KYFYXX,
  233. SM,
  234. RWSMC,
  235. MC,
  236. XMMC,
  237. ERPBH,
  238. XMLX,
  239. XMFZR,
  240. SSBM,
  241. XMZXQ
  242. )
  243. values
  244. (
  245. #{rws},
  246. #{nf},
  247. #{sqr},
  248. #{sqsj},
  249. #{spzt},
  250. #{kyfyxx},
  251. #{sm},
  252. #{rwsmc},
  253. #{mc},
  254. #{xmmc},
  255. #{erpbh},
  256. #{xmlx},
  257. #{xmfzr},
  258. #{ssbm},
  259. #{xmzxq}
  260. )
  261. </insert>
  262. <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
  263. insert into prj_AnnualBudget(RWS, NF, SQR, SQSJ, SPZT, KYFYXX, SM, RWSMC, MC, XMMC, ERPBH, XMLX, XMFZR, SSBM,
  264. XMZXQ)
  265. values
  266. <foreach collection="entities" item="entity" separator=",">
  267. (#{entity.rws}, #{entity.nf}, #{entity.sqr}, #{entity.sqsj}, #{entity.spzt}, #{entity.kyfyxx}, #{entity.sm},
  268. #{entity.rwsmc}, #{entity.mc}, #{entity.xmmc}, #{entity.erpbh}, #{entity.xmlx}, #{entity.xmfzr},
  269. #{entity.ssbm}, #{entity.xmzxq})
  270. </foreach>
  271. </insert>
  272. <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
  273. insert into prj_AnnualBudget(RWS, NF, SQR, SQSJ, SPZT, KYFYXX, SM, RWSMC, MC, XMMC, ERPBH, XMLX, XMFZR, SSBM,
  274. XMZXQ)
  275. values
  276. <foreach collection="entities" item="entity" separator=",">
  277. (#{entity.rws}, #{entity.nf}, #{entity.sqr}, #{entity.sqsj}, #{entity.spzt}, #{entity.kyfyxx}, #{entity.sm},
  278. #{entity.rwsmc}, #{entity.mc}, #{entity.xmmc}, #{entity.erpbh}, #{entity.xmlx}, #{entity.xmfzr},
  279. #{entity.ssbm}, #{entity.xmzxq})
  280. </foreach>
  281. on duplicate key update
  282. RWS = values(RWS),
  283. NF = values(NF),
  284. SQR = values(SQR),
  285. SQSJ = values(SQSJ),
  286. SPZT = values(SPZT),
  287. KYFYXX = values(KYFYXX),
  288. SM = values(SM),
  289. RWSMC = values(RWSMC),
  290. MC = values(MC),
  291. XMMC = values(XMMC),
  292. ERPBH = values(ERPBH),
  293. XMLX = values(XMLX),
  294. XMFZR = values(XMFZR),
  295. SSBM = values(SSBM),
  296. XMZXQ = values(XMZXQ)
  297. </insert>
  298. <!--通过主键修改数据-->
  299. <update id="update">
  300. if
  301. not exists (select ID from prj_AnnualBudget where ID !=
  302. #{id}
  303. and
  304. RWS
  305. =
  306. #{rws}
  307. and
  308. NF
  309. =
  310. #{nf}
  311. )
  312. update prj_AnnualBudget
  313. set NF = #{nf},
  314. SQSJ = #{sqsj},
  315. SM = #{sm},
  316. MC = #{mc},
  317. XMZXQ = #{xmzxq}
  318. where ID = #{id}
  319. </update>
  320. <!--通过主键删除-->
  321. <delete id="deleteById">
  322. delete
  323. from prj_AnnualBudget
  324. where ID = #{id}
  325. </delete>
  326. <!--获取年度预算列表-->
  327. <select id="getNdysList" resultMap="PrjAnnualbudgetMap" parameterType="map">
  328. select a.*, t.XMLXMC, r.XM as XMFZRXM, d.dept_name as SSBMMC, u.name as SQRXM, bd.XMZYS
  329. from prj_AnnualBudget a
  330. left join base_ProjectType t on t.XMLX = a.XMLX
  331. left join base_Person r on r.ID = a.XMFZR
  332. left join sys_user_info u on u.user_id = a.SQR
  333. left join sys_dept_info d on d.dept_id = a.SSBM
  334. left join prj_AnnualBudgetDetail bd on bd.NYS = a.ID and bd.FJ = ''
  335. where 1 = 1
  336. <if test="userId != null and userId != ''">
  337. and (a.SQR = #{userId} or #{userId} in (select SHR from prj_ApproveRecord where XMID = a.ID))
  338. </if>
  339. <if test="xmmc != null and xmmc != ''">
  340. and a.XMMC like '%'+#{xmmc}+'%'
  341. </if>
  342. <if test="erpbh != null and erpbh != ''">
  343. and a.ERPBH like '%'+#{erpbh}+'%'
  344. </if>
  345. <if test="xmlx != null and xmlx != ''">
  346. and a.XMLX = #{xmlx}
  347. </if>
  348. <if test="ssbmmc != null and ssbmmc != ''">
  349. and d.dept_name like '%'+#{ssbmmc}+'%'
  350. </if>
  351. <if test="spzt != null and spzt != ''">
  352. and a.SPZT = #{spzt}
  353. </if>
  354. <if test="rwsmc != null and rwsmc != ''">
  355. and a.RWSMC like '%'+#{rwsmc}+'%'
  356. </if>
  357. <if test="nf != null and nf != ''">
  358. and a.NF = #{nf}
  359. </if>
  360. <choose>
  361. <when test="sortName != null and sortName != '' and sortOrder != null and sortOrder != ''">
  362. order by ${sortName} ${sortOrder}
  363. </when>
  364. </choose>
  365. ORDER BY
  366. CASE
  367. WHEN a.SPZT = '部门主任审批' THEN 0
  368. WHEN a.SPZT = '科技项目管理专责审批' THEN 1
  369. WHEN a.SPZT = '科技部部门主任审批' THEN 2
  370. WHEN a.SPZT = '主管院领导审批' THEN 3
  371. WHEN a.SPZT = '院长审批' THEN 4
  372. WHEN a.SPZT = '科技项目管理专责确认' THEN 5
  373. WHEN a.SPZT = '未提交' THEN 996
  374. WHEN a.SPZT = '未提交(返回)' THEN 997
  375. WHEN a.SPZT = '审批结束' THEN 998
  376. WHEN a.SPZT = '作废' THEN 999
  377. END
  378. ASC
  379. </select>
  380. <!--获取年份-->
  381. <select id="getYearList" resultMap="PrjAnnualbudgetMap">
  382. select distinct NF
  383. from prj_AnnualBudget
  384. where NF is not NULL
  385. </select>
  386. <!--批量删除年度预算-->
  387. <delete id="batchDelete" parameterType="java.util.ArrayList">
  388. delete from prj_AnnualBudget
  389. where ID in
  390. <foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
  391. #{item}
  392. </foreach>
  393. </delete>
  394. <!--撤销审核状态任务书-->
  395. <update id="tjrevokeApprove">
  396. update prj_AnnualBudget
  397. set SPZT = '未提交'
  398. where ID = #{id}
  399. </update>
  400. <!--通过主键修改审批状态-->
  401. <update id="updateSpzt">
  402. update prj_AnnualBudget
  403. set SPZT = #{spzt}
  404. where ID = #{id}
  405. </update>
  406. <update id="updateXTJSYZX">
  407. update A
  408. set A.XTJSYZX = B.xtjsyzx from prj_AnnualBudgetDetail A
  409. inner join (SELECT
  410. fymc, sum(ysje) xtjsyzx
  411. from prj_AnnualBudgetDetail
  412. where nys in (SELECT ID from prj_AnnualBudget where RWS = #{rws})
  413. group by fymc) B
  414. on A.FYMC = B.fymc
  415. where
  416. NYS = ( SELECT top 1 ID from prj_AnnualBudget where RWS = #{rws} order by nf desc)
  417. </update>
  418. <update id="updateSJYZX">
  419. update A
  420. set A.sjyzx = B.BZJE from prj_AnnualBudgetDetail A
  421. inner join (SELECT convert(decimal(18,2),(sum(BZJE)/10000)) BZJE ,pa.fymc
  422. from(SELECT id ,fylb
  423. from sta_BudgetApproval
  424. where nys in (
  425. select id
  426. from prj_AnnualBudget
  427. where rws = #{rws})) sb
  428. left join sta_Reimbursement sa on sa.fysq = sb.id
  429. LEFT join prj_AnnualBudgetDetail pa on pa.id = sb.fylb
  430. group by pa.fymc ) B
  431. on A.FYMC = B.fymc
  432. where
  433. NYS = (
  434. SELECT top 1 ID from
  435. prj_AnnualBudget
  436. where RWS = #{rws} order by nf desc )
  437. </update>
  438. <update id="updateSJYZXByBZID">
  439. update A
  440. set A.sjyzx = (B.BZJE + isnull(A.sjyzx, 0) + isnull(#{nysSum}, 0)) from prj_AnnualBudgetDetail A
  441. inner join (
  442. select pa.fymc , sr.bzje, pa.id from sta_Reimbursement sr
  443. left join sta_BudgetApproval sb on sb.id = sr.FYSQ
  444. left join prj_AnnualBudgetDetail pa on pa.id = sb.fylb
  445. where sr.id = #{bzId}
  446. ) B
  447. on A.FYMC = B.fymc
  448. where
  449. a.id=b.id
  450. </update>
  451. <update id="updateSJYZXSum">
  452. update A
  453. set A.sjyzx = B.BZJE from prj_AnnualBudgetDetail A
  454. inner join (SELECT convert(decimal(18,2),(sum(BZJE)/10000)) BZJE ,pa.fymc
  455. from(SELECT id ,fylb
  456. from sta_BudgetApproval
  457. where nys in (
  458. select id
  459. from prj_AnnualBudget
  460. where rws = #{rws})) sb
  461. left join sta_Reimbursement sa on sa.fysq = sb.id
  462. LEFT join prj_AnnualBudgetDetail pa on pa.id = sb.fylb
  463. group by pa.fymc ) B
  464. on A.FYMC = B.fymc
  465. where
  466. NYS = (
  467. SELECT top 1 ID from
  468. prj_AnnualBudget
  469. where RWS = #{rws} order by nf desc )
  470. </update>
  471. <update id="updateXTJSYZXByNysId">
  472. update A
  473. set A.XTJSYZX = B.xtjsyzx from prj_AnnualBudgetDetail A
  474. inner join (SELECT
  475. fymc, sum(ysje) xtjsyzx
  476. from prj_AnnualBudgetDetail
  477. where nys in (SELECT ID from prj_AnnualBudget where RWS = #{rwsId} and nf &lt; #{nf} )
  478. group by fymc) B
  479. on A.FYMC = B.fymc
  480. where
  481. NYS = #{nysId}
  482. </update>
  483. <update id="updateSJYZXByNysId">
  484. update A
  485. set A.sjyzx = B.BZJE from prj_AnnualBudgetDetail A
  486. inner join (SELECT convert(decimal(18,2),(sum(BZJE)/10000)) BZJE ,pa.fymc
  487. from(SELECT id ,fylb
  488. from sta_BudgetApproval
  489. where nys in (
  490. select id
  491. from prj_AnnualBudget
  492. where rws = #{rwsId} and nf &lt; #{nf} )) sb
  493. left join sta_Reimbursement sa on sa.fysq = sb.id
  494. LEFT join prj_AnnualBudgetDetail pa on pa.id = sb.fylb
  495. group by pa.fymc ) B
  496. on A.FYMC = B.fymc
  497. where
  498. NYS = #{nysId}
  499. </update>
  500. <update id="updateSJYZXSumByNysId">
  501. update A
  502. set A.sjyzx = B.BZJE from prj_AnnualBudgetDetail A
  503. inner join (SELECT sum(BZJE) BZJE ,pa.fymc
  504. from(SELECT id ,fylb
  505. from sta_BudgetApproval
  506. where nys in (
  507. select id
  508. from prj_AnnualBudget
  509. where rws = #{rwsId} and nf &lt; #{nf} )) sb
  510. left join sta_Reimbursement sa on sa.fysq = sb.id
  511. LEFT join prj_AnnualBudgetDetail pa on pa.id = sb.fylb
  512. group by pa.fymc ) B
  513. on A.FYMC = B.fymc
  514. where
  515. NYS = #{nysId}
  516. </update>
  517. <!--已申请费用的预算-->
  518. <select id="getFysqBudgetList">
  519. select b.*
  520. from sta_BudgetApproval b
  521. left join prj_AnnualBudget a on a.ID = b.NYS
  522. left join prj_AnnualBudgetDetail d on d.NYS = a.ID
  523. where 1 = 1
  524. </select>
  525. <select id="listByRws" resultType="com.liang.entity.PrjAnnualbudget">
  526. select *
  527. from prj_AnnualBudget
  528. where rws = #{rws}
  529. order by nf asc
  530. </select>
  531. <select id="getNYSSum" resultType="java.math.BigDecimal">
  532. SELECT sum(pan.sjyzx) sjyzx
  533. FROM (
  534. select sb.nys,
  535. pab.fymc
  536. from sta_Reimbursement sr
  537. left join sta_BudgetApproval sb on sb.id = sr.FYSQ
  538. left join prj_AnnualBudgetDetail pab on pab.id = sb.fylb
  539. where sr.id = #{id}
  540. ) b
  541. left join prj_AnnualBudgetDetail pan on b.fymc = pan.fymc
  542. where pan.nys in (
  543. SELECT id
  544. from prj_AnnualBudget pann
  545. where rws = #{rwsId}
  546. AND pann.id &lt; (select sb.nys
  547. from sta_Reimbursement sr
  548. left join sta_BudgetApproval sb on sb.id = sr.FYSQ
  549. where sr.id = #{id})
  550. )
  551. </select>
  552. <select id="queryByRws1" resultType="com.liang.entity.PrjAnnualbudget">
  553. select TOP 1 a.*, u.name as SQRXM
  554. from prj_AnnualBudget a
  555. left join
  556. sys_user_info u on u.user_id = a.SQR
  557. INNER JOIN sta_BudgetApproval s ON a.RWS = s.XMID
  558. where RWS = #{rws}
  559. AND a.NF = #{nf}
  560. </select>
  561. </mapper>