| @@ -343,8 +343,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| public PageInfo<MarkingSceneDataVo> getSceneDataList(TenantEntity tenantEntity, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | public PageInfo<MarkingSceneDataVo> getSceneDataList(TenantEntity tenantEntity, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | ||||
| List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | ||||
| MarkingCouponDataReportDto queryDto = new MarkingCouponDataReportDto(); | MarkingCouponDataReportDto queryDto = new MarkingCouponDataReportDto(); | ||||
| queryDto.setTenantEntitys(tenantEntitys); | |||||
| org.springframework.beans.BeanUtils.copyProperties(markingCouponDataReportDto, queryDto); | org.springframework.beans.BeanUtils.copyProperties(markingCouponDataReportDto, queryDto); | ||||
| queryDto.setTenantEntitys(tenantEntitys); | |||||
| queryDto.updateTenantInfo(tenantEntity); | queryDto.updateTenantInfo(tenantEntity); | ||||
| HashMap<String, Object> params = new HashMap<>(); | HashMap<String, Object> params = new HashMap<>(); | ||||
| @@ -391,6 +391,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| Map<String, Integer> countMap = new HashMap<>(); | Map<String, Integer> countMap = new HashMap<>(); | ||||
| params.clear(); | params.clear(); | ||||
| params.put("tenantEntitys",tenantEntitys); | |||||
| params.put("tenantId", tenantEntity.getTenantId()); | params.put("tenantId", tenantEntity.getTenantId()); | ||||
| if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | ||||
| params.put("parentTenantId", tenantEntity.getParentTenantId()); | params.put("parentTenantId", tenantEntity.getParentTenantId()); | ||||
| @@ -445,6 +446,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| Map<String, Integer> triggerCountMap = new HashMap<>(); | Map<String, Integer> triggerCountMap = new HashMap<>(); | ||||
| params.clear(); | params.clear(); | ||||
| params.put("tenantEntitys",tenantEntitys); | |||||
| params.put("tenantId", tenantEntity.getTenantId()); | params.put("tenantId", tenantEntity.getTenantId()); | ||||
| if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | ||||
| params.put("parentTenantId", tenantEntity.getParentTenantId()); | params.put("parentTenantId", tenantEntity.getParentTenantId()); | ||||
| @@ -91,7 +91,7 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||||
| @Override | @Override | ||||
| public long countUser(TenantEntity tenantEntity, Long tagId, Date startTime, Date endTime ) { | public long countUser(TenantEntity tenantEntity, Long tagId, Date startTime, Date endTime ) { | ||||
| String str = JSON.toJSONString(tagId); | String str = JSON.toJSONString(tagId); | ||||
| return wxCUserTagsMapper.countUser(str, tenantEntity.getTenantId(),tenantEntity.getFinalTenantId(), startTime, endTime); | |||||
| return wxCUserTagsMapper.countUser(str, tenantEntity.getFinalTenantId(),tenantEntity.getFinalTenantId(), startTime, endTime); | |||||
| } | } | ||||
| @@ -2254,7 +2254,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| for (int i = 0; i < tags.length; i++) { | for (int i = 0; i < tags.length; i++) { | ||||
| WxTags tag = new WxTags(); | WxTags tag = new WxTags(); | ||||
| tag.setName(tags[i].getMessage()); | tag.setName(tags[i].getMessage()); | ||||
| tag.setCount(wxCUserTagsMapper.countUser(JSON.toJSONString(tags[i].getCode()), tenantEntity.getTenantId(),tenantEntity.getFinalTenantId(), startTime, endTime)); | |||||
| tag.setCount(wxCUserTagsMapper.countUser(JSON.toJSONString(tags[i].getCode()), tenantEntity.getFinalTenantId(),tenantEntity.getFinalTenantId(), startTime, endTime)); | |||||
| tagList.add(tag); | tagList.add(tag); | ||||
| total -= tag.getCount(); | total -= tag.getCount(); | ||||
| } | } | ||||
| @@ -2289,7 +2289,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| for (int i = 0; i < tags.length; i++) { | for (int i = 0; i < tags.length; i++) { | ||||
| WxTags tag = new WxTags(); | WxTags tag = new WxTags(); | ||||
| tag.setName(tags[i].getMessage()); | tag.setName(tags[i].getMessage()); | ||||
| tag.setCount(wxCUserTagsMapper.countUser(JSON.toJSONString(tags[i].getCode()), tenantEntity.getTenantId(),tenantEntity.getFinalTenantId(), startTime, endTime)); | |||||
| tag.setCount(wxCUserTagsMapper.countUser(JSON.toJSONString(tags[i].getCode()), tenantEntity.getFinalTenantId(),tenantEntity.getFinalTenantId(), startTime, endTime)); | |||||
| tagList.add(tag); | tagList.add(tag); | ||||
| total -= tag.getCount(); | total -= tag.getCount(); | ||||
| } | } | ||||
| @@ -139,7 +139,9 @@ | |||||
| <select id="queryForSceneRepotyHistoryCar" resultType="com.iformall.domain.vo.MarkingSceneDataVo" parameterType="hashmap"> | <select id="queryForSceneRepotyHistoryCar" resultType="com.iformall.domain.vo.MarkingSceneDataVo" parameterType="hashmap"> | ||||
| select DATE_FORMAT(ccl.create_date,'%Y-%m-%d') xTime, count(ccl.id) triggerCount | select DATE_FORMAT(ccl.create_date,'%Y-%m-%d') xTime, count(ccl.id) triggerCount | ||||
| from wx_c_user_car cuc, wx_car_cmd_log ccl | |||||
| from wx_c_user_car cuc, (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_car_cmd_log${tenantEntity.shardTableSuffix} | |||||
| </foreach>) ccl | |||||
| where ccl.plateNumber = cuc.car_number and cmd_type=#{cmdType} | where ccl.plateNumber = cuc.car_number and cmd_type=#{cmdType} | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and cuc.`tenant_id` = #{tenantId} | and cuc.`tenant_id` = #{tenantId} | ||||
| @@ -232,8 +232,12 @@ | |||||
| parameterType="hashmap"> | parameterType="hashmap"> | ||||
| select DATE_FORMAT(cal.create_time,'%Y-%m-%d') AS xTime, | select DATE_FORMAT(cal.create_time,'%Y-%m-%d') AS xTime, | ||||
| COUNT(co.id) as tempCount | COUNT(co.id) as tempCount | ||||
| from wx_coupon_action_log cal | |||||
| left join wx_coupon_order co on cal.coupon_order_id=co.id | |||||
| from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_coupon_action_log${tenantEntity.shardTableSuffix} | |||||
| </foreach>) cal | |||||
| left join (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_coupon_order${tenantEntity.shardTableSuffix} | |||||
| </foreach>) co on cal.coupon_order_id=co.id | |||||
| where co.coupon_order_status = 1 | where co.coupon_order_status = 1 | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and cal.`tenant_id` = #{tenantId} | and cal.`tenant_id` = #{tenantId} | ||||
| @@ -891,7 +891,7 @@ | |||||
| and `parent_tenant_id` = #{wxCoupon.parentTenantId} | and `parent_tenant_id` = #{wxCoupon.parentTenantId} | ||||
| </if> | </if> | ||||
| group by product_id) o on o.product_id = c.id | group by product_id) o on o.product_id = c.id | ||||
| left join (SELECT count(id) as join_count, coupon_id FROM (SELECT count(id) as press_count, coupon_id FROM (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| left join (SELECT count(id) as join_count, coupon_id FROM (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_order_press${tenantEntity.shardTableSuffix} | SELECT * from wx_order_press${tenantEntity.shardTableSuffix} | ||||
| </foreach>) wx_order_press WHERE 1=1 | </foreach>) wx_order_press WHERE 1=1 | ||||
| <if test=" null != wxCoupon.tenantId and '' != wxCoupon.tenantId"> | <if test=" null != wxCoupon.tenantId and '' != wxCoupon.tenantId"> | ||||
| @@ -901,7 +901,7 @@ | |||||
| and `parent_tenant_id` = #{wxCoupon.parentTenantId} | and `parent_tenant_id` = #{wxCoupon.parentTenantId} | ||||
| </if> | </if> | ||||
| group by coupon_id) op2 on op2.coupon_id = c.id | group by coupon_id) op2 on op2.coupon_id = c.id | ||||
| left join (SELECT count(id) as xCount, coupon_id FROM (SELECT count(id) as join_count, coupon_id FROM (SELECT count(id) as press_count, coupon_id FROM (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| left join (SELECT count(id) as xCount, coupon_id FROM (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_coupon_order${tenantEntity.shardTableSuffix} | SELECT * from wx_coupon_order${tenantEntity.shardTableSuffix} | ||||
| </foreach>) wx_coupon_order WHERE coupon_order_status = 1 | </foreach>) wx_coupon_order WHERE coupon_order_status = 1 | ||||
| <if test=" null != wxCoupon.tenantId and '' != wxCoupon.tenantId"> | <if test=" null != wxCoupon.tenantId and '' != wxCoupon.tenantId"> | ||||
| @@ -1066,7 +1066,9 @@ | |||||
| and wo.create_date between #{wxCoupon.startdate} and #{wxCoupon.enddate} | and wo.create_date between #{wxCoupon.startdate} and #{wxCoupon.enddate} | ||||
| ) | ) | ||||
| / | / | ||||
| (select count(wop.id) from wx_coupon wc | |||||
| (select count(wop.id) from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_coupon${tenantEntity.shardTableSuffix} | |||||
| </foreach>) wc | |||||
| left join (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | left join (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | ||||
| SELECT * from wx_order${tenantEntity.shardTableSuffix} | SELECT * from wx_order${tenantEntity.shardTableSuffix} | ||||
| </foreach>) wo on wo.product_id = wc.id | </foreach>) wo on wo.product_id = wc.id | ||||
| @@ -272,7 +272,9 @@ | |||||
| <select id="queryForSceneRepotyHistoryVerified" resultType="com.iformall.domain.vo.MarkingSceneDataVo" parameterType="hashmap"> | <select id="queryForSceneRepotyHistoryVerified" resultType="com.iformall.domain.vo.MarkingSceneDataVo" parameterType="hashmap"> | ||||
| select DATE_FORMAT(update_date,'%Y-%m-%d') xTime, count(c.id) triggerCount | select DATE_FORMAT(update_date,'%Y-%m-%d') xTime, count(c.id) triggerCount | ||||
| from wx_coupon_order c | |||||
| from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_coupon_order${tenantEntity.shardTableSuffix} | |||||
| </foreach>) c | |||||
| where c.coupon_order_status = 1 | where c.coupon_order_status = 1 | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and c.`tenant_id` = #{tenantId} | and c.`tenant_id` = #{tenantId} | ||||
| @@ -288,7 +290,9 @@ | |||||
| <select id="queryForSceneRepotyHistoryOrdered" resultType="com.iformall.domain.vo.MarkingSceneDataVo" parameterType="hashmap"> | <select id="queryForSceneRepotyHistoryOrdered" resultType="com.iformall.domain.vo.MarkingSceneDataVo" parameterType="hashmap"> | ||||
| select DATE_FORMAT(update_date,'%Y-%m-%d') xTime, count(c.id) triggerCount | select DATE_FORMAT(update_date,'%Y-%m-%d') xTime, count(c.id) triggerCount | ||||
| from wx_coupon_order c | |||||
| from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_coupon_order${tenantEntity.shardTableSuffix} | |||||
| </foreach>) c | |||||
| where 1=1 | where 1=1 | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and c.`tenant_id` = #{tenantId} | and c.`tenant_id` = #{tenantId} | ||||
| @@ -304,7 +308,11 @@ | |||||
| <select id="queryForSceneRepotyMechantHistoryOrdered" resultType="com.iformall.domain.vo.MarkingSceneDataVo" parameterType="hashmap"> | <select id="queryForSceneRepotyMechantHistoryOrdered" resultType="com.iformall.domain.vo.MarkingSceneDataVo" parameterType="hashmap"> | ||||
| select DATE_FORMAT(update_date,'%Y-%m-%d') xTime, count(c.id) triggerCount | select DATE_FORMAT(update_date,'%Y-%m-%d') xTime, count(c.id) triggerCount | ||||
| from wx_coupon_order c left join wx_coupon_action_log cal on cal.tenant_id = c.tenant_id | |||||
| from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_coupon_order${tenantEntity.shardTableSuffix} | |||||
| </foreach>) c left join (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_coupon_action_log${tenantEntity.shardTableSuffix} | |||||
| </foreach>) cal on cal.tenant_id = c.tenant_id | |||||
| where cal.coupon_order_id=c.id | where cal.coupon_order_id=c.id | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and c.`tenant_id` = #{tenantId} | and c.`tenant_id` = #{tenantId} | ||||
| @@ -146,10 +146,10 @@ | |||||
| <if test=" null != marketing.parentTenantId and '' != marketing.parentTenantId"> | <if test=" null != marketing.parentTenantId and '' != marketing.parentTenantId"> | ||||
| and c.`parent_tenant_id` = #{marketing.parentTenantId} | and c.`parent_tenant_id` = #{marketing.parentTenantId} | ||||
| </if> | </if> | ||||
| <if test=" null != marketing.couponId and ''! = marketing.couponId"> | |||||
| <if test=" null != marketing.couponId and '' != marketing.couponId"> | |||||
| and c.coupon_id=#{marketing.couponId} | and c.coupon_id=#{marketing.couponId} | ||||
| </if> | </if> | ||||
| <if test=" null != marketing.title and ''! = marketing.title"> | |||||
| <if test=" null != marketing.title and '' != marketing.title"> | |||||
| and c.title like concat('%',#{marketing.title},'%') | and c.title like concat('%',#{marketing.title},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != marketing.sortColumns"> order by ${marketing.sortColumns} </if> | <if test=" null != marketing.sortColumns"> order by ${marketing.sortColumns} </if> | ||||
| @@ -551,7 +551,9 @@ | |||||
| <select id="queryForSceneRepotyHistory" resultType="com.iformall.domain.vo.MarkingSceneDataVo" parameterType="hashmap"> | <select id="queryForSceneRepotyHistory" resultType="com.iformall.domain.vo.MarkingSceneDataVo" parameterType="hashmap"> | ||||
| select DATE_FORMAT(o.create_date,'%Y-%m-%d') xTime, count(o.id) triggerCount | select DATE_FORMAT(o.create_date,'%Y-%m-%d') xTime, count(o.id) triggerCount | ||||
| from wx_order o | |||||
| from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_order${tenantEntity.shardTableSuffix} | |||||
| </foreach>) o | |||||
| where o.`type` = #{type} | where o.`type` = #{type} | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and o.`tenant_id` = #{tenantId} | and o.`tenant_id` = #{tenantId} | ||||