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