GiveBackBailLetterMapper.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  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.unis.transaction.server.dao.GiveBackBailLetterDao'>
  4. <!--退保证金委托函 单表[TY_JYTKWTH]表
  5. 和实体基础映射-->
  6. <resultMap id='ResultMapBase' type='com.unis.transaction.server.entity.givebackbail.GiveBackBailLetterDO'>
  7. <id column='WTHBM' jdbcType='VARCHAR' property='wthbm' /><!--委托函编码#<主键><非空>-->
  8. <result column='TZBT' jdbcType='VARCHAR' property='tzbt' /><!--通知标题-->
  9. <result column='WTHBH' jdbcType='VARCHAR' property='wthbh' /><!--委托函编号-->
  10. <result column='WTLX' jdbcType='INTEGER' property='wtlx' /><!--0销售#<默认值:0>1采购-->
  11. <result column='WTLXMC' jdbcType='VARCHAR' property='wtlxmc' /><!--类型名称-->
  12. <result column='JSDW' jdbcType='VARCHAR' property='jsdw' /><!--接收单位-->
  13. <result column='JSZW' jdbcType='VARCHAR' property='jszw' /><!--接收正文-->
  14. <result column='APCC' jdbcType='VARCHAR' property='apcc' /><!--场次-->
  15. <result column='BZR' jdbcType='VARCHAR' property='bzr' /><!--编制人-->
  16. <result column='BZSJ' jdbcType='DATE' property='bzsj' /><!--编制时间-->
  17. <result column='ZT' jdbcType='VARCHAR' property='zt' /><!--状态值-->
  18. <result column='ZTMC' jdbcType='VARCHAR' property='ztmc' /><!--状态名称-->
  19. <result column='STATUS' jdbcType='INTEGER' property='status' /><!--状态#<默认值:1>1:正常,0:已作废(用做是否删除)-->
  20. <result column='CREATOR' jdbcType='VARCHAR' property='creator' /><!--创建人-->
  21. <result column='CREATOR_CODE' jdbcType='VARCHAR' property='creatorCode' /><!--创建人编码-->
  22. <result column='CREATE_DATE' jdbcType='TIMESTAMP' property='createDate' /><!--创建时间#<默认值:current>-->
  23. <result column='REFRESHER' jdbcType='VARCHAR' property='refresher' /><!--更新人-->
  24. <result column='REFRESHER_CODE' jdbcType='VARCHAR' property='refresherCode' /><!--更新人编码-->
  25. <result column='REFRESH_TIME' jdbcType='TIMESTAMP' property='refreshTime' /><!--更新时间#<默认值:current>-->
  26. <result column='REMARK' jdbcType='CLOB' property='remark' /><!--备注-->
  27. </resultMap>
  28. <!--[TY_JYTKWTH]表基础列-->
  29. <sql id='Column_Base_List'>
  30. WTHBM, TZBT, WTHBH,HTBM,HTBH,CCBM, WTLX, WTLXMC, JSDW, JSZW, APCC, BZR, BZSJ, ZT, ZTMC, STATUS,
  31. CREATOR, CREATOR_CODE, CREATE_DATE, REFRESHER, REFRESHER_CODE, REFRESH_TIME, REMARK
  32. </sql>
  33. <!--[TY_JYTKWTH]带别名的表基础列,别名为大写表名-->
  34. <sql id='Column_Alias_List'>
  35. A.WTHBM, A.TZBT, A.WTHBH,A.HTBM,A.HTBH,A.CCBM, A.WTLX, A.WTLXMC, A.JSDW, A.JSZW, A.APCC, A.BZR, A.BZSJ,
  36. A.ZT, A.ZTMC, A.STATUS, A.CREATOR, A.CREATOR_CODE, A.CREATE_DATE, A.REFRESHER, A.REFRESHER_CODE,
  37. A.REFRESH_TIME, A.REMARK
  38. </sql>
  39. <!--[TY_JYTKWTH]表 order by 条件-->
  40. <sql id='Order_By_Clause'>
  41. ORDER BY WTHBM DESC
  42. </sql>
  43. <!--[TY_JYTKWTH]表 order by 条件-->
  44. <sql id='Order_By_Alias_Clause'>
  45. ORDER BY A.WTHBM DESC
  46. </sql>
  47. <!--插入全部字段,特别注意:插入全部字段时,数据库默认值会不起效-->
  48. <insert id='insertEntity'>
  49. insert into TY_JYTKWTH (WTHBM, TZBT, WTHBH,
  50. WTLX, WTLXMC, JSDW,HTBM,HTBH,CCBM,
  51. JSZW, APCC, BZR, BZSJ,
  52. ZT, ZTMC, STATUS, CREATOR,
  53. CREATOR_CODE, CREATE_DATE, REFRESHER,
  54. REFRESHER_CODE, REFRESH_TIME, REMARK
  55. )
  56. values (#{wthbm,jdbcType=VARCHAR}, #{tzbt,jdbcType=VARCHAR}, #{wthbh,jdbcType=VARCHAR},
  57. #{wtlx,jdbcType=INTEGER}, #{wtlxmc,jdbcType=VARCHAR}, #{jsdw,jdbcType=VARCHAR}, #{htbm,jdbcType=VARCHAR},
  58. #{htbh,jdbcType=VARCHAR}, #{ccbm,jdbcType=VARCHAR},
  59. #{jszw,jdbcType=VARCHAR}, #{apcc,jdbcType=VARCHAR}, #{bzr,jdbcType=VARCHAR}, #{bzsj,jdbcType=DATE},
  60. #{zt,jdbcType=VARCHAR}, #{ztmc,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{creator,jdbcType=VARCHAR},
  61. #{creatorCode,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{refresher,jdbcType=VARCHAR},
  62. #{refresherCode,jdbcType=VARCHAR}, #{refreshTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=CLOB}
  63. )
  64. </insert>
  65. <!--选择性插入字段,只插入值不为null的属性对应的字段-->
  66. <insert id='insertEntitySelective'>
  67. insert into TY_JYTKWTH
  68. <trim prefix='(' suffix=')' suffixOverrides=','>
  69. <if test='wthbm != null and wthbm != ""'>
  70. WTHBM,
  71. </if>
  72. <if test='tzbt != null and tzbt != ""'>
  73. TZBT,
  74. </if>
  75. <if test='wthbh != null and wthbh != ""'>
  76. WTHBH,
  77. </if>
  78. <if test='wtlx != null'>
  79. WTLX,
  80. </if>
  81. <if test='wtlxmc != null and wtlxmc != ""'>
  82. WTLXMC,
  83. </if>
  84. <if test='jsdw != null and jsdw != ""'>
  85. JSDW,
  86. </if>
  87. <if test='jsdwbm != null and jsdwbm != ""'>
  88. JSDWBM,
  89. </if>
  90. <if test='jszw != null and jszw != ""'>
  91. JSZW,
  92. </if>
  93. <if test='apcc != null and apcc != ""'>
  94. APCC,
  95. </if>
  96. <if test='bzr != null and bzr != ""'>
  97. BZR,
  98. </if>
  99. <if test='bzsj != null'>
  100. BZSJ,
  101. </if>
  102. <if test='zt != null and zt != ""'>
  103. ZT,
  104. </if>
  105. <if test='ztmc != null and ztmc != ""'>
  106. ZTMC,
  107. </if>
  108. <if test='status != null'>
  109. STATUS,
  110. </if>
  111. <if test='creator != null and creator != ""'>
  112. CREATOR,
  113. </if>
  114. <if test='creatorCode != null and creatorCode != ""'>
  115. CREATOR_CODE,
  116. </if>
  117. <if test='createDate != null'>
  118. CREATE_DATE,
  119. </if>
  120. <if test='refresher != null and refresher != ""'>
  121. REFRESHER,
  122. </if>
  123. <if test='refresherCode != null and refresherCode != ""'>
  124. REFRESHER_CODE,
  125. </if>
  126. <if test='refreshTime != null'>
  127. REFRESH_TIME,
  128. </if>
  129. <if test='remark != null and remark != ""'>
  130. REMARK,
  131. </if>
  132. <if test='htbm != null and htbm != ""'>
  133. htbm,
  134. </if>
  135. <if test='htbh != null and htbh != ""'>
  136. htbh,
  137. </if>
  138. <if test='ccbm != null and ccbm != ""'>
  139. ccbm,
  140. </if>
  141. <if test='wtfbm != null and wtfbm != ""'>
  142. wtfbm
  143. </if>
  144. </trim>
  145. <trim prefix='values (' suffix=')' suffixOverrides=','>
  146. <if test='wthbm != null and wthbm != ""'>
  147. #{wthbm,jdbcType=VARCHAR},
  148. </if>
  149. <if test='tzbt != null and tzbt != ""'>
  150. #{tzbt,jdbcType=VARCHAR},
  151. </if>
  152. <if test='wthbh != null and wthbh != ""'>
  153. #{wthbh,jdbcType=VARCHAR},
  154. </if>
  155. <if test='wtlx != null'>
  156. #{wtlx,jdbcType=INTEGER},
  157. </if>
  158. <if test='wtlxmc != null and wtlxmc != ""'>
  159. #{wtlxmc,jdbcType=VARCHAR},
  160. </if>
  161. <if test='jsdw != null and jsdw != ""'>
  162. #{jsdw,jdbcType=VARCHAR},
  163. </if>
  164. <if test='jsdwbm != null and jsdwbm != ""'>
  165. #{jsdwbm,jdbcType=VARCHAR},
  166. </if>
  167. <if test='jszw != null and jszw != ""'>
  168. #{jszw,jdbcType=VARCHAR},
  169. </if>
  170. <if test='apcc != null and apcc != ""'>
  171. #{apcc,jdbcType=VARCHAR},
  172. </if>
  173. <if test='bzr != null and bzr != ""'>
  174. #{bzr,jdbcType=VARCHAR},
  175. </if>
  176. <if test='bzsj != null'>
  177. #{bzsj,jdbcType=DATE},
  178. </if>
  179. <if test='zt != null and zt != ""'>
  180. #{zt,jdbcType=VARCHAR},
  181. </if>
  182. <if test='ztmc != null and ztmc != ""'>
  183. #{ztmc,jdbcType=VARCHAR},
  184. </if>
  185. <if test='status != null'>
  186. #{status,jdbcType=INTEGER},
  187. </if>
  188. <if test='creator != null and creator != ""'>
  189. #{creator,jdbcType=VARCHAR},
  190. </if>
  191. <if test='creatorCode != null and creatorCode != ""'>
  192. #{creatorCode,jdbcType=VARCHAR},
  193. </if>
  194. <if test='createDate != null'>
  195. #{createDate,jdbcType=TIMESTAMP},
  196. </if>
  197. <if test='refresher != null and refresher != ""'>
  198. #{refresher,jdbcType=VARCHAR},
  199. </if>
  200. <if test='refresherCode != null and refresherCode != ""'>
  201. #{refresherCode,jdbcType=VARCHAR},
  202. </if>
  203. <if test='refreshTime != null'>
  204. #{refreshTime,jdbcType=TIMESTAMP},
  205. </if>
  206. <if test='remark != null and remark != ""'>
  207. #{remark,jdbcType=CLOB},
  208. </if>
  209. <if test='htbm != null and htbm != ""'>
  210. #{htbm,jdbcType=VARCHAR},
  211. </if>
  212. <if test='htbh != null and htbh != ""'>
  213. #{htbh,jdbcType=VARCHAR},
  214. </if>
  215. <if test='ccbm != null and ccbm != ""'>
  216. #{ccbm,jdbcType=VARCHAR},
  217. </if>
  218. <if test='wtfbm != null and wtfbm != ""'>
  219. #{wtfbm,jdbcType=VARCHAR}
  220. </if>
  221. </trim>
  222. </insert>
  223. <!--更新状态-->
  224. <update id='updateStatusByEntity'>
  225. update TY_JYTKWTH
  226. <set>
  227. <if test='refresher != null and refresher != ""'>
  228. REFRESHER = #{refresher,jdbcType=VARCHAR},
  229. </if>
  230. <if test='refresherCode != null and refresherCode != ""'>
  231. REFRESHER_CODE = #{refresherCode,jdbcType=VARCHAR},
  232. </if>
  233. <if test='refreshTime != null'>
  234. REFRESH_TIME = #{refreshTime,jdbcType=TIMESTAMP},
  235. </if>
  236. <if test='zt != null and zt != ""'>
  237. ZT = #{zt,jdbcType=VARCHAR},
  238. </if>
  239. <if test='ztmc != null and ztmc != ""'>
  240. ZTMC = #{ztmc,jdbcType=VARCHAR},
  241. </if>
  242. <if test='wthbh != null and wthbh != ""'>
  243. WTHBH = #{wthbh,jdbcType=VARCHAR},
  244. </if>
  245. <if test='wtfbm != null and wtfbm != ""'>
  246. WTFBM = #{wtfbm,jdbcType=VARCHAR},
  247. </if>
  248. <if test='wtlxmc != null and wtlxmc != ""'>
  249. WTLXMC = #{wtlxmc,jdbcType=VARCHAR},
  250. </if>
  251. <if test='status != null'>
  252. STATUS = #{status,jdbcType=INTEGER},
  253. </if>
  254. <if test='htbm != null and htbm != ""'>
  255. htbm = #{htbm,jdbcType=VARCHAR},
  256. </if>
  257. <if test='htbh != null and htbh != ""'>
  258. htbh = #{htbh,jdbcType=VARCHAR},
  259. </if>
  260. <if test='ccbm != null and ccbm != ""'>
  261. ccbm = #{ccbm,jdbcType=VARCHAR}
  262. </if>
  263. </set>
  264. <where>
  265. <!--此处为必填条件,如不满足则不执行,以免更新全部-->
  266. <choose>
  267. <when test='wthbm !=null and wthbm != ""'>
  268. WTHBM = #{wthbm,jdbcType=VARCHAR}
  269. </when>
  270. <otherwise>
  271. AND 1=0
  272. </otherwise>
  273. </choose>
  274. </where>
  275. </update>
  276. <!--根据某些属性更新全部字段-->
  277. <update id='updateByEntity'>
  278. update TY_JYTKWTH
  279. set TZBT = #{tzbt,jdbcType=VARCHAR},
  280. WTHBH = #{wthbh,jdbcType=VARCHAR},
  281. WTFBM = #{wtfbm,jdbcType=VARCHAR},
  282. WTLX = #{wtlx,jdbcType=INTEGER},
  283. WTLXMC = #{wtlxmc,jdbcType=VARCHAR},
  284. JSDW = #{jsdw,jdbcType=VARCHAR},
  285. JSZW = #{jszw,jdbcType=VARCHAR},
  286. APCC = #{apcc,jdbcType=VARCHAR},
  287. BZR = #{bzr,jdbcType=VARCHAR},
  288. BZSJ = #{bzsj,jdbcType=DATE},
  289. WTFBM = #{wtfbm,jdbcType=VARCHAR},
  290. ZT = #{zt,jdbcType=VARCHAR},
  291. ZTMC = #{ztmc,jdbcType=VARCHAR},
  292. STATUS = #{status,jdbcType=INTEGER},
  293. REFRESHER = #{refresher,jdbcType=VARCHAR},
  294. REFRESHER_CODE = #{refresherCode,jdbcType=VARCHAR},
  295. REFRESH_TIME = #{refreshTime,jdbcType=TIMESTAMP},
  296. htbm = #{htbm,jdbcType=VARCHAR},
  297. htbh = #{htbh,jdbcType=VARCHAR},
  298. ccbm = #{ccbm,jdbcType=VARCHAR},
  299. REMARK = #{remark,jdbcType=CLOB}
  300. <where>
  301. <!--此处为必填条件,如不满足则不执行,以免更新全部-->
  302. <choose>
  303. <when test='wthbm !=null and wthbm != ""'>
  304. WTHBM = #{wthbm,jdbcType=VARCHAR}
  305. </when>
  306. <otherwise>
  307. AND 1=0
  308. </otherwise>
  309. </choose>
  310. <!--此处可添加状态条件等-->
  311. <if test='status!=null'>
  312. AND STATUS = #{status,jdbcType=INTEGER}
  313. </if>
  314. </where>
  315. </update>
  316. <!--根据实体不为null的属性,选择性更新字段-->
  317. <update id='updateByEntitySelective'>
  318. update TY_JYTKWTH
  319. <set>
  320. <if test='tzbt != null and tzbt != ""'>
  321. TZBT = #{tzbt,jdbcType=VARCHAR},
  322. </if>
  323. <if test='wthbh != null and wthbh != ""'>
  324. WTHBH = #{wthbh,jdbcType=VARCHAR},
  325. </if>
  326. <if test='wtfbm != null and wtfbm != ""'>
  327. WTFBM = #{wtfbm,jdbcType=VARCHAR},
  328. </if>
  329. <if test='wtlx != null'>
  330. WTLX = #{wtlx,jdbcType=INTEGER},
  331. </if>
  332. <if test='wtlxmc != null and wtlxmc != ""'>
  333. WTLXMC = #{wtlxmc,jdbcType=VARCHAR},
  334. </if>
  335. <if test='jsdw != null and jsdw != ""'>
  336. JSDW = #{jsdw,jdbcType=VARCHAR},
  337. </if>
  338. <if test='jsdwbm != null and jsdwbm != ""'>
  339. JSDWBM = #{jsdwbm,jdbcType=VARCHAR},
  340. </if>
  341. <if test='jszw != null and jszw != ""'>
  342. JSZW = #{jszw,jdbcType=VARCHAR},
  343. </if>
  344. <if test='apcc != null and apcc != ""'>
  345. APCC = #{apcc,jdbcType=VARCHAR},
  346. </if>
  347. <if test='bzr != null and bzr != ""'>
  348. BZR = #{bzr,jdbcType=VARCHAR},
  349. </if>
  350. <if test='bzsj != null'>
  351. BZSJ = #{bzsj,jdbcType=DATE},
  352. </if>
  353. <if test='zt != null and zt != ""'>
  354. ZT = #{zt,jdbcType=VARCHAR},
  355. </if>
  356. <if test='ztmc != null and ztmc != ""'>
  357. ZTMC = #{ztmc,jdbcType=VARCHAR},
  358. </if>
  359. <if test='status != null'>
  360. STATUS = #{status,jdbcType=INTEGER},
  361. </if>
  362. <if test='refresher != null and refresher != ""'>
  363. REFRESHER = #{refresher,jdbcType=VARCHAR},
  364. </if>
  365. <if test='refresherCode != null and refresherCode != ""'>
  366. REFRESHER_CODE = #{refresherCode,jdbcType=VARCHAR},
  367. </if>
  368. <if test='refreshTime != null'>
  369. REFRESH_TIME = #{refreshTime,jdbcType=TIMESTAMP},
  370. </if>
  371. <if test='remark != null and remark != ""'>
  372. REMARK = #{remark,jdbcType=CLOB},
  373. </if>
  374. <if test='htbm != null and htbm != ""'>
  375. htbm = #{htbm,jdbcType=VARCHAR},
  376. </if>
  377. <if test='htbh != null and htbh != ""'>
  378. htbh = #{htbh,jdbcType=VARCHAR},
  379. </if>
  380. <if test='ccbm != null and ccbm != ""'>
  381. ccbm = #{ccbm,jdbcType=VARCHAR}
  382. </if>
  383. </set>
  384. <where>
  385. <!--此处为必填条件,如不满足则不执行,以免更新全部-->
  386. <choose>
  387. <when test='wthbm !=null and wthbm != ""'>
  388. WTHBM = #{wthbm,jdbcType=VARCHAR}
  389. </when>
  390. <otherwise>
  391. AND 1=0
  392. </otherwise>
  393. </choose>
  394. <!--此处可添加状态条件等-->
  395. <if test='status!=null'>
  396. AND STATUS = #{status,jdbcType=INTEGER}
  397. </if>
  398. </where>
  399. </update>
  400. <!--[真删除]根据实体的某些属性进行单条或者批量删除
  401. 此处不支持id集合的形式,如有其他情况自行添加-->
  402. <delete id='deleteByEntity'>
  403. DELETE FROM TY_JYTKWTH
  404. <where>
  405. <!--此处为必填条件,如不满足则不执行,以免更新全部-->
  406. <choose>
  407. <when test='wthbm !=null and wthbm != ""'>
  408. WTHBM = #{wthbm,jdbcType=VARCHAR}
  409. </when>
  410. <when test='apcc !=null and apcc != ""'>
  411. APCC = #{apcc,jdbcType=VARCHAR}
  412. </when>
  413. <otherwise>
  414. AND 1=0
  415. </otherwise>
  416. </choose>
  417. <!--此处可添加状态条件等-->
  418. <if test='status!=null'>
  419. AND STATUS = #{status,jdbcType=INTEGER}
  420. </if>
  421. </where>
  422. </delete>
  423. <!--[假删除]根据实体的某些属性进行单条或者批量删除
  424. 此处不支持id集合的形式,如有其他情况自行添加-->
  425. <update id='deleteShamByEntity'>
  426. update TY_JYTKWTH
  427. set
  428. STATUS = #{status,jdbcType=INTEGER}
  429. <where>
  430. <!--此处为必填条件,如不满足则不执行,以免更新全部-->
  431. <choose>
  432. <when test='wthbm !=null and wthbm != ""'>
  433. WTHBM = #{wthbm,jdbcType=VARCHAR}
  434. </when>
  435. <when test='apcc !=null and apcc != ""'>
  436. APCC = #{apcc,jdbcType=VARCHAR}
  437. </when>
  438. <otherwise>
  439. AND 1=0
  440. </otherwise>
  441. </choose>
  442. </where>
  443. </update>
  444. <!--根据实体的某些属性查询数量-->
  445. <select id='selectCountByEntity' resultType='java.lang.Integer'>
  446. SELECT
  447. COUNT(*)
  448. FROM TY_JYTKWTH
  449. <where>
  450. <!--if条件要注意,以免误删除或者更新全部-->
  451. <if test='wthbm !=null and wthbm != ""'>
  452. AND WTHBM = #{wthbm,jdbcType=VARCHAR}
  453. </if>
  454. <if test='tzbt !=null and tzbt != ""'>
  455. AND TZBT = #{tzbt,jdbcType=VARCHAR}
  456. </if>
  457. <if test='wthbh !=null and wthbh != ""'>
  458. AND WTHBH = #{wthbh,jdbcType=VARCHAR}
  459. </if>
  460. <if test='wtlx !=null'>
  461. AND WTLX = #{wtlx,jdbcType=INTEGER}
  462. </if>
  463. <if test='wtlxmc !=null and wtlxmc != ""'>
  464. AND WTLXMC = #{wtlxmc,jdbcType=VARCHAR}
  465. </if>
  466. <!--此处可添加状态条件等-->
  467. <if test='status!=null'>
  468. AND STATUS = #{status,jdbcType=INTEGER}
  469. </if>
  470. </where>
  471. </select>
  472. <!--根据实体的唯一标示查询,如id,联合主键,业务唯一标示等,多种方式均可,但要保证数据唯一
  473. 此处只使用系统id,如有其他情况自行添加-->
  474. <select id='selectById' resultType='com.unis.transaction.common.vo.givebackbail.GiveBackBailLetterVO'>
  475. SELECT
  476. *
  477. FROM TY_JYTKWTH
  478. <where>
  479. <!--此处为必填条件,如不满足则不执行,以免查询全部-->
  480. <choose>
  481. <when test='wthbm !=null and wthbm != ""'>
  482. WTHBM = #{wthbm,jdbcType=VARCHAR}
  483. </when>
  484. <when test='apcc !=null and apcc != ""'>
  485. APCC = #{apcc,jdbcType=VARCHAR}
  486. </when>
  487. <otherwise>
  488. AND 1=0
  489. </otherwise>
  490. </choose>
  491. <!--此处可添加状态条件等-->
  492. <if test='status!=null'>
  493. AND STATUS = #{status,jdbcType=INTEGER}
  494. </if>
  495. </where>
  496. </select>
  497. <!--根据实体的某些属性查询分页数据
  498. 此处选取其中1-2个字段,需要根据实际情况修改-->
  499. <select id='selectPageByEntity' resultType='com.unis.transaction.common.vo.givebackbail.GiveBackBailLetterVO'>
  500. SELECT
  501. <include refid='Column_Base_List' />
  502. FROM TY_JYTKWTH
  503. <where>
  504. <!--自定义配置的检索条件-->
  505. <if test='wthbh !=null and wthbh != ""'>
  506. AND WTHBH like CONCAT('%',CONCAT(#{wthbh,jdbcType=VARCHAR},'%'))
  507. </if>
  508. <if test='htbm !=null and htbm != ""'>
  509. AND htbm like '%' || #{htbm} || '%'
  510. </if>
  511. <if test='htbh !=null and htbh != ""'>
  512. AND htbh like '%' || #{htbh} || '%'
  513. </if>
  514. <if test='wtlx !=null'>
  515. AND WTLX = #{wtlx,jdbcType=INTEGER}
  516. </if>
  517. <if test='jsdw !=null and jsdw != ""'>
  518. AND JSDW = #{jsdw,jdbcType=VARCHAR}
  519. </if>
  520. <if test='zt !=null and zt != ""'>
  521. AND ZT = #{zt,jdbcType=VARCHAR}
  522. </if>
  523. <if test='creator !=null and creator != ""'>
  524. AND CREATOR = #{creator,jdbcType=VARCHAR}
  525. </if>
  526. <!--if条件要注意,以免误删除或者更新全部-->
  527. <if test='wthbm !=null and wthbm != ""'>
  528. AND WTHBM = #{wthbm,jdbcType=VARCHAR}
  529. </if>
  530. <if test='tzbt !=null and tzbt != ""'>
  531. AND TZBT = #{tzbt,jdbcType=VARCHAR}
  532. </if>
  533. <if test='wtlxmc !=null and wtlxmc != ""'>
  534. AND WTLXMC = #{wtlxmc,jdbcType=VARCHAR}
  535. </if>
  536. <!--此处可添加状态条件等-->
  537. <if test='status!=null'>
  538. AND STATUS = #{status,jdbcType=INTEGER}
  539. </if>
  540. </where>
  541. </select>
  542. <!--根据实体的某些属性查询多条数据
  543. 此处选取其中1-2个字段,需要根据实际情况修改-->
  544. <select id='selectByEntity' resultType='com.unis.transaction.common.vo.givebackbail.GiveBackBailLetterVO'>
  545. SELECT
  546. <include refid='Column_Base_List' />
  547. FROM TY_JYTKWTH
  548. <where>
  549. <!--自定义配置的检索条件-->
  550. <if test='wthbh !=null and wthbh != ""'>
  551. AND WTHBH = #{wthbh,jdbcType=VARCHAR}
  552. </if>
  553. <if test='wtlx !=null'>
  554. AND WTLX = #{wtlx,jdbcType=INTEGER}
  555. </if>
  556. <if test='jsdw !=null and jsdw != ""'>
  557. AND JSDW = #{jsdw,jdbcType=VARCHAR}
  558. </if>
  559. <if test='zt !=null and zt != ""'>
  560. AND ZT = #{zt,jdbcType=VARCHAR}
  561. </if>
  562. <if test='creator !=null and creator != ""'>
  563. AND CREATOR = #{creator,jdbcType=VARCHAR}
  564. </if>
  565. <!--if条件要注意,以免误删除或者更新全部-->
  566. <if test='wthbm !=null and wthbm != ""'>
  567. AND WTHBM = #{wthbm,jdbcType=VARCHAR}
  568. </if>
  569. <if test='tzbt !=null and tzbt != ""'>
  570. AND TZBT = #{tzbt,jdbcType=VARCHAR}
  571. </if>
  572. <if test='wtlxmc !=null and wtlxmc != ""'>
  573. AND WTLXMC = #{wtlxmc,jdbcType=VARCHAR}
  574. </if>
  575. <!--此处可添加状态条件等-->
  576. <if test='status!=null'>
  577. AND STATUS = #{status,jdbcType=INTEGER}
  578. </if>
  579. </where>
  580. <include refid='Order_By_Clause' />
  581. </select>
  582. <select id="selectHt" resultType="com.unis.transaction.common.vo.givebackbail.GiveBackBailLetterVO" parameterType="com.unis.transaction.common.vo.givebackbail.GiveBackBailLetterVO">
  583. select htbm from ty_jytkwth
  584. <where>
  585. htbm is not null
  586. <if test='zt != null and zt != ""'>
  587. AND zt &lt;&gt; #{zt}
  588. </if>
  589. <if test='wtfbm !=null and wtfbm != ""'>
  590. AND wtfbm = #{wtfbm}
  591. </if>
  592. </where>
  593. </select>
  594. <select id="selectYfsHt" resultType="com.unis.transaction.common.vo.givebackbail.GiveBackBailLetterVO">
  595. select * from ty_jytkwth where zt = #{zt} and wtfbm=#{wtfbm} and htbm is not null
  596. </select>
  597. </mapper>