AskaChannelsMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.mofangchuxing.aska.dao.mapper.AskaChannelsMapper">
  6. <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.AskaChannels">
  7. <id property="id" column="id" jdbcType="INTEGER"/>
  8. <result property="name" column="name" jdbcType="CHAR"/>
  9. <result property="prefix" column="prefix" jdbcType="CHAR"/>
  10. <result property="ownerId" column="ownerId" jdbcType="INTEGER"/>
  11. <result property="phone" column="phone" jdbcType="CHAR"/>
  12. <result property="note" column="note" jdbcType="VARCHAR"/>
  13. <result property="account" column="account" jdbcType="VARCHAR"/>
  14. <result property="accountName" column="accountName" jdbcType="VARCHAR"/>
  15. <result property="accountType" column="accountType" jdbcType="CHAR"/>
  16. <result property="relation" column="relation" jdbcType="CHAR"/>
  17. <result property="apiv3" column="apiv3" jdbcType="VARCHAR"/>
  18. <result property="certPath" column="certPath" jdbcType="VARCHAR"/>
  19. <result property="tripartite" column="tripartite" jdbcType="CHAR"/>
  20. <result property="tripvalue" column="tripvalue" jdbcType="INTEGER"/>
  21. <result property="realtimeSplit" column="realtimeSplit" jdbcType="INTEGER"/>
  22. <result property="cashSplit" column="cashSplit" jdbcType="INTEGER"/>
  23. <result property="status" column="status" jdbcType="CHAR"/>
  24. <result property="accountingIncome" column="accountingIncome" jdbcType="INTEGER"/>
  25. <result property="splitIncome" column="splitIncome" jdbcType="INTEGER"/>
  26. <result property="accountingRefund" column="accountingRefund" jdbcType="INTEGER"/>
  27. <result property="splitRefund" column="splitRefund" jdbcType="INTEGER"/>
  28. <result property="cashOut" column="cashOut" jdbcType="INTEGER"/>
  29. <result property="balance" column="balance" jdbcType="INTEGER"/>
  30. </resultMap>
  31. <sql id="Base_Column_List">
  32. id,name,prefix,
  33. ownerId,phone,note,
  34. account,accountName,accountType,
  35. relation,apiv3,certPath,
  36. tripartite,tripvalue,realtimeSplit,cashSplit
  37. status,accountingIncome,splitIncome,
  38. accountingRefund,splitRefund,cashOut,balance
  39. </sql>
  40. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  41. select
  42. <include refid="Base_Column_List" />
  43. from aska_channels
  44. where id = #{id,jdbcType=INTEGER}
  45. </select>
  46. <select id="getAllChannels" resultType="com.mofangchuxing.aska.domain.vo.AskaChannelsVo">
  47. select ac.*,aa.name as username
  48. from aska_channels ac left join aska_accounts aa on ac.ownerId = aa.id
  49. where 1=1
  50. <if test="channelName != null and channelName != ''">
  51. and ac.name = #{channelName,jdbcType=VARCHAR}
  52. </if>
  53. </select>
  54. <select id="selectByOwnerId" resultType="com.mofangchuxing.aska.domain.vo.AskaChannelsVo">
  55. select id as channelId,name as channelName from aska_channels where ownerId = #{ownerId} limit 1
  56. </select>
  57. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  58. delete from aska_channels
  59. where id = #{id,jdbcType=INTEGER}
  60. </delete>
  61. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannels" useGeneratedKeys="true">
  62. insert into aska_channels
  63. ( id,name,prefix
  64. ,ownerId,phone,note
  65. ,account,accountName,accountType
  66. ,relation,apiv3,certPath
  67. ,tripartite,tripvalue,realtimeSplit
  68. ,status,accountingIncome,splitIncome
  69. ,accountingRefund,splitRefund,cashOut,balance
  70. )
  71. values (#{id,jdbcType=INTEGER},#{name,jdbcType=CHAR},#{prefix,jdbcType=CHAR}
  72. ,#{ownerId,jdbcType=INTEGER},#{phone,jdbcType=CHAR},#{note,jdbcType=VARCHAR}
  73. ,#{account,jdbcType=VARCHAR},#{accountName,jdbcType=VARCHAR},#{accountType,jdbcType=CHAR}
  74. ,#{relation,jdbcType=CHAR},#{apiv3,jdbcType=VARCHAR},#{certPath,jdbcType=VARCHAR}
  75. ,#{tripartite,jdbcType=CHAR},#{tripvalue,jdbcType=INTEGER},#{realtimeSplit,jdbcType=INTEGER}
  76. ,#{status,jdbcType=CHAR},#{accountingIncome,jdbcType=INTEGER},#{splitIncome,jdbcType=INTEGER}
  77. ,#{accountingRefund,jdbcType=INTEGER},#{splitRefund,jdbcType=INTEGER},#{cashOut,jdbcType=INTEGER},#{balance,jdbcType=INTEGER}
  78. )
  79. </insert>
  80. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannels" useGeneratedKeys="true">
  81. insert into aska_channels
  82. <trim prefix="(" suffix=")" suffixOverrides=",">
  83. <if test="id != null">id,</if>
  84. <if test="name != null">name,</if>
  85. <if test="prefix != null">prefix,</if>
  86. <if test="ownerId != null">ownerId,</if>
  87. <if test="phone != null">phone,</if>
  88. <if test="note != null">note,</if>
  89. <if test="account != null">account,</if>
  90. <if test="accountName != null">accountName,</if>
  91. <if test="accountType != null">accountType,</if>
  92. <if test="relation != null">relation,</if>
  93. <if test="apiv3 != null">apiv3,</if>
  94. <if test="certPath != null">certPath,</if>
  95. <if test="tripartite != null">tripartite,</if>
  96. <if test="tripvalue != null">tripvalue,</if>
  97. <if test="realtimeSplit != null">realtimeSplit,</if>
  98. <if test="status != null">status,</if>
  99. <if test="balance != null">balance,</if>
  100. </trim>
  101. <trim prefix="values (" suffix=")" suffixOverrides=",">
  102. <if test="id != null">#{id,jdbcType=INTEGER},</if>
  103. <if test="name != null">#{name,jdbcType=CHAR},</if>
  104. <if test="prefix != null">#{prefix,jdbcType=CHAR},</if>
  105. <if test="ownerId != null">#{ownerId,jdbcType=INTEGER},</if>
  106. <if test="phone != null">#{phone,jdbcType=CHAR},</if>
  107. <if test="note != null">#{note,jdbcType=VARCHAR},</if>
  108. <if test="account != null">#{account,jdbcType=VARCHAR},</if>
  109. <if test="accountName != null">#{accountName,jdbcType=VARCHAR},</if>
  110. <if test="accountType != null">#{accountType,jdbcType=CHAR},</if>
  111. <if test="relation != null">#{relation,jdbcType=CHAR},</if>
  112. <if test="apiv3 != null">#{apiv3,jdbcType=VARCHAR},</if>
  113. <if test="certPath != null">#{certPath,jdbcType=VARCHAR},</if>
  114. <if test="tripartite != null">#{tripartite,jdbcType=CHAR},</if>
  115. <if test="tripvalue != null">#{tripvalue,jdbcType=INTEGER},</if>
  116. <if test="realtimeSplit != null">#{realtimeSplit,jdbcType=INTEGER},</if>
  117. <if test="status != null">#{status,jdbcType=CHAR},</if>
  118. <if test="balance != null">#{balance,jdbcType=INTEGER},</if>
  119. </trim>
  120. </insert>
  121. <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannels">
  122. update aska_channels
  123. <set>
  124. <if test="name != null">
  125. name = #{name,jdbcType=CHAR},
  126. </if>
  127. <if test="prefix != null">
  128. prefix = #{prefix,jdbcType=CHAR},
  129. </if>
  130. <if test="ownerId != null">
  131. ownerId = #{ownerId,jdbcType=INTEGER},
  132. </if>
  133. <if test="phone != null">
  134. phone = #{phone,jdbcType=CHAR},
  135. </if>
  136. <if test="note != null">
  137. note = #{note,jdbcType=VARCHAR},
  138. </if>
  139. <if test="account != null">
  140. account = #{account,jdbcType=VARCHAR},
  141. </if>
  142. <if test="accountName != null">
  143. accountName = #{accountName,jdbcType=VARCHAR},
  144. </if>
  145. <if test="accountType != null">
  146. accountType = #{accountType,jdbcType=CHAR},
  147. </if>
  148. <if test="relation != null">
  149. relation = #{relation,jdbcType=CHAR},
  150. </if>
  151. <if test="apiv3 != null">
  152. apiv3 = #{apiv3,jdbcType=VARCHAR},
  153. </if>
  154. <if test="certPath != null">
  155. certPath = #{certPath,jdbcType=VARCHAR},
  156. </if>
  157. <if test="tripartite != null">
  158. tripartite = #{tripartite,jdbcType=CHAR},
  159. </if>
  160. <if test="tripvalue != null">
  161. tripvalue = #{tripvalue,jdbcType=INTEGER},
  162. </if>
  163. <if test="realtimeSplit != null">
  164. realtimeSplit = #{realtimeSplit,jdbcType=INTEGER},
  165. </if>
  166. <if test="status != null">
  167. status = #{status,jdbcType=CHAR},
  168. </if>
  169. <if test="accountingIncome != null">
  170. accountingIncome = #{accountingIncome,jdbcType=INTEGER},
  171. </if>
  172. <if test="splitIncome != null">
  173. splitIncome = #{splitIncome,jdbcType=INTEGER},
  174. </if>
  175. <if test="accountingRefund != null">
  176. accountingRefund = #{accountingRefund,jdbcType=INTEGER},
  177. </if>
  178. <if test="splitRefund != null">
  179. splitRefund = #{splitRefund,jdbcType=INTEGER},
  180. </if>
  181. <if test="cashOut != null">
  182. cashOut = #{cashOut,jdbcType=INTEGER},
  183. </if>
  184. <if test="balance != null">
  185. balance = #{balance,jdbcType=INTEGER},
  186. </if>
  187. </set>
  188. where id = #{id,jdbcType=INTEGER}
  189. </update>
  190. <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.AskaChannels">
  191. update aska_channels
  192. set
  193. name = #{name,jdbcType=CHAR},
  194. prefix = #{prefix,jdbcType=CHAR},
  195. ownerId = #{ownerId,jdbcType=INTEGER},
  196. phone = #{phone,jdbcType=CHAR},
  197. note = #{note,jdbcType=VARCHAR},
  198. account = #{account,jdbcType=VARCHAR},
  199. accountName = #{accountName,jdbcType=VARCHAR},
  200. accountType = #{accountType,jdbcType=CHAR},
  201. relation = #{relation,jdbcType=CHAR},
  202. apiv3 = #{apiv3,jdbcType=VARCHAR},
  203. certPath = #{certPath,jdbcType=VARCHAR},
  204. tripartite = #{tripartite,jdbcType=CHAR},
  205. tripvalue = #{tripvalue,jdbcType=INTEGER},
  206. realtimeSplit = #{realtimeSplit,jdbcType=INTEGER},
  207. status = #{status,jdbcType=CHAR},
  208. accountingIncome = #{accountingIncome,jdbcType=INTEGER},
  209. splitIncome = #{splitIncome,jdbcType=INTEGER},
  210. accountingRefund = #{accountingRefund,jdbcType=INTEGER},
  211. splitRefund = #{splitRefund,jdbcType=INTEGER},
  212. cashOut = #{cashOut,jdbcType=INTEGER},
  213. balance = #{balance,jdbcType=INTEGER}
  214. where id = #{id,jdbcType=INTEGER}
  215. </update>
  216. </mapper>