DEMO_HDXX_Mapper.xml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- 核三框架升级自动生成mapper文件 -->
  3. <!-- DEMO_HDXX表牵涉到的sql文件 -->
  4. <!DOCTYPE mapper
  5. PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
  6. "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
  7. <mapper namespace="DEMO_HDXX">
  8. <!-- DEMO_HDXX 全字段 -->
  9. <sql id="DEMO_HDXX_COL">
  10. SPSJ,SPBZ,BZ,HDID,HDBT,YWLSH,HDKSSJ,
  11. HDJSSJ,HDLB,HDFQR,JBR,JBSJ,SPR
  12. </sql>
  13. <!-- DEMO_HDXX 选择字段 -->
  14. <sql id="DEMO_HDXX_COLSEL">
  15. <trim suffixOverrides=",">
  16. <if test="SPSJ != null">
  17. SPSJ,
  18. </if>
  19. <if test="SPBZ != null">
  20. SPBZ,
  21. </if>
  22. <if test="BZ != null">
  23. BZ,
  24. </if>
  25. <if test="HDID != null">
  26. HDID,
  27. </if>
  28. <if test="HDBT != null">
  29. HDBT,
  30. </if>
  31. <if test="YWLSH != null">
  32. YWLSH,
  33. </if>
  34. <if test="HDKSSJ != null">
  35. HDKSSJ,
  36. </if>
  37. <if test="HDJSSJ != null">
  38. HDJSSJ,
  39. </if>
  40. <if test="HDLB != null">
  41. HDLB,
  42. </if>
  43. <if test="HDFQR != null">
  44. HDFQR,
  45. </if>
  46. <if test="JBR != null">
  47. JBR,
  48. </if>
  49. <if test="JBSJ != null">
  50. JBSJ,
  51. </if>
  52. <if test="SPR != null">
  53. SPR
  54. </if>
  55. </trim>
  56. </sql>
  57. <!-- DEMO_HDXX 记录数 -->
  58. <select id="DEMO_HDXX_CNT" parameterType="hashmap" resultType="long">
  59. select count(1)
  60. from DEMO_HDXX
  61. <where>
  62. <if test="SPSJ != null">
  63. and SPSJ=#{SPSJ}
  64. </if>
  65. <if test="SPBZ != null">
  66. and SPBZ=#{SPBZ}
  67. </if>
  68. <if test="BZ != null">
  69. and BZ=#{BZ}
  70. </if>
  71. <if test="HDID != null">
  72. and HDID=#{HDID}
  73. </if>
  74. <if test="HDBT != null">
  75. and HDBT=#{HDBT}
  76. </if>
  77. <if test="YWLSH != null">
  78. and YWLSH=#{YWLSH}
  79. </if>
  80. <if test="HDKSSJ != null">
  81. and HDKSSJ=#{HDKSSJ}
  82. </if>
  83. <if test="HDJSSJ != null">
  84. and HDJSSJ=#{HDJSSJ}
  85. </if>
  86. <if test="HDLB != null">
  87. and HDLB=#{HDLB}
  88. </if>
  89. <if test="HDFQR != null">
  90. and HDFQR=#{HDFQR}
  91. </if>
  92. <if test="JBR != null">
  93. and JBR=#{JBR}
  94. </if>
  95. <if test="JBSJ != null">
  96. and JBSJ=#{JBSJ}
  97. </if>
  98. <if test="SPR != null">
  99. and SPR=#{SPR}
  100. </if>
  101. </where>
  102. </select>
  103. <!-- DEMO_HDXX 全字段查询 -->
  104. <select id="DEMO_HDXX_Q" parameterType="hashmap" resultType="hashmap">
  105. select
  106. <include refid="DEMO_HDXX_COL" /> <!--引用前边定义的所有字段 -->
  107. from DEMO_HDXX
  108. <where>
  109. <if test="SPSJ != null">
  110. and SPSJ=#{SPSJ}
  111. </if>
  112. <if test="SPBZ != null">
  113. and SPBZ=#{SPBZ}
  114. </if>
  115. <if test="BZ != null">
  116. and BZ=#{BZ}
  117. </if>
  118. <if test="HDID != null">
  119. and HDID=#{HDID}
  120. </if>
  121. <if test="HDBT != null">
  122. and HDBT=#{HDBT}
  123. </if>
  124. <if test="YWLSH != null">
  125. and YWLSH=#{YWLSH}
  126. </if>
  127. <if test="HDKSSJ != null">
  128. and HDKSSJ=#{HDKSSJ}
  129. </if>
  130. <if test="HDJSSJ != null">
  131. and HDJSSJ=#{HDJSSJ}
  132. </if>
  133. <if test="HDLB != null">
  134. and HDLB=#{HDLB}
  135. </if>
  136. <if test="HDFQR != null">
  137. and HDFQR=#{HDFQR}
  138. </if>
  139. <if test="JBR != null">
  140. and JBR=#{JBR}
  141. </if>
  142. <if test="JBSJ != null">
  143. and JBSJ=#{JBSJ}
  144. </if>
  145. <if test="SPR != null">
  146. and SPR=#{SPR}
  147. </if>
  148. </where>
  149. </select>
  150. <!-- DEMO_HDXX 选择查询 -->
  151. <select id="DEMO_HDXX_QS" parameterType="hashmap" resultType="hashmap">
  152. select
  153. <include refid="DEMO_HDXX_COLSEL" /> <!--引用前边定义的所有字段 -->
  154. from DEMO_HDXX
  155. <where>
  156. <if test="SPSJ != null">
  157. and SPSJ=#{SPSJ}
  158. </if>
  159. <if test="SPBZ != null">
  160. and SPBZ=#{SPBZ}
  161. </if>
  162. <if test="BZ != null">
  163. and BZ=#{BZ}
  164. </if>
  165. <if test="HDID != null">
  166. and HDID=#{HDID}
  167. </if>
  168. <if test="HDBT != null">
  169. and HDBT=#{HDBT}
  170. </if>
  171. <if test="YWLSH != null">
  172. and YWLSH=#{YWLSH}
  173. </if>
  174. <if test="HDKSSJ != null">
  175. and HDKSSJ=#{HDKSSJ}
  176. </if>
  177. <if test="HDJSSJ != null">
  178. and HDJSSJ=#{HDJSSJ}
  179. </if>
  180. <if test="HDLB != null">
  181. and HDLB=#{HDLB}
  182. </if>
  183. <if test="HDFQR != null">
  184. and HDFQR=#{HDFQR}
  185. </if>
  186. <if test="JBR != null">
  187. and JBR=#{JBR}
  188. </if>
  189. <if test="JBSJ != null">
  190. and JBSJ=#{JBSJ}
  191. </if>
  192. <if test="SPR != null">
  193. and SPR=#{SPR}
  194. </if>
  195. </where>
  196. </select>
  197. <!-- DEMO_HDXX 插入 -->
  198. <insert id="DEMO_HDXX_I" parameterType="hashmap">
  199. insert into DEMO_HDXX (
  200. SPSJ,SPBZ,BZ,HDID,HDBT,YWLSH,HDKSSJ,
  201. HDJSSJ,HDLB,HDFQR,JBR,JBSJ,SPR,YHZH
  202. ) values (
  203. #{SPSJ},#{SPBZ},#{BZ},#{HDID},#{HDBT},#{YWLSH},#{HDKSSJ},
  204. #{HDJSSJ},#{HDLB},#{HDFQR},#{JBR},#{JBSJ},#{SPR},#{YHZH}
  205. )
  206. </insert>
  207. <!-- DEMO_HDXX 插入-类型映射 -->
  208. <insert id="DEMO_HDXX_IT" parameterType="hashmap">
  209. insert into DEMO_HDXX (
  210. SPSJ,SPBZ,BZ,HDID,HDBT,YWLSH,HDKSSJ,
  211. HDJSSJ,HDLB,HDFQR,JBR,JBSJ,SPR
  212. ) values (
  213. #{SPSJ ,javaType=long,jdbcType=NUMERIC},#{SPBZ ,javaType=string,jdbcType=VARCHAR},
  214. #{BZ ,javaType=string,jdbcType=VARCHAR},#{HDID ,javaType=long,jdbcType=NUMERIC},#{HDBT ,javaType=string,jdbcType=VARCHAR},
  215. #{YWLSH ,javaType=string,jdbcType=VARCHAR},#{HDKSSJ ,javaType=long,jdbcType=NUMERIC},#{HDJSSJ ,javaType=long,jdbcType=NUMERIC},
  216. #{HDLB ,javaType=string,jdbcType=VARCHAR},#{HDFQR ,javaType=string,jdbcType=VARCHAR},#{JBR ,javaType=string,jdbcType=VARCHAR},
  217. #{JBSJ ,javaType=long,jdbcType=NUMERIC},#{SPR ,javaType=string,jdbcType=VARCHAR}
  218. )
  219. </insert>
  220. <!-- DEMO_HDXX 选择字段插入 -->
  221. <insert id="DEMO_HDXX_IS" parameterType="hashmap">
  222. insert into DEMO_HDXX (
  223. <trim suffixOverrides=",">
  224. <if test="SPSJ != null">SPSJ,</if>
  225. <if test="SPBZ != null">SPBZ,</if>
  226. <if test="BZ != null">BZ,</if>
  227. <if test="HDID != null">HDID,</if>
  228. <if test="HDBT != null">HDBT,</if>
  229. <if test="YWLSH != null">YWLSH,</if>
  230. <if test="HDKSSJ != null">HDKSSJ,</if>
  231. <if test="HDJSSJ != null">HDJSSJ,</if>
  232. <if test="HDLB != null">HDLB,</if>
  233. <if test="HDFQR != null">HDFQR,</if>
  234. <if test="JBR != null">JBR,</if>
  235. <if test="JBSJ != null">JBSJ,</if>
  236. <if test="SPR != null">SPR,</if>
  237. <if test="YHZH != null">YHZH,</if>
  238. </trim>
  239. ) values (
  240. <trim suffixOverrides=",">
  241. <if test="SPSJ != null">#{SPSJ},</if>
  242. <if test="SPBZ != null">#{SPBZ},</if>
  243. <if test="BZ != null">#{BZ},</if>
  244. <if test="HDID != null">#{HDID},</if>
  245. <if test="HDBT != null">#{HDBT},</if>
  246. <if test="YWLSH != null">#{YWLSH},</if>
  247. <if test="HDKSSJ != null">#{HDKSSJ},</if>
  248. <if test="HDJSSJ != null">#{HDJSSJ},</if>
  249. <if test="HDLB != null">#{HDLB},</if>
  250. <if test="HDFQR != null">#{HDFQR},</if>
  251. <if test="JBR != null">#{JBR},</if>
  252. <if test="JBSJ != null">#{JBSJ},</if>
  253. <if test="SPR != null">#{SPR},</if>
  254. <if test="YHZH != null">#{YHZH},</if>
  255. </trim>
  256. )
  257. </insert>
  258. <!-- DEMO_HDXX 修改 -->
  259. <update id="DEMO_HDXX_U" parameterType="hashmap">
  260. update DEMO_HDXX
  261. set
  262. SPSJ= #{SPSJ},SPBZ= #{SPBZ},BZ= #{BZ},
  263. HDID= #{HDID},HDBT= #{HDBT},YWLSH= #{YWLSH},HDKSSJ= #{HDKSSJ},
  264. HDJSSJ= #{HDJSSJ},HDLB= #{HDLB},HDFQR= #{HDFQR},JBR= #{JBR},
  265. JBSJ= #{JBSJ},SPR= #{SPR}
  266. where
  267. HDID = #{HDID}
  268. </update>
  269. <!-- DEMO_HDXX 选择修改 -->
  270. <update id="DEMO_HDXX_US" parameterType="hashmap">
  271. update DEMO_HDXX
  272. set
  273. <trim suffixOverrides=",">
  274. <if test="SPSJ != null">SPSJ=#{SPSJ},</if>
  275. <if test="SPBZ != null">SPBZ=#{SPBZ},</if>
  276. <if test="BZ != null">BZ=#{BZ},</if>
  277. <if test="HDID != null">HDID=#{HDID},</if>
  278. <if test="HDBT != null">HDBT=#{HDBT},</if>
  279. <if test="YWLSH != null">YWLSH=#{YWLSH},</if>
  280. <if test="HDKSSJ != null">HDKSSJ=#{HDKSSJ},</if>
  281. <if test="HDJSSJ != null">HDJSSJ=#{HDJSSJ},</if>
  282. <if test="HDLB != null">HDLB=#{HDLB},</if>
  283. <if test="HDFQR != null">HDFQR=#{HDFQR},</if>
  284. <if test="JBR != null">JBR=#{JBR},</if>
  285. <if test="JBSJ != null">JBSJ=#{JBSJ},</if>
  286. <if test="SPR != null">SPR=#{SPR},</if>
  287. <if test="YHZH != null">YHZH=#{YHZH},</if>
  288. </trim>
  289. where
  290. HDID = #{HDID}
  291. </update>
  292. <!-- DEMO_HDXX 删除 -->
  293. <delete id="DEMO_HDXX_D" parameterType="hashmap">
  294. delete from DEMO_HDXX
  295. <where>
  296. HDID = #{HDID}
  297. </where>
  298. </delete>
  299. </mapper>