| @@ -7,3 +7,7 @@ ADD COLUMN `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_u | |||
| ALTER TABLE `wx_mall` | |||
| ADD COLUMN `live_support` SMALLINT(1) DEFAULT '0' COMMENT '是否支持直播(0-不支持,1-支持)'; | |||
| ALTER TABLE `wx_user_visit` | |||
| ADD COLUMN `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID' AFTER `tenant_id`; | |||
| CREATE OR REPLACE ALGORITHM = UNDEFINED DEFINER = `root`@`%` SQL SECURITY DEFINER VIEW `mallink`.`view_touch_user` AS select date_format(`u`.`day_date`,'%Y-%m-%d') AS `xTime`,`u`.`tenant_id` AS `tenant_id`,`u`.`parent_tenant_id` AS `parent_tenant_id`,`u`.`visit_pv` AS `pv`,`u`.`visit_uv` AS `uv`,ifnull(`o`.`couponCount`,0) AS `couponCount`,ifnull(`o`.`userCount`,0) AS `userCount`,ifnull(`v`.`verifyCount`,0) AS `verifyCount`,ifnull(`v`.`verifyUserCount`,0) AS `verifyUserCount` from ((`mallink`.`wx_user_visit` `u` left join (select `mallink`.`wx_coupon_order`.`tenant_id` AS `tenant_id`,date_format(`mallink`.`wx_coupon_order`.`create_date`,'%Y-%m-%d') AS `xTime`,count(distinct `mallink`.`wx_coupon_order`.`c_user_id`) AS `userCount`,count(0) AS `couponCount` from `mallink`.`wx_coupon_order` group by `xTime`,`mallink`.`wx_coupon_order`.`tenant_id`) `o` on(((date_format(`u`.`day_date`,'%Y-%m-%d') = `o`.`xTime`) and (`o`.`tenant_id` = `u`.`tenant_id`)))) left join (select `mallink`.`wx_coupon_order`.`tenant_id` AS `tenant_id`,date_format(`mallink`.`wx_coupon_order`.`update_date`,'%Y-%m-%d') AS `xTime`,count(0) AS `verifyCount`,count(distinct `mallink`.`wx_coupon_order`.`c_user_id`) AS `verifyUserCount` from `mallink`.`wx_coupon_order` where (`mallink`.`wx_coupon_order`.`coupon_order_status` = 1) group by `xTime`,`mallink`.`wx_coupon_order`.`tenant_id`) `v` on(((date_format(`u`.`day_date`,'%Y-%m-%d') = `v`.`xTime`) and (`v`.`tenant_id` = `u`.`tenant_id`)))); | |||
| @@ -1,7 +1,7 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.BaseTenantEntity; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -10,7 +10,7 @@ import java.util.*; | |||
| @TableName(value = "wx_user_visit") | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxUserVisit extends BaseTenantEntity { | |||
| public class WxUserVisit extends TenantEntity { | |||
| protected Long id; | |||
| @@ -175,9 +175,12 @@ | |||
| <sql id="dynamicWhereConditionsVo"> | |||
| where 1 = 1 | |||
| <if test=" null != tenantId "> | |||
| <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 != boxId "> | |||
| and `box_id` = #{boxId} | |||
| @@ -27,9 +27,12 @@ | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| <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 != boxId "> | |||
| and `box_id` = #{boxId} | |||
| @@ -106,9 +109,12 @@ | |||
| <sql id="dynamicWhereConditionsVo"> | |||
| where 1 = 1 | |||
| <if test=" null != tenantId "> | |||
| <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 != boxId "> | |||
| and `box_id` = #{boxId} | |||
| @@ -232,9 +238,12 @@ | |||
| tenant_id | |||
| FROM kw_meter_data | |||
| where 1 = 1 | |||
| <if test=" null != tenantId "> | |||
| <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 != meterId "> | |||
| and `meter_id` = #{meterId} | |||
| </if> | |||
| @@ -152,8 +152,11 @@ | |||
| <include refid="allSafeColumns"/> | |||
| from mall_user_info | |||
| where 1=1 | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`=#{tenantId} | |||
| <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 != bopenId "> | |||
| and `bopen_id`=#{bopenId} | |||
| @@ -174,8 +177,11 @@ | |||
| update mall_user_info | |||
| set `web_open_id` = null | |||
| where 1=1 | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`=#{tenantId} | |||
| <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 != username "> | |||
| and username=#{username} | |||
| @@ -189,8 +195,11 @@ | |||
| update mall_user_info | |||
| set `web_open_id` = null, `bopen_id` = null | |||
| where 1=1 | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`=#{tenantId} | |||
| <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 != username "> | |||
| and username=#{username} | |||
| @@ -205,8 +214,11 @@ | |||
| <include refid="allColumns"/> | |||
| from mall_user_info | |||
| where 1=1 | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`=#{tenantId} | |||
| <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 != phone "> | |||
| and `phone`=#{phone} | |||
| @@ -83,9 +83,12 @@ | |||
| select a.id,a.cover_img,a.title,a.activity_start_time,a.activity_end_time,aj.`status` | |||
| from wx_activity_join aj left join wx_activity a on aj.activity_id=a.id | |||
| where aj.user_id=#{userId} | |||
| <if test=" null != tenantId "> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and aj.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and aj.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != statusStr and ''!=statusStr"> | |||
| and aj.`status` in (${statusStr}) and a.`status`=2 | |||
| </if> | |||
| @@ -28,7 +28,12 @@ | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1=1 | |||
| <if test=" null != id ">and `id` = #{id}</if> | |||
| <if test=" null != tenantId ">and `tenant_id` = #{tenantId}</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 != ids "> | |||
| and id in | |||
| @@ -66,13 +66,12 @@ | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`= #{tenantId} | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId "> | |||
| and `parent_tenant_id`= #{parentTenantId} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != openId "> | |||
| @@ -4,6 +4,7 @@ | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCUserFromB"> | |||
| <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="merchant_id" jdbcType="INTEGER" property="merchantId" /> | |||
| <result column="b_user_id" jdbcType="BIGINT" property="bUserId" /> | |||
| <result column="c_user_id" jdbcType="BIGINT" property="cUserId" /> | |||
| @@ -16,13 +17,18 @@ | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`merchant_id`,`b_user_id`,`c_user_id`,`info`,`create_time`,`update_time`,`openid`,`app_id` | |||
| `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`b_user_id`,`c_user_id`,`info`,`create_time`,`update_time`,`openid`,`app_id` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> and `id` = #{id} </if> | |||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | |||
| <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 != merchantId "> and `merchant_id` = #{merchantId} </if> | |||
| <if test=" null != bUserId "> and `b_user_id` = #{bUserId} </if> | |||
| <if test=" null != cUserId "> and `c_user_id` = #{cUserId} </if> | |||
| @@ -124,18 +124,24 @@ | |||
| update wx_coupon_channel | |||
| set status=#{status}, update_date=#{updateDate} | |||
| where coupon_id=#{couponId} | |||
| <if test=" null != tenantId "> | |||
| and tenant_id = #{tenantId} | |||
| </if> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| </update> | |||
| <update id="updateEndTimeByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel"> | |||
| update wx_coupon_channel | |||
| set end_time = #{endTime} | |||
| where coupon_id=#{couponId} | |||
| <if test=" null != tenantId "> | |||
| and tenant_id = #{tenantId} | |||
| </if> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| </update> | |||
| <sql id="CouponChannelVoColumns"> | |||
| @@ -214,8 +220,11 @@ | |||
| <if test="status != null"> | |||
| and cc.status=#{status} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and cc.tenant_id = #{tenantId} | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and cc.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and cc.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </select> | |||
| @@ -226,12 +226,18 @@ | |||
| <select id="touchUsersReportList" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="com.iformall.domain.dto.MarkingCouponDataReportDto"> | |||
| SELECT xTime, tenant_id, pv, uv, couponCount, userCount, verifyCount, verifyUserCount | |||
| FROM view_touch_user | |||
| WHERE view_touch_user.tenant_id=#{tenantId} | |||
| 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> | |||
| <if test="startTime != null"> | |||
| and view_touch_user.xTime >= DATE_FORMAT(#{startTime},'%Y-%m-%d') | |||
| and xTime >= DATE_FORMAT(#{startTime},'%Y-%m-%d') | |||
| </if> | |||
| <if test="endTime != null"> | |||
| and view_touch_user.xTime <= DATE_FORMAT(#{endTime},'%Y-%m-%d') | |||
| and xTime <= DATE_FORMAT(#{endTime},'%Y-%m-%d') | |||
| </if> | |||
| GROUP BY xTime | |||
| order by xTime desc | |||
| @@ -852,8 +858,11 @@ | |||
| left join wx_shop s on ms.shop_id=s.id | |||
| left join wx_coupon_merchant cm on ms.merchant_id=cm.merchant_id | |||
| where ms.is_del=0 and s.building=#{building} | |||
| <if test=" null != tenantId "> | |||
| and ms.tenant_id=#{tenantId} | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and ms.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and ms.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test="null!=floor"> | |||
| and s.floor=#{floor} | |||
| @@ -145,8 +145,11 @@ | |||
| <update id="updateStatusByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel"> | |||
| update wx_coupon_send set status=#{status} | |||
| where coupon_id=#{couponId} | |||
| <if test=" null != tenantId "> | |||
| and tenant_id = #{tenantId} | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| </update> | |||
| @@ -198,9 +198,12 @@ | |||
| select count(0) | |||
| from wx_credit_history | |||
| where 1=1 | |||
| <if test=" null != tenantId "> | |||
| <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 != cUserId "> | |||
| and `c_user_id` = #{cUserId} | |||
| </if> | |||
| @@ -26,13 +26,6 @@ | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </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},'%') | |||
| @@ -85,9 +85,11 @@ | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| <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 != gameId "> | |||
| @@ -295,9 +295,12 @@ | |||
| FROM wx_merchant m | |||
| left join wx_business bu on bu.id = m.business_id | |||
| <where> | |||
| <if test=" null != tenantId "> | |||
| <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 != status "> | |||
| and m.`status` = #{status} | |||
| </if> | |||
| @@ -250,9 +250,12 @@ | |||
| ms.create_date create_date,ms.subsidy subsidy,ms.real_subsidy,ms.status,ms.freeze | |||
| from wx_merchant_subsidy ms left join wx_merchant m on ms.merchant_id=m.id | |||
| where 1=1 | |||
| <if test=" null != tenantId "> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and ms.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and ms.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != orderId "> | |||
| and ms.`order_id` = #{orderId} | |||
| </if> | |||
| @@ -30,12 +30,14 @@ | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| </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 != batchNo "> | |||
| and `batch_no` like concat('%', #{batchNo},'%') | |||
| @@ -23,8 +23,11 @@ | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`=#{tenantId} | |||
| <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 != type "> | |||
| @@ -63,7 +66,14 @@ | |||
| </select> | |||
| <update id="updateLimitNum" parameterType="com.iformall.domain.po.WxMsgLimit"> | |||
| update wx_msg_limit set limit_num = limit_num - 1 where `id` = #{id} and `tenant_id` = #{tenantId} and limit_num > 0 | |||
| update wx_msg_limit set limit_num = limit_num - 1 where `id` = #{id} | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| and limit_num > 0 | |||
| </update> | |||
| <delete id="delLimitNum" parameterType="com.iformall.domain.po.WxMsgLimit"> | |||
| @@ -82,8 +82,11 @@ | |||
| <if test=" null != modelId"> | |||
| and `model_id` = #{modelId} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`=#{tenantId} | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| limit 1 | |||
| </select> | |||
| @@ -237,9 +237,12 @@ | |||
| update wx_order set order_status=#{orderStatus} | |||
| where product_id=#{productId} | |||
| and press_end_date is not null and order_status in (6,7) | |||
| <if test=" null != tenantId "> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| </update> | |||
| <update id="updateOrderGroupStatusByCouponId" parameterType="com.iformall.domain.po.WxOrder"> | |||
| @@ -502,9 +505,12 @@ | |||
| LEFT JOIN wx_c_user cu on cu.id = o.c_user_id | |||
| LEFT JOIN wx_c_user_basic_info cubi on cubi.id = o.c_user_id | |||
| where o.order_status = '0' and o.`type` = 1 | |||
| <if test=" null != tenantId "> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and o.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and o.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != merchantId "> | |||
| and bu.`merchant_id` = #{merchantId} | |||
| </if> | |||
| @@ -20,9 +20,12 @@ | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </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 != orderId "> | |||
| and `order_id` = #{orderId} | |||
| </if> | |||
| @@ -173,7 +173,12 @@ | |||
| <include refid="allColumns"/> | |||
| from wx_pay_order | |||
| where 1=1 | |||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| and order_id in ( | |||
| select id from wx_order where `tenant_id` = #{tenantId} and type = 1 and order_status = 0 | |||
| ); | |||
| @@ -130,7 +130,13 @@ | |||
| left join wx_mall_building b on s.building=b.id | |||
| left join wx_brand br on rc.brand=br.id | |||
| <where> | |||
| <if test=" null != tenantId ">rc.tenant_id=#{tenantId}</if> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and rc.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and rc.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != merchantName and merchantName!=''">and rc.`merchant_name` like | |||
| concat('%',#{merchantName},'%') | |||
| @@ -565,6 +565,12 @@ | |||
| <select id="getCountByWxShop" parameterType="com.iformall.domain.po.WxShop" resultType="Long"> | |||
| select count(*) from wx_shop w where w.is_del=0 | |||
| <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 != type"> | |||
| and `type`=#{type} | |||
| </if> | |||
| @@ -4,6 +4,7 @@ | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxUserVisit"> | |||
| <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="ref_date" jdbcType="VARCHAR" property="refDate" /> | |||
| <result column="day_date" jdbcType="TIMESTAMP" property="dayDate" /> | |||
| <result column="session_cnt" jdbcType="INTEGER" property="sessionCnt" /> | |||
| @@ -18,7 +19,7 @@ | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`ref_date`,`day_date`,`session_cnt`,`visit_pv`,`visit_uv`,`visit_uv_new`,`stay_time_uv`,`stay_time_session`,`visit_depth`,`app_id`,`create_date` | |||
| `id`,`tenant_id`,`parent_tenant_id`,`ref_date`,`day_date`,`session_cnt`,`visit_pv`,`visit_uv`,`visit_uv_new`,`stay_time_uv`,`stay_time_session`,`visit_depth`,`app_id`,`create_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -28,9 +29,11 @@ | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` =#{tenantId} | |||
| <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 != refDate "> | |||
| @@ -107,7 +110,13 @@ | |||
| parameterType="com.iformall.domain.dto.MarkingCouponDataReportDto"> | |||
| SELECT DATE_FORMAT(day_date,'%Y-%m-%d') as xTime,visit_pv as pv,visit_uv as uv | |||
| from wx_user_visit | |||
| where tenant_id=#{tenantId} | |||
| 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> | |||
| <if test="startTime != null"> | |||
| and day_date >= #{startTime} | |||
| </if> | |||
| @@ -122,7 +131,13 @@ | |||
| <select id="touchUsersReportData" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="hashmap"> | |||
| SELECT DATE_FORMAT(day_date,'%m/%d') as xTime,visit_pv as pv,visit_uv as uv | |||
| from wx_user_visit | |||
| where tenant_id=#{tenantId} | |||
| 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> | |||
| <if test="startTime != null"> | |||
| and day_date >= #{startTime} | |||
| </if> | |||
| @@ -133,7 +148,13 @@ | |||
| </select> | |||
| <select id="queryVisitUv" resultType="Long" parameterType="hashmap"> | |||
| select count(visit_uv) from wx_user_visit where tenant_id=#{tenantId} | |||
| select count(visit_uv) from wx_user_visit 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> | |||
| <if test="startTime != null"> | |||
| and day_date >= #{startTime} | |||
| </if> | |||