DEMO_HDJH_Mapper.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- 核三框架升级自动生成mapper文件 -->
  3. <!-- DEMO_HDJH表牵涉到的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_HDJH">
  8. <!-- DEMO_HDJH 全字段 -->
  9. <sql id="DEMO_HDJH_COL">
  10. HDID,HDMXID,HDMXKSSJ,HDMXJSSJ,HDAP,BZ
  11. </sql>
  12. <!-- DEMO_HDJH 选择字段 -->
  13. <sql id="DEMO_HDJH_COLSEL">
  14. <trim suffixOverrides=",">
  15. <if test="HDID != null">
  16. HDID,
  17. </if>
  18. <if test="HDMXID != null">
  19. HDMXID,
  20. </if>
  21. <if test="HDMXKSSJ != null">
  22. HDMXKSSJ,
  23. </if>
  24. <if test="HDMXJSSJ != null">
  25. HDMXJSSJ,
  26. </if>
  27. <if test="HDAP != null">
  28. HDAP,
  29. </if>
  30. <if test="BZ != null">
  31. BZ
  32. </if>
  33. </trim>
  34. </sql>
  35. <!-- DEMO_HDJH 记录数 -->
  36. <select id="DEMO_HDJH_CNT" parameterType="hashmap" resultType="long">
  37. select count(1)
  38. from DEMO_HDJH
  39. <where>
  40. <if test="HDID != null">
  41. and HDID=#{HDID}
  42. </if>
  43. <if test="HDMXID != null">
  44. and HDMXID=#{HDMXID}
  45. </if>
  46. <if test="HDMXKSSJ != null">
  47. and HDMXKSSJ=#{HDMXKSSJ}
  48. </if>
  49. <if test="HDMXJSSJ != null">
  50. and HDMXJSSJ=#{HDMXJSSJ}
  51. </if>
  52. <if test="HDAP != null">
  53. and HDAP=#{HDAP}
  54. </if>
  55. <if test="BZ != null">
  56. and BZ=#{BZ}
  57. </if>
  58. </where>
  59. </select>
  60. <!-- DEMO_HDJH 全字段查询 -->
  61. <select id="DEMO_HDJH_Q" parameterType="hashmap" resultType="hashmap">
  62. select
  63. <include refid="DEMO_HDJH_COL" /> <!--引用前边定义的所有字段 -->
  64. from DEMO_HDJH
  65. <where>
  66. <if test="HDID != null">
  67. and HDID=#{HDID}
  68. </if>
  69. <if test="HDMXID != null">
  70. and HDMXID=#{HDMXID}
  71. </if>
  72. <if test="HDMXKSSJ != null">
  73. and HDMXKSSJ=#{HDMXKSSJ}
  74. </if>
  75. <if test="HDMXJSSJ != null">
  76. and HDMXJSSJ=#{HDMXJSSJ}
  77. </if>
  78. <if test="HDAP != null">
  79. and HDAP=#{HDAP}
  80. </if>
  81. <if test="BZ != null">
  82. and BZ=#{BZ}
  83. </if>
  84. </where>
  85. </select>
  86. <!-- DEMO_HDJH 选择查询 -->
  87. <select id="DEMO_HDJH_QS" parameterType="hashmap" resultType="hashmap">
  88. select
  89. <include refid="DEMO_HDJH_COLSEL" /> <!--引用前边定义的所有字段 -->
  90. from DEMO_HDJH
  91. <where>
  92. <if test="HDID != null">
  93. and HDID=#{HDID}
  94. </if>
  95. <if test="HDMXID != null">
  96. and HDMXID=#{HDMXID}
  97. </if>
  98. <if test="HDMXKSSJ != null">
  99. and HDMXKSSJ=#{HDMXKSSJ}
  100. </if>
  101. <if test="HDMXJSSJ != null">
  102. and HDMXJSSJ=#{HDMXJSSJ}
  103. </if>
  104. <if test="HDAP != null">
  105. and HDAP=#{HDAP}
  106. </if>
  107. <if test="BZ != null">
  108. and BZ=#{BZ}
  109. </if>
  110. </where>
  111. </select>
  112. <!-- DEMO_HDJH 插入 -->
  113. <insert id="DEMO_HDJH_I" parameterType="hashmap">
  114. insert into DEMO_HDJH (
  115. HDID,HDMXID,HDMXKSSJ,HDMXJSSJ,HDAP,BZ
  116. ) values (
  117. #{HDID},#{HDMXID},#{HDMXKSSJ},#{HDMXJSSJ},#{HDAP},#{BZ}
  118. )
  119. </insert>
  120. <!-- DEMO_HDJH 插入-类型映射 -->
  121. <insert id="DEMO_HDJH_IT" parameterType="hashmap">
  122. insert into DEMO_HDJH (
  123. HDID,HDMXID,HDMXKSSJ,HDMXJSSJ,HDAP,BZ
  124. ) values (
  125. #{HDID ,javaType=long,jdbcType=NUMERIC},#{HDMXID ,javaType=long,jdbcType=NUMERIC},
  126. #{HDMXKSSJ ,javaType=long,jdbcType=NUMERIC},#{HDMXJSSJ ,javaType=long,jdbcType=NUMERIC},#{HDAP ,javaType=string,jdbcType=VARCHAR},
  127. #{BZ ,javaType=string,jdbcType=VARCHAR}
  128. )
  129. </insert>
  130. <!-- DEMO_HDJH 选择字段插入 -->
  131. <insert id="DEMO_HDJH_IS" parameterType="hashmap">
  132. insert into DEMO_HDJH (
  133. <trim suffixOverrides=",">
  134. <if test="HDID != null">HDID,</if>
  135. <if test="HDMXID != null">HDMXID,</if>
  136. <if test="HDMXKSSJ != null">HDMXKSSJ,</if>
  137. <if test="HDMXJSSJ != null">HDMXJSSJ,</if>
  138. <if test="HDAP != null">HDAP,</if>
  139. <if test="BZ != null">BZ,</if>
  140. </trim>
  141. ) values (
  142. <trim suffixOverrides=",">
  143. <if test="HDID != null">#{HDID},</if>
  144. <if test="HDMXID != null">#{HDMXID},</if>
  145. <if test="HDMXKSSJ != null">#{HDMXKSSJ},</if>
  146. <if test="HDMXJSSJ != null">#{HDMXJSSJ},</if>
  147. <if test="HDAP != null">#{HDAP},</if>
  148. <if test="BZ != null">#{BZ},</if>
  149. </trim>
  150. )
  151. </insert>
  152. <!-- DEMO_HDJH 修改 -->
  153. <update id="DEMO_HDJH_U" parameterType="hashmap">
  154. update DEMO_HDJH
  155. set
  156. HDID= #{HDID},HDMXID= #{HDMXID},HDMXKSSJ= #{HDMXKSSJ},
  157. HDMXJSSJ= #{HDMXJSSJ},HDAP= #{HDAP},BZ= #{BZ}
  158. where
  159. HDMXID = #{HDMXID}
  160. </update>
  161. <!-- DEMO_HDJH 选择修改 -->
  162. <update id="DEMO_HDJH_US" parameterType="hashmap">
  163. update DEMO_HDJH
  164. set
  165. <trim suffixOverrides=",">
  166. <if test="HDMXKSSJ != null">HDMXKSSJ=#{HDMXKSSJ},</if>
  167. <if test="HDMXJSSJ != null">HDMXJSSJ=#{HDMXJSSJ},</if>
  168. <if test="HDAP != null">HDAP=#{HDAP},</if>
  169. <if test="BZ != null">BZ=#{BZ},</if>
  170. </trim>
  171. where
  172. HDMXID = #{HDMXID}
  173. </update>
  174. <!-- DEMO_HDJH 删除 -->
  175. <delete id="DEMO_HDJH_D" parameterType="hashmap">
  176. delete from DEMO_HDJH
  177. <where>
  178. HDMXID = #{HDMXID}
  179. </where>
  180. </delete>
  181. </mapper>