PrjAnnualbudgetdetailDao.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  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.PrjAnnualbudgetdetailDao">
  4. <resultMap type="com.liang.entity.PrjAnnualbudgetdetail" id="PrjAnnualbudgetdetailMap">
  5. <result property="id" column="ID" jdbcType="INTEGER"/>
  6. <result property="fymc" column="FYMC" jdbcType="VARCHAR"/>
  7. <result property="ysje" column="YSJE" jdbcType="NUMERIC"/>
  8. <result property="ysqje" column="YSQJE" jdbcType="NUMERIC"/>
  9. <result property="nys" column="NYS" jdbcType="INTEGER"/>
  10. <result property="bm" column="BM" jdbcType="VARCHAR"/>
  11. <result property="fj" column="FJ" jdbcType="VARCHAR"/>
  12. <result property="nf" column="NF" jdbcType="INTEGER"/>
  13. <result property="px" column="PX" jdbcType="VARCHAR"/>
  14. <result property="hjbm" column="HJBM" jdbcType="VARCHAR"/>
  15. <result property="bz" column="BZ" jdbcType="VARCHAR"/>
  16. <result property="dw1" column="DW1" jdbcType="NUMERIC"/>
  17. <result property="dw2" column="DW2" jdbcType="NUMERIC"/>
  18. <result property="dw3" column="DW3" jdbcType="NUMERIC"/>
  19. <result property="dw4" column="DW4" jdbcType="NUMERIC"/>
  20. <result property="dw5" column="DW5" jdbcType="NUMERIC"/>
  21. <result property="dw6" column="DW6" jdbcType="NUMERIC"/>
  22. <result property="dw7" column="DW7" jdbcType="NUMERIC"/>
  23. <result property="dw8" column="DW8" jdbcType="NUMERIC"/>
  24. <result property="dw9" column="DW9" jdbcType="NUMERIC"/>
  25. <result property="dw10" column="DW10" jdbcType="NUMERIC"/>
  26. <result property="sjys1" column="SJYS1" jdbcType="NUMERIC"/>
  27. <result property="sjys2" column="SJYS2" jdbcType="NUMERIC"/>
  28. <result property="sjys3" column="SJYS3" jdbcType="NUMERIC"/>
  29. <result property="sjys4" column="SJYS4" jdbcType="NUMERIC"/>
  30. <result property="sjys5" column="SJYS5" jdbcType="NUMERIC"/>
  31. <result property="sjys6" column="SJYS6" jdbcType="NUMERIC"/>
  32. <result property="sjys7" column="SJYS7" jdbcType="NUMERIC"/>
  33. <result property="sjys8" column="SJYS8" jdbcType="NUMERIC"/>
  34. <result property="sjys9" column="SJYS9" jdbcType="NUMERIC"/>
  35. <result property="sjys10" column="SJYS10" jdbcType="NUMERIC"/>
  36. <result property="xtjsyzx" column="XTJSYZX" jdbcType="NUMERIC"/>
  37. <result property="xmz" column="XMZ" jdbcType="NUMERIC"/>
  38. <result property="byj" column="BYJ" jdbcType="NUMERIC"/>
  39. <result property="zrje" column="ZRJE" jdbcType="NUMERIC"/>
  40. <result property="rwsys" column="RWSYS" jdbcType="NUMERIC"/>
  41. <result property="xmzys" column="XMZYS" jdbcType="NUMERIC"/>
  42. <result property="ybzje" column="YBZJE" jdbcType="NUMERIC"/>
  43. <result property="zcbyj" column="ZCBYJ" jdbcType="NUMERIC"/>
  44. <result property="kyys" column="KYYS" jdbcType="NUMERIC"/>
  45. <result property="zcje" column="ZCJE" jdbcType="NUMERIC"/>
  46. <result property="byjysq" column="BYJYSQ" jdbcType="NUMERIC"/>
  47. <result property="byqybz" column="BYQYBZ" jdbcType="NUMERIC"/>
  48. <result property="zrbyj" column="ZRBYJ" jdbcType="NUMERIC"/>
  49. <result property="sjyzx" column="SJYZX" jdbcType="NUMERIC"/>
  50. <result property="dnzyzf" column="DNZYZF" jdbcType="NUMERIC"/>
  51. </resultMap>
  52. <!--查询单个-->
  53. <select id="queryById" resultMap="PrjAnnualbudgetdetailMap">
  54. select *
  55. from prj_AnnualBudgetDetail
  56. where ID = #{id}
  57. </select>
  58. <!--查询指定行数据-->
  59. <select id="queryAllByLimit" resultMap="PrjAnnualbudgetdetailMap">
  60. select *
  61. from prj_AnnualBudgetDetail
  62. <where>
  63. <if test="id != null">
  64. and ID = #{id}
  65. </if>
  66. <if test="fymc != null and fymc != ''">
  67. and FYMC = #{fymc}
  68. </if>
  69. <if test="ysje != null">
  70. and YSJE = #{ysje}
  71. </if>
  72. <if test="ysqje != null">
  73. and YSQJE = #{ysqje}
  74. </if>
  75. <if test="nys != null">
  76. and NYS = #{nys}
  77. </if>
  78. <if test="bm != null and bm != ''">
  79. and BM = #{bm}
  80. </if>
  81. <if test="fj != null and fj != ''">
  82. and FJ = #{fj}
  83. </if>
  84. <if test="nf != null">
  85. and NF = #{nf}
  86. </if>
  87. <if test="px != null and px != ''">
  88. and PX = #{px}
  89. </if>
  90. <if test="hjbm != null and hjbm != ''">
  91. and HJBM = #{hjbm}
  92. </if>
  93. <if test="bz != null and bz != ''">
  94. and BZ = #{bz}
  95. </if>
  96. <if test="dw1 != null">
  97. and DW1 = #{dw1}
  98. </if>
  99. <if test="dw2 != null">
  100. and DW2 = #{dw2}
  101. </if>
  102. <if test="dw3 != null">
  103. and DW3 = #{dw3}
  104. </if>
  105. <if test="dw4 != null">
  106. and DW4 = #{dw4}
  107. </if>
  108. <if test="dw5 != null">
  109. and DW5 = #{dw5}
  110. </if>
  111. <if test="dw6 != null">
  112. and DW6 = #{dw6}
  113. </if>
  114. <if test="dw7 != null">
  115. and DW7 = #{dw7}
  116. </if>
  117. <if test="dw8 != null">
  118. and DW8 = #{dw8}
  119. </if>
  120. <if test="dw9 != null">
  121. and DW9 = #{dw9}
  122. </if>
  123. <if test="dw10 != null">
  124. and DW10 = #{dw10}
  125. </if>
  126. <if test="sjys1 != null">
  127. and SJYS1 = #{sjys1}
  128. </if>
  129. <if test="sjys2 != null">
  130. and SJYS2 = #{sjys2}
  131. </if>
  132. <if test="sjys3 != null">
  133. and SJYS3 = #{sjys3}
  134. </if>
  135. <if test="sjys4 != null">
  136. and SJYS4 = #{sjys4}
  137. </if>
  138. <if test="sjys5 != null">
  139. and SJYS5 = #{sjys5}
  140. </if>
  141. <if test="sjys6 != null">
  142. and SJYS6 = #{sjys6}
  143. </if>
  144. <if test="sjys7 != null">
  145. and SJYS7 = #{sjys7}
  146. </if>
  147. <if test="sjys8 != null">
  148. and SJYS8 = #{sjys8}
  149. </if>
  150. <if test="sjys9 != null">
  151. and SJYS9 = #{sjys9}
  152. </if>
  153. <if test="sjys10 != null">
  154. and SJYS10 = #{sjys10}
  155. </if>
  156. <if test="xtjsyzx != null">
  157. and XTJSYZX = #{xtjsyzx}
  158. </if>
  159. <if test="xmz != null">
  160. and XMZ = #{xmz}
  161. </if>
  162. <if test="byj != null">
  163. and BYJ = #{byj}
  164. </if>
  165. <if test="zrje != null">
  166. and ZRJE = #{zrje}
  167. </if>
  168. <if test="rwsys != null">
  169. and RWSYS = #{rwsys}
  170. </if>
  171. <if test="xmzys != null">
  172. and XMZYS = #{xmzys}
  173. </if>
  174. <if test="ybzje != null">
  175. and YBZJE = #{ybzje}
  176. </if>
  177. <if test="zcbyj != null">
  178. and ZCBYJ = #{zcbyj}
  179. </if>
  180. <if test="kyys != null">
  181. and KYYS = #{kyys}
  182. </if>
  183. <if test="zcje != null">
  184. and ZCJE = #{zcje}
  185. </if>
  186. <if test="byjysq != null">
  187. and BYJYSQ = #{byjysq}
  188. </if>
  189. <if test="byqybz != null">
  190. and BYQYBZ = #{byqybz}
  191. </if>
  192. <if test="zrbyj != null">
  193. and ZRBYJ = #{zrbyj}
  194. </if>
  195. <if test="sjyzx != null">
  196. and SJYZX = #{sjyzx}
  197. </if>
  198. <if test="dnzyzf != null">
  199. and DNZYZF = #{dnzyzf}
  200. </if>
  201. </where>
  202. limit #{pageable.offset}, #{pageable.pageSize}
  203. </select>
  204. <!--统计总行数-->
  205. <select id="count" resultType="java.lang.Long">
  206. select count(1)
  207. from prj_AnnualBudgetDetail
  208. <where>
  209. <if test="id != null">
  210. and ID = #{id}
  211. </if>
  212. <if test="fymc != null and fymc != ''">
  213. and FYMC = #{fymc}
  214. </if>
  215. <if test="ysje != null">
  216. and YSJE = #{ysje}
  217. </if>
  218. <if test="ysqje != null">
  219. and YSQJE = #{ysqje}
  220. </if>
  221. <if test="nys != null">
  222. and NYS = #{nys}
  223. </if>
  224. <if test="bm != null and bm != ''">
  225. and BM = #{bm}
  226. </if>
  227. <if test="fj != null and fj != ''">
  228. and FJ = #{fj}
  229. </if>
  230. <if test="nf != null">
  231. and NF = #{nf}
  232. </if>
  233. <if test="px != null and px != ''">
  234. and PX = #{px}
  235. </if>
  236. <if test="hjbm != null and hjbm != ''">
  237. and HJBM = #{hjbm}
  238. </if>
  239. <if test="bz != null and bz != ''">
  240. and BZ = #{bz}
  241. </if>
  242. <if test="dw1 != null">
  243. and DW1 = #{dw1}
  244. </if>
  245. <if test="dw2 != null">
  246. and DW2 = #{dw2}
  247. </if>
  248. <if test="dw3 != null">
  249. and DW3 = #{dw3}
  250. </if>
  251. <if test="dw4 != null">
  252. and DW4 = #{dw4}
  253. </if>
  254. <if test="dw5 != null">
  255. and DW5 = #{dw5}
  256. </if>
  257. <if test="dw6 != null">
  258. and DW6 = #{dw6}
  259. </if>
  260. <if test="dw7 != null">
  261. and DW7 = #{dw7}
  262. </if>
  263. <if test="dw8 != null">
  264. and DW8 = #{dw8}
  265. </if>
  266. <if test="dw9 != null">
  267. and DW9 = #{dw9}
  268. </if>
  269. <if test="dw10 != null">
  270. and DW10 = #{dw10}
  271. </if>
  272. <if test="sjys1 != null">
  273. and SJYS1 = #{sjys1}
  274. </if>
  275. <if test="sjys2 != null">
  276. and SJYS2 = #{sjys2}
  277. </if>
  278. <if test="sjys3 != null">
  279. and SJYS3 = #{sjys3}
  280. </if>
  281. <if test="sjys4 != null">
  282. and SJYS4 = #{sjys4}
  283. </if>
  284. <if test="sjys5 != null">
  285. and SJYS5 = #{sjys5}
  286. </if>
  287. <if test="sjys6 != null">
  288. and SJYS6 = #{sjys6}
  289. </if>
  290. <if test="sjys7 != null">
  291. and SJYS7 = #{sjys7}
  292. </if>
  293. <if test="sjys8 != null">
  294. and SJYS8 = #{sjys8}
  295. </if>
  296. <if test="sjys9 != null">
  297. and SJYS9 = #{sjys9}
  298. </if>
  299. <if test="sjys10 != null">
  300. and SJYS10 = #{sjys10}
  301. </if>
  302. <if test="xtjsyzx != null">
  303. and XTJSYZX = #{xtjsyzx}
  304. </if>
  305. <if test="xmz != null">
  306. and XMZ = #{xmz}
  307. </if>
  308. <if test="byj != null">
  309. and BYJ = #{byj}
  310. </if>
  311. <if test="zrje != null">
  312. and ZRJE = #{zrje}
  313. </if>
  314. <if test="rwsys != null">
  315. and RWSYS = #{rwsys}
  316. </if>
  317. <if test="xmzys != null">
  318. and XMZYS = #{xmzys}
  319. </if>
  320. <if test="ybzje != null">
  321. and YBZJE = #{ybzje}
  322. </if>
  323. <if test="zcbyj != null">
  324. and ZCBYJ = #{zcbyj}
  325. </if>
  326. <if test="kyys != null">
  327. and KYYS = #{kyys}
  328. </if>
  329. <if test="zcje != null">
  330. and ZCJE = #{zcje}
  331. </if>
  332. <if test="byjysq != null">
  333. and BYJYSQ = #{byjysq}
  334. </if>
  335. <if test="byqybz != null">
  336. and BYQYBZ = #{byqybz}
  337. </if>
  338. <if test="zrbyj != null">
  339. and ZRBYJ = #{zrbyj}
  340. </if>
  341. <if test="sjyzx != null">
  342. and SJYZX = #{sjyzx}
  343. </if>
  344. <if test="dnzyzf != null">
  345. and DNZYZF = #{dnzyzf}
  346. </if>
  347. </where>
  348. </select>
  349. <!--新增所有列-->
  350. <insert id="insert" keyProperty="id" useGeneratedKeys="true">
  351. insert into prj_AnnualBudgetDetail(FYMC, YSJE, YSQJE, NYS, BM, FJ, NF, PX, HJBM, BZ, DW1, DW2, DW3, DW4, DW5, DW6, DW7, DW8, DW9, DW10, SJYS1, SJYS2, SJYS3, SJYS4, SJYS5, SJYS6, SJYS7, SJYS8, SJYS9, SJYS10, XTJSYZX, XMZ, BYJ, ZRJE, RWSYS, XMZYS, YBZJE, ZCBYJ, KYYS, ZCJE, BYJYSQ, BYQYBZ, ZRBYJ, SJYZX, DNZYZF)
  352. values (#{fymc}, #{ysje}, #{ysqje}, #{nys}, #{bm}, #{fj}, #{nf}, #{px}, #{hjbm}, #{bz}, #{dw1}, #{dw2}, #{dw3}, #{dw4}, #{dw5}, #{dw6}, #{dw7}, #{dw8}, #{dw9}, #{dw10}, #{sjys1}, #{sjys2}, #{sjys3}, #{sjys4}, #{sjys5}, #{sjys6}, #{sjys7}, #{sjys8}, #{sjys9}, #{sjys10}, #{xtjsyzx}, #{xmz}, #{byj}, #{zrje}, #{rwsys}, #{xmzys}, #{ybzje}, #{zcbyj}, #{kyys}, #{zcje}, #{byjysq}, #{byqybz}, #{zrbyj}, #{sjyzx}, #{dnzyzf})
  353. </insert>
  354. <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
  355. insert into prj_AnnualBudgetDetail(FYMC, YSJE, YSQJE, NYS, BM, FJ, NF, PX, HJBM, BZ, DW1, DW2, DW3, DW4, DW5, DW6, DW7, DW8, DW9, DW10, SJYS1, SJYS2, SJYS3, SJYS4, SJYS5, SJYS6, SJYS7, SJYS8, SJYS9, SJYS10, XTJSYZX, XMZ, BYJ, ZRJE, RWSYS, XMZYS, YBZJE, ZCBYJ, KYYS, ZCJE, BYJYSQ, BYQYBZ, ZRBYJ, SJYZX, DNZYZF)
  356. values
  357. <foreach collection="entities" item="entity" separator=",">
  358. (#{entity.fymc}, #{entity.ysje}, #{entity.ysqje}, #{entity.nys}, #{entity.bm}, #{entity.fj}, #{entity.nf}, #{entity.px}, #{entity.hjbm}, #{entity.bz}, #{entity.dw1}, #{entity.dw2}, #{entity.dw3}, #{entity.dw4}, #{entity.dw5}, #{entity.dw6}, #{entity.dw7}, #{entity.dw8}, #{entity.dw9}, #{entity.dw10}, #{entity.sjys1}, #{entity.sjys2}, #{entity.sjys3}, #{entity.sjys4}, #{entity.sjys5}, #{entity.sjys6}, #{entity.sjys7}, #{entity.sjys8}, #{entity.sjys9}, #{entity.sjys10}, #{entity.xtjsyzx}, #{entity.xmz}, #{entity.byj}, #{entity.zrje}, #{entity.rwsys}, #{entity.xmzys}, #{entity.ybzje}, #{entity.zcbyj}, #{entity.kyys}, #{entity.zcje}, #{entity.byjysq}, #{entity.byqybz}, #{entity.zrbyj}, #{entity.sjyzx}, #{entity.dnzyzf})
  359. </foreach>
  360. on duplicate key update
  361. FYMC = values(FYMC),
  362. YSJE = values(YSJE),
  363. YSQJE = values(YSQJE),
  364. NYS = values(NYS),
  365. BM = values(BM),
  366. FJ = values(FJ),
  367. NF = values(NF),
  368. PX = values(PX),
  369. HJBM = values(HJBM),
  370. BZ = values(BZ),
  371. DW1 = values(DW1),
  372. DW2 = values(DW2),
  373. DW3 = values(DW3),
  374. DW4 = values(DW4),
  375. DW5 = values(DW5),
  376. DW6 = values(DW6),
  377. DW7 = values(DW7),
  378. DW8 = values(DW8),
  379. DW9 = values(DW9),
  380. DW10 = values(DW10),
  381. SJYS1 = values(SJYS1),
  382. SJYS2 = values(SJYS2),
  383. SJYS3 = values(SJYS3),
  384. SJYS4 = values(SJYS4),
  385. SJYS5 = values(SJYS5),
  386. SJYS6 = values(SJYS6),
  387. SJYS7 = values(SJYS7),
  388. SJYS8 = values(SJYS8),
  389. SJYS9 = values(SJYS9),
  390. SJYS10 = values(SJYS10),
  391. XTJSYZX = values(XTJSYZX),
  392. XMZ = values(XMZ),
  393. BYJ = values(BYJ),
  394. ZRJE = values(ZRJE),
  395. RWSYS = values(RWSYS),
  396. XMZYS = values(XMZYS),
  397. YBZJE = values(YBZJE),
  398. ZCBYJ = values(ZCBYJ),
  399. KYYS = values(KYYS),
  400. ZCJE = values(ZCJE),
  401. BYJYSQ = values(BYJYSQ),
  402. BYQYBZ = values(BYQYBZ),
  403. ZRBYJ = values(ZRBYJ),
  404. SJYZX = values(SJYZX),
  405. DNZYZF = values(DNZYZF)
  406. </insert>
  407. <!--通过主键修改数据-->
  408. <update id="update">
  409. update prj_AnnualBudgetDetail
  410. set XMZYS = #{xmzys},
  411. XTJSYZX = #{xtjsyzx},
  412. SJYZX = #{sjyzx},
  413. YSJE = #{ysje},
  414. XMZ = #{xmz},
  415. BYJ = #{byj}
  416. where ID = #{id}
  417. </update>
  418. <!--通过主键删除-->
  419. <delete id="deleteById">
  420. delete from prj_AnnualBudgetDetail where ID = #{id}
  421. </delete>
  422. <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
  423. insert into prj_AnnualBudgetDetail(FYMC, NYS, BM, FJ, NF, PX, HJBM, BZ, DW1, DW2, DW3, DW4, DW5, DW6, DW7, DW8, DW9, DW10, RWSYS,XMZYS)
  424. values
  425. <foreach collection="entities" item="entity" separator=",">
  426. (#{entity.mc}, #{entity.xm}, #{entity.bm}, #{entity.fj}, #{entity.nf}, #{entity.px}, #{entity.hjbm}, #{entity.bz}, #{entity.dw1}, #{entity.dw2},
  427. #{entity.dw3}, #{entity.dw4}, #{entity.dw5}, #{entity.dw6}, #{entity.dw7}, #{entity.dw8}, #{entity.dw9}, #{entity.dw10}, #{entity.ysje},#{entity.xmzys})
  428. </foreach>
  429. </insert>
  430. <!--获取年度预算-->
  431. <select id="getBudgetList" resultMap="PrjAnnualbudgetdetailMap">
  432. select (select FYMC from prj_AnnualBudgetDetail where BM = b.FJ and NYS = b.NYS) as FJMC, b.*
  433. from prj_AnnualBudgetDetail b
  434. where NYS = #{nys}
  435. </select>
  436. <!--获取费用申请年度预算-->
  437. <select id="getFysqBudgetList" resultMap="PrjAnnualbudgetdetailMap">
  438. select (select FYMC from prj_AnnualBudgetDetail where BM = b.FJ and NYS = b.NYS) as FJMC, b.*
  439. from prj_AnnualBudgetDetail b
  440. where NYS = #{nys}
  441. -- and ID not in (select FYLB from sta_BudgetApproval where FYLB = b.ID and SPZT != '作废')
  442. </select>
  443. <!--批量删除年度预算明细-->
  444. <delete id="batchDelete" parameterType="java.util.ArrayList">
  445. delete from prj_AnnualBudgetDetail
  446. where NYS in
  447. <foreach item="item" index="index" collection="nysList" open = "(" separator = "," close = ")">
  448. #{item}
  449. </foreach>
  450. </delete>
  451. <!--获取费用申请年度预算-->
  452. <select id="getSubNode" resultMap="PrjAnnualbudgetdetailMap">
  453. select (select FYMC from prj_AnnualBudgetDetail where BM = b.FJ and NYS = b.NYS) as FJMC, b.*
  454. from prj_AnnualBudgetDetail b
  455. where NYS = #{nys}
  456. and BM not in (select distinct FJ from prj_AnnualBudgetDetail where FJ != ''AND NYS=#{nys})
  457. </select>
  458. </mapper>