|
- <?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"/>
- <result column="cash_out_support" jdbcType="INTEGER" property="cashOutSupport"/>
- <result column="cash_out_limit" jdbcType="INTEGER" property="cashOutLimit"/>
- <result column="alipay_app_auth_token" jdbcType="VARCHAR" property="alipayAppAuthToken"/>
- <result column="alipay_member_template_id" jdbcType="VARCHAR" property="alipayMemberTemplateId"/>
-
-
- <result column="admin_id" jdbcType="BIGINT" property="adminId"/>
- <result column="admin_name" jdbcType="VARCHAR" property="adminName"/>
- <result column="admin_phone" jdbcType="VARCHAR" property="adminPhone"/>
- <result column="admin_username" jdbcType="VARCHAR" property="adminUsername"/>
- <result column="admin_status" jdbcType="INTEGER" property="adminStatus"/>
-
- </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`,`cash_out_support`,`cash_out_limit`,`alipay_app_auth_token`,`alipay_member_template_id`
- </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 != tenantIdList ">
- and tenant_id in
- <foreach collection="tenantIdList" index="index" item="tIdItem" open="(" separator="," close=")">
- #{tIdItem}
- </foreach>
- </if>
-
- <if test=" null != parentTenantIdList ">
- and parent_tenant_id in
- <foreach collection="parentTenantIdList" index="index" item="ptIdItem" open="(" separator="," close=")">
- #{ptIdItem}
- </foreach>
- </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 `tenant_id` = #{value}
- </select>
- <select id="getByTenantInfo" parameterType="com.iformall.domain.po.base.TenantEntity" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_mall
- where 1=1
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
- </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="updateUnSubMall">
- update wx_mall set parent_tenant_id = null where parent_tenant_id = #{parentTenantId}
- </update>
-
- <update id="undateSubmall">
- <if test="tenantIds != null and tenantIds.size > 0">
- update wx_mall set parent_tenant_id = #{parentTenantId} where tenant_id in
- <foreach collection="tenantIds" item="item" index="index" open="("
- separator="," close=")">
- #{item}
- </foreach>
- </if>
- </update>
-
-
- <select id="getTenantEntitys" parameterType="com.iformall.domain.po.base.TenantEntity" resultType="com.iformall.domain.po.base.TenantEntity">
- select `tenant_id`,`parent_tenant_id` from wx_mall where `parent_tenant_id` = #{tenantId}
- </select>
-
- <select id="findListAadmin" parameterType="com.iformall.domain.po.WxMall" resultMap="BaseResultMap">
- select
- m.`id`,m.`tenant_id`,m.`parent_tenant_id`,m.`name`,m.`group`,m.`country`,m.`province`,m.`city`,m.`addr`,
- m.`service_phone`,m.`valid_start`, m.`valid_end`,
- mui.`id` admin_id,mui.`username` admin_username,mui.`name` admin_name,mui.`phone` admin_phone,mui.status admin_status
- from wx_mall m
- left join mall_user_info mui on m.tenant_id = mui.tenant_id and mui.is_admin = 1
- where 1=1
- <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>
- <if test=" null != name ">
- and m.`name` like concat('%', #{name},'%')
- </if>
-
- <if test=" null != startTime ">
- and m.`valid_start` >= #{startTime}
- </if>
- <if test=" null != endTime">
- and m.`valid_start` < #{endTime}
- </if>
-
- <if test=" null != adminName ">
- and mui.`name` like concat('%', #{adminName},'%')
- </if>
- <if test=" null != adminPhone">
- and mui.`phone` like concat('%', #{adminPhone},'%')
- </if>
- <if test=" null != adminUsername ">
- and mui.`username` like concat('%', #{adminUsername},'%')
- </if>
-
- <if test=" null != adminStatus ">
- and mui.`status` = #{adminStatus}
- </if>
-
- </select>
-
- </mapper>
|