AskaRetailsMapper.xml 13 KB

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