Commit f19d8656 by Administrator

Merge branch 'feature/1003377' into 'master'

feat: [1003377] 第三方群链接做埋点统计

See merge request rays/pcloud-book!864
parents a81905ec 356c8ee9
......@@ -17,7 +17,18 @@ public enum DataTypeEnum {
/**
* 2券库
*/
gift_coupon(2);
gift_coupon(2),
/**
* 官方群
*/
rays_group(3),
/**
*
*/
third_group(4);
public final Integer code;
......
......@@ -28,6 +28,7 @@ import com.pcloud.book.applet.vo.AppletNewsClassifyVO;
import com.pcloud.book.applet.vo.AppletNewsShowStateVO;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.skill.biz.PcloudGroupActivityBiz;
import com.pcloud.book.skill.facade.response.QueryGroupActivityResponseVO;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.permission.PermissionException;
......
......@@ -15,6 +15,7 @@ import com.pcloud.book.group.entity.BookGroupClassify;
import com.pcloud.book.group.vo.AddClassifyVO;
import com.pcloud.book.group.vo.AdviserClassifyParam;
import com.pcloud.book.group.vo.AdviserClassifyVO;
import com.pcloud.book.group.vo.BookGroupClassifyAnalysisVO;
import com.pcloud.book.group.vo.BookGroupClassifyVO;
import com.pcloud.book.group.vo.BookGroupQrcodeStatisticVO;
import com.pcloud.book.group.vo.ClassifyAndGroupCountVO;
......@@ -287,4 +288,5 @@ public interface BookGroupClassifyBiz {
List<BookGroupClassifyDTO> getBookGroupClassifyByClassifyIds(List<Long> classifyIds);
PageBeanNew<BookGroupClassifyAnalysisVO> listGroupClassify4Analysis(String name, Long proLabelId, Long depLabelId, Long purLabelId, Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, Integer linkOnly, Integer browseQty, Integer clickQty, Integer currentPage, Integer numPerPage, String cityCode);
}
......@@ -2,10 +2,19 @@ package com.pcloud.book.group.biz.impl;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.pcloud.appcenter.assist.dto.AssistTempletDTO;
import com.pcloud.book.applet.dao.AppletLinkClickDao;
import com.pcloud.book.applet.dto.PvuvDTO;
import com.pcloud.book.applet.enums.DataRecordTypeEnum;
import com.pcloud.book.applet.enums.DataTypeEnum;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.constant.BookConstant;
import com.pcloud.book.book.dao.BookDao;
import com.pcloud.book.book.dao.BookLabelDao;
import com.pcloud.book.book.entity.BookLabel;
import com.pcloud.book.consumer.app.AssistTempletConsr;
import com.pcloud.book.consumer.common.ExportConsr;
import com.pcloud.book.consumer.label.LabelConsr;
import com.pcloud.book.consumer.message.MessageConsr;
import com.pcloud.book.consumer.promotion.PromotionConsr;
import com.pcloud.book.consumer.reader.ReaderConsr;
......@@ -60,6 +69,7 @@ import com.pcloud.book.group.tools.SendWeixinRequestTools;
import com.pcloud.book.group.vo.AddClassifyVO;
import com.pcloud.book.group.vo.AdviserClassifyParam;
import com.pcloud.book.group.vo.AdviserClassifyVO;
import com.pcloud.book.group.vo.BookGroupClassifyAnalysisVO;
import com.pcloud.book.group.vo.BookGroupClassifyVO;
import com.pcloud.book.group.vo.BookGroupQrcodeStatisticVO;
import com.pcloud.book.group.vo.ClassifyAndGroupCountVO;
......@@ -83,6 +93,8 @@ import com.pcloud.book.keywords.entity.BookKeyword;
import com.pcloud.book.keywords.entity.Keyword;
import com.pcloud.book.record.biz.BookBrowseRecordBiz;
import com.pcloud.book.record.entity.RegionMap;
import com.pcloud.book.rightsSetting.biz.RightsSettingBiz;
import com.pcloud.book.rightsSetting.entity.BaseTempletClassify;
import com.pcloud.book.util.common.ThreadPoolUtils;
import com.pcloud.book.util.properties.BookProps;
import com.pcloud.common.core.aspect.ParamLog;
......@@ -94,7 +106,9 @@ import com.pcloud.common.page.PageParam;
import com.pcloud.common.utils.DateUtils;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.common.utils.httpclient.UrlUtils;
import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.common.utils.string.StringUtilParent;
import com.pcloud.facade.tradecenter.dto.BookGroupSaleSearchDto;
import com.pcloud.facade.tradecenter.dto.QrGroupBuyDetailDto;
import com.pcloud.labelcenter.label.service.LabelService;
......@@ -209,6 +223,16 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
private BookDao bookDao;
@Autowired
private BookBrowseRecordBiz bookBrowseRecordBiz;
@Autowired
private LabelConsr labelConsr;
@Autowired
private AppletLinkClickDao appletLinkClickDao;
@Autowired
private RightsSettingBiz rightsSettingBiz;
@Autowired
private AssistTempletConsr assistTempletConsr;
@Autowired
private BookLabelDao bookLabelDao;
@Override
......@@ -1522,4 +1546,185 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
List<BookGroupClassifyDTO> bookGroupClassifyByClassifyIds = bookGroupClassifyDao.getBookGroupClassifyByClassifyIds(classifyIds);
return bookGroupClassifyByClassifyIds;
}
@Override
public PageBeanNew<BookGroupClassifyAnalysisVO> listGroupClassify4Analysis(String name, Long proLabelId, Long depLabelId, Long purLabelId, Long firstClassify, Long secondClassify, Long gradeLabelId, Long subjectLabelId, Integer linkOnly, Integer browseQty, Integer clickQty, Integer currentPage, Integer numPerPage, String cityCode) {
PageParam pageParam = new PageParam(currentPage, numPerPage);
BaseTempletClassify baseTempletClassify =new BaseTempletClassify();
baseTempletClassify.setFirstClassify(firstClassify);
baseTempletClassify.setSecondClassify(secondClassify);
baseTempletClassify.setSubjectLabelId(subjectLabelId);
baseTempletClassify.setGradeLabelId(gradeLabelId);
if (null != baseTempletClassify.getFirstClassify()){
rightsSettingBiz.setClassifyAndLabel(baseTempletClassify);
}
final Map<String, Object> map = Maps.newHashMap();
map.put("name", StringUtil.isEmpty(name) ? null : name);
map.put("proLabelId", proLabelId);
map.put("depLabelId", depLabelId);
map.put("purLabelId", purLabelId);
map.put("cityCode", cityCode);
map.put("linkOnly", linkOnly);
map.put("firstClassify", baseTempletClassify.getFirstClassify());
map.put("secondClassify", baseTempletClassify.getSecondClassify());
map.put("gradeLabelId", baseTempletClassify.getGradeLabelId());
map.put("subjectLabelId", baseTempletClassify.getSubjectLabelId());
PageBeanNew<BookGroupClassifyAnalysisVO> pageBeanNew = bookGroupClassifyDao.listPageNew(pageParam, map, "listGroupClassify4Analysis");
List<BookGroupClassifyAnalysisVO> recordList = pageBeanNew.getRecordList();
if(CollectionUtils.isEmpty(recordList)){
return pageBeanNew;
}
// 处理属性值
for(BookGroupClassifyAnalysisVO vo : recordList){
// 截取字符串
String filterStr = StringUtilParent.replaceHtml(vo.getDesc());
String subStr = filterStr.length() > 60 ? filterStr.substring(0, 60) + "..." : filterStr;
vo.setDesc(subStr);
}
// 设置分类
setLabelContent(recordList);
// 设置标签
setLabel(recordList);
// 设置城市
setCityNameByAnalysis(recordList);
// 设置 PV/UV
fillStatistic(recordList.stream().filter(x->x.getGroupType() == 0).collect(Collectors.toList()), browseQty, clickQty, DataTypeEnum.rays_group);
fillStatistic(recordList.stream().filter(x->x.getGroupType() == 1).collect(Collectors.toList()), browseQty, clickQty, DataTypeEnum.third_group);
// 填充微信文章入群链接
// fillGroupUrl(recordList);
return pageBeanNew;
}
private void setLabelContent(List<BookGroupClassifyAnalysisVO> recordList) {
log.info("权益设置标签具体内容");
if (ListUtils.isEmpty(recordList)){
return;
}
List<Long> firstClassifyIds = new ArrayList<>();
List<Long> secondClassifyIds = new ArrayList<>();
List<Long> classifyIds = new ArrayList<>();
List<Long> gradeLabelIds = new ArrayList<>();
List<Long> subjectLabelIds = new ArrayList<>();
List<Long> labelIds = new ArrayList<>();
for (BookGroupClassifyAnalysisVO vo : recordList) {
firstClassifyIds.add(vo.getFirstClassify());
secondClassifyIds.add(vo.getSecondClassify());
gradeLabelIds.add(vo.getGradeLabelId());
subjectLabelIds.add(vo.getSubjectLabelId());
}
if (!ListUtils.isEmpty(firstClassifyIds)){
classifyIds.addAll(firstClassifyIds);
}
if (!ListUtils.isEmpty(secondClassifyIds)){
classifyIds.addAll(secondClassifyIds);
}
if (!ListUtils.isEmpty(gradeLabelIds)){
labelIds.addAll(gradeLabelIds);
}
if (!ListUtils.isEmpty(subjectLabelIds)){
labelIds.addAll(subjectLabelIds);
}
Map<Long, AssistTempletDTO> classifyMap = new HashMap<>();
Map<Long, BookLabel> labelMap= new HashMap<>();
if (!ListUtils.isEmpty(classifyIds)){
classifyMap = assistTempletConsr.mapByIds4Classify(classifyIds);
}
if (!ListUtils.isEmpty(labelIds)){
labelMap = bookLabelDao.getMapByIds(labelIds);
}
for (BookGroupClassifyAnalysisVO vo : recordList){
if (!MapUtils.isEmpty(classifyMap) && classifyMap.containsKey(vo.getFirstClassify())){
vo.setFirstClassifyName(classifyMap.get(vo.getFirstClassify()).getTempletName());
}
if (!MapUtils.isEmpty(classifyMap) && classifyMap.containsKey(vo.getSecondClassify())){
vo.setSecondClassifyName(classifyMap.get(vo.getSecondClassify()).getTempletName());
}
if (!MapUtils.isEmpty(labelMap) && labelMap.containsKey(vo.getGradeLabelId())){
vo.setGradeLabelName(labelMap.get(vo.getGradeLabelId()).getName());
}
if (!MapUtils.isEmpty(labelMap) && labelMap.containsKey(vo.getSubjectLabelId())){
vo.setSubjectLabelName(labelMap.get(vo.getSubjectLabelId()).getName());
}
}
}
private void fillGroupUrl(List<BookGroupClassifyAnalysisVO> recordList) {
// 链接
for (BookGroupClassifyAnalysisVO vo : recordList) {
try {
if(vo.getGroupType() == 0){
vo.setWxArticleUrl(UrlUtils.getShortUrl4Own(bookGroupBiz.getGroupNewsMaterialById(null, vo.getId(), 0, null)));
} else if(vo.getGroupType() == 1){
vo.setWxArticleUrl(UrlUtils.getShortUrl4Own(bookGroupBiz.getGroupNewsMaterialById(null, null, 1, vo.getId())));
}
} catch (Exception e){}
}
}
private void fillStatistic(List<BookGroupClassifyAnalysisVO> recordList, Integer browseQty, Integer clickQty, DataTypeEnum dataTypeEnum) {
if (ListUtils.isEmpty(recordList)) {
return;
}
if (null != browseQty && browseQty.intValue()>1){ //等于1 值查询当天数据。大于1时,从昨天开始倒推7天,所以要+1
browseQty += 1;
}
if (null != clickQty && clickQty.intValue() >1){
clickQty += 1;
}
List<Long> newsIds = recordList.stream().filter(s -> s != null).map(x-> x.getId()).distinct().collect(Collectors.toList());
Map<Long, PvuvDTO> clickMap = appletLinkClickDao.mapPVUV(dataTypeEnum.code, DataRecordTypeEnum.click.code, newsIds,clickQty);
Map<Long, PvuvDTO> browseMap = appletLinkClickDao.mapPVUV(dataTypeEnum.code, DataRecordTypeEnum.browse.code, newsIds,browseQty);
for (BookGroupClassifyAnalysisVO vo : recordList) {
Long newsId = vo.getId();
if (!MapUtils.isEmpty(clickMap) && clickMap.containsKey(newsId)) {
PvuvDTO pvuvDTO = clickMap.get(newsId);
vo.setClickPVUV(pvuvDTO.getPv() + "/" + pvuvDTO.getUv());
} else {
vo.setClickPVUV("0/0");
}
if (!MapUtils.isEmpty(browseMap) && browseMap.containsKey(newsId)) {
PvuvDTO pvuvDTO = browseMap.get(newsId);
vo.setBrowsePVUV(pvuvDTO.getPv() + "/" + pvuvDTO.getUv());
} else {
vo.setBrowsePVUV("0/0");
}
}
}
private void setLabel(List<BookGroupClassifyAnalysisVO> recordList) {
// 组装标签名称
List<Long> labelId = Lists.newArrayList();
for (BookGroupClassifyAnalysisVO responseVO : recordList) {
labelId.add(responseVO.getProLabelId());
labelId.add(responseVO.getPurLabelId());
labelId.add(responseVO.getDepLabelId());
}
Map<Long, String> labelName = labelConsr.getLabelName(labelId);
for (BookGroupClassifyAnalysisVO responseVO : recordList) {
responseVO.setPurLabelName(labelName.get(responseVO.getPurLabelId()));
responseVO.setProLabelName(labelName.get(responseVO.getProLabelId()));
responseVO.setDepLabelName(labelName.get(responseVO.getDepLabelId()));
}
}
private void setCityNameByAnalysis(List<BookGroupClassifyAnalysisVO> recordList) {
log.info("设置城市名称");
if (ListUtils.isEmpty(recordList)){
return;
}
List<String> cityCodes = recordList.stream().map(e -> e.getCityCode()).distinct().collect(Collectors.toList());
if (ListUtils.isEmpty(cityCodes)) {
return;
}
Map<String, RegionMap> regionMapMap = bookBrowseRecordBiz.getCitysByCodes(cityCodes);
if (MapUtils.isNotEmpty(regionMapMap)){
recordList.forEach(classifyVO -> {
RegionMap regionMap = regionMapMap.get(classifyVO.getCityCode());
if (regionMapMap.containsKey(classifyVO.getCityCode()) && null != regionMap){
classifyVO.setCityName(regionMap.getRegionName());
}
});
}
}
}
......@@ -5,6 +5,7 @@ import com.pcloud.book.group.dto.GroupQrcode4ClassifyDTO;
import com.pcloud.book.group.vo.AddClassifyVO;
import com.pcloud.book.group.vo.AdviserClassifyParam;
import com.pcloud.book.group.vo.AdviserClassifyVO;
import com.pcloud.book.group.vo.BookGroupClassifyAnalysisVO;
import com.pcloud.book.group.vo.BookGroupClassifyVO;
import com.pcloud.book.group.vo.BookGroupQrcodeStatisticVO;
import com.pcloud.book.group.vo.ClassifyAndGroupCountVO;
......@@ -288,6 +289,26 @@ public interface BookGroupClassifyFacade {
@RequestParam("numPerPage") Integer numPerPage,
@RequestParam(value = "cityCode",required = false) String cityCode) throws BizException, PermissionException;
@ApiOperation("平台端获取群分类统计分析数据")
@GetMapping("listGroupClassify4Analysis")
ResponseDto<PageBeanNew<BookGroupClassifyAnalysisVO>> listGroupClassify4Analysis(
@RequestHeader("token") @ApiParam("token信息") String token,
@RequestParam(value = "name", required = false) @ApiParam("群分类名 | 书刊名") String name,
@RequestParam(value = "proLabelId", required = false) @ApiParam("专业标签") Long proLabelId,
@RequestParam(value = "depLabelId", required = false) @ApiParam("深度标签") Long depLabelId,
@RequestParam(value = "purLabelId", required = false) @ApiParam("目的") Long purLabelId,
@RequestParam(value = "firstClassify", required = false) @ApiParam("一级分类") Long firstClassify,
@RequestParam(value = "secondClassify", required = false) @ApiParam("二级分类") Long secondClassify,
@RequestParam(value = "gradeLabelId", required = false) @ApiParam("年级") Long gradeLabelId,
@RequestParam(value = "subjectLabelId", required = false) @ApiParam("科目") Long subjectLabelId,
@RequestParam(value = "linkOnly", required = false) @ApiParam("只看第三方") Integer linkOnly,
@RequestParam(value = "browseQty", required = false) @ApiParam("浏览量") Integer browseQty,
@RequestParam(value = "clickQty", required = false) @ApiParam("点击量") Integer clickQty,
@RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage,
@RequestParam(value = "cityCode",required = false) String cityCode
) throws BizException, PermissionException;
@ApiOperation("根据群分类ID获取群二维码")
@GetMapping("getGroupQrcodeByClassify")
ResponseDto<String> getGroupQrcodeByClassify(@RequestHeader("token") String token,@RequestParam("classifyId") Integer classifyId) throws BizException,PermissionException;
......
......@@ -327,6 +327,30 @@ public class BookGroupClassifyFacadeImpl implements BookGroupClassifyFacade {
}
@Override
@GetMapping("listGroupClassify4Analysis")
public ResponseDto<PageBeanNew<BookGroupClassifyAnalysisVO>> listGroupClassify4Analysis(
@RequestHeader("token") @ApiParam("token信息") String token,
@RequestParam(value = "name", required = false) @ApiParam("群分类名 | 书刊名") String name,
@RequestParam(value = "proLabelId", required = false) @ApiParam("专业标签") Long proLabelId,
@RequestParam(value = "depLabelId", required = false) @ApiParam("深度标签") Long depLabelId,
@RequestParam(value = "purLabelId", required = false) @ApiParam("目的") Long purLabelId,
@RequestParam(value = "firstClassify", required = false) @ApiParam("一级分类") Long firstClassify,
@RequestParam(value = "secondClassify", required = false) @ApiParam("二级分类") Long secondClassify,
@RequestParam(value = "gradeLabelId", required = false) @ApiParam("年级") Long gradeLabelId,
@RequestParam(value = "subjectLabelId", required = false) @ApiParam("科目") Long subjectLabelId,
@RequestParam(value = "linkOnly", required = false) @ApiParam("只看第三方") Integer linkOnly,
@RequestParam(value = "browseQty", required = false) @ApiParam("浏览量") Integer browseQty,
@RequestParam(value = "clickQty", required = false) @ApiParam("点击量") Integer clickQty,
@RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage,
@RequestParam(value = "cityCode",required = false) String cityCode
) throws BizException, PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(bookGroupClassifyBiz.listGroupClassify4Analysis(name, proLabelId, depLabelId, purLabelId,
firstClassify, secondClassify, gradeLabelId, subjectLabelId, linkOnly,browseQty,clickQty,currentPage, numPerPage,cityCode));
}
@Override
@GetMapping("getGroupQrcodeByClassify")
public ResponseDto<String> getGroupQrcodeByClassify(@RequestHeader("token") String token, @RequestParam("classifyId") Integer classifyId) throws BizException, PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
......
package com.pcloud.book.group.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class BookGroupClassifyAnalysisVO {
@ApiModelProperty("ID")
private Long id;
@ApiModelProperty("群分类名称")
private String classifyName;
@ApiModelProperty("群分类介绍")
private String desc;
@ApiModelProperty("专业")
private Long proLabelId;
@ApiModelProperty("深度")
private Long depLabelId;
@ApiModelProperty("目的")
private Long purLabelId;
@ApiModelProperty("专业标签名称")
private String proLabelName;
@ApiModelProperty("深度标签名称")
private String depLabelName;
@ApiModelProperty("目的标签名称")
private String purLabelName;
@ApiModelProperty("目的标签名称")
private Integer groupType;
@ApiModelProperty("城市编码")
private String cityCode;
@ApiModelProperty("城市名称")
private String cityName;
@ApiModelProperty("点击量pv/uv")
private String clickPVUV;
@ApiModelProperty("浏览量pv/uv")
private String browsePVUV;
@ApiModelProperty("微信入群文章链接")
private String wxArticleUrl;
@ApiModelProperty("第一级类型标识")
private Long firstClassify;
@ApiModelProperty("第一级类型标识名称")
private String firstClassifyName;
@ApiModelProperty("第二级类型标识")
private Long secondClassify;
@ApiModelProperty("第二级类型标识名称")
private String secondClassifyName;
@ApiModelProperty("年级标签id")
private Long gradeLabelId;
@ApiModelProperty("年级标签名称")
private String gradeLabelName;
@ApiModelProperty("科目标签id")
private Long subjectLabelId;
@ApiModelProperty("科目标签名称")
private String subjectLabelName;
}
......@@ -5,8 +5,12 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.pcloud.appcenter.assist.dto.AssistTempletDTO;
import com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz;
import com.pcloud.book.applet.dao.AppletLinkClickDao;
import com.pcloud.book.applet.dto.AppletGroupManageDTO;
import com.pcloud.book.applet.dto.AppletGroupStatementDTO;
import com.pcloud.book.applet.dto.PvuvDTO;
import com.pcloud.book.applet.enums.DataRecordTypeEnum;
import com.pcloud.book.applet.enums.DataTypeEnum;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.biz.BookBiz;
import com.pcloud.book.book.dao.BookDao;
......@@ -132,6 +136,8 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
private BookBrowseRecordBiz bookBrowseRecordBiz;
@Autowired
private BookGroupBiz bookGroupBiz;
@Autowired
private AppletLinkClickDao appletLinkClickDao;
@ParamLog("批量分类")
@Override
......
......@@ -96,5 +96,11 @@ public class QueryGroupActivityResponseVO {
@ApiModelProperty("城市名称")
private String cityCode;
@ApiModelProperty("点击量pv/uv")
private String clickPVUV;
@ApiModelProperty("浏览量pv/uv")
private String browsePVUV;
}
......@@ -1170,6 +1170,96 @@
ORDER BY a.create_time DESC
</select>
<select id="listGroupClassify4Analysis" parameterType="map" resultType="com.pcloud.book.group.vo.BookGroupClassifyAnalysisVO">
SELECT * FROM(
<if test="linkOnly == null or linkOnly == 0">
SELECT
a.id,
a.classify classifyName,
a.classify_introduce AS `desc`,
c.pro_label_id AS proLabelId,
c.dep_label_id AS depLabelId,
c.pur_label_id AS purLabelId,
0 firstClassify,
0 secondClassify,
0 gradeLabelId,
0 subjectLabelId,
0 groupType,
city_code cityCode,
a.create_time
FROM book_group_classify a
LEFT JOIN book_group_qrcode b ON a.id = b.classify_id AND b.is_delete = 0 AND a.is_delete = 0
LEFT JOIN book_group c ON a.book_group_id = c.id
<where>
a.is_delete=0
<if test="firstClassify != null">
AND 1=2
</if>
<if test="secondClassify != null">
AND 1=2
</if>
<if test="gradeLabelId != null">
AND 1=2
</if>
<if test="subjectLabelId != null">
AND 1=2
</if>
</where>
GROUP BY b.classify_id
HAVING count(b.classify_id) > 0
UNION
</if>
SELECT
a.id,
a.`name` classifyName,
a.description as `desc`,
a.pro_label_id AS proLabelId,
a.dep_label_id AS depLabelId,
a.pur_label_id AS purLabelId,
a.first_classify AS firstClassify,
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId,
a.group_type as groupType,
'' cityCode,
a.create_time
FROM pcloud_group_activity a
WHERE
a.is_delete = 0
AND a.group_type = 1
<if test="firstClassify != null">
AND a.first_classify = #{firstClassify}
</if>
<if test="secondClassify != null">
AND a.second_classify = #{secondClassify}
</if>
<if test="gradeLabelId != null">
AND a.grade_label_id = #{gradeLabelId}
</if>
<if test="subjectLabelId != null">
AND a.subject_label_id = #{subjectLabelId}
</if>
) temp_tb
<where>
<if test="name!=null">
classifyName LIKE CONCAT("%",#{name},"%")
</if>
<if test="proLabelId!=null">
AND proLabelId = #{proLabelId}
</if>
<if test="depLabelId!=null">
AND depLabelId = #{depLabelId}
</if>
<if test="purLabelId!=null">
AND purLabelId = #{purLabelId}
</if>
<if test="cityCode != null">
and cityCode = #{cityCode}
</if>
</where>
ORDER BY create_time DESC
</select>
<select id="listClassify4Heals" resultType="com.pcloud.book.group.dto.ListClassify4WechatDTO" parameterType="map">
SELECT
c.id classifyId,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment