| @@ -92,9 +92,10 @@ public class MarkingDataReportController extends BaseController { | |||
| public ResultData touchUsersDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] MarkingDataReportController::touchUsersDataList"); | |||
| TenantEntity tenantInfo = getTenantInfo(); | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantInfo); | |||
| markingCouponDataReportDto.setTenantEntitys(tenantEntitys); | |||
| //List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantInfo); | |||
| //markingCouponDataReportDto.setTenantEntitys(tenantEntitys); | |||
| markingCouponDataReportDto.updateTenantInfo(tenantInfo); | |||
| markingCouponDataReportDto.setTenantEntity(tenantInfo); | |||
| return new ResultData(markingDataReportService.getTouchUsersReportList(markingCouponDataReportDto, pageNum, pageSize)); | |||
| } | |||
| @@ -103,9 +104,10 @@ public class MarkingDataReportController extends BaseController { | |||
| @SystemControllerLog(description = "券数据-触达用户数数据导出") | |||
| public void exportTouchUsersData(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, HttpServletRequest request, HttpServletResponse response) { | |||
| TenantEntity tenantInfo = getTenantInfo(); | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantInfo); | |||
| markingCouponDataReportDto.setTenantEntitys(tenantEntitys); | |||
| //List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantInfo); | |||
| //markingCouponDataReportDto.setTenantEntitys(tenantEntitys); | |||
| markingCouponDataReportDto.updateTenantInfo(tenantInfo); | |||
| markingCouponDataReportDto.setTenantEntity(tenantInfo); | |||
| markingDataReportService.exportTouchUsersData(request, response, markingCouponDataReportDto); | |||
| } | |||
| @@ -27,6 +27,8 @@ public class MarkingCouponDataReportDto extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private List<TenantEntity> tenantEntitys; | |||
| @TableField(exist = false) | |||
| private TenantEntity tenantEntity; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "xTime") | |||
| @@ -58,8 +58,8 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> { | |||
| //营销报表 券数据图表 | |||
| //List<MarkingCouponDataReportVo> couponDataMap(HashMap<String,Object> params); | |||
| HashMap<String,Integer> findCreateDateCouponOrderCount(HashMap<String,Object> params); | |||
| HashMap<String,Integer> findCreateDateCouponOrderUserCount(HashMap<String,Object> params); | |||
| List<Map<String,Object>> findCreateDateCouponOrderCount(HashMap<String,Object> params); | |||
| List<Map<String,Object>> findCreateDateCouponOrderUserCount(HashMap<String,Object> params); | |||
| //营销报表 券数据报表 | |||
| List<MarkingCouponDataReportVo> couponDataList(HashMap<String,Object> params); //返回日期格式yy-MM-dd | |||
| @@ -82,7 +82,7 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> { | |||
| List<MarkingSceneDataVo> queryForSceneRepotyHistoryVerified(HashMap<String,Object> params); | |||
| List<MarkingSceneDataVo> queryForSceneRepotyHistoryOrdered(HashMap<String,Object> params); | |||
| List<MarkingSceneDataVo> queryForSceneRepotyMechantHistoryOrdered(HashMap<String,Object> params); | |||
| //List<MarkingSceneDataVo> queryForSceneRepotyMechantHistoryOrdered(HashMap<String,Object> params); | |||
| @@ -224,8 +224,6 @@ public interface WxCouponOrderService { | |||
| void statisticsWriteOff(WxCouponOrder wxCouponOrder, Map<String, Object> resultMap); | |||
| Integer findCount(WxCouponOrder wxCouponOrder); | |||
| PageInfo<WxCouponOrderBVo> goodsListAsPage(WxCouponOrderBVo couponOrderBvo, Integer pageNum, Integer pageSize); | |||
| List<MarkingCouponDataReportVo> couponDataMap(TenantEntity tenantEntity,Date startTime,Date endTime); | |||
| @@ -309,6 +309,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||
| if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | |||
| params.put("parentTenantId", tenantEntity.getParentTenantId()); | |||
| } | |||
| params.put("tenantEntity", tenantEntity); | |||
| if (markingCouponDataReportDto.getStartTime() != null) | |||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(), 0)); | |||
| if (markingCouponDataReportDto.getEndTime() != null) | |||
| @@ -491,13 +492,13 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||
| triggerCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getXtime, p -> p.getTriggerCount())); | |||
| }else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.MERCHANT.getCode())) { | |||
| //购买发券数 | |||
| if (markingCouponDataReportDto.getStartTime() != null) | |||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | |||
| if (markingCouponDataReportDto.getEndTime() != null) | |||
| params.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); | |||
| params.put("channelType", markingCouponDataReportDto.getType()); | |||
| List<MarkingSceneDataVo> markingSceneDataVos = wxCouponOrderMapper.queryForSceneRepotyMechantHistoryOrdered(params); | |||
| triggerCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getXtime, p -> p.getTriggerCount())); | |||
| // if (markingCouponDataReportDto.getStartTime() != null) | |||
| // params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | |||
| // if (markingCouponDataReportDto.getEndTime() != null) | |||
| // params.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); | |||
| // params.put("channelType", markingCouponDataReportDto.getType()); | |||
| // List<MarkingSceneDataVo> markingSceneDataVos = wxCouponOrderMapper.queryForSceneRepotyMechantHistoryOrdered(params); | |||
| // triggerCountMap = markingSceneDataVos.stream().collect(Collectors.toMap(MarkingSceneDataVo::getXtime, p -> p.getTriggerCount())); | |||
| } | |||
| NumberFormat nf = NumberFormat.getPercentInstance(); | |||
| nf.setMinimumFractionDigits(2); | |||
| @@ -1456,9 +1456,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| wxCouponOrder.setStartTime(startTime); | |||
| wxCouponOrder.setEndTime(endTime); | |||
| // wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| //TODO 待优化数据 | |||
| //int thisMonthCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys);//月消费金额 | |||
| int thisMonthCount = 0; | |||
| int thisMonthCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys);//月消费金额 | |||
| c.clear(); | |||
| c.add(Calendar.DAY_OF_YEAR, -1); | |||
| c.set(Calendar.HOUR_OF_DAY, 0); | |||
| @@ -2384,11 +2384,6 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| resultMap.put("countTingche",wxCouponOrderMapper.findWriteOffCount(wxCouponOrder)); | |||
| } | |||
| @Override | |||
| public Integer findCount(WxCouponOrder wxCouponOrder) { | |||
| return wxCouponOrderMapper.findCount(wxCouponOrder); | |||
| } | |||
| @Override | |||
| public PageInfo<WxCouponOrderBVo> goodsListAsPage(WxCouponOrderBVo record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findGoodsList(record)); | |||
| @@ -2405,23 +2400,35 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| paramMap.put("parentTenantId", tenantEntity.getParentTenantId()); | |||
| paramMap.put("startCreateDateTimes", startTime.getTime()); | |||
| paramMap.put("endCreateDateTimes", endTime.getTime()); | |||
| Map<String,Integer> couponCount = wxCouponOrderMapper.findCreateDateCouponOrderCount(paramMap); | |||
| if (null != couponCount) { | |||
| for (Iterator<String> it = couponCount.keySet().iterator();it.hasNext();) { | |||
| String date = it.next(); | |||
| if (!dateList.contains(date)){ | |||
| dateList.add(date); | |||
| List<Map<String,Object>> couponCountList = wxCouponOrderMapper.findCreateDateCouponOrderCount(paramMap); | |||
| Map<String,Long> couponCount = new HashMap<String,Long>(); | |||
| if (null != couponCountList) { | |||
| for (int i = 0; i < couponCountList.size();i++) { | |||
| Map<String,Object> map = couponCountList.get(i); | |||
| String date = (String)map.get("createTime"); | |||
| Long count = (Long)map.get("count"); | |||
| if ((!StringUtils.isBlank(date)) && null != count) { | |||
| if(!dateList.contains(date)) { | |||
| dateList.add(date); | |||
| } | |||
| couponCount.put(date, count); | |||
| } | |||
| } | |||
| } | |||
| //券领取人数 | |||
| Map<String,Integer> couponUserCount = wxCouponOrderMapper.findCreateDateCouponOrderUserCount(paramMap); | |||
| if (null != couponUserCount) { | |||
| for (Iterator<String> it = couponUserCount.keySet().iterator();it.hasNext();) { | |||
| String date = it.next(); | |||
| if (!dateList.contains(date)){ | |||
| dateList.add(date); | |||
| List<Map<String,Object>> couponUserCountList = wxCouponOrderMapper.findCreateDateCouponOrderUserCount(paramMap); | |||
| Map<String,Long> couponUserCount = new HashMap<String,Long>(); | |||
| if (null != couponUserCountList) { | |||
| for (int i = 0; i < couponUserCountList.size();i++) { | |||
| Map<String,Object> map = couponUserCountList.get(i); | |||
| String date = (String)map.get("createTime"); | |||
| Long count = (Long)map.get("count"); | |||
| if ((!StringUtils.isBlank(date)) && null != count) { | |||
| if(!dateList.contains(date)) { | |||
| dateList.add(date); | |||
| } | |||
| couponUserCount.put(date, count); | |||
| } | |||
| } | |||
| } | |||
| @@ -2433,23 +2440,35 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| verfiyParamMap.put("couponOrderStatus", 1); | |||
| verfiyParamMap.put("updateStartTime", startTime); | |||
| verfiyParamMap.put("updateEndTime", endTime); | |||
| Map<String,Integer> verfiyCount = wxCouponOrderMapper.findCreateDateCouponOrderCount(verfiyParamMap); | |||
| if (null != verfiyCount) { | |||
| for (Iterator<String> it = verfiyCount.keySet().iterator();it.hasNext();) { | |||
| String date = it.next(); | |||
| if (!dateList.contains(date)){ | |||
| dateList.add(date); | |||
| List<Map<String,Object>> verfiyCountList = wxCouponOrderMapper.findCreateDateCouponOrderCount(verfiyParamMap); | |||
| Map<String,Long> verfiyCount = new HashMap<String,Long>(); | |||
| if (null != verfiyCountList) { | |||
| for (int i = 0; i < verfiyCountList.size();i++) { | |||
| Map<String,Object> map = verfiyCountList.get(i); | |||
| String date = (String)map.get("createTime"); | |||
| Long count = (Long)map.get("count"); | |||
| if ((!StringUtils.isBlank(date)) && null != count) { | |||
| if(!dateList.contains(date)) { | |||
| dateList.add(date); | |||
| } | |||
| verfiyCount.put(date, count); | |||
| } | |||
| } | |||
| } | |||
| //券核销人数 | |||
| Map<String,Integer> verfiyUserCount = wxCouponOrderMapper.findCreateDateCouponOrderUserCount(verfiyParamMap); | |||
| if (null != verfiyUserCount) { | |||
| for (Iterator<String> it = verfiyUserCount.keySet().iterator();it.hasNext();) { | |||
| String date = it.next(); | |||
| if (!dateList.contains(date)){ | |||
| dateList.add(date); | |||
| List<Map<String,Object>> verfiyUserCountList = wxCouponOrderMapper.findCreateDateCouponOrderUserCount(verfiyParamMap); | |||
| Map<String,Long> verfiyUserCount = new HashMap<String,Long>(); | |||
| if (null != verfiyUserCountList) { | |||
| for (int i = 0; i < verfiyUserCountList.size();i++) { | |||
| Map<String,Object> map = verfiyUserCountList.get(i); | |||
| String date = (String)map.get("createTime"); | |||
| Long count = (Long)map.get("count"); | |||
| if ((!StringUtils.isBlank(date)) && null != count) { | |||
| if(!dateList.contains(date)) { | |||
| dateList.add(date); | |||
| } | |||
| verfiyUserCount.put(date, count); | |||
| } | |||
| } | |||
| } | |||
| @@ -2460,25 +2479,25 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| String date = dateList.get(i); | |||
| MarkingCouponDataReportVo vo = new MarkingCouponDataReportVo(); | |||
| if (null != couponCount && couponCount.containsKey(date)) { | |||
| vo.setCouponCount(couponCount.get(date)); | |||
| vo.setCouponCount(couponCount.get(date).intValue()); | |||
| }else { | |||
| vo.setCouponCount(0); | |||
| } | |||
| if (null != couponUserCount && couponUserCount.containsKey(date)) { | |||
| vo.setCouponUserCount(couponUserCount.get(date));; | |||
| vo.setCouponUserCount(couponUserCount.get(date).intValue());; | |||
| }else { | |||
| vo.setCouponUserCount(0); | |||
| } | |||
| if (null != verfiyCount && verfiyCount.containsKey(date)) { | |||
| vo.setVerifyCount(verfiyCount.get(date)); | |||
| vo.setVerifyCount(verfiyCount.get(date).intValue()); | |||
| }else { | |||
| vo.setVerifyCount(0); | |||
| } | |||
| if (null != verfiyUserCount && verfiyUserCount.containsKey(date)) { | |||
| vo.setVerifyUserCount(verfiyUserCount.get(date)); | |||
| vo.setVerifyUserCount(verfiyUserCount.get(date).intValue()); | |||
| }else { | |||
| vo.setVerifyUserCount(0); | |||
| } | |||
| @@ -294,7 +294,7 @@ | |||
| <select id = "findCreateDateCouponOrderCount" resultType="hashmap" parameterType="hashmap"> | |||
| select DATE_FORMAT(create_date,'%m/%d') as createTime ,count(1) as count from wx_coupon_order | |||
| select DATE_FORMAT(create_date,'%m/%d') as createTime ,count(1) as count from wx_coupon_order co | |||
| where `tenant_id` = #{tenantId} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| @@ -318,7 +318,7 @@ | |||
| </select> | |||
| <select id = "findCreateDateCouponOrderUserCount" resultType="hashmap" parameterType="hashmap"> | |||
| select DATE_FORMAT(create_date,'%m/%d') as createTime ,count(DISTINCT c_user_id) as count from wx_coupon_order | |||
| select DATE_FORMAT(create_date,'%m/%d') as createTime ,count(DISTINCT c_user_id) as count from wx_coupon_order co | |||
| where `tenant_id` = #{tenantId} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| @@ -343,13 +343,7 @@ | |||
| <select id="couponDataList" resultType="com.iformall.domain.vo.MarkingCouponDataReportVo" parameterType="hashmap"> | |||
| SELECT createTime,couponId,sum(couponCount) couponCount,sum(couponUserCount) couponUserCount,sum(verifyCount) verifyCount,sum(verifyUserCount) verifyUserCount | |||
| from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||
| SELECT * from view_coupon_data${tenantEntity.shardTableSuffix} WHERE `tenant_id` = #{tenantEntity.tenantId} | |||
| </foreach>) view_coupon_data | |||
| where 1=1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| from view_coupon_data${tenantEntity.shardTableSuffix} WHERE `tenant_id` = #{tenantEntity.tenantId} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| @@ -372,13 +366,7 @@ | |||
| <select id="touchUsersReportList" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="com.iformall.domain.dto.MarkingCouponDataReportDto"> | |||
| SELECT xTime, sum(pv) pv, sum(uv) uv, sum(couponCount) couponCount, sum(userCount) userCount, sum(verifyCount) verifyCount, sum(verifyUserCount) verifyUserCount | |||
| FROM (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||
| SELECT * from view_touch_user${tenantEntity.shardTableSuffix} WHERE `tenant_id` = #{tenantEntity.tenantId} | |||
| </foreach>) view_touch_user | |||
| WHERE 1=1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| from view_touch_user${tenantEntity.shardTableSuffix} WHERE `tenant_id` = #{tenantEntity.tenantId} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| @@ -395,9 +383,7 @@ | |||
| <select id="queryForSceneRepotyHistoryVerified" resultType="com.iformall.domain.vo.MarkingSceneDataVo" parameterType="hashmap"> | |||
| select DATE_FORMAT(update_date,'%Y-%m-%d') xTime, count(c.id) triggerCount | |||
| from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||
| SELECT * from wx_coupon_order${tenantEntity.shardTableSuffix} | |||
| </foreach>) c | |||
| from wx_coupon_order c | |||
| where c.coupon_order_status = 1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and c.`tenant_id` = #{tenantId} | |||
| @@ -413,13 +399,7 @@ | |||
| <select id="queryForSceneRepotyHistoryOrdered" resultType="com.iformall.domain.vo.MarkingSceneDataVo" parameterType="hashmap"> | |||
| select DATE_FORMAT(update_date,'%Y-%m-%d') xTime, count(c.id) triggerCount | |||
| from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||
| SELECT * from wx_coupon_order${tenantEntity.shardTableSuffix} | |||
| </foreach>) c | |||
| where 1=1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and c.`tenant_id` = #{tenantId} | |||
| </if> | |||
| from wx_coupon_order c where c.`tenant_id` = #{tenantId} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and c.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| @@ -429,13 +409,13 @@ | |||
| group by xTime | |||
| </select> | |||
| <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 | |||
| 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 | |||
| from ( | |||
| SELECT * from wx_coupon_order | |||
| ) c left join ( | |||
| SELECT * from wx_coupon_action_log | |||
| ) cal on cal.tenant_id = c.tenant_id | |||
| where cal.coupon_order_id=c.id | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and c.`tenant_id` = #{tenantId} | |||
| @@ -450,14 +430,11 @@ | |||
| and c.create_date BETWEEN #{startTime} and #{endTime} | |||
| </if> | |||
| group by xTime | |||
| </select> | |||
| </select> --> | |||
| <select id="queryPriceTotal" parameterType="com.iformall.domain.po.WxCouponOrder" resultType="java.lang.Integer" > | |||
| SELECT IFNULL(SUM(coupon_price),0) from wx_coupon_order | |||
| where 1=1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| where `tenant_id` = #{tenantId} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| @@ -474,27 +451,16 @@ | |||
| and coupon_type = #{couponType} | |||
| </if> | |||
| <if test=" null != startTime"> | |||
| and create_date >= #{startTime} | |||
| and create_date_times >= unix_timestamp(#{startTime})*1000 | |||
| </if> | |||
| <if test=" null != endTime"> | |||
| and create_date <= #{endTime} | |||
| and create_date_times <= unix_timestamp(#{endTime})*1000 | |||
| </if> | |||
| </select> | |||
| <select id="findCount" parameterType="com.iformall.domain.po.WxCouponOrder" resultType="java.lang.Integer"> | |||
| select COUNT(1) FROM wx_coupon_order co | |||
| <if test=" null != businessId "> | |||
| inner join wx_coupon c | |||
| on c.id = co.coupon_id | |||
| and c.business = #{businessId} | |||
| <if test=" null != subBusinessId "> | |||
| and c.sub_business = #{subBusinessId} | |||
| </if> | |||
| </if> | |||
| where 1=1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and co.`tenant_id` = #{tenantId} | |||
| </if> | |||
| where co.`tenant_id` = #{tenantId} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and co.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| @@ -584,10 +550,7 @@ | |||
| <select id="findProductCount" parameterType="com.iformall.domain.po.WxCouponOrder" resultType="java.lang.Integer"> | |||
| select COALESCE(sum(coupon_number),0) FROM wx_coupon_order co | |||
| where 1=1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and co.`tenant_id` = #{tenantId} | |||
| </if> | |||
| where co.`tenant_id` = #{tenantId} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and co.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||