DemandOrderMapper.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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.goafanti.common.dao.DemandOrderMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.DemandOrder" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="serial_number" property="serialNumber" jdbcType="INTEGER" />
  7. <result column="demand_id" property="demandId" jdbcType="VARCHAR" />
  8. <result column="uid" property="uid" jdbcType="VARCHAR" />
  9. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  10. <result column="enclosure_url" property="enclosureUrl" jdbcType="VARCHAR" />
  11. <result column="status" property="status" jdbcType="INTEGER" />
  12. <result column="intention_money" property="intentionMoney" jdbcType="INTEGER" />
  13. <result column="contract_money" property="contractMoney" jdbcType="INTEGER" />
  14. <result column="commission" property="commission" jdbcType="INTEGER" />
  15. <result column="service_money" property="serviceMoney" jdbcType="INTEGER" />
  16. <result column="refund" property="refund" jdbcType="INTEGER" />
  17. <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
  18. </resultMap>
  19. <sql id="Base_Column_List" >
  20. id, serial_number, demand_id, uid, create_time, enclosure_url, status, intention_money,
  21. contract_money, commission, service_money, refund, deleted_sign
  22. </sql>
  23. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  24. select
  25. <include refid="Base_Column_List" />
  26. from demand_order
  27. where id = #{id,jdbcType=VARCHAR}
  28. </select>
  29. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  30. delete from demand_order
  31. where id = #{id,jdbcType=VARCHAR}
  32. </delete>
  33. <insert id="insert" parameterType="com.goafanti.common.model.DemandOrder" >
  34. insert into demand_order (id, serial_number, demand_id,
  35. uid, create_time, enclosure_url,
  36. status, intention_money, contract_money,
  37. commission, service_money, refund,
  38. deleted_sign)
  39. values (#{id,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, #{demandId,jdbcType=VARCHAR},
  40. #{uid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{enclosureUrl,jdbcType=VARCHAR},
  41. #{status,jdbcType=INTEGER}, #{intentionMoney,jdbcType=INTEGER}, #{contractMoney,jdbcType=INTEGER},
  42. #{commission,jdbcType=INTEGER}, #{serviceMoney,jdbcType=INTEGER}, #{refund,jdbcType=INTEGER},
  43. #{deletedSign,jdbcType=INTEGER})
  44. </insert>
  45. <insert id="insertSelective" parameterType="com.goafanti.common.model.DemandOrder" >
  46. insert into demand_order
  47. <trim prefix="(" suffix=")" suffixOverrides="," >
  48. <if test="id != null" >
  49. id,
  50. </if>
  51. <if test="serialNumber != null" >
  52. serial_number,
  53. </if>
  54. <if test="demandId != null" >
  55. demand_id,
  56. </if>
  57. <if test="uid != null" >
  58. uid,
  59. </if>
  60. <if test="createTime != null" >
  61. create_time,
  62. </if>
  63. <if test="enclosureUrl != null" >
  64. enclosure_url,
  65. </if>
  66. <if test="status != null" >
  67. status,
  68. </if>
  69. <if test="intentionMoney != null" >
  70. intention_money,
  71. </if>
  72. <if test="contractMoney != null" >
  73. contract_money,
  74. </if>
  75. <if test="commission != null" >
  76. commission,
  77. </if>
  78. <if test="serviceMoney != null" >
  79. service_money,
  80. </if>
  81. <if test="refund != null" >
  82. refund,
  83. </if>
  84. <if test="deletedSign != null" >
  85. deleted_sign,
  86. </if>
  87. </trim>
  88. <trim prefix="values (" suffix=")" suffixOverrides="," >
  89. <if test="id != null" >
  90. #{id,jdbcType=VARCHAR},
  91. </if>
  92. <if test="serialNumber != null" >
  93. #{serialNumber,jdbcType=INTEGER},
  94. </if>
  95. <if test="demandId != null" >
  96. #{demandId,jdbcType=VARCHAR},
  97. </if>
  98. <if test="uid != null" >
  99. #{uid,jdbcType=VARCHAR},
  100. </if>
  101. <if test="createTime != null" >
  102. #{createTime,jdbcType=TIMESTAMP},
  103. </if>
  104. <if test="enclosureUrl != null" >
  105. #{enclosureUrl,jdbcType=VARCHAR},
  106. </if>
  107. <if test="status != null" >
  108. #{status,jdbcType=INTEGER},
  109. </if>
  110. <if test="intentionMoney != null" >
  111. #{intentionMoney,jdbcType=INTEGER},
  112. </if>
  113. <if test="contractMoney != null" >
  114. #{contractMoney,jdbcType=INTEGER},
  115. </if>
  116. <if test="commission != null" >
  117. #{commission,jdbcType=INTEGER},
  118. </if>
  119. <if test="serviceMoney != null" >
  120. #{serviceMoney,jdbcType=INTEGER},
  121. </if>
  122. <if test="refund != null" >
  123. #{refund,jdbcType=INTEGER},
  124. </if>
  125. <if test="deletedSign != null" >
  126. #{deletedSign,jdbcType=INTEGER},
  127. </if>
  128. </trim>
  129. </insert>
  130. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.DemandOrder" >
  131. update demand_order
  132. <set >
  133. <if test="serialNumber != null" >
  134. serial_number = #{serialNumber,jdbcType=INTEGER},
  135. </if>
  136. <if test="demandId != null" >
  137. demand_id = #{demandId,jdbcType=VARCHAR},
  138. </if>
  139. <if test="uid != null" >
  140. uid = #{uid,jdbcType=VARCHAR},
  141. </if>
  142. <if test="createTime != null" >
  143. create_time = #{createTime,jdbcType=TIMESTAMP},
  144. </if>
  145. <if test="enclosureUrl != null" >
  146. enclosure_url = #{enclosureUrl,jdbcType=VARCHAR},
  147. </if>
  148. <if test="status != null" >
  149. status = #{status,jdbcType=INTEGER},
  150. </if>
  151. <if test="intentionMoney != null" >
  152. intention_money = #{intentionMoney,jdbcType=INTEGER},
  153. </if>
  154. <if test="contractMoney != null" >
  155. contract_money = #{contractMoney,jdbcType=INTEGER},
  156. </if>
  157. <if test="commission != null" >
  158. commission = #{commission,jdbcType=INTEGER},
  159. </if>
  160. <if test="serviceMoney != null" >
  161. service_money = #{serviceMoney,jdbcType=INTEGER},
  162. </if>
  163. <if test="refund != null" >
  164. refund = #{refund,jdbcType=INTEGER},
  165. </if>
  166. <if test="deletedSign != null" >
  167. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  168. </if>
  169. </set>
  170. where id = #{id,jdbcType=VARCHAR}
  171. </update>
  172. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.DemandOrder" >
  173. update demand_order
  174. set serial_number = #{serialNumber,jdbcType=INTEGER},
  175. demand_id = #{demandId,jdbcType=VARCHAR},
  176. uid = #{uid,jdbcType=VARCHAR},
  177. create_time = #{createTime,jdbcType=TIMESTAMP},
  178. enclosure_url = #{enclosureUrl,jdbcType=VARCHAR},
  179. status = #{status,jdbcType=INTEGER},
  180. intention_money = #{intentionMoney,jdbcType=INTEGER},
  181. contract_money = #{contractMoney,jdbcType=INTEGER},
  182. commission = #{commission,jdbcType=INTEGER},
  183. service_money = #{serviceMoney,jdbcType=INTEGER},
  184. refund = #{refund,jdbcType=INTEGER},
  185. deleted_sign = #{deletedSign,jdbcType=INTEGER}
  186. where id = #{id,jdbcType=VARCHAR}
  187. </update>
  188. <select id="selectDemandOrderByUidAndDemandId" resultMap="BaseResultMap" >
  189. select
  190. <include refid="Base_Column_List" />
  191. from demand_order
  192. where uid = #{0} and demand_id = #{1}
  193. </select>
  194. <select id="findDemandOrderListByPage" parameterType="String" resultMap="BaseResultMap">
  195. select
  196. <include refid="Base_Column_List" />
  197. from demand_order
  198. where deleted_sign = 0 and uid = #{uid,jdbcType=VARCHAR}
  199. <if test="status != null">
  200. and status = #{status,jdbcType=INTEGER}
  201. </if>
  202. order by serial_number desc
  203. <if test="page_sql!=null">
  204. ${page_sql}
  205. </if>
  206. </select>
  207. <select id="findDemandOrderCount" parameterType="String" resultType="java.lang.Integer">
  208. select
  209. count(1)
  210. from demand_order
  211. where deleted_sign = 0 and uid = #{uid,jdbcType=VARCHAR}
  212. <if test="status != null">
  213. and status = #{status,jdbcType=INTEGER}
  214. </if>
  215. </select>
  216. </mapper>