后台服务
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

WxMallMapper.xml 11 KiB

2 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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 != tenantIdList ">
  124. and tenant_id in
  125. <foreach collection="tenantIdList" index="index" item="tIdItem" open="(" separator="," close=")">
  126. #{tIdItem}
  127. </foreach>
  128. </if>
  129. <if test=" null != parentTenantIdList ">
  130. and parent_tenant_id in
  131. <foreach collection="parentTenantIdList" index="index" item="ptIdItem" open="(" separator="," close=")">
  132. #{ptIdItem}
  133. </foreach>
  134. </if>
  135. <if test=" null != ids ">
  136. and id in
  137. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  138. #{idItem}
  139. </foreach>
  140. </if>
  141. <if test=" null != sortColumns">order by ${sortColumns}</if>
  142. </sql>
  143. <select id="findList" parameterType="com.iformall.domain.po.WxMall" resultMap="BaseResultMap">
  144. select
  145. <include refid="allColumns"/>
  146. from wx_mall
  147. <include refid="dynamicWhereConditions"/>
  148. </select>
  149. <select id="listAsSelectMall" resultMap="BaseResultMap">
  150. select
  151. <include refid="allColumns"/>
  152. from wx_mall
  153. where id &gt; 1
  154. and `sale_type` != 100 and `group_support` != 1 and `tenant_id` != #{id}
  155. and (`parent_tenant_id` is null or `parent_tenant_id` = #{id} or trim(parent_tenant_id) = '')
  156. </select>
  157. <select id="getByTenantId" parameterType="string" resultMap="BaseResultMap">
  158. select
  159. <include refid="allColumns"/>
  160. from wx_mall
  161. where `tenant_id` = #{value}
  162. </select>
  163. <select id="getByTenantInfo" parameterType="com.iformall.domain.po.base.TenantEntity" resultMap="BaseResultMap">
  164. select
  165. <include refid="allColumns"/>
  166. from wx_mall
  167. where 1=1
  168. <if test=" null != tenantId and '' != tenantId">
  169. and `tenant_id` = #{tenantId}
  170. </if>
  171. <if test=" null != parentTenantId and '' != parentTenantId">
  172. and `parent_tenant_id` = #{parentTenantId}
  173. </if>
  174. </select>
  175. <select id="queryMenusByTenantId" parameterType="string" resultType="string">
  176. select st.menus
  177. from mall_sale_type st, wx_mall m
  178. where st.type = m.sale_type and m.`tenant_id` = #{value}
  179. </select>
  180. <select id="queryMenusByTenantInfo" parameterType="com.iformall.domain.po.WxMall" resultType="string">
  181. select st.menus
  182. from mall_sale_type st, wx_mall m
  183. where st.type = m.sale_type
  184. <if test=" null != tenantId and '' != tenantId">
  185. and m.`tenant_id` = #{tenantId}
  186. </if>
  187. <if test=" null != parentTenantId and '' != parentTenantId">
  188. and m.`parent_tenant_id` = #{parentTenantId}
  189. </if>
  190. </select>
  191. <update id="updateUnSubMall">
  192. update wx_mall set parent_tenant_id = null where parent_tenant_id = #{parentTenantId}
  193. </update>
  194. <update id="undateSubmall">
  195. <if test="tenantIds != null and tenantIds.size > 0">
  196. update wx_mall set parent_tenant_id = #{parentTenantId} where tenant_id in
  197. <foreach collection="tenantIds" item="item" index="index" open="("
  198. separator="," close=")">
  199. #{item}
  200. </foreach>
  201. </if>
  202. </update>
  203. <select id="getTenantEntitys" parameterType="com.iformall.domain.po.base.TenantEntity" resultType="com.iformall.domain.po.base.TenantEntity">
  204. select `tenant_id`,`parent_tenant_id` from wx_mall where `parent_tenant_id` = #{tenantId}
  205. </select>
  206. <select id="findListAadmin" parameterType="com.iformall.domain.po.WxMall" resultMap="BaseResultMap">
  207. select
  208. m.`id`,m.`tenant_id`,m.`parent_tenant_id`,m.`name`,m.`group`,m.`country`,m.`province`,m.`city`,m.`addr`,
  209. m.`service_phone`,m.`valid_start`, m.`valid_end`,
  210. mui.`id` admin_id,mui.`username` admin_username,mui.`name` admin_name,mui.`phone` admin_phone,mui.status admin_status
  211. from wx_mall m
  212. left join mall_user_info mui on m.tenant_id = mui.tenant_id and mui.is_admin = 1
  213. where 1=1
  214. <if test=" null != tenantId and '' != tenantId">
  215. and m.`tenant_id` = #{tenantId}
  216. </if>
  217. <if test=" null != parentTenantId and '' != parentTenantId">
  218. and m.`parent_tenant_id` = #{parentTenantId}
  219. </if>
  220. <if test=" null != name ">
  221. and m.`name` like concat('%', #{name},'%')
  222. </if>
  223. <if test=" null != startTime ">
  224. and m.`valid_start` &gt;= #{startTime}
  225. </if>
  226. <if test=" null != endTime">
  227. and m.`valid_start` &lt; #{endTime}
  228. </if>
  229. <if test=" null != adminName ">
  230. and mui.`name` like concat('%', #{adminName},'%')
  231. </if>
  232. <if test=" null != adminPhone">
  233. and mui.`phone` like concat('%', #{adminPhone},'%')
  234. </if>
  235. <if test=" null != adminUsername ">
  236. and mui.`username` like concat('%', #{adminUsername},'%')
  237. </if>
  238. <if test=" null != adminStatus ">
  239. and mui.`status` = #{adminStatus}
  240. </if>
  241. </select>
  242. </mapper>