No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 

206 líneas
8.0 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. </resultMap>
  38. <sql id="allColumns">
  39. `id`,`tenant_id`,`parent_tenant_id`,`name`,`group`,`country`,`province`,`city`,`addr`,
  40. `total_area`,`operating_area`,`park_area`,`park_place_number`,`service_phone`,
  41. `img_url`,`img_url_h`, `weap_note`, `img_qrcode_weapp`, `img_qrcode_wemp`,
  42. `weapp_share_title`,`weapp_share_cover_img`, `pos_qrcode_rule`,
  43. `sale_type`, `valid_start`, `valid_end`,`business_hours`,`introduction`,`img`,
  44. `group_support`,`latitude`,`longitude`,`live_support`
  45. </sql>
  46. <sql id="dynamicWhereConditions">
  47. where id &gt; 1
  48. <if test=" null != id ">
  49. and `id` = #{id}
  50. </if>
  51. <if test=" null != tenantId and '' != tenantId">
  52. and `tenant_id` = #{tenantId}
  53. </if>
  54. <if test=" null != parentTenantId and '' != parentTenantId">
  55. and `parent_tenant_id` = #{parentTenantId}
  56. </if>
  57. <if test=" null != name ">
  58. and `name` like concat('%', #{name},'%')
  59. </if>
  60. <if test=" null != group ">
  61. and `group` like concat('%', #{group},'%')
  62. </if>
  63. <if test=" null != country ">
  64. and `country` like concat('%', #{country},'%')
  65. </if>
  66. <if test=" null != province ">
  67. and `province` like concat('%', #{province},'%')
  68. </if>
  69. <if test=" null != city ">
  70. and `city` like concat('%', #{city},'%')
  71. </if>
  72. <if test=" null != addr ">
  73. and `addr` like concat('%', #{addr},'%')
  74. </if>
  75. <if test=" null != totalArea ">
  76. and `total_area` = #{totalArea}
  77. </if>
  78. <if test=" null != operatingArea ">
  79. and `operating_area` = #{operatingArea}
  80. </if>
  81. <if test=" null != parkArea ">
  82. and `park_area` = #{parkArea}
  83. </if>
  84. <if test=" null != parkPlaceNumber ">
  85. and `park_place_number` = #{parkPlaceNumber}
  86. </if>
  87. <if test=" null != servicePhone ">
  88. and `service_phone` = #{servicePhone}
  89. </if>
  90. <if test=" null != imgUrl ">
  91. and `img_url` = #{imgUrl}
  92. </if>
  93. <if test=" null != imgUrlH ">
  94. and `img_ur_h` = #{imgUrlH}
  95. </if>
  96. <if test=" null != imgQrcodeWeapp ">
  97. and `img_qrcode_weapp` = #{imgQrcodeWeapp}
  98. </if>
  99. <if test=" null != imgQrcodeWemp ">
  100. and `img_qrcode_wemp` = #{imgQrcodeWemp}
  101. </if>
  102. <if test=" null != saleType ">
  103. and `sale_type` = #{saleType}
  104. </if>
  105. <if test=" null != validStart ">
  106. and `valid_start` = #{validStart}
  107. </if>
  108. <if test=" null != validEnd ">
  109. and `valid_end` = #{validEnd}
  110. </if>
  111. <if test=" null != groupSupport ">
  112. and `group_support` = #{groupSupport}
  113. </if>
  114. <if test=" null != ids ">
  115. and id in
  116. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  117. #{idItem}
  118. </foreach>
  119. </if>
  120. <if test=" null != sortColumns">order by ${sortColumns}</if>
  121. </sql>
  122. <select id="findList" parameterType="com.iformall.domain.po.WxMall" resultMap="BaseResultMap">
  123. select
  124. <include refid="allColumns"/>
  125. from wx_mall
  126. <include refid="dynamicWhereConditions"/>
  127. </select>
  128. <select id="listAsSelectMall" resultMap="BaseResultMap">
  129. select
  130. <include refid="allColumns"/>
  131. from wx_mall
  132. where id &gt; 1
  133. and `sale_type` != 100 and `group_support` != 1 and `tenant_id` != #{id}
  134. and (`parent_tenant_id` is null or `parent_tenant_id` = #{id} or trim(parent_tenant_id) = '')
  135. </select>
  136. <select id="getByTenantId" parameterType="string" resultMap="BaseResultMap">
  137. select
  138. <include refid="allColumns"/>
  139. from wx_mall
  140. where 1=1 and `tenant_id` = #{value}
  141. </select>
  142. <select id="getByTenantInfo" parameterType="com.iformall.domain.po.WxMall" resultMap="BaseResultMap">
  143. select
  144. <include refid="allColumns"/>
  145. from wx_mall
  146. <include refid="dynamicWhereConditions"/>
  147. </select>
  148. <select id="queryMenusByTenantId" parameterType="string" resultType="string">
  149. select st.menus
  150. from mall_sale_type st, wx_mall m
  151. where st.type = m.sale_type and m.`tenant_id` = #{value}
  152. </select>
  153. <select id="queryMenusByTenantInfo" parameterType="com.iformall.domain.po.WxMall" resultType="string">
  154. select st.menus
  155. from mall_sale_type st, wx_mall m
  156. where st.type = m.sale_type
  157. <if test=" null != tenantId and '' != tenantId">
  158. and m.`tenant_id` = #{tenantId}
  159. </if>
  160. <if test=" null != parentTenantId and '' != parentTenantId">
  161. and m.`parent_tenant_id` = #{parentTenantId}
  162. </if>
  163. </select>
  164. <update id="undateSubmall">
  165. update wx_mall set parent_tenant_id = null where parent_tenant_id = #{parentTenantId} ;
  166. update wx_mall set parent_tenant_id = #{parentTenantId} where tenant_id in
  167. <foreach collection="tenantIds" item="item" index="index" open="("
  168. separator="," close=")">
  169. #{item}
  170. </foreach>
  171. </update>
  172. </mapper>