25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 

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