BankinformationMapper.xml 14 KB

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