spring 基础框架建设

TpBillMapper.xml 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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="dao.TpBillMapper" >
  4. <resultMap id="BaseResultMap" type="model.TpBill" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="community_id" property="communityId" jdbcType="INTEGER" />
  7. <result column="bill_name" property="billName" jdbcType="VARCHAR" />
  8. <result column="bill_explain" property="billExplain" jdbcType="VARCHAR" />
  9. <result column="pay_price" property="payPrice" jdbcType="CHAR" />
  10. <result column="pay_total_num" property="payTotalNum" jdbcType="INTEGER" />
  11. <result column="payed_num" property="payedNum" jdbcType="INTEGER" />
  12. <result column="unpayed_num" property="unpayedNum" jdbcType="INTEGER" />
  13. <result column="bill_status" property="billStatus" jdbcType="CHAR" />
  14. <result column="end_date" property="endDate" jdbcType="TIMESTAMP" />
  15. <result column="create_user" property="createUser" jdbcType="INTEGER" />
  16. <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
  17. <result column="update_user" property="updateUser" jdbcType="INTEGER" />
  18. <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
  19. </resultMap>
  20. <sql id="Base_Column_List" >
  21. id, community_id, bill_name, bill_explain, pay_price, pay_total_num, payed_num, unpayed_num,
  22. bill_status, end_date, create_user, create_date, update_user, update_date
  23. </sql>
  24. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  25. select
  26. <include refid="Base_Column_List" />
  27. from tp_bill
  28. where id = #{id,jdbcType=INTEGER}
  29. </select>
  30. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  31. delete from tp_bill
  32. where id = #{id,jdbcType=INTEGER}
  33. </delete>
  34. <insert id="insert" parameterType="model.TpBill" >
  35. insert into tp_bill (id, community_id, bill_name,
  36. bill_explain, pay_price, pay_total_num,
  37. payed_num, unpayed_num, bill_status,
  38. end_date, create_user, create_date,
  39. update_user, update_date)
  40. values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{billName,jdbcType=VARCHAR},
  41. #{billExplain,jdbcType=VARCHAR}, #{payPrice,jdbcType=CHAR}, #{payTotalNum,jdbcType=INTEGER},
  42. #{payedNum,jdbcType=INTEGER}, #{unpayedNum,jdbcType=INTEGER}, #{billStatus,jdbcType=CHAR},
  43. #{endDate,jdbcType=TIMESTAMP}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP},
  44. #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
  45. </insert>
  46. <insert id="insertSelective" parameterType="model.TpBill" >
  47. insert into tp_bill
  48. <trim prefix="(" suffix=")" suffixOverrides="," >
  49. <if test="id != null" >
  50. id,
  51. </if>
  52. <if test="communityId != null" >
  53. community_id,
  54. </if>
  55. <if test="billName != null" >
  56. bill_name,
  57. </if>
  58. <if test="billExplain != null" >
  59. bill_explain,
  60. </if>
  61. <if test="payPrice != null" >
  62. pay_price,
  63. </if>
  64. <if test="payTotalNum != null" >
  65. pay_total_num,
  66. </if>
  67. <if test="payedNum != null" >
  68. payed_num,
  69. </if>
  70. <if test="unpayedNum != null" >
  71. unpayed_num,
  72. </if>
  73. <if test="billStatus != null" >
  74. bill_status,
  75. </if>
  76. <if test="endDate != null" >
  77. end_date,
  78. </if>
  79. <if test="createUser != null" >
  80. create_user,
  81. </if>
  82. <if test="createDate != null" >
  83. create_date,
  84. </if>
  85. <if test="updateUser != null" >
  86. update_user,
  87. </if>
  88. <if test="updateDate != null" >
  89. update_date,
  90. </if>
  91. </trim>
  92. <trim prefix="values (" suffix=")" suffixOverrides="," >
  93. <if test="id != null" >
  94. #{id,jdbcType=INTEGER},
  95. </if>
  96. <if test="communityId != null" >
  97. #{communityId,jdbcType=INTEGER},
  98. </if>
  99. <if test="billName != null" >
  100. #{billName,jdbcType=VARCHAR},
  101. </if>
  102. <if test="billExplain != null" >
  103. #{billExplain,jdbcType=VARCHAR},
  104. </if>
  105. <if test="payPrice != null" >
  106. #{payPrice,jdbcType=CHAR},
  107. </if>
  108. <if test="payTotalNum != null" >
  109. #{payTotalNum,jdbcType=INTEGER},
  110. </if>
  111. <if test="payedNum != null" >
  112. #{payedNum,jdbcType=INTEGER},
  113. </if>
  114. <if test="unpayedNum != null" >
  115. #{unpayedNum,jdbcType=INTEGER},
  116. </if>
  117. <if test="billStatus != null" >
  118. #{billStatus,jdbcType=CHAR},
  119. </if>
  120. <if test="endDate != null" >
  121. #{endDate,jdbcType=TIMESTAMP},
  122. </if>
  123. <if test="createUser != null" >
  124. #{createUser,jdbcType=INTEGER},
  125. </if>
  126. <if test="createDate != null" >
  127. #{createDate,jdbcType=TIMESTAMP},
  128. </if>
  129. <if test="updateUser != null" >
  130. #{updateUser,jdbcType=INTEGER},
  131. </if>
  132. <if test="updateDate != null" >
  133. #{updateDate,jdbcType=TIMESTAMP},
  134. </if>
  135. </trim>
  136. </insert>
  137. <update id="updateByPrimaryKeySelective" parameterType="model.TpBill" >
  138. update tp_bill
  139. <set >
  140. <if test="communityId != null" >
  141. community_id = #{communityId,jdbcType=INTEGER},
  142. </if>
  143. <if test="billName != null" >
  144. bill_name = #{billName,jdbcType=VARCHAR},
  145. </if>
  146. <if test="billExplain != null" >
  147. bill_explain = #{billExplain,jdbcType=VARCHAR},
  148. </if>
  149. <if test="payPrice != null" >
  150. pay_price = #{payPrice,jdbcType=CHAR},
  151. </if>
  152. <if test="payTotalNum != null" >
  153. pay_total_num = #{payTotalNum,jdbcType=INTEGER},
  154. </if>
  155. <if test="payedNum != null" >
  156. payed_num = #{payedNum,jdbcType=INTEGER},
  157. </if>
  158. <if test="unpayedNum != null" >
  159. unpayed_num = #{unpayedNum,jdbcType=INTEGER},
  160. </if>
  161. <if test="billStatus != null" >
  162. bill_status = #{billStatus,jdbcType=CHAR},
  163. </if>
  164. <if test="endDate != null" >
  165. end_date = #{endDate,jdbcType=TIMESTAMP},
  166. </if>
  167. <if test="createUser != null" >
  168. create_user = #{createUser,jdbcType=INTEGER},
  169. </if>
  170. <if test="createDate != null" >
  171. create_date = #{createDate,jdbcType=TIMESTAMP},
  172. </if>
  173. <if test="updateUser != null" >
  174. update_user = #{updateUser,jdbcType=INTEGER},
  175. </if>
  176. <if test="updateDate != null" >
  177. update_date = #{updateDate,jdbcType=TIMESTAMP},
  178. </if>
  179. </set>
  180. where id = #{id,jdbcType=INTEGER}
  181. </update>
  182. <update id="updateByPrimaryKey" parameterType="model.TpBill" >
  183. update tp_bill
  184. set community_id = #{communityId,jdbcType=INTEGER},
  185. bill_name = #{billName,jdbcType=VARCHAR},
  186. bill_explain = #{billExplain,jdbcType=VARCHAR},
  187. pay_price = #{payPrice,jdbcType=CHAR},
  188. pay_total_num = #{payTotalNum,jdbcType=INTEGER},
  189. payed_num = #{payedNum,jdbcType=INTEGER},
  190. unpayed_num = #{unpayedNum,jdbcType=INTEGER},
  191. bill_status = #{billStatus,jdbcType=CHAR},
  192. end_date = #{endDate,jdbcType=TIMESTAMP},
  193. create_user = #{createUser,jdbcType=INTEGER},
  194. create_date = #{createDate,jdbcType=TIMESTAMP},
  195. update_user = #{updateUser,jdbcType=INTEGER},
  196. update_date = #{updateDate,jdbcType=TIMESTAMP}
  197. where id = #{id,jdbcType=INTEGER}
  198. </update>
  199. </mapper>