AskaRetailsMapper.xml 13 KB

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