BankinformationMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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.usoftchina.saas.document.mapper.BankinformationMapper" >
  4. <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Bankinformation" >
  5. <id column="bk_id" property="id" jdbcType="INTEGER" />
  6. <result column="bk_bankcode" property="bk_bankcode" jdbcType="VARCHAR" />
  7. <result column="bk_bankname" property="bk_bankname" jdbcType="VARCHAR" />
  8. <result column="bk_date" property="bk_date" jdbcType="TIMESTAMP" />
  9. <result column="bk_type" property="bk_type" jdbcType="VARCHAR" />
  10. <result column="bk_beginamount" property="bk_beginamount" jdbcType="DOUBLE" />
  11. <result column="bk_thisamount" property="bk_thisamount" jdbcType="DOUBLE" />
  12. <result column="bk_status" property="bk_status" jdbcType="VARCHAR" />
  13. <result column="bk_statuscode" property="bk_statuscode" jdbcType="VARCHAR" />
  14. <result column="bk_recorderid" property="bk_recorderid" jdbcType="INTEGER" />
  15. <result column="bk_recorder" property="bk_recorder" jdbcType="VARCHAR" />
  16. <result column="bk_recorddate" property="bk_recorddate" jdbcType="TIMESTAMP" />
  17. <result column="bk_ym" property="bk_ym" jdbcType="INTEGER" />
  18. <result column="companyid" property="companyId" jdbcType="INTEGER" />
  19. <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
  20. <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
  21. <result column="bk_text1" property="bk_text1" jdbcType="VARCHAR" />
  22. <result column="bk_text2" property="bk_text2" jdbcType="VARCHAR" />
  23. <result column="bk_text3" property="bk_text3" jdbcType="VARCHAR" />
  24. <result column="bk_text4" property="bk_text4" jdbcType="VARCHAR" />
  25. <result column="bk_text5" property="bk_text5" jdbcType="VARCHAR" />
  26. </resultMap>
  27. <resultMap id="ResultMapWithBLOBs" type="com.usoftchina.saas.document.entities.Bankinformation" extends="BaseResultMap" >
  28. <result column="bk_remark" property="bk_remark" jdbcType="LONGVARCHAR" />
  29. </resultMap>
  30. <sql id="Base_Column_List" >
  31. bk_id, bk_bankcode, bk_bankname, bk_date, bk_type, bk_beginamount, bk_thisamount,
  32. bk_status, bk_statuscode, bk_recorderid, bk_recorder, bk_recorddate, bk_ym, companyid,
  33. updaterId, updateTime, bk_text1, bk_text2, bk_text3, bk_text4, bk_text5
  34. </sql>
  35. <sql id="Blob_Column_List" >
  36. bk_remark
  37. </sql>
  38. <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
  39. select
  40. <include refid="Base_Column_List" />
  41. ,
  42. <include refid="Blob_Column_List" />
  43. from bankinformation
  44. where bk_id = #{id,jdbcType=INTEGER}
  45. </select>
  46. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  47. delete from bankinformation
  48. where bk_id = #{id,jdbcType=INTEGER}
  49. </delete>
  50. <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
  51. insert into bankinformation (bk_id, bk_bankcode, bk_bankname,
  52. bk_date, bk_type, bk_beginamount,
  53. bk_thisamount, bk_status, bk_statuscode,
  54. bk_recorderid, bk_recorder, bk_recorddate,
  55. bk_ym, companyid, updaterId,
  56. updateTime, bk_text1, bk_text2,
  57. bk_text3, bk_text4, bk_text5,
  58. bk_remark)
  59. values (#{bk_bankcode,jdbcType=VARCHAR}, #{bk_bankname,jdbcType=VARCHAR},
  60. #{bk_date,jdbcType=TIMESTAMP}, #{bk_type,jdbcType=VARCHAR}, #{bk_beginamount,jdbcType=DOUBLE},
  61. #{bk_thisamount,jdbcType=DOUBLE}, #{bk_status,jdbcType=VARCHAR}, #{bk_statuscode,jdbcType=VARCHAR},
  62. #{bk_recorderid,jdbcType=INTEGER}, #{bk_recorder,jdbcType=VARCHAR}, #{bk_recorddate,jdbcType=TIMESTAMP},
  63. #{bk_ym,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER},
  64. #{updateTime,jdbcType=TIMESTAMP}, #{bk_text1,jdbcType=VARCHAR}, #{bk_text2,jdbcType=VARCHAR},
  65. #{bk_text3,jdbcType=VARCHAR}, #{bk_text4,jdbcType=VARCHAR}, #{bk_text5,jdbcType=VARCHAR},
  66. #{bk_remark,jdbcType=LONGVARCHAR})
  67. </insert>
  68. <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
  69. insert into bankinformation
  70. <trim prefix="(" suffix=")" suffixOverrides="," >
  71. <if test="bk_bankcode != null" >
  72. bk_bankcode,
  73. </if>
  74. <if test="bk_bankname != null" >
  75. bk_bankname,
  76. </if>
  77. <if test="bk_date != null" >
  78. bk_date,
  79. </if>
  80. <if test="bk_type != null" >
  81. bk_type,
  82. </if>
  83. <if test="bk_beginamount != null" >
  84. bk_beginamount,
  85. </if>
  86. <if test="bk_thisamount != null" >
  87. bk_thisamount,
  88. </if>
  89. <if test="bk_status != null" >
  90. bk_status,
  91. </if>
  92. <if test="bk_statuscode != null" >
  93. bk_statuscode,
  94. </if>
  95. <if test="bk_recorderid != null" >
  96. bk_recorderid,
  97. </if>
  98. <if test="bk_recorder != null" >
  99. bk_recorder,
  100. </if>
  101. <if test="bk_recorddate != null" >
  102. bk_recorddate,
  103. </if>
  104. <if test="bk_ym != null" >
  105. bk_ym,
  106. </if>
  107. <if test="companyId != null" >
  108. companyid,
  109. </if>
  110. <if test="updaterId != null" >
  111. updaterId,
  112. </if>
  113. <if test="updateTime != null" >
  114. updateTime,
  115. </if>
  116. <if test="bk_text1 != null" >
  117. bk_text1,
  118. </if>
  119. <if test="bk_text2 != null" >
  120. bk_text2,
  121. </if>
  122. <if test="bk_text3 != null" >
  123. bk_text3,
  124. </if>
  125. <if test="bk_text4 != null" >
  126. bk_text4,
  127. </if>
  128. <if test="bk_text5 != null" >
  129. bk_text5,
  130. </if>
  131. <if test="bk_remark != null" >
  132. bk_remark,
  133. </if>
  134. </trim>
  135. <trim prefix="values (" suffix=")" suffixOverrides="," >
  136. <if test="bk_bankcode != null" >
  137. #{bk_bankcode,jdbcType=VARCHAR},
  138. </if>
  139. <if test="bk_bankname != null" >
  140. #{bk_bankname,jdbcType=VARCHAR},
  141. </if>
  142. <if test="bk_date != null" >
  143. #{bk_date,jdbcType=TIMESTAMP},
  144. </if>
  145. <if test="bk_type != null" >
  146. #{bk_type,jdbcType=VARCHAR},
  147. </if>
  148. <if test="bk_beginamount != null" >
  149. #{bk_beginamount,jdbcType=DOUBLE},
  150. </if>
  151. <if test="bk_thisamount != null" >
  152. #{bk_thisamount,jdbcType=DOUBLE},
  153. </if>
  154. <if test="bk_status != null" >
  155. #{bk_status,jdbcType=VARCHAR},
  156. </if>
  157. <if test="bk_statuscode != null" >
  158. #{bk_statuscode,jdbcType=VARCHAR},
  159. </if>
  160. <if test="bk_recorderid != null" >
  161. #{bk_recorderid,jdbcType=INTEGER},
  162. </if>
  163. <if test="bk_recorder != null" >
  164. #{bk_recorder,jdbcType=VARCHAR},
  165. </if>
  166. <if test="bk_recorddate != null" >
  167. #{bk_recorddate,jdbcType=TIMESTAMP},
  168. </if>
  169. <if test="bk_ym != null" >
  170. #{bk_ym,jdbcType=INTEGER},
  171. </if>
  172. <if test="companyId != null" >
  173. #{companyId,jdbcType=INTEGER},
  174. </if>
  175. <if test="updaterId != null" >
  176. #{updaterId,jdbcType=INTEGER},
  177. </if>
  178. <if test="updateTime != null" >
  179. #{updateTime,jdbcType=TIMESTAMP},
  180. </if>
  181. <if test="bk_text1 != null" >
  182. #{bk_text1,jdbcType=VARCHAR},
  183. </if>
  184. <if test="bk_text2 != null" >
  185. #{bk_text2,jdbcType=VARCHAR},
  186. </if>
  187. <if test="bk_text3 != null" >
  188. #{bk_text3,jdbcType=VARCHAR},
  189. </if>
  190. <if test="bk_text4 != null" >
  191. #{bk_text4,jdbcType=VARCHAR},
  192. </if>
  193. <if test="bk_text5 != null" >
  194. #{bk_text5,jdbcType=VARCHAR},
  195. </if>
  196. <if test="bk_remark != null" >
  197. #{bk_remark,jdbcType=LONGVARCHAR},
  198. </if>
  199. </trim>
  200. </insert>
  201. <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
  202. update bankinformation
  203. <set >
  204. <if test="bk_bankcode != null" >
  205. bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR},
  206. </if>
  207. <if test="bk_bankname != null" >
  208. bk_bankname = #{bk_bankname,jdbcType=VARCHAR},
  209. </if>
  210. <if test="bk_date != null" >
  211. bk_date = #{bk_date,jdbcType=TIMESTAMP},
  212. </if>
  213. <if test="bk_type != null" >
  214. bk_type = #{bk_type,jdbcType=VARCHAR},
  215. </if>
  216. <if test="bk_beginamount != null" >
  217. bk_beginamount = #{bk_beginamount,jdbcType=DOUBLE},
  218. </if>
  219. <if test="bk_thisamount != null" >
  220. bk_thisamount = #{bk_thisamount,jdbcType=DOUBLE},
  221. </if>
  222. <if test="bk_status != null" >
  223. bk_status = #{bk_status,jdbcType=VARCHAR},
  224. </if>
  225. <if test="bk_statuscode != null" >
  226. bk_statuscode = #{bk_statuscode,jdbcType=VARCHAR},
  227. </if>
  228. <if test="bk_recorderid != null" >
  229. bk_recorderid = #{bk_recorderid,jdbcType=INTEGER},
  230. </if>
  231. <if test="bk_recorder != null" >
  232. bk_recorder = #{bk_recorder,jdbcType=VARCHAR},
  233. </if>
  234. <if test="bk_recorddate != null" >
  235. bk_recorddate = #{bk_recorddate,jdbcType=TIMESTAMP},
  236. </if>
  237. <if test="bk_ym != null" >
  238. bk_ym = #{bk_ym,jdbcType=INTEGER},
  239. </if>
  240. <if test="companyId != null" >
  241. companyid = #{companyId,jdbcType=INTEGER},
  242. </if>
  243. <if test="updaterId != null" >
  244. updaterId = #{updaterId,jdbcType=INTEGER},
  245. </if>
  246. <if test="updateTime != null" >
  247. updateTime = #{updateTime,jdbcType=TIMESTAMP},
  248. </if>
  249. <if test="bk_text1 != null" >
  250. bk_text1 = #{bk_text1,jdbcType=VARCHAR},
  251. </if>
  252. <if test="bk_text2 != null" >
  253. bk_text2 = #{bk_text2,jdbcType=VARCHAR},
  254. </if>
  255. <if test="bk_text3 != null" >
  256. bk_text3 = #{bk_text3,jdbcType=VARCHAR},
  257. </if>
  258. <if test="bk_text4 != null" >
  259. bk_text4 = #{bk_text4,jdbcType=VARCHAR},
  260. </if>
  261. <if test="bk_text5 != null" >
  262. bk_text5 = #{bk_text5,jdbcType=VARCHAR},
  263. </if>
  264. <if test="bk_remark != null" >
  265. bk_remark = #{bk_remark,jdbcType=LONGVARCHAR},
  266. </if>
  267. </set>
  268. where bk_id = #{id,jdbcType=INTEGER}
  269. </update>
  270. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
  271. update bankinformation
  272. set bk_bankcode = #{bkBankcode,jdbcType=VARCHAR},
  273. bk_bankname = #{bkBankname,jdbcType=VARCHAR},
  274. bk_date = #{bkDate,jdbcType=TIMESTAMP},
  275. bk_type = #{bkType,jdbcType=VARCHAR},
  276. bk_beginamount = #{bkBeginamount,jdbcType=DOUBLE},
  277. bk_thisamount = #{bkThisamount,jdbcType=DOUBLE},
  278. bk_status = #{bkStatus,jdbcType=VARCHAR},
  279. bk_statuscode = #{bkStatuscode,jdbcType=VARCHAR},
  280. bk_recorderid = #{bkRecorderid,jdbcType=INTEGER},
  281. bk_recorder = #{bkRecorder,jdbcType=VARCHAR},
  282. bk_recorddate = #{bkRecorddate,jdbcType=TIMESTAMP},
  283. bk_ym = #{bkYm,jdbcType=INTEGER},
  284. companyid = #{companyId,jdbcType=INTEGER},
  285. updaterId = #{updaterId,jdbcType=INTEGER},
  286. updateTime = #{updateTime,jdbcType=TIMESTAMP},
  287. bk_text1 = #{bkText1,jdbcType=VARCHAR},
  288. bk_text2 = #{bkText2,jdbcType=VARCHAR},
  289. bk_text3 = #{bkText3,jdbcType=VARCHAR},
  290. bk_text4 = #{bkText4,jdbcType=VARCHAR},
  291. bk_text5 = #{bkText5,jdbcType=VARCHAR},
  292. bk_remark = #{bkRemark,jdbcType=LONGVARCHAR}
  293. where bk_id = #{bkId,jdbcType=INTEGER}
  294. </update>
  295. <update id="updateBankcode">
  296. update bankinformation
  297. set bk_thisamount = nvl(#{bk_thisamount,jdbcType=DOUBLE},0) ${symbol} #{nowbalance}
  298. where bk_bankcode = #{bankcode,jdbcType=VARCHAR}
  299. </update>
  300. <select id="selectThisamount" resultType="java.lang.Double" parameterType="com.usoftchina.saas.document.entities.Bankinformation">
  301. select bk_thisamount from bankinformation
  302. where bk_bankcode = #{bankcode,jdbcType=VARCHAR}
  303. </select>
  304. <select id="selectAll" resultMap="BaseResultMap">
  305. SELECT * FROM bankinformation
  306. </select>
  307. <select id="selectBankinformationBycondition" resultMap="BaseResultMap">
  308. select
  309. <include refid="Base_Column_List" />
  310. from bankinformation
  311. <where>
  312. <if test="con != null">
  313. ${con}
  314. </if>
  315. <if test="companyId != null">
  316. and bankinformation.companyId = #{companyId}
  317. </if>
  318. </where> order by bk_id
  319. </select>
  320. <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
  321. SELECT CONCAT(bk_bankcode,' ',bk_bankname) display,bk_bankname value FROM bankinformation WHERE COMPANYID=#{companyId}
  322. </select>
  323. </mapper>