選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 

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