AskaRetailsMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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.AskaRetailsMapper">
  6. <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.AskaRetails">
  7. <id property="id" column="id" jdbcType="INTEGER"/>
  8. <result property="name" column="name" jdbcType="CHAR"/>
  9. <result property="address" column="address" jdbcType="VARCHAR"/>
  10. <result property="type" column="type" jdbcType="CHAR"/>
  11. <result property="lat" column="lat" jdbcType="DOUBLE"/>
  12. <result property="lng" column="lng" jdbcType="DOUBLE"/>
  13. <result property="ownerId" column="ownerId" jdbcType="INTEGER"/>
  14. <result property="phone" column="phone" jdbcType="CHAR"/>
  15. <result property="note" column="note" jdbcType="VARCHAR"/>
  16. <result property="account" column="account" jdbcType="VARCHAR"/>
  17. <result property="accountName" column="accountName" jdbcType="VARCHAR"/>
  18. <result property="accountType" column="accountType" jdbcType="CHAR"/>
  19. <result property="relation" column="relation" jdbcType="CHAR"/>
  20. <result property="apiv3" column="apiv3" jdbcType="VARCHAR"/>
  21. <result property="certPath" column="certPath" jdbcType="VARCHAR"/>
  22. <result property="tripartite" column="tripartite" jdbcType="CHAR"/>
  23. <result property="tripvalue" column="tripvalue" jdbcType="INTEGER"/>
  24. <result property="realtimeSplit" column="realtimeSplit" jdbcType="INTEGER"/>
  25. <result property="status" column="status" jdbcType="CHAR"/>
  26. <result property="accountingIncome" column="accountingIncome" jdbcType="INTEGER"/>
  27. <result property="splitIncome" column="splitIncome" jdbcType="INTEGER"/>
  28. <result property="accountingRefund" column="accountingRefund" jdbcType="INTEGER"/>
  29. <result property="splitRefund" column="splitRefund" jdbcType="INTEGER"/>
  30. <result property="cashOut" column="cashOut" jdbcType="INTEGER"/>
  31. <result property="balance" column="balance" jdbcType="INTEGER"/>
  32. </resultMap>
  33. <sql id="Base_Column_List">
  34. id,name,address,
  35. type,lat,lng,
  36. ownerId,phone,note,
  37. account,accountName,accountType,
  38. relation,apiv3,certPath,
  39. tripartite,tripvalue,realtimeSplit,
  40. status,accountingIncome,splitIncome,
  41. accountingRefund,splitRefund,cashOut,balance
  42. </sql>
  43. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  44. select
  45. <include refid="Base_Column_List" />
  46. from aska_retails
  47. where id = #{id,jdbcType=INTEGER}
  48. </select>
  49. <select id="listAllRetails" resultType="com.mofangchuxing.aska.domain.vo.AskaRetailsVo">
  50. select
  51. ar.*,aa.name as username
  52. from aska_retails ar left join aska_accounts aa on ar.ownerId = aa.id
  53. where 1=1
  54. <if test="name != null and name != ''">
  55. and ar.name = #{name}
  56. </if>
  57. <if test="retailType != null and retailType != ''">
  58. and ar.retail_type = #{retailType}
  59. </if>
  60. <if test="status != null">
  61. and ar.status = #{status}
  62. </if>
  63. </select>
  64. <select id="listAllRetailsNoLimit" resultType="com.mofangchuxing.aska.domain.vo.AskaRetailsVo">
  65. select id as retailId,
  66. name as retailName,
  67. lat,lng,address,status
  68. from aska_retails
  69. </select>
  70. <select id="selectByOwnerId" resultType="com.mofangchuxing.aska.domain.vo.AskaRetailsVo">
  71. select id as retailId,name as retailName from aska_retails where ownerId = #{ownerId} limit 1
  72. </select>
  73. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  74. delete from aska_retails
  75. where id = #{id,jdbcType=INTEGER}
  76. </delete>
  77. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaRetails" useGeneratedKeys="true">
  78. insert into aska_retails
  79. ( id,name,address
  80. ,type,lat,lng
  81. ,ownerId,phone,note
  82. ,account,accountName,accountType
  83. ,relation,apiv3,certPath
  84. ,tripartite,tripvalue,realtimeSplit
  85. ,status,accountingIncome,splitIncome
  86. ,accountingRefund,splitRefund,cashOut,balance
  87. )
  88. values (#{id,jdbcType=INTEGER},#{name,jdbcType=CHAR},#{address,jdbcType=VARCHAR}
  89. ,#{type,jdbcType=CHAR},#{lat,jdbcType=DOUBLE},#{lng,jdbcType=DOUBLE}
  90. ,#{ownerId,jdbcType=INTEGER},#{phone,jdbcType=CHAR},#{note,jdbcType=VARCHAR}
  91. ,#{account,jdbcType=VARCHAR},#{accountName,jdbcType=VARCHAR},#{accountType,jdbcType=CHAR}
  92. ,#{relation,jdbcType=CHAR},#{apiv3,jdbcType=VARCHAR},#{certPath,jdbcType=VARCHAR}
  93. ,#{tripartite,jdbcType=CHAR},#{tripvalue,jdbcType=INTEGER},#{realtimeSplit,jdbcType=INTEGER}
  94. ,#{status,jdbcType=CHAR},#{accountingIncome,jdbcType=INTEGER},#{splitIncome,jdbcType=INTEGER}
  95. ,#{accountingRefund,jdbcType=INTEGER},#{splitRefund,jdbcType=INTEGER},#{cashOut,jdbcType=INTEGER},#{balance,jdbcType=INTEGER}
  96. )
  97. </insert>
  98. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaRetails" useGeneratedKeys="true">
  99. insert into aska_retails
  100. <trim prefix="(" suffix=")" suffixOverrides=",">
  101. <if test="id != null">id,</if>
  102. <if test="name != null">name,</if>
  103. <if test="address != null">address,</if>
  104. <if test="type != null">type,</if>
  105. <if test="lat != null">lat,</if>
  106. <if test="lng != null">lng,</if>
  107. <if test="ownerId != null">ownerId,</if>
  108. <if test="phone != null">phone,</if>
  109. <if test="note != null">note,</if>
  110. <if test="account != null">account,</if>
  111. <if test="accountName != null">accountName,</if>
  112. <if test="accountType != null">accountType,</if>
  113. <if test="relation != null">relation,</if>
  114. <if test="apiv3 != null">apiv3,</if>
  115. <if test="certPath != null">certPath,</if>
  116. <if test="tripartite != null">tripartite,</if>
  117. <if test="tripvalue != null">tripvalue,</if>
  118. <if test="realtimeSplit != null">realtimeSplit,</if>
  119. <if test="status != null">status,</if>
  120. <if test="balance != null">balance,</if>
  121. </trim>
  122. <trim prefix="values (" suffix=")" suffixOverrides=",">
  123. <if test="id != null">#{id,jdbcType=INTEGER},</if>
  124. <if test="name != null">#{name,jdbcType=CHAR},</if>
  125. <if test="address != null">#{address,jdbcType=VARCHAR},</if>
  126. <if test="type != null">#{type,jdbcType=CHAR},</if>
  127. <if test="lat != null">#{lat,jdbcType=DOUBLE},</if>
  128. <if test="lng != null">#{lng,jdbcType=DOUBLE},</if>
  129. <if test="ownerId != null">#{ownerId,jdbcType=INTEGER},</if>
  130. <if test="phone != null">#{phone,jdbcType=CHAR},</if>
  131. <if test="note != null">#{note,jdbcType=VARCHAR},</if>
  132. <if test="account != null">#{account,jdbcType=VARCHAR},</if>
  133. <if test="accountName != null">#{accountName,jdbcType=VARCHAR},</if>
  134. <if test="accountType != null">#{accountType,jdbcType=CHAR},</if>
  135. <if test="relation != null">#{relation,jdbcType=CHAR},</if>
  136. <if test="apiv3 != null">#{apiv3,jdbcType=VARCHAR},</if>
  137. <if test="certPath != null">#{certPath,jdbcType=VARCHAR},</if>
  138. <if test="tripartite != null">#{tripartite,jdbcType=CHAR},</if>
  139. <if test="tripvalue != null">#{tripvalue,jdbcType=INTEGER},</if>
  140. <if test="realtimeSplit != null">#{realtimeSplit,jdbcType=INTEGER},</if>
  141. <if test="status != null">#{status,jdbcType=CHAR},</if>
  142. <if test="balance != null">#{balance,jdbcType=INTEGER},</if>
  143. </trim>
  144. </insert>
  145. <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaRetails">
  146. update aska_retails
  147. <set>
  148. <if test="name != null">
  149. name = #{name,jdbcType=CHAR},
  150. </if>
  151. <if test="address != null">
  152. address = #{address,jdbcType=VARCHAR},
  153. </if>
  154. <if test="type != null">
  155. type = #{type,jdbcType=CHAR},
  156. </if>
  157. <if test="lat != null">
  158. lat = #{lat,jdbcType=DOUBLE},
  159. </if>
  160. <if test="lng != null">
  161. lng = #{lng,jdbcType=DOUBLE},
  162. </if>
  163. <if test="ownerId != null">
  164. ownerId = #{ownerId,jdbcType=INTEGER},
  165. </if>
  166. <if test="phone != null">
  167. phone = #{phone,jdbcType=CHAR},
  168. </if>
  169. <if test="note != null">
  170. note = #{note,jdbcType=VARCHAR},
  171. </if>
  172. <if test="account != null">
  173. account = #{account,jdbcType=VARCHAR},
  174. </if>
  175. <if test="accountName != null">
  176. accountName = #{accountName,jdbcType=VARCHAR},
  177. </if>
  178. <if test="accountType != null">
  179. accountType = #{accountType,jdbcType=CHAR},
  180. </if>
  181. <if test="relation != null">
  182. relation = #{relation,jdbcType=CHAR},
  183. </if>
  184. <if test="apiv3 != null">
  185. apiv3 = #{apiv3,jdbcType=VARCHAR},
  186. </if>
  187. <if test="certPath != null">
  188. certPath = #{certPath,jdbcType=VARCHAR},
  189. </if>
  190. <if test="tripartite != null">
  191. tripartite = #{tripartite,jdbcType=CHAR},
  192. </if>
  193. <if test="tripvalue != null">
  194. tripvalue = #{tripvalue,jdbcType=INTEGER},
  195. </if>
  196. <if test="realtimeSplit != null">
  197. realtimeSplit = #{realtimeSplit,jdbcType=INTEGER},
  198. </if>
  199. <if test="status != null">
  200. status = #{status,jdbcType=CHAR},
  201. </if>
  202. <if test="accountingIncome != null">
  203. accountingIncome = #{accountingIncome,jdbcType=INTEGER},
  204. </if>
  205. <if test="splitIncome != null">
  206. splitIncome = #{splitIncome,jdbcType=INTEGER},
  207. </if>
  208. <if test="accountingRefund != null">
  209. accountingRefund = #{accountingRefund,jdbcType=INTEGER},
  210. </if>
  211. <if test="splitRefund != null">
  212. splitRefund = #{splitRefund,jdbcType=INTEGER},
  213. </if>
  214. <if test="cashOut != null">
  215. cashOut = #{cashOut,jdbcType=INTEGER},
  216. </if>
  217. <if test="balance != null">
  218. balance = #{balance,jdbcType=INTEGER},
  219. </if>
  220. </set>
  221. where id = #{id,jdbcType=INTEGER}
  222. </update>
  223. <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.AskaRetails">
  224. update aska_retails
  225. set
  226. name = #{name,jdbcType=CHAR},
  227. address = #{address,jdbcType=VARCHAR},
  228. type = #{type,jdbcType=CHAR},
  229. lat = #{lat,jdbcType=DOUBLE},
  230. lng = #{lng,jdbcType=DOUBLE},
  231. ownerId = #{ownerId,jdbcType=INTEGER},
  232. phone = #{phone,jdbcType=CHAR},
  233. note = #{note,jdbcType=VARCHAR},
  234. account = #{account,jdbcType=VARCHAR},
  235. accountName = #{accountName,jdbcType=VARCHAR},
  236. accountType = #{accountType,jdbcType=CHAR},
  237. relation = #{relation,jdbcType=CHAR},
  238. apiv3 = #{apiv3,jdbcType=VARCHAR},
  239. certPath = #{certPath,jdbcType=VARCHAR},
  240. tripartite = #{tripartite,jdbcType=CHAR},
  241. tripvalue = #{tripvalue,jdbcType=INTEGER},
  242. realtimeSplit = #{realtimeSplit,jdbcType=INTEGER},
  243. status = #{status,jdbcType=CHAR},
  244. accountingIncome = #{accountingIncome,jdbcType=INTEGER},
  245. splitIncome = #{splitIncome,jdbcType=INTEGER},
  246. accountingRefund = #{accountingRefund,jdbcType=INTEGER},
  247. splitRefund = #{splitRefund,jdbcType=INTEGER},
  248. cashOut = #{cashOut,jdbcType=INTEGER},
  249. balance = #{balance,jdbcType=INTEGER}
  250. where id = #{id,jdbcType=INTEGER}
  251. </update>
  252. </mapper>