SitePayMapper.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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.xc.dao.SitePayMapper" >
  4. <resultMap id="BaseResultMap" type="com.xc.pojo.SitePay" >
  5. <constructor >
  6. <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
  7. <arg column="c_type" jdbcType="INTEGER" javaType="java.lang.Integer" />
  8. <arg column="form_url" jdbcType="VARCHAR" javaType="java.lang.String" />
  9. <arg column="form_code" jdbcType="VARCHAR" javaType="java.lang.String" />
  10. <arg column="channel_type" jdbcType="VARCHAR" javaType="java.lang.String" />
  11. <arg column="channel_name" jdbcType="VARCHAR" javaType="java.lang.String" />
  12. <arg column="channel_desc" jdbcType="VARCHAR" javaType="java.lang.String" />
  13. <arg column="channel_account" jdbcType="VARCHAR" javaType="java.lang.String" />
  14. <arg column="channel_img" jdbcType="VARCHAR" javaType="java.lang.String" />
  15. <arg column="channel_min_limit" jdbcType="INTEGER" javaType="java.lang.Integer" />
  16. <arg column="channel_max_limit" jdbcType="INTEGER" javaType="java.lang.Integer" />
  17. <arg column="is_show" jdbcType="INTEGER" javaType="java.lang.Integer" />
  18. <arg column="is_lock" jdbcType="INTEGER" javaType="java.lang.Integer" />
  19. </constructor>
  20. </resultMap>
  21. <sql id="Base_Column_List" >
  22. id, c_type,form_url,form_code,channel_type, channel_name, channel_desc, channel_account, channel_img, channel_min_limit,
  23. channel_max_limit, is_show, is_lock
  24. </sql>
  25. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  26. select
  27. <include refid="Base_Column_List" />
  28. from site_pay
  29. where id = #{id,jdbcType=INTEGER}
  30. </select>
  31. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  32. delete from site_pay
  33. where id = #{id,jdbcType=INTEGER}
  34. </delete>
  35. <insert id="insert" parameterType="com.xc.pojo.SitePay" >
  36. insert into site_pay (id, c_type,form_url,form_code,channel_type, channel_name,
  37. channel_desc, channel_account, channel_img,
  38. channel_min_limit, channel_max_limit, is_show,
  39. is_lock)
  40. values (#{id,jdbcType=INTEGER}, #{cType,jdbcType=INTEGER},#{formUrl,jdbcType=VARCHAR},#{formCode,jdbcType=VARCHAR},
  41. #{channelType,jdbcType=VARCHAR}, #{channelName,jdbcType=VARCHAR},
  42. #{channelDesc,jdbcType=VARCHAR}, #{channelAccount,jdbcType=VARCHAR}, #{channelImg,jdbcType=VARCHAR},
  43. #{channelMinLimit,jdbcType=INTEGER}, #{channelMaxLimit,jdbcType=INTEGER}, #{isShow,jdbcType=INTEGER},
  44. #{isLock,jdbcType=INTEGER})
  45. </insert>
  46. <insert id="insertSelective" parameterType="com.xc.pojo.SitePay" >
  47. insert into site_pay
  48. <trim prefix="(" suffix=")" suffixOverrides="," >
  49. <if test="id != null" >
  50. id,
  51. </if>
  52. <if test="cType != null" >
  53. c_type,
  54. </if>
  55. <if test="formUrl != null" >
  56. form_url,
  57. </if>
  58. <if test="formCode != null" >
  59. form_code,
  60. </if>
  61. <if test="channelType != null" >
  62. channel_type,
  63. </if>
  64. <if test="channelName != null" >
  65. channel_name,
  66. </if>
  67. <if test="channelDesc != null" >
  68. channel_desc,
  69. </if>
  70. <if test="channelAccount != null" >
  71. channel_account,
  72. </if>
  73. <if test="channelImg != null" >
  74. channel_img,
  75. </if>
  76. <if test="channelMinLimit != null" >
  77. channel_min_limit,
  78. </if>
  79. <if test="channelMaxLimit != null" >
  80. channel_max_limit,
  81. </if>
  82. <if test="isShow != null" >
  83. is_show,
  84. </if>
  85. <if test="isLock != null" >
  86. is_lock,
  87. </if>
  88. </trim>
  89. <trim prefix="values (" suffix=")" suffixOverrides="," >
  90. <if test="id != null" >
  91. #{id,jdbcType=INTEGER},
  92. </if>
  93. <if test="cType != null" >
  94. #{cType,jdbcType=INTEGER},
  95. </if>
  96. <if test="formUrl != null" >
  97. #{formUrl,jdbcType=VARCHAR},
  98. </if>
  99. <if test="formCode != null" >
  100. #{formCode,jdbcType=VARCHAR},
  101. </if>
  102. <if test="channelType != null" >
  103. #{channelType,jdbcType=VARCHAR},
  104. </if>
  105. <if test="channelName != null" >
  106. #{channelName,jdbcType=VARCHAR},
  107. </if>
  108. <if test="channelDesc != null" >
  109. #{channelDesc,jdbcType=VARCHAR},
  110. </if>
  111. <if test="channelAccount != null" >
  112. #{channelAccount,jdbcType=VARCHAR},
  113. </if>
  114. <if test="channelImg != null" >
  115. #{channelImg,jdbcType=VARCHAR},
  116. </if>
  117. <if test="channelMinLimit != null" >
  118. #{channelMinLimit,jdbcType=INTEGER},
  119. </if>
  120. <if test="channelMaxLimit != null" >
  121. #{channelMaxLimit,jdbcType=INTEGER},
  122. </if>
  123. <if test="isShow != null" >
  124. #{isShow,jdbcType=INTEGER},
  125. </if>
  126. <if test="isLock != null" >
  127. #{isLock,jdbcType=INTEGER},
  128. </if>
  129. </trim>
  130. </insert>
  131. <update id="updateByPrimaryKeySelective" parameterType="com.xc.pojo.SitePay" >
  132. update site_pay
  133. <set >
  134. <if test="cType != null" >
  135. c_type = #{cType,jdbcType=INTEGER},
  136. </if>
  137. <if test="formUrl != null" >
  138. form_url = #{formUrl,jdbcType=VARCHAR},
  139. </if>
  140. <if test="formCode != null" >
  141. form_code = #{formCode,jdbcType=VARCHAR},
  142. </if>
  143. <if test="channelType != null" >
  144. channel_type = #{channelType,jdbcType=VARCHAR},
  145. </if>
  146. <if test="channelName != null" >
  147. channel_name = #{channelName,jdbcType=VARCHAR},
  148. </if>
  149. <if test="channelDesc != null" >
  150. channel_desc = #{channelDesc,jdbcType=VARCHAR},
  151. </if>
  152. <if test="channelAccount != null" >
  153. channel_account = #{channelAccount,jdbcType=VARCHAR},
  154. </if>
  155. <if test="channelImg != null" >
  156. channel_img = #{channelImg,jdbcType=VARCHAR},
  157. </if>
  158. <if test="channelMinLimit != null" >
  159. channel_min_limit = #{channelMinLimit,jdbcType=INTEGER},
  160. </if>
  161. <if test="channelMaxLimit != null" >
  162. channel_max_limit = #{channelMaxLimit,jdbcType=INTEGER},
  163. </if>
  164. <if test="isShow != null" >
  165. is_show = #{isShow,jdbcType=INTEGER},
  166. </if>
  167. <if test="isLock != null" >
  168. is_lock = #{isLock,jdbcType=INTEGER},
  169. </if>
  170. </set>
  171. where id = #{id,jdbcType=INTEGER}
  172. </update>
  173. <update id="updateByPrimaryKey" parameterType="com.xc.pojo.SitePay" >
  174. update site_pay
  175. set c_type = #{cType,jdbcType=INTEGER},
  176. form_url = #{formUrl,jdbcType=VARCHAR},
  177. form_code = #{formCode,jdbcType=VARCHAR},
  178. channel_type = #{channelType,jdbcType=VARCHAR},
  179. channel_name = #{channelName,jdbcType=VARCHAR},
  180. channel_desc = #{channelDesc,jdbcType=VARCHAR},
  181. channel_account = #{channelAccount,jdbcType=VARCHAR},
  182. channel_img = #{channelImg,jdbcType=VARCHAR},
  183. channel_min_limit = #{channelMinLimit,jdbcType=INTEGER},
  184. channel_max_limit = #{channelMaxLimit,jdbcType=INTEGER},
  185. is_show = #{isShow,jdbcType=INTEGER},
  186. is_lock = #{isLock,jdbcType=INTEGER}
  187. where id = #{id,jdbcType=INTEGER}
  188. </update>
  189. <select id="findByChannelType" parameterType="string" resultMap="BaseResultMap">
  190. SELECT
  191. <include refid="Base_Column_List"/>
  192. FROM site_pay WHERE channel_type = #{channelType}
  193. </select>
  194. <select id="listByAdmin" parameterType="string" resultMap="BaseResultMap">
  195. SELECT
  196. <include refid="Base_Column_List"/>
  197. FROM site_pay
  198. <where>
  199. <if test="channelType != null and channelType != '' ">
  200. channel_type = #{channelType}
  201. </if>
  202. </where>
  203. order by id desc
  204. </select>
  205. <select id="getPayInfo" resultMap="BaseResultMap">
  206. SELECT
  207. <include refid="Base_Column_List"/>
  208. FROM site_pay WHERE is_show = 0
  209. </select>
  210. <select id="selectServerUrl" resultType="String">
  211. select url from t_k_server_url order by rand() limit 1
  212. </select>
  213. </mapper>