Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

275 строки
11 KiB

  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.iformall.mapper.WxMallMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMall">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
  8. <result column="name" jdbcType="VARCHAR" property="name"/>
  9. <result column="group" jdbcType="VARCHAR" property="group"/>
  10. <result column="country" jdbcType="VARCHAR" property="country"/>
  11. <result column="province" jdbcType="VARCHAR" property="province"/>
  12. <result column="city" jdbcType="VARCHAR" property="city"/>
  13. <result column="addr" jdbcType="VARCHAR" property="addr"/>
  14. <result column="total_area" jdbcType="DECIMAL" property="totalArea"/>
  15. <result column="operating_area" jdbcType="DECIMAL" property="operatingArea"/>
  16. <result column="park_area" jdbcType="DECIMAL" property="parkArea"/>
  17. <result column="park_place_number" jdbcType="INTEGER" property="parkPlaceNumber"/>
  18. <result column="service_phone" jdbcType="VARCHAR" property="servicePhone"/>
  19. <result column="img_url" jdbcType="VARCHAR" property="imgUrl"/>
  20. <result column="img_url_h" jdbcType="VARCHAR" property="imgUrlH"/>
  21. <result column="weap_note" jdbcType="VARCHAR" property="weapNote"/>
  22. <result column="img_qrcode_weapp" jdbcType="VARCHAR" property="imgQrcodeWeapp"/>
  23. <result column="img_qrcode_wemp" jdbcType="VARCHAR" property="imgQrcodeWemp"/>
  24. <result column="weapp_share_title" jdbcType="VARCHAR" property="weappShareTitle"/>
  25. <result column="weapp_share_cover_img" jdbcType="VARCHAR" property="weappShareCoverImg"/>
  26. <result column="pos_qrcode_rule" jdbcType="VARCHAR" property="posQrcodeRule"/>
  27. <result column="sale_type" jdbcType="TINYINT" property="saleType"/>
  28. <result column="valid_start" jdbcType="TIMESTAMP" property="validStart"/>
  29. <result column="valid_end" jdbcType="TIMESTAMP" property="validEnd"/>
  30. <result column="business_hours" jdbcType="VARCHAR" property="businessHours"/>
  31. <result column="introduction" jdbcType="VARCHAR" property="introduction"/>
  32. <result column="img" jdbcType="VARCHAR" property="img"/>
  33. <result column="group_support" jdbcType="INTEGER" property="groupSupport"/>
  34. <result column="latitude" jdbcType="DECIMAL" property="latitude"/>
  35. <result column="longitude" jdbcType="DECIMAL" property="longitude"/>
  36. <result column="live_support" jdbcType="INTEGER" property="liveSupport"/>
  37. <result column="cash_out_support" jdbcType="INTEGER" property="cashOutSupport"/>
  38. <result column="cash_out_limit" jdbcType="INTEGER" property="cashOutLimit"/>
  39. <result column="alipay_app_auth_token" jdbcType="VARCHAR" property="alipayAppAuthToken"/>
  40. <result column="alipay_member_template_id" jdbcType="VARCHAR" property="alipayMemberTemplateId"/>
  41. <result column="admin_id" jdbcType="BIGINT" property="adminId"/>
  42. <result column="admin_name" jdbcType="VARCHAR" property="adminName"/>
  43. <result column="admin_phone" jdbcType="VARCHAR" property="adminPhone"/>
  44. <result column="admin_username" jdbcType="VARCHAR" property="adminUsername"/>
  45. <result column="admin_status" jdbcType="INTEGER" property="adminStatus"/>
  46. </resultMap>
  47. <sql id="allColumns">
  48. `id`,`tenant_id`,`parent_tenant_id`,`name`,`group`,`country`,`province`,`city`,`addr`,
  49. `total_area`,`operating_area`,`park_area`,`park_place_number`,`service_phone`,
  50. `img_url`,`img_url_h`, `weap_note`, `img_qrcode_weapp`, `img_qrcode_wemp`,
  51. `weapp_share_title`,`weapp_share_cover_img`, `pos_qrcode_rule`,
  52. `sale_type`, `valid_start`, `valid_end`,`business_hours`,`introduction`,`img`,
  53. `group_support`,`latitude`,`longitude`,`live_support`,`cash_out_support`,`cash_out_limit`,`alipay_app_auth_token`,`alipay_member_template_id`
  54. </sql>
  55. <sql id="dynamicWhereConditions">
  56. where id &gt; 1
  57. <if test=" null != id ">
  58. and `id` = #{id}
  59. </if>
  60. <if test=" null != tenantId and '' != tenantId">
  61. and `tenant_id` = #{tenantId}
  62. </if>
  63. <if test=" null != parentTenantId and '' != parentTenantId">
  64. and `parent_tenant_id` = #{parentTenantId}
  65. </if>
  66. <if test=" null != name ">
  67. and `name` like concat('%', #{name},'%')
  68. </if>
  69. <if test=" null != group ">
  70. and `group` like concat('%', #{group},'%')
  71. </if>
  72. <if test=" null != country ">
  73. and `country` like concat('%', #{country},'%')
  74. </if>
  75. <if test=" null != province ">
  76. and `province` like concat('%', #{province},'%')
  77. </if>
  78. <if test=" null != city ">
  79. and `city` like concat('%', #{city},'%')
  80. </if>
  81. <if test=" null != addr ">
  82. and `addr` like concat('%', #{addr},'%')
  83. </if>
  84. <if test=" null != totalArea ">
  85. and `total_area` = #{totalArea}
  86. </if>
  87. <if test=" null != operatingArea ">
  88. and `operating_area` = #{operatingArea}
  89. </if>
  90. <if test=" null != parkArea ">
  91. and `park_area` = #{parkArea}
  92. </if>
  93. <if test=" null != parkPlaceNumber ">
  94. and `park_place_number` = #{parkPlaceNumber}
  95. </if>
  96. <if test=" null != servicePhone ">
  97. and `service_phone` = #{servicePhone}
  98. </if>
  99. <if test=" null != imgUrl ">
  100. and `img_url` = #{imgUrl}
  101. </if>
  102. <if test=" null != imgUrlH ">
  103. and `img_ur_h` = #{imgUrlH}
  104. </if>
  105. <if test=" null != imgQrcodeWeapp ">
  106. and `img_qrcode_weapp` = #{imgQrcodeWeapp}
  107. </if>
  108. <if test=" null != imgQrcodeWemp ">
  109. and `img_qrcode_wemp` = #{imgQrcodeWemp}
  110. </if>
  111. <if test=" null != saleType ">
  112. and `sale_type` = #{saleType}
  113. </if>
  114. <if test=" null != validStart ">
  115. and `valid_start` = #{validStart}
  116. </if>
  117. <if test=" null != validEnd ">
  118. and `valid_end` = #{validEnd}
  119. </if>
  120. <if test=" null != groupSupport ">
  121. and `group_support` = #{groupSupport}
  122. </if>
  123. <if test=" null != ids ">
  124. and id in
  125. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  126. #{idItem}
  127. </foreach>
  128. </if>
  129. <if test=" null != sortColumns">order by ${sortColumns}</if>
  130. </sql>
  131. <select id="findList" parameterType="com.iformall.domain.po.WxMall" resultMap="BaseResultMap">
  132. select
  133. <include refid="allColumns"/>
  134. from wx_mall
  135. <include refid="dynamicWhereConditions"/>
  136. </select>
  137. <select id="listAsSelectMall" resultMap="BaseResultMap">
  138. select
  139. <include refid="allColumns"/>
  140. from wx_mall
  141. where id &gt; 1
  142. and `sale_type` != 100 and `group_support` != 1 and `tenant_id` != #{id}
  143. and (`parent_tenant_id` is null or `parent_tenant_id` = #{id} or trim(parent_tenant_id) = '')
  144. </select>
  145. <select id="getByTenantId" parameterType="string" resultMap="BaseResultMap">
  146. select
  147. <include refid="allColumns"/>
  148. from wx_mall
  149. where `tenant_id` = #{value}
  150. </select>
  151. <select id="getByTenantInfo" parameterType="com.iformall.domain.po.base.TenantEntity" resultMap="BaseResultMap">
  152. select
  153. <include refid="allColumns"/>
  154. from wx_mall
  155. where 1=1
  156. <if test=" null != tenantId and '' != tenantId">
  157. and `tenant_id` = #{tenantId}
  158. </if>
  159. <if test=" null != parentTenantId and '' != parentTenantId">
  160. and `parent_tenant_id` = #{parentTenantId}
  161. </if>
  162. </select>
  163. <select id="queryMenusByTenantId" parameterType="string" resultType="string">
  164. select st.menus
  165. from mall_sale_type st, wx_mall m
  166. where st.type = m.sale_type and m.`tenant_id` = #{value}
  167. </select>
  168. <select id="queryMenusByTenantInfo" parameterType="com.iformall.domain.po.WxMall" resultType="string">
  169. select st.menus
  170. from mall_sale_type st, wx_mall m
  171. where st.type = m.sale_type
  172. <if test=" null != tenantId and '' != tenantId">
  173. and m.`tenant_id` = #{tenantId}
  174. </if>
  175. <if test=" null != parentTenantId and '' != parentTenantId">
  176. and m.`parent_tenant_id` = #{parentTenantId}
  177. </if>
  178. </select>
  179. <update id="undateSubmall">
  180. update wx_mall set parent_tenant_id = null where parent_tenant_id = #{parentTenantId} ;
  181. <if test="tenantIds != null and tenantIds.size > 0">
  182. update wx_mall set parent_tenant_id = #{parentTenantId} where tenant_id in
  183. <foreach collection="tenantIds" item="item" index="index" open="("
  184. separator="," close=")">
  185. #{item}
  186. </foreach>
  187. </if>
  188. </update>
  189. <select id="getTenantEntitys" parameterType="com.iformall.domain.po.base.TenantEntity" resultType="com.iformall.domain.po.base.TenantEntity">
  190. select `tenant_id`,`parent_tenant_id` from wx_mall where 1=1
  191. <if test=" null != tenantId and '' != tenantId">
  192. and `tenant_id` = #{tenantId}
  193. </if>
  194. <if test=" null != parentTenantId and '' != parentTenantId">
  195. and `parent_tenant_id` = #{parentTenantId}
  196. </if>
  197. </select>
  198. <select id="findListAadmin" parameterType="com.iformall.domain.po.WxMall" resultMap="BaseResultMap">
  199. select
  200. m.`id`,m.`tenant_id`,m.`parent_tenant_id`,m.`name`,m.`group`,m.`country`,m.`province`,m.`city`,m.`addr`,
  201. m.`service_phone`,m.`valid_start`, m.`valid_end`,
  202. mui.`id` admin_id,mui.`username` admin_username,mui.`name` admin_name,mui.`phone` admin_phone,mui.status admin_status
  203. from wx_mall m
  204. left join mall_user_info mui on m.tenant_id = mui.tenant_id and mui.is_admin = 1
  205. where 1=1
  206. <if test=" null != tenantId and '' != tenantId">
  207. and m.`tenant_id` = #{tenantId}
  208. </if>
  209. <if test=" null != parentTenantId and '' != parentTenantId">
  210. and m.`parent_tenant_id` = #{parentTenantId}
  211. </if>
  212. <if test=" null != name ">
  213. and m.`name` like concat('%', #{name},'%')
  214. </if>
  215. <if test=" null != startTime ">
  216. and m.`valid_start` &gt;= #{startTime}
  217. </if>
  218. <if test=" null != endTime">
  219. and m.`valid_start` &lt; #{endTime}
  220. </if>
  221. <if test=" null != adminName ">
  222. and mui.`name` like concat('%', #{adminName},'%')
  223. </if>
  224. <if test=" null != adminPhone">
  225. and mui.`phone` like concat('%', #{adminPhone},'%')
  226. </if>
  227. <if test=" null != adminUsername ">
  228. and mui.`username` like concat('%', #{adminUsername},'%')
  229. </if>
  230. <if test=" null != adminStatus ">
  231. and mui.`status` = #{adminStatus}
  232. </if>
  233. </select>
  234. </mapper>