FncVoucherMapper.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  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.ydtech.modules.fnc.dao.FncVoucherMapper">
  4. <resultMap id="BaseResultMap" type="com.ydtech.modules.fnc.model.FncVoucher">
  5. <id column="c_seq_no" jdbcType="VARCHAR" property="cSeqNo"/>
  6. <id column="c_item_no" jdbcType="VARCHAR" property="cItemNo"/>
  7. <result column="c_vou_type" jdbcType="VARCHAR" property="cVouType"/>
  8. <result column="c_vou_kind" jdbcType="VARCHAR" property="cVouKind"/>
  9. <result column="c_red_flag" jdbcType="VARCHAR" property="cRedFlag"/>
  10. <result column="c_cav_flag" jdbcType="VARCHAR" property="cCavFlag"/>
  11. <result column="c_sbjt_no" jdbcType="VARCHAR" property="cSbjtNo"/>
  12. <result column="c_sbjt_memo" jdbcType="VARCHAR" property="cSbjtMemo"/>
  13. <result column="c_vou_memo" jdbcType="VARCHAR" property="cVouMemo"/>
  14. <result column="n_amt" jdbcType="DOUBLE" property="nAmt"/>
  15. <result column="n_exch_amt" jdbcType="DOUBLE" property="nExchAmt"/>
  16. <result column="c_cur_no" jdbcType="VARCHAR" property="cCurNo"/>
  17. <result column="n_rate" jdbcType="DOUBLE" property="nRate"/>
  18. <result column="c_chr_cur_no" jdbcType="VARCHAR" property="cChrCurNo"/>
  19. <result column="c_dptacc_no" jdbcType="VARCHAR" property="cDptaccNo"/>
  20. <result column="c_year_no" jdbcType="VARCHAR" property="cYearNo"/>
  21. <result column="t_vou_tm" jdbcType="DATE" property="tVouTm"/>
  22. <result column="c_dept_name" jdbcType="VARCHAR" property="cDeptName"/>
  23. <result column="c_status" jdbcType="VARCHAR" property="cStatus"/>
  24. <result column="c_crt_user" jdbcType="VARCHAR" property="cCrtUser"/>
  25. <result column="t_crt_tm" jdbcType="DATE" property="tCrtTm"/>
  26. </resultMap>
  27. <sql id="Example_Where_Clause">
  28. <where>
  29. <foreach collection="oredCriteria" item="criteria" separator="or">
  30. <if test="criteria.valid">
  31. <trim prefix="(" prefixOverrides="and" suffix=")">
  32. <foreach collection="criteria.criteria" item="criterion">
  33. <choose>
  34. <when test="criterion.noValue">
  35. and ${criterion.condition}
  36. </when>
  37. <when test="criterion.singleValue">
  38. and ${criterion.condition} #{criterion.value}
  39. </when>
  40. <when test="criterion.betweenValue">
  41. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  42. </when>
  43. <when test="criterion.listValue">
  44. and ${criterion.condition}
  45. <foreach close=")" collection="criterion.value" item="listItem" open="("
  46. separator=",">
  47. #{listItem}
  48. </foreach>
  49. </when>
  50. </choose>
  51. </foreach>
  52. </trim>
  53. </if>
  54. </foreach>
  55. </where>
  56. </sql>
  57. <sql id="Update_By_Example_Where_Clause">
  58. <where>
  59. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  60. <if test="criteria.valid">
  61. <trim prefix="(" prefixOverrides="and" suffix=")">
  62. <foreach collection="criteria.criteria" item="criterion">
  63. <choose>
  64. <when test="criterion.noValue">
  65. and ${criterion.condition}
  66. </when>
  67. <when test="criterion.singleValue">
  68. and ${criterion.condition} #{criterion.value}
  69. </when>
  70. <when test="criterion.betweenValue">
  71. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  72. </when>
  73. <when test="criterion.listValue">
  74. and ${criterion.condition}
  75. <foreach close=")" collection="criterion.value" item="listItem" open="("
  76. separator=",">
  77. #{listItem}
  78. </foreach>
  79. </when>
  80. </choose>
  81. </foreach>
  82. </trim>
  83. </if>
  84. </foreach>
  85. </where>
  86. </sql>
  87. <sql id="Base_Column_List">
  88. c_seq_no, c_item_no, c_vou_type, c_vou_kind, c_red_flag, c_cav_flag, c_sbjt_no, c_sbjt_memo,
  89. c_vou_memo, n_amt, n_exch_amt, c_cur_no, n_rate, c_chr_cur_no, c_dptacc_no, c_year_no,
  90. t_vou_tm, c_dept_name, c_status, c_crt_user, t_crt_tm
  91. </sql>
  92. <select id="selectByExample" parameterType="com.ydtech.modules.fnc.model.FncVoucherExample"
  93. resultMap="BaseResultMap">
  94. select
  95. <if test="distinct">
  96. distinct
  97. </if>
  98. 'true' as QUERYID,
  99. <include refid="Base_Column_List"/>
  100. from fnc_voucher
  101. <if test="_parameter != null">
  102. <include refid="Example_Where_Clause"/>
  103. </if>
  104. <if test="orderByClause != null">
  105. order by ${orderByClause}
  106. </if>
  107. </select>
  108. <select id="selectByPrimaryKey" parameterType="com.ydtech.modules.fnc.model.FncVoucherKey"
  109. resultMap="BaseResultMap">
  110. select
  111. <include refid="Base_Column_List"/>
  112. from fnc_voucher
  113. where c_seq_no = #{cSeqNo,jdbcType=VARCHAR}
  114. and c_item_no = #{cItemNo,jdbcType=VARCHAR}
  115. </select>
  116. <delete id="deleteByPrimaryKey" parameterType="com.ydtech.modules.fnc.model.FncVoucherKey">
  117. delete
  118. from fnc_voucher
  119. where c_seq_no = #{cSeqNo,jdbcType=VARCHAR}
  120. and c_item_no = #{cItemNo,jdbcType=VARCHAR}
  121. </delete>
  122. <delete id="deleteByExample" parameterType="com.ydtech.modules.fnc.model.FncVoucherExample">
  123. delete from fnc_voucher
  124. <if test="_parameter != null">
  125. <include refid="Example_Where_Clause"/>
  126. </if>
  127. </delete>
  128. <insert id="insert" parameterType="com.ydtech.modules.fnc.model.FncVoucher">
  129. insert into fnc_voucher (c_seq_no, c_item_no, c_vou_type,
  130. c_vou_kind, c_red_flag, c_cav_flag,
  131. c_sbjt_no, c_sbjt_memo, c_vou_memo,
  132. n_amt, n_exch_amt, c_cur_no,
  133. n_rate, c_chr_cur_no, c_dptacc_no,
  134. c_year_no, t_vou_tm, c_dept_name,
  135. c_status, c_crt_user, t_crt_tm)
  136. values (#{cSeqNo,jdbcType=VARCHAR}, #{cItemNo,jdbcType=VARCHAR}, #{cVouType,jdbcType=VARCHAR},
  137. #{cVouKind,jdbcType=VARCHAR}, #{cRedFlag,jdbcType=VARCHAR}, #{cCavFlag,jdbcType=VARCHAR},
  138. #{cSbjtNo,jdbcType=VARCHAR}, #{cSbjtMemo,jdbcType=VARCHAR}, #{cVouMemo,jdbcType=VARCHAR},
  139. #{nAmt,jdbcType=DOUBLE}, #{nExchAmt,jdbcType=DOUBLE}, #{cCurNo,jdbcType=VARCHAR},
  140. #{nRate,jdbcType=DOUBLE}, #{cChrCurNo,jdbcType=VARCHAR}, #{cDptaccNo,jdbcType=VARCHAR},
  141. #{cYearNo,jdbcType=VARCHAR}, #{tVouTm,jdbcType=DATE}, #{cDeptName,jdbcType=VARCHAR},
  142. #{cStatus,jdbcType=VARCHAR}, #{cCrtUser,jdbcType=VARCHAR}, #{tCrtTm,jdbcType=DATE})
  143. </insert>
  144. <insert id="insertSelective" parameterType="com.ydtech.modules.fnc.model.FncVoucher">
  145. insert into fnc_voucher
  146. <trim prefix="(" suffix=")" suffixOverrides=",">
  147. <if test="cSeqNo != null">
  148. c_seq_no,
  149. </if>
  150. <if test="cItemNo != null">
  151. c_item_no,
  152. </if>
  153. <if test="cVouType != null">
  154. c_vou_type,
  155. </if>
  156. <if test="cVouKind != null">
  157. c_vou_kind,
  158. </if>
  159. <if test="cRedFlag != null">
  160. c_red_flag,
  161. </if>
  162. <if test="cCavFlag != null">
  163. c_cav_flag,
  164. </if>
  165. <if test="cSbjtNo != null">
  166. c_sbjt_no,
  167. </if>
  168. <if test="cSbjtMemo != null">
  169. c_sbjt_memo,
  170. </if>
  171. <if test="cVouMemo != null">
  172. c_vou_memo,
  173. </if>
  174. <if test="nAmt != null">
  175. n_amt,
  176. </if>
  177. <if test="nExchAmt != null">
  178. n_exch_amt,
  179. </if>
  180. <if test="cCurNo != null">
  181. c_cur_no,
  182. </if>
  183. <if test="nRate != null">
  184. n_rate,
  185. </if>
  186. <if test="cChrCurNo != null">
  187. c_chr_cur_no,
  188. </if>
  189. <if test="cDptaccNo != null">
  190. c_dptacc_no,
  191. </if>
  192. <if test="cYearNo != null">
  193. c_year_no,
  194. </if>
  195. <if test="tVouTm != null">
  196. t_vou_tm,
  197. </if>
  198. <if test="cDeptName != null">
  199. c_dept_name,
  200. </if>
  201. <if test="cStatus != null">
  202. c_status,
  203. </if>
  204. <if test="cCrtUser != null">
  205. c_crt_user,
  206. </if>
  207. <if test="tCrtTm != null">
  208. t_crt_tm,
  209. </if>
  210. </trim>
  211. <trim prefix="values (" suffix=")" suffixOverrides=",">
  212. <if test="cSeqNo != null">
  213. #{cSeqNo,jdbcType=VARCHAR},
  214. </if>
  215. <if test="cItemNo != null">
  216. #{cItemNo,jdbcType=VARCHAR},
  217. </if>
  218. <if test="cVouType != null">
  219. #{cVouType,jdbcType=VARCHAR},
  220. </if>
  221. <if test="cVouKind != null">
  222. #{cVouKind,jdbcType=VARCHAR},
  223. </if>
  224. <if test="cRedFlag != null">
  225. #{cRedFlag,jdbcType=VARCHAR},
  226. </if>
  227. <if test="cCavFlag != null">
  228. #{cCavFlag,jdbcType=VARCHAR},
  229. </if>
  230. <if test="cSbjtNo != null">
  231. #{cSbjtNo,jdbcType=VARCHAR},
  232. </if>
  233. <if test="cSbjtMemo != null">
  234. #{cSbjtMemo,jdbcType=VARCHAR},
  235. </if>
  236. <if test="cVouMemo != null">
  237. #{cVouMemo,jdbcType=VARCHAR},
  238. </if>
  239. <if test="nAmt != null">
  240. #{nAmt,jdbcType=DOUBLE},
  241. </if>
  242. <if test="nExchAmt != null">
  243. #{nExchAmt,jdbcType=DOUBLE},
  244. </if>
  245. <if test="cCurNo != null">
  246. #{cCurNo,jdbcType=VARCHAR},
  247. </if>
  248. <if test="nRate != null">
  249. #{nRate,jdbcType=DOUBLE},
  250. </if>
  251. <if test="cChrCurNo != null">
  252. #{cChrCurNo,jdbcType=VARCHAR},
  253. </if>
  254. <if test="cDptaccNo != null">
  255. #{cDptaccNo,jdbcType=VARCHAR},
  256. </if>
  257. <if test="cYearNo != null">
  258. #{cYearNo,jdbcType=VARCHAR},
  259. </if>
  260. <if test="tVouTm != null">
  261. #{tVouTm,jdbcType=DATE},
  262. </if>
  263. <if test="cDeptName != null">
  264. #{cDeptName,jdbcType=VARCHAR},
  265. </if>
  266. <if test="cStatus != null">
  267. #{cStatus,jdbcType=VARCHAR},
  268. </if>
  269. <if test="cCrtUser != null">
  270. #{cCrtUser,jdbcType=VARCHAR},
  271. </if>
  272. <if test="tCrtTm != null">
  273. #{tCrtTm,jdbcType=DATE},
  274. </if>
  275. </trim>
  276. </insert>
  277. <select id="countByExample" parameterType="com.ydtech.modules.fnc.model.FncVoucherExample"
  278. resultType="java.lang.Long">
  279. select count(*) from fnc_voucher
  280. <if test="_parameter != null">
  281. <include refid="Example_Where_Clause"/>
  282. </if>
  283. </select>
  284. <update id="updateByExampleSelective" parameterType="map">
  285. update fnc_voucher
  286. <set>
  287. <if test="record.cSeqNo != null">
  288. c_seq_no = #{record.cSeqNo,jdbcType=VARCHAR},
  289. </if>
  290. <if test="record.cItemNo != null">
  291. c_item_no = #{record.cItemNo,jdbcType=VARCHAR},
  292. </if>
  293. <if test="record.cVouType != null">
  294. c_vou_type = #{record.cVouType,jdbcType=VARCHAR},
  295. </if>
  296. <if test="record.cVouKind != null">
  297. c_vou_kind = #{record.cVouKind,jdbcType=VARCHAR},
  298. </if>
  299. <if test="record.cRedFlag != null">
  300. c_red_flag = #{record.cRedFlag,jdbcType=VARCHAR},
  301. </if>
  302. <if test="record.cCavFlag != null">
  303. c_cav_flag = #{record.cCavFlag,jdbcType=VARCHAR},
  304. </if>
  305. <if test="record.cSbjtNo != null">
  306. c_sbjt_no = #{record.cSbjtNo,jdbcType=VARCHAR},
  307. </if>
  308. <if test="record.cSbjtMemo != null">
  309. c_sbjt_memo = #{record.cSbjtMemo,jdbcType=VARCHAR},
  310. </if>
  311. <if test="record.cVouMemo != null">
  312. c_vou_memo = #{record.cVouMemo,jdbcType=VARCHAR},
  313. </if>
  314. <if test="record.nAmt != null">
  315. n_amt = #{record.nAmt,jdbcType=DOUBLE},
  316. </if>
  317. <if test="record.nExchAmt != null">
  318. n_exch_amt = #{record.nExchAmt,jdbcType=DOUBLE},
  319. </if>
  320. <if test="record.cCurNo != null">
  321. c_cur_no = #{record.cCurNo,jdbcType=VARCHAR},
  322. </if>
  323. <if test="record.nRate != null">
  324. n_rate = #{record.nRate,jdbcType=DOUBLE},
  325. </if>
  326. <if test="record.cChrCurNo != null">
  327. c_chr_cur_no = #{record.cChrCurNo,jdbcType=VARCHAR},
  328. </if>
  329. <if test="record.cDptaccNo != null">
  330. c_dptacc_no = #{record.cDptaccNo,jdbcType=VARCHAR},
  331. </if>
  332. <if test="record.cYearNo != null">
  333. c_year_no = #{record.cYearNo,jdbcType=VARCHAR},
  334. </if>
  335. <if test="record.tVouTm != null">
  336. t_vou_tm = #{record.tVouTm,jdbcType=DATE},
  337. </if>
  338. <if test="record.cDeptName != null">
  339. c_dept_name = #{record.cDeptName,jdbcType=VARCHAR},
  340. </if>
  341. <if test="record.cStatus != null">
  342. c_status = #{record.cStatus,jdbcType=VARCHAR},
  343. </if>
  344. <if test="record.cCrtUser != null">
  345. c_crt_user = #{record.cCrtUser,jdbcType=VARCHAR},
  346. </if>
  347. <if test="record.tCrtTm != null">
  348. t_crt_tm = #{record.tCrtTm,jdbcType=DATE},
  349. </if>
  350. </set>
  351. <if test="_parameter != null">
  352. <include refid="Update_By_Example_Where_Clause"/>
  353. </if>
  354. </update>
  355. <update id="updateByExample" parameterType="map">
  356. update fnc_voucher
  357. set c_seq_no = #{record.cSeqNo,jdbcType=VARCHAR},
  358. c_item_no = #{record.cItemNo,jdbcType=VARCHAR},
  359. c_vou_type = #{record.cVouType,jdbcType=VARCHAR},
  360. c_vou_kind = #{record.cVouKind,jdbcType=VARCHAR},
  361. c_red_flag = #{record.cRedFlag,jdbcType=VARCHAR},
  362. c_cav_flag = #{record.cCavFlag,jdbcType=VARCHAR},
  363. c_sbjt_no = #{record.cSbjtNo,jdbcType=VARCHAR},
  364. c_sbjt_memo = #{record.cSbjtMemo,jdbcType=VARCHAR},
  365. c_vou_memo = #{record.cVouMemo,jdbcType=VARCHAR},
  366. n_amt = #{record.nAmt,jdbcType=DOUBLE},
  367. n_exch_amt = #{record.nExchAmt,jdbcType=DOUBLE},
  368. c_cur_no = #{record.cCurNo,jdbcType=VARCHAR},
  369. n_rate = #{record.nRate,jdbcType=DOUBLE},
  370. c_chr_cur_no = #{record.cChrCurNo,jdbcType=VARCHAR},
  371. c_dptacc_no = #{record.cDptaccNo,jdbcType=VARCHAR},
  372. c_year_no = #{record.cYearNo,jdbcType=VARCHAR},
  373. t_vou_tm = #{record.tVouTm,jdbcType=DATE},
  374. c_dept_name = #{record.cDeptName,jdbcType=VARCHAR},
  375. c_status = #{record.cStatus,jdbcType=VARCHAR},
  376. c_crt_user = #{record.cCrtUser,jdbcType=VARCHAR},
  377. t_crt_tm = #{record.tCrtTm,jdbcType=DATE}
  378. <if test="_parameter != null">
  379. <include refid="Update_By_Example_Where_Clause"/>
  380. </if>
  381. </update>
  382. <update id="updateByPrimaryKeySelective" parameterType="com.ydtech.modules.fnc.model.FncVoucher">
  383. update fnc_voucher
  384. <set>
  385. <if test="cVouType != null">
  386. c_vou_type = #{cVouType,jdbcType=VARCHAR},
  387. </if>
  388. <if test="cVouKind != null">
  389. c_vou_kind = #{cVouKind,jdbcType=VARCHAR},
  390. </if>
  391. <if test="cRedFlag != null">
  392. c_red_flag = #{cRedFlag,jdbcType=VARCHAR},
  393. </if>
  394. <if test="cCavFlag != null">
  395. c_cav_flag = #{cCavFlag,jdbcType=VARCHAR},
  396. </if>
  397. <if test="cSbjtNo != null">
  398. c_sbjt_no = #{cSbjtNo,jdbcType=VARCHAR},
  399. </if>
  400. <if test="cSbjtMemo != null">
  401. c_sbjt_memo = #{cSbjtMemo,jdbcType=VARCHAR},
  402. </if>
  403. <if test="cVouMemo != null">
  404. c_vou_memo = #{cVouMemo,jdbcType=VARCHAR},
  405. </if>
  406. <if test="nAmt != null">
  407. n_amt = #{nAmt,jdbcType=DOUBLE},
  408. </if>
  409. <if test="nExchAmt != null">
  410. n_exch_amt = #{nExchAmt,jdbcType=DOUBLE},
  411. </if>
  412. <if test="cCurNo != null">
  413. c_cur_no = #{cCurNo,jdbcType=VARCHAR},
  414. </if>
  415. <if test="nRate != null">
  416. n_rate = #{nRate,jdbcType=DOUBLE},
  417. </if>
  418. <if test="cChrCurNo != null">
  419. c_chr_cur_no = #{cChrCurNo,jdbcType=VARCHAR},
  420. </if>
  421. <if test="cDptaccNo != null">
  422. c_dptacc_no = #{cDptaccNo,jdbcType=VARCHAR},
  423. </if>
  424. <if test="cYearNo != null">
  425. c_year_no = #{cYearNo,jdbcType=VARCHAR},
  426. </if>
  427. <if test="tVouTm != null">
  428. t_vou_tm = #{tVouTm,jdbcType=DATE},
  429. </if>
  430. <if test="cDeptName != null">
  431. c_dept_name = #{cDeptName,jdbcType=VARCHAR},
  432. </if>
  433. <if test="cStatus != null">
  434. c_status = #{cStatus,jdbcType=VARCHAR},
  435. </if>
  436. <if test="cCrtUser != null">
  437. c_crt_user = #{cCrtUser,jdbcType=VARCHAR},
  438. </if>
  439. <if test="tCrtTm != null">
  440. t_crt_tm = #{tCrtTm,jdbcType=DATE},
  441. </if>
  442. </set>
  443. where c_seq_no = #{cSeqNo,jdbcType=VARCHAR}
  444. and c_item_no = #{cItemNo,jdbcType=VARCHAR}
  445. </update>
  446. <update id="updateByPrimaryKey" parameterType="com.ydtech.modules.fnc.model.FncVoucher">
  447. update fnc_voucher
  448. set c_vou_type = #{cVouType,jdbcType=VARCHAR},
  449. c_vou_kind = #{cVouKind,jdbcType=VARCHAR},
  450. c_red_flag = #{cRedFlag,jdbcType=VARCHAR},
  451. c_cav_flag = #{cCavFlag,jdbcType=VARCHAR},
  452. c_sbjt_no = #{cSbjtNo,jdbcType=VARCHAR},
  453. c_sbjt_memo = #{cSbjtMemo,jdbcType=VARCHAR},
  454. c_vou_memo = #{cVouMemo,jdbcType=VARCHAR},
  455. n_amt = #{nAmt,jdbcType=DOUBLE},
  456. n_exch_amt = #{nExchAmt,jdbcType=DOUBLE},
  457. c_cur_no = #{cCurNo,jdbcType=VARCHAR},
  458. n_rate = #{nRate,jdbcType=DOUBLE},
  459. c_chr_cur_no = #{cChrCurNo,jdbcType=VARCHAR},
  460. c_dptacc_no = #{cDptaccNo,jdbcType=VARCHAR},
  461. c_year_no = #{cYearNo,jdbcType=VARCHAR},
  462. t_vou_tm = #{tVouTm,jdbcType=DATE},
  463. c_dept_name = #{cDeptName,jdbcType=VARCHAR},
  464. c_status = #{cStatus,jdbcType=VARCHAR},
  465. c_crt_user = #{cCrtUser,jdbcType=VARCHAR},
  466. t_crt_tm = #{tCrtTm,jdbcType=DATE}
  467. where c_seq_no = #{cSeqNo,jdbcType=VARCHAR}
  468. and c_item_no = #{cItemNo,jdbcType=VARCHAR}
  469. </update>
  470. <select id="queryVoucherByCodition" parameterType="com.ydtech.modules.fnc.vo.FncVoucherReq"
  471. resultMap="BaseResultMap">
  472. select
  473. c_seq_no, c_item_no, c_vou_type, c_vou_kind, c_red_flag, c_cav_flag, c_sbjt_no, c_sbjt_memo,
  474. c_vou_memo, n_amt, n_exch_amt, c_cur_no, n_rate, c_chr_cur_no, c_dptacc_no, c_year_no,
  475. t_vou_tm, c_dept_name, case c_status
  476. when '1' then '审核通过'
  477. when '0' then '初始状态'
  478. else '其他' end c_status, case c_crt_user
  479. when 'sys' then '系统自动生成'
  480. else '其他' end c_crt_user, t_crt_tm
  481. from fnc_voucher
  482. <trim prefix="WHERE" prefixOverrides="AND">
  483. <if test="cdptaccNo != null and cdptaccNo != ''">
  484. AND c_dptacc_no = #{cdptaccNo,jdbcType=VARCHAR}
  485. </if>
  486. <if test="cdeptName != null and cdeptName != ''">
  487. AND c_dept_name = #{cdeptName,jdbcType=VARCHAR}
  488. </if>
  489. <if test="cseqNo != null and cseqNo != ''">
  490. AND c_seq_no = #{cseqNo,jdbcType=VARCHAR}
  491. </if>
  492. <if test="cyearNo != null and cyearNo != ''">
  493. AND c_year_no = #{cyearNo,jdbcType=VARCHAR}
  494. </if>
  495. <if test="tvouTmStart != null and tvouTmEnd != null">
  496. AND DATE_FORMAT(t_vou_tm, '%Y-%m-%d') between DATE_FORMAT(#{tvouTmStart,jdbcType=TIMESTAMP}, '%Y-%m-%d')
  497. and DATE_FORMAT(#{tvouTmEnd,jdbcType=TIMESTAMP}, '%Y-%m-%d')
  498. </if>
  499. <if test="csbjtNo != null and csbjtNo != ''">
  500. AND c_sbjt_no = #{csbjtNo,jdbcType=VARCHAR}
  501. </if>
  502. <if test="namtMin != null and namtMax != null ">
  503. AND n_amt between #{namtMin,jdbcType=DOUBLE} and #{namtMax,jdbcType=DOUBLE}
  504. </if>
  505. </trim>
  506. </select>
  507. <select id="exportVoucherByCodition" parameterType="com.ydtech.modules.fnc.vo.FncVoucherReq"
  508. resultType="com.ydtech.modules.fnc.vo.FncVoucherVo">
  509. select
  510. c_dptacc_no cDptaccNo,
  511. (SELECT b.book_name from fnc_book b where b.book_code=a.c_dptacc_no) cDptaccName,
  512. c_seq_no cSeqNo,
  513. c_item_no cItemNo,
  514. c_year_no cYearNo,
  515. t_vou_tm tVouTm,
  516. case c_status
  517. when '1' then '审核通过'
  518. when '0' then '初始状态'
  519. else '其他' end cStatus,
  520. c_sbjt_no cSbjtNo,
  521. c_sbjt_memo cSbjtMemo,
  522. c_cav_flag cCavFlag,
  523. n_amt nAmt,
  524. c_cur_no cCurNo
  525. from fnc_voucher a
  526. <trim prefix="WHERE" prefixOverrides="AND">
  527. <if test="cdptaccNo != null and cdptaccNo != ''">
  528. AND c_dptacc_no = #{cdptaccNo,jdbcType=VARCHAR}
  529. </if>
  530. <if test="cdeptName != null and cdeptName != ''">
  531. AND c_dept_name = #{cdeptName,jdbcType=VARCHAR}
  532. </if>
  533. <if test="cseqNo != null and cseqNo != ''">
  534. AND c_seq_no = #{cseqNo,jdbcType=VARCHAR}
  535. </if>
  536. <if test="cyearNo != null and cyearNo != ''">
  537. AND c_year_no = #{cyearNo,jdbcType=VARCHAR}
  538. </if>
  539. <if test="tvouTmStart != null and tvouTmEnd != null">
  540. AND DATE_FORMAT(t_vou_tm, '%Y-%m-%d') between DATE_FORMAT(#{tvouTmStart,jdbcType=TIMESTAMP}, '%Y-%m-%d')
  541. and DATE_FORMAT(#{tvouTmEnd,jdbcType=TIMESTAMP}, '%Y-%m-%d')
  542. </if>
  543. <if test="csbjtNo != null and csbjtNo != ''">
  544. AND c_sbjt_no = #{csbjtNo,jdbcType=VARCHAR}
  545. </if>
  546. <if test="namtMin != null and namtMax != null ">
  547. AND n_amt between #{namtMin,jdbcType=DOUBLE} and #{namtMax,jdbcType=DOUBLE}
  548. </if>
  549. </trim>
  550. order by t_vou_tm,c_seq_no,c_item_no
  551. </select>
  552. <select id="queryVoucher" parameterType="com.ydtech.modules.fnc.vo.FncVoucherReq" resultMap="BaseResultMap">
  553. select
  554. c_seq_no,c_dptacc_no,c_year_no,t_vou_tm,
  555. case c_status
  556. when '1' then '审核通过'
  557. when '0' then '初始状态'
  558. else '其他' end c_status,
  559. case c_crt_user
  560. when 'sys' then '系统自动生成'
  561. else '其他' end c_crt_user
  562. from fnc_voucher
  563. <trim prefix="WHERE" prefixOverrides="AND">
  564. <if test="cdptaccNo != null and cdptaccNo != ''">
  565. AND c_dptacc_no = #{cdptaccNo,jdbcType=VARCHAR}
  566. </if>
  567. <if test="cseqNo != null and cseqNo != ''">
  568. AND c_seq_no = #{cseqNo,jdbcType=VARCHAR}
  569. </if>
  570. <if test="cyearNo != null and cyearNo != ''">
  571. AND c_year_no = #{cyearNo,jdbcType=VARCHAR}
  572. </if>
  573. <if test="tvouTmStart != null and tvouTmEnd != null ">
  574. AND DATE_FORMAT(t_vou_tm, '%Y-%m-%d') between DATE_FORMAT(#{tvouTmStart,jdbcType=TIMESTAMP}, '%Y-%m-%d')
  575. and DATE_FORMAT(#{tvouTmEnd,jdbcType=TIMESTAMP}, '%Y-%m-%d')
  576. </if>
  577. <if test="cdeptName != null and cdeptName != ''">
  578. AND c_dept_name = #{cdeptName,jdbcType=VARCHAR}
  579. </if>
  580. </trim>
  581. group by c_seq_no,c_dptacc_no,c_year_no,t_vou_tm,c_status,c_crt_user
  582. </select>
  583. </mapper>