|
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.iformall.mapper.WxMallMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMall">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
- <result column="name" jdbcType="VARCHAR" property="name"/>
- <result column="group" jdbcType="VARCHAR" property="group"/>
- <result column="country" jdbcType="VARCHAR" property="country"/>
- <result column="province" jdbcType="VARCHAR" property="province"/>
- <result column="city" jdbcType="VARCHAR" property="city"/>
- <result column="addr" jdbcType="VARCHAR" property="addr"/>
- <result column="total_area" jdbcType="DECIMAL" property="totalArea"/>
- <result column="operating_area" jdbcType="DECIMAL" property="operatingArea"/>
- <result column="park_area" jdbcType="DECIMAL" property="parkArea"/>
- <result column="park_place_number" jdbcType="INTEGER" property="parkPlaceNumber"/>
- <result column="service_phone" jdbcType="VARCHAR" property="servicePhone"/>
- <result column="img_url" jdbcType="VARCHAR" property="imgUrl"/>
- <result column="img_url_h" jdbcType="VARCHAR" property="imgUrlH"/>
- <result column="weap_note" jdbcType="VARCHAR" property="weapNote"/>
- <result column="img_qrcode_weapp" jdbcType="VARCHAR" property="imgQrcodeWeapp"/>
- <result column="img_qrcode_wemp" jdbcType="VARCHAR" property="imgQrcodeWemp"/>
- <result column="weapp_share_title" jdbcType="VARCHAR" property="weappShareTitle"/>
- <result column="weapp_share_cover_img" jdbcType="VARCHAR" property="weappShareCoverImg"/>
- <result column="pos_qrcode_rule" jdbcType="VARCHAR" property="posQrcodeRule"/>
- <result column="sale_type" jdbcType="TINYINT" property="saleType"/>
- <result column="valid_start" jdbcType="TIMESTAMP" property="validStart"/>
- <result column="valid_end" jdbcType="TIMESTAMP" property="validEnd"/>
-
- <result column="business_hours" jdbcType="VARCHAR" property="businessHours"/>
- <result column="introduction" jdbcType="VARCHAR" property="introduction"/>
- <result column="img" jdbcType="VARCHAR" property="img"/>
-
- <result column="group_support" jdbcType="INTEGER" property="groupSupport"/>
- <result column="latitude" jdbcType="DECIMAL" property="latitude"/>
- <result column="longitude" jdbcType="DECIMAL" property="longitude"/>
- <result column="live_support" jdbcType="INTEGER" property="liveSupport"/>
-
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`name`,`group`,`country`,`province`,`city`,`addr`,
- `total_area`,`operating_area`,`park_area`,`park_place_number`,`service_phone`,
- `img_url`,`img_url_h`, `weap_note`, `img_qrcode_weapp`, `img_qrcode_wemp`,
- `weapp_share_title`,`weapp_share_cover_img`, `pos_qrcode_rule`,
- `sale_type`, `valid_start`, `valid_end`,`business_hours`,`introduction`,`img`,
- `group_support`,`latitude`,`longitude`,`live_support`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where id > 1
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
-
- <if test=" null != name ">
- and `name` like concat('%', #{name},'%')
- </if>
-
- <if test=" null != group ">
- and `group` like concat('%', #{group},'%')
- </if>
-
- <if test=" null != country ">
- and `country` like concat('%', #{country},'%')
- </if>
-
- <if test=" null != province ">
- and `province` like concat('%', #{province},'%')
- </if>
-
- <if test=" null != city ">
- and `city` like concat('%', #{city},'%')
- </if>
-
- <if test=" null != addr ">
- and `addr` like concat('%', #{addr},'%')
- </if>
-
- <if test=" null != totalArea ">
- and `total_area` = #{totalArea}
- </if>
-
- <if test=" null != operatingArea ">
- and `operating_area` = #{operatingArea}
- </if>
-
- <if test=" null != parkArea ">
- and `park_area` = #{parkArea}
- </if>
-
- <if test=" null != parkPlaceNumber ">
- and `park_place_number` = #{parkPlaceNumber}
- </if>
- <if test=" null != servicePhone ">
- and `service_phone` = #{servicePhone}
- </if>
- <if test=" null != imgUrl ">
- and `img_url` = #{imgUrl}
- </if>
- <if test=" null != imgUrlH ">
- and `img_ur_h` = #{imgUrlH}
- </if>
-
- <if test=" null != imgQrcodeWeapp ">
- and `img_qrcode_weapp` = #{imgQrcodeWeapp}
- </if>
- <if test=" null != imgQrcodeWemp ">
- and `img_qrcode_wemp` = #{imgQrcodeWemp}
- </if>
-
- <if test=" null != saleType ">
- and `sale_type` = #{saleType}
- </if>
-
- <if test=" null != validStart ">
- and `valid_start` = #{validStart}
- </if>
-
- <if test=" null != validEnd ">
- and `valid_end` = #{validEnd}
- </if>
-
- <if test=" null != groupSupport ">
- and `group_support` = #{groupSupport}
- </if>
-
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns">order by ${sortColumns}</if>
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxMall" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_mall
- <include refid="dynamicWhereConditions"/>
- </select>
-
-
- <select id="listAsSelectMall" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_mall
- where id > 1
- and `sale_type` != 100 and `group_support` != 1 and `tenant_id` != #{id}
- and (`parent_tenant_id` is null or `parent_tenant_id` = #{id} or trim(parent_tenant_id) = '')
- </select>
-
- <select id="getByTenantId" parameterType="string" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_mall
- where 1=1 and `tenant_id` = #{value}
- </select>
- <select id="getByTenantInfo" parameterType="com.iformall.domain.po.WxMall" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_mall
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="queryMenusByTenantId" parameterType="string" resultType="string">
- select st.menus
- from mall_sale_type st, wx_mall m
- where st.type = m.sale_type and m.`tenant_id` = #{value}
- </select>
-
- <select id="queryMenusByTenantInfo" parameterType="com.iformall.domain.po.WxMall" resultType="string">
- select st.menus
- from mall_sale_type st, wx_mall m
- where st.type = m.sale_type
- <if test=" null != tenantId and '' != tenantId">
- and m.`tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and m.`parent_tenant_id` = #{parentTenantId}
- </if>
- </select>
-
- <update id="undateSubmall">
- update wx_mall set parent_tenant_id = null where parent_tenant_id = #{parentTenantId} ;
- update wx_mall set parent_tenant_id = #{parentTenantId} where tenant_id in
- <foreach collection="tenantIds" item="item" index="index" open="("
- separator="," close=")">
- #{item}
- </foreach>
- </update>
-
-
-
- </mapper>
|