Commit c0265a68 by 田超

Merge branch 'feature/1003095' into 'master'

feat: [1003095] 社群共读模板支持第三方群分类接入

See merge request rays/pcloud-book!788
parents 2e032e52 775e5765
......@@ -78,11 +78,13 @@ public class AppletGroupManageBizImpl implements AppletGroupManageBiz {
// 平台端共读模板创建修改为选择群分类自更新群 群变更为群分类 需要补充信息
for (AppletGroupManageDTO appletGroupManageDTO : recordList.getRecordList()) {
Long classifyId = appletGroupManageDTO.getClassifyId();
String groupQrCode = groupQrcodeBiz.getChangeGroupQrCode(classifyId);
ClassifyQrcodeVO groupQrcodeInfo = groupQrcodeBiz.getGroupQrcodeInfo(groupQrCode, classifyId);
appletGroupManageDTO.setUserNumber(groupQrcodeInfo.getUserNumber());
appletGroupManageDTO.setBookGroupQrcodeId(groupQrcodeInfo.getId());
appletGroupManageDTO.setGroupPic(groupQrCode);
if (classifyId!=null && classifyId !=0 ) {
String groupQrCode = groupQrcodeBiz.getChangeGroupQrCode(classifyId);
ClassifyQrcodeVO groupQrcodeInfo = groupQrcodeBiz.getGroupQrcodeInfo(groupQrCode, classifyId);
appletGroupManageDTO.setUserNumber(groupQrcodeInfo.getUserNumber());
appletGroupManageDTO.setBookGroupQrcodeId(groupQrcodeInfo.getId());
appletGroupManageDTO.setGroupPic(groupQrCode);
}
}
// 组装标签名称
......
......@@ -19,6 +19,9 @@ public class AppletGroupManageDTO extends BaseEntity {
private Long id;
@ApiModelProperty("群类型 1:第三方群")
private Long groupType;
@ApiModelProperty("共读活动id")
private Long groupActivityId;
......@@ -94,4 +97,6 @@ public class AppletGroupManageDTO extends BaseEntity {
@ApiModelProperty("关联")
private Long relatedBookGroupId;
@ApiModelProperty("第三方群链接")
private String groupLink;
}
\ No newline at end of file
......@@ -1376,7 +1376,7 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
}
PageParam pageParam = new PageParam(currentPage, numPerPage);
final Map<String, Object> map = Maps.newHashMap();
map.put("list",ids);
map.put("list", ids);
map.put("name", StringUtil.isEmpty(name) ? null : name);
map.put("proLabelId", proLabelId);
map.put("depLabelId", depLabelId);
......
......@@ -850,6 +850,17 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
private void fillGroupActivityHead(List<GroupActivity4AppletDTO> groupActivity4AppletList) {
if (!ListUtils.isEmpty(groupActivity4AppletList)) {
for (GroupActivity4AppletDTO groupActivity4AppletDTO : groupActivity4AppletList) {
//第三方群获取头像 end add by Pansy
Integer integer = 1;
if(null != groupActivity4AppletDTO.getGroupType() && groupActivity4AppletDTO.getGroupType().intValue() == integer.intValue()){
//头像列表从缓存里取
List<String> headUrlList = appletGroupSearchRecordBiz
.getHeadUrlList(3, 3l);
groupActivity4AppletDTO.setHeadUrlList(headUrlList);
}
//第三方群获取头像 end
String filterStr = StringUtilParent.replaceHtml(groupActivity4AppletDTO.getDesc());
String subStr = filterStr.length() > 60 ? filterStr.substring(0, 60) + "..." : filterStr;
groupActivity4AppletDTO.setCutDesc(subStr);
......@@ -1104,6 +1115,9 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
if (item.getServeId() != null && RightsServeTypeEnum.GROUP.name().equals(item.getServeType())
&& !groupIds.contains(item.getServeId())) {
// if (item.getGroup){
//
// }
groupIds.add(item.getServeId());
}
if (item.getServeId() != null && RightsServeTypeEnum.NEWS.name().equals(item.getServeType())
......
......@@ -9,6 +9,7 @@ import com.pcloud.book.applet.dto.AppletGroupManageDTO;
import com.pcloud.book.applet.dto.AppletGroupStatementDTO;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.biz.BookBiz;
import com.pcloud.book.book.dao.BookDao;
import com.pcloud.book.book.dao.BookLabelDao;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.book.book.entity.BookLabel;
......@@ -37,10 +38,13 @@ import com.pcloud.book.skill.dto.UpdateActivityShowStateDTO;
import com.pcloud.book.skill.entity.PcloudGroupActivity;
import com.pcloud.book.skill.entity.PcloudSkill;
import com.pcloud.book.skill.enums.SkillTypeEnum;
import com.pcloud.book.skill.facade.request.GroupActivityClassifyVO;
import com.pcloud.book.skill.facade.request.GroupActivityShowStateVO;
import com.pcloud.book.skill.facade.request.SaveGroupActivityRequestVO;
import com.pcloud.book.skill.facade.request.UpdateGroupActivityRequestVO;
import com.pcloud.book.skill.facade.response.QueryGroupActivityResponseVO;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam;
import com.pcloud.common.utils.ListUtils;
......@@ -55,6 +59,7 @@ import com.sdk.wxgroup.SendPicMessageVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
......@@ -73,7 +78,6 @@ import java.util.UUID;
@Service
public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
@Resource
private PcloudSkillDao pcloudSkillDao;
@Resource
......@@ -115,6 +119,12 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
@ParamLog("保存共读活动")
@Override
public void saveGroupActivity(SaveGroupActivityRequestVO vo) {
//校验编号是否重复
Integer count = pcloudGroupActivityDao.getCountByNumber(vo.getNumber());
if (count>0){
throw new BookBizException(BookBizException.PARAM_IS_ERROR,"参数有误,编号已存在!");
}
vo.checkParam();
PcloudGroupActivity entity = vo.getEntity();
Date now = new Date();
......@@ -131,10 +141,17 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
@Override
public void updateGroupActivity(UpdateGroupActivityRequestVO vo) {
vo.checkParam();
PcloudGroupActivity activity = pcloudGroupActivityDao.getById(vo.getId());
if (null == activity) {
throw new BookBizException(BookBizException.ID_NOT_EXIST, "共读活动不存在");
}
//校验编号是否重复
Integer count = pcloudGroupActivityDao.getCountByNumber(vo.getNumber());
if (count>0 && (!vo.getNumber().equals(activity.getNumber()))){
throw new BookBizException(BookBizException.PARAM_IS_ERROR,"参数有误,编号已存在!");
}
PcloudGroupActivity entity = vo.getEntity();
Date now = new Date();
entity.setUpdateUser(vo.getUserId());
......@@ -206,6 +223,7 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
Long secondClassify,
Long gradeLabelId,
Long subjectLabelId, Integer numPerPage, Integer currentPage) {
PageParam pageParam = new PageParam(currentPage, numPerPage);
BaseTempletClassify baseTempletClassify =new BaseTempletClassify();
baseTempletClassify.setFirstClassify(firstClassify);
......@@ -348,13 +366,17 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
@Override
public Map<Long, GroupActivity4AppletDTO> getByIds(List<Long> ids) {
if(ListUtils.isEmpty(ids)){
if (ListUtils.isEmpty(ids)) {
return new HashMap<>();
}
List<Long> activityGroupIds = new ArrayList<>();
List<Long> adviserGroupIds = rightsSettingItemDetailDao.getAdviserGroupIds(ids);
List<Long> activityGroupIds = rightsSettingItemDetailDao.getActivityGroupIds(ids);
if (!ListUtils.isEmpty(adviserGroupIds)) {
ids.removeAll(adviserGroupIds);
}
activityGroupIds = ids;
// 合并
return getGroupMap(adviserGroupIds, activityGroupIds);
return getGroupMap(adviserGroupIds, activityGroupIds);
}
private Map<Long, GroupActivity4AppletDTO> getGroupMap(List<Long> adviserGroupIds, List<Long> activityGroupIds) {
......@@ -420,12 +442,25 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
// 通过 classifyId 获取群二维码链接
String groupQrCode = groupQrcodeBiz.getChangeGroupQrCode(activity4AppletDTO.getClassifyId());
// 通过群二维码链接反查群ID
ClassifyQrcodeVO groupQrcodeInfo = groupQrcodeBiz.getGroupQrcodeInfo(groupQrCode, activity4AppletDTO.getClassifyId());
//头像、对话
List<String> headUrlList = appletGroupSearchRecordBiz.getHeadUrlList(groupQrcodeInfo.getUserNumber(), groupQrcodeInfo.getId());
activity4AppletDTO.setHeadUrlList(headUrlList);
List<AppletGroupStatementDTO> statementDTOS = appletGroupSearchRecordBiz.getStatementList(groupQrcodeInfo.getUserNumber(), headUrlList, groupQrcodeInfo.getId());
activity4AppletDTO.setStatementDTOList(statementDTOS);
if (activity4AppletDTO.getClassifyId() != null && activity4AppletDTO.getClassifyId() != 0){
ClassifyQrcodeVO groupQrcodeInfo = groupQrcodeBiz
.getGroupQrcodeInfo(groupQrCode, activity4AppletDTO.getClassifyId());
//头像、对话
List<String> headUrlList = appletGroupSearchRecordBiz
.getHeadUrlList(groupQrcodeInfo.getUserNumber(), groupQrcodeInfo.getId());
activity4AppletDTO.setHeadUrlList(headUrlList);
List<AppletGroupStatementDTO> statementDTOS = appletGroupSearchRecordBiz
.getStatementList(groupQrcodeInfo.getUserNumber(), headUrlList, groupQrcodeInfo.getId());
activity4AppletDTO.setStatementDTOList(statementDTOS);
}else{
//头像、对话
List<String> headUrlList = appletGroupSearchRecordBiz
.getHeadUrlList(3, 3L);
activity4AppletDTO.setHeadUrlList(headUrlList);
}
}
return list;
}
......@@ -466,9 +501,13 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
if(ListUtils.isEmpty(ids)){
return new HashMap<>();
}
List<Long> adviserIds = rightsNowItemDao.getAdviserGroupIds(ids);
List<Long> activityGroupIds = rightsNowItemDao.getActivityGroupIds(ids);
return getGroupMap(adviserIds, activityGroupIds);
List<Long> adviserGroupIds = rightsNowItemDao.getAdviserGroupIds(ids);
List<Long> activityGroupIds = new ArrayList<>();
if (!ListUtils.isEmpty(adviserGroupIds)) {
ids.removeAll(adviserGroupIds);
}
activityGroupIds = ids;
return getGroupMap(adviserGroupIds, activityGroupIds);
}
@Override
......
......@@ -3,12 +3,23 @@ package com.pcloud.book.skill.dao;
import com.pcloud.book.rightsSetting.entity.BaseTempletClassify;
import com.pcloud.book.skill.dto.GroupActivity4AppletDTO;
import com.pcloud.book.skill.entity.PcloudGroupActivity;
import com.pcloud.book.skill.facade.request.GroupActivityClassifyVO;
import com.pcloud.book.skill.facade.request.GroupActivityShowStateVO;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
import java.util.Map;
public interface PcloudGroupActivityDao extends BaseDao<PcloudGroupActivity> {
Integer getCountByNumber(String number);
void batchUpdateShowState(GroupActivityClassifyVO groupActivityClassifyVO);
void batchUpdateShowState(GroupActivityShowStateVO appletNewsShowStateVO);
void deleteByIds(List<Long> ids);
Map<Long, PcloudGroupActivity> mayByIds(List<Long> ids);
void updateByPrimaryKeySelective(PcloudGroupActivity entity);
......
......@@ -4,6 +4,8 @@ import com.pcloud.book.rightsSetting.entity.BaseTempletClassify;
import com.pcloud.book.skill.dao.PcloudGroupActivityDao;
import com.pcloud.book.skill.dto.GroupActivity4AppletDTO;
import com.pcloud.book.skill.entity.PcloudGroupActivity;
import com.pcloud.book.skill.facade.request.GroupActivityClassifyVO;
import com.pcloud.book.skill.facade.request.GroupActivityShowStateVO;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
......@@ -16,6 +18,35 @@ import java.util.Map;
public class PcloudGroupActivityDaoImpl extends BaseDaoImpl<PcloudGroupActivity> implements PcloudGroupActivityDao {
@Override
public Integer getCountByNumber(String number){
return getSessionTemplate().selectOne(getStatement("getCountByNumber"), number);
}
@Override
public void batchUpdateShowState(GroupActivityClassifyVO groupActivityClassifyVO) {
Map<String,Object> map = new HashMap<>();
map.put("ids", groupActivityClassifyVO.getIds());
map.put("firstClassify", groupActivityClassifyVO.getFirstClassify());
map.put("secondClassify", groupActivityClassifyVO.getSecondClassify());
map.put("gradeLabelId", groupActivityClassifyVO.getGradeLabelId());
map.put("subjectLabelId", groupActivityClassifyVO.getSubjectLabelId());
getSessionTemplate().update(getStatement("batchUpdateClassify"), map);
}
@Override
public void batchUpdateShowState(GroupActivityShowStateVO groupActivityShowStateVO){
Map<String,Object> map = new HashMap<>();
map.put("ids", groupActivityShowStateVO.getIds());
map.put("showState", groupActivityShowStateVO.getShowState());
getSessionTemplate().update(getStatement("batchUpdateShowState"), map);
}
@Override
public void deleteByIds(List<Long> ids){
getSessionTemplate().update(getStatement("deleteByIds"), ids);
}
@Override
public Map<Long, PcloudGroupActivity> mayByIds(List<Long> ids) {
return super.getSqlSession().selectMap(getStatement("mayByIds"), ids,"id");
}
......
......@@ -19,6 +19,9 @@ import lombok.Data;
@JsonInclude(Include.NON_NULL)
public class GroupActivity4AppletDTO implements Serializable {
@ApiModelProperty("群类型 1:第三方群")
private Integer groupType;
private Long id;
private Boolean openStatus;
......@@ -77,6 +80,6 @@ public class GroupActivity4AppletDTO implements Serializable {
@ApiModelProperty("关联社群书ID")
private Long relatedBookGroupId;
@ApiModelProperty("群类型")
private Integer groupType;
@ApiModelProperty("群链接")
private String groupLink;
}
......@@ -4,6 +4,13 @@ import com.pcloud.book.rightsSetting.entity.BaseTempletClassify;
public class PcloudGroupActivity extends BaseTempletClassify {
private static final long serialVersionUID = -2579070770051745966L;
private String number;
private String groupExtLink;
private Integer groupType;
private String name;
private String desc;
......@@ -133,4 +140,28 @@ public class PcloudGroupActivity extends BaseTempletClassify {
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getGroupExtLink() {
return groupExtLink;
}
public void setGroupExtLink(String groupExtLink) {
this.groupExtLink = groupExtLink;
}
public Integer getGroupType() {
return groupType;
}
public void setGroupType(Integer groupType) {
this.groupType = groupType;
}
}
\ No newline at end of file
......@@ -2,6 +2,8 @@ package com.pcloud.book.skill.facade;
import com.pcloud.book.skill.biz.PcloudGroupActivityBiz;
import com.pcloud.book.skill.dto.UpdateActivityShowStateDTO;
import com.pcloud.book.skill.facade.request.GroupActivityClassifyVO;
import com.pcloud.book.skill.facade.request.GroupActivityShowStateVO;
import com.pcloud.book.skill.facade.request.SaveGroupActivityRequestVO;
import com.pcloud.book.skill.facade.request.UpdateGroupActivityRequestVO;
import com.pcloud.book.skill.facade.response.QueryGroupActivityResponseVO;
......@@ -9,6 +11,7 @@ import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.SessionUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -18,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@RestController
......@@ -67,7 +71,7 @@ public class PcloudGroupActivityFacade {
@PostMapping("updateActivityShowState")
public ResponseDto<Void> updateActivityShowState(@RequestHeader("token") String token, @RequestBody UpdateActivityShowStateDTO showStateDTO) throws PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
pcloudGroupActivityBiz.updateActivityShowState(showStateDTO);
return new ResponseDto<>();
}
......
package com.pcloud.book.skill.facade.request;
import com.pcloud.book.rightsSetting.entity.BaseTempletClassify;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @ClassName com.pcloud.book.applet.vo.AppletNewsShowStateVO
* @Author ZhengYongQiang
* @Description 批量上下架
* @Date 2020/4/27 20:27
* @Version 1.0
**/
@Data
public class GroupActivityClassifyVO extends BaseTempletClassify {
@ApiModelProperty("修改的数据id")
private List<Long> ids;
}
package com.pcloud.book.skill.facade.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @ClassName com.pcloud.book.applet.vo.AppletNewsShowStateVO
* @Author ZhengYongQiang
* @Description 批量上下架
* @Date 2020/4/27 20:27
* @Version 1.0
**/
@Data
public class GroupActivityShowStateVO implements Serializable {
@ApiModelProperty("修改的数据id")
private List<Long> ids;
@ApiModelProperty("是否展示")
private Boolean showState;
}
......@@ -22,6 +22,15 @@ public class SaveGroupActivityRequestVO extends BaseTempletClassify {
private static final long serialVersionUID = -5370056714391879364L;
@ApiModelProperty("编号")
private String number;
@ApiModelProperty("第三方入群链接")
private String groupExtLink;
@ApiModelProperty("群类型 0官方群 1第三方入群指引")
private Integer groupType;
@ApiModelProperty("共度名称")
private String name;
......@@ -49,10 +58,17 @@ public class SaveGroupActivityRequestVO extends BaseTempletClassify {
public void checkParam() {
if (StringUtil.isBlank(this.getName())
|| null == this.getProLabelId() || null == this.getDepLabelId()
|| null == this.getJoinType() || null == this.getPurLabelId()
|| null == this.getBookGroupClassifyId()) {
|| null == this.getPurLabelId()
|| null == this.getGroupType()
|| null == this.getNumber()) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "请求参数缺失");
}
if("0".equals(this.getGroupType())){
if (null == this.getJoinType()
|| null == this.getBookGroupClassifyId()) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "请求参数缺失");
}
}
}
/**
......
......@@ -22,6 +22,15 @@ public class UpdateGroupActivityRequestVO extends BaseTempletClassify {
private static final long serialVersionUID = 3642060073527485455L;
@ApiModelProperty("编号")
private String number;
@ApiModelProperty("第三方入群链接")
private String groupExtLink;
@ApiModelProperty("群类型 0官方群 1第三方入群指引")
private Integer groupType;
@ApiModelProperty("主键")
private Long id;
......@@ -55,8 +64,10 @@ public class UpdateGroupActivityRequestVO extends BaseTempletClassify {
public void checkParam() {
if (null == id || StringUtil.isBlank(this.getName())
|| null == this.getProLabelId() || null == this.getDepLabelId()
|| null == this.getJoinType() || null == this.getPurLabelId()
|| null == this.getBookGroupClassifyId()) {
|| null == this.getPurLabelId()
|| null == this.getBookGroupClassifyId()
|| null == this.getJoinType()
|| null == this.getNumber()) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "请求参数缺失");
}
}
......
......@@ -6,6 +6,14 @@ import lombok.Data;
@Data
public class QueryGroupActivityResponseVO {
@ApiModelProperty("编号")
private String number;
@ApiModelProperty("群链接")
private String groupExtLink;
@ApiModelProperty("群类型")
private Integer groupType;
@ApiModelProperty("主键")
private Integer id;
......
......@@ -62,19 +62,23 @@
b.book_group_classify_id AS classifyId,
c.book_group_id bookGroupId,
c.price,
g.related_book_group_id relatedBookGroupId
g.related_book_group_id relatedBookGroupId,
b.group_type as groupType,
b.group_extLink as groupLink
FROM
applet_group_manage a
LEFT JOIN pcloud_group_activity b ON a.group_activity_id = b.id AND b.is_delete = 0
LEFT JOIN book_group_classify c ON b.book_group_classify_id = c.id AND c.is_delete = 0
left JOIN pcloud_group_activity b ON a.group_activity_id = b.id
left JOIN book_group_classify c ON b.book_group_classify_id = c.id
LEFT JOIN book_group g ON g.id = c.book_group_id
WHERE a.enable=1
<if test="recommend!=null">
AND a.recommend=#{recommend}
</if>
<if test="name!=null">
AND b.name like concat('%',#{name},'%')
</if>
AND b.is_delete = 0
AND (c.is_delete = 0 or c.is_delete is NULL)
<if test="recommend!=null">
AND a.recommend=#{recommend}
</if>
<if test="name!=null">
AND b.name like concat('%',#{name},'%')
</if>
ORDER BY a.id DESC
</select>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.pcloud.book.skill.dao.impl.PcloudGroupActivityDaoImpl" >
<resultMap id="BaseResultMap" type="com.pcloud.book.skill.entity.PcloudGroupActivity" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="description" property="desc" jdbcType="VARCHAR" />
<result column="join_type" property="joinType" jdbcType="INTEGER" />
<result column="group_pic" property="groupPic" jdbcType="VARCHAR" />
<result column="pro_label_id" property="proLabelId" jdbcType="INTEGER" />
<result column="dep_label_id" property="depLabelId" jdbcType="INTEGER" />
<result column="pur_label_id" property="purLabelId" jdbcType="INTEGER" />
<result column="book_group_classify_id" property="bookGroupClassifyId" jdbcType="INTEGER" />
<result column="group_name" property="groupName" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="create_user" property="createUser" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="update_user" property="updateUser" jdbcType="INTEGER" />
<result column="is_delete" property="isDelete" jdbcType="BIT" />
<result column="first_classify" property="firstClassify" jdbcType="BIGINT" />
<result column="second_classify" property="secondClassify" jdbcType="BIGINT" />
<result column="grade_label_id" property="gradeLabelId" jdbcType="BIGINT" />
<result column="subject_label_id" property="subjectLabelId" jdbcType="BIGINT" />
</resultMap>
<sql id="Base_Column_List" >
<resultMap id="BaseResultMap" type="com.pcloud.book.skill.entity.PcloudGroupActivity" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="number" property="number" jdbcType="VARCHAR" />
<result column="group_extLink" property="groupExtLink" jdbcType="VARCHAR" />
<result column="group_type" property="groupType" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="description" property="desc" jdbcType="VARCHAR" />
<result column="join_type" property="joinType" jdbcType="INTEGER" />
<result column="group_pic" property="groupPic" jdbcType="VARCHAR" />
<result column="pro_label_id" property="proLabelId" jdbcType="INTEGER" />
<result column="dep_label_id" property="depLabelId" jdbcType="INTEGER" />
<result column="pur_label_id" property="purLabelId" jdbcType="INTEGER" />
<result column="book_group_classify_id" property="bookGroupClassifyId" jdbcType="INTEGER" />
<result column="group_name" property="groupName" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="create_user" property="createUser" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="update_user" property="updateUser" jdbcType="INTEGER" />
<result column="is_delete" property="isDelete" jdbcType="BIT" />
<result column="first_classify" property="firstClassify" jdbcType="BIGINT" />
<result column="second_classify" property="secondClassify" jdbcType="BIGINT" />
<result column="grade_label_id" property="gradeLabelId" jdbcType="BIGINT" />
<result column="subject_label_id" property="subjectLabelId" jdbcType="BIGINT" />
</resultMap>
<sql id="Base_Column_List" >
id, name, description, join_type, group_pic, pro_label_id, dep_label_id,
pur_label_id, book_group_classify_id,
create_time, create_user, update_time, update_user, is_delete,
first_classify, second_classify, grade_label_id, subject_label_id
</sql>
<update id="deleteById" parameterType="long">
<update id="batchUpdateClassify" parameterType="map">
UPDATE pcloud_group_activity
SET
first_classify = #{firstClassify,jdbcType=BIGINT},
second_classify = #{secondClassify,jdbcType=BIGINT},
grade_label_id = #{gradeLabelId,jdbcType=BIGINT},
subject_label_id = #{subjectLabelId,jdbcType=BIGINT},
update_time=NOW()
WHERE id IN
<foreach collection="ids" item="item" separator="," open="(" close=")" >
${item}
</foreach>
</update>
<select id="getCountByNumber" parameterType="String" resultType="integer">
select count(1)
from pcloud_group_activity
where number=#{number}
</select>
<update id="batchUpdateShowState" parameterType="map">
UPDATE pcloud_group_activity
SET
is_show = #{showState},
update_time=NOW()
WHERE id IN
<foreach collection="ids" item="item" separator="," open="(" close=")" >
${item}
</foreach>
</update>
<update id="deleteByIds" parameterType="long">
update pcloud_group_activity set is_delete = 1 where id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
${item}
</foreach>
</update>
<update id="deleteById" parameterType="long">
update pcloud_group_activity set is_delete = 1 where id = #{id}
</update>
<select id="getGroupClassifyIds" resultType="long" parameterType="map">
select book_group_classify_id from pcloud_group_activity
where
is_delete = 0 and is_show = 1
<if test="firstClassify != null">
and first_classify = #{firstClassify}
</if>
<if test="secondClassify != null">
and second_classify = #{secondClassify}
</if>
<if test="gradeLabelId != null">
and grade_label_id = #{gradeLabelId}
</if>
<if test="subjectLabelId != null">
and subject_label_id = #{subjectLabelId}
</if>
is_delete = 0 and is_show = 1
<if test="firstClassify != null">
and first_classify = #{firstClassify}
</if>
<if test="secondClassify != null">
and second_classify = #{secondClassify}
</if>
<if test="gradeLabelId != null">
and grade_label_id = #{gradeLabelId}
</if>
<if test="subjectLabelId != null">
and subject_label_id = #{subjectLabelId}
</if>
order by id desc
</select>
<select id="queryGroupActivity" resultType="com.pcloud.book.skill.facade.response.QueryGroupActivityResponseVO" parameterType="map" >
SELECT
<select id="queryGroupActivity" resultType="com.pcloud.book.skill.facade.response.QueryGroupActivityResponseVO" parameterType="map" >
SELECT
a.id,
a.`name`,
a.description as `desc`,
......@@ -67,85 +110,140 @@
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId,
a.number,
a.group_extLink as groupExtLink,
a.group_type as groupType,
is_show AS isShow
FROM
FROM
pcloud_group_activity a left join book_group_classify b on a.book_group_classify_id = b.id
WHERE
WHERE
a.is_delete = 0
<if test="proLabelId != null">
and a.pro_label_id = #{proLabelId}
and a.pro_label_id = #{proLabelId}
</if>
<if test="depLabelId != null">
and a.dep_label_id = #{depLabelId}
and a.dep_label_id = #{depLabelId}
</if>
<if test="purLabelId != null">
and a.pur_label_id = #{purLabelId}
and a.pur_label_id = #{purLabelId}
</if>
<if test="name != null">
and a.name like CONCAT('%', #{name},'%')
and a.name like CONCAT('%', #{name},'%')
</if>
<if test="joinType != null">
and a.join_type = #{joinType}
and a.join_type = #{joinType}
</if>
<if test="firstClassify != null">
and a.first_classify = #{firstClassify}
and a.first_classify = #{firstClassify}
</if>
<if test="secondClassify != null">
and a.second_classify = #{secondClassify}
and a.second_classify = #{secondClassify}
</if>
<if test="gradeLabelId != null">
and a.grade_label_id = #{gradeLabelId}
and a.grade_label_id = #{gradeLabelId}
</if>
<if test="subjectLabelId != null">
and a.subject_label_id = #{subjectLabelId}
and a.subject_label_id = #{subjectLabelId}
</if>
order by a.id desc
</select>
order by a.id desc
</select>
<select id="getTishBookSchoolList" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO" parameterType="map" >
SELECT
a.id,
a.id groupActivityId,
a.`name`,
a.description as `desc`,
a.join_type AS joinType,
c.classify AS classifyName,
a.book_group_classify_id classifyId,
c.book_group_id bookGroupId,
a.first_classify AS firstClassify,
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId,
d.related_book_group_id AS relatedBookGroupId,
c.id AS classifyId,
c.book_group_id AS bookGroupId,
d.related_book_group_id AS relatedBookGroupId,
c.price AS price
FROM
pcloud_group_activity a
LEFT JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
LEFT JOIN book_group_qrcode b ON b.classify_id = c.id AND b.is_delete = 0
LEFT JOIN book_group d ON c.book_group_id = d.id
WHERE
a.is_delete = 0 AND a.is_show = 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>
GROUP BY a.id
ORDER BY a.id DESC
LIMIT #{limit}
</select>
<select id="listGroupActivity" resultType="com.pcloud.book.skill.facade.response.ListGroupActivityResponseVO" parameterType="map" >
SELECT
a.id,
a.name,
a.description,
a.number,
a.group_type groupType,
a.group_extLink groupExtLink,
b.id classifyId,
b.classify classifyName,
b.classify_introduce AS classifyIntroduce,
b.book_group_id bookGroupId,
b.price,
count(c.classify_id) AS groupCount
FROM
pcloud_group_activity a
LEFT JOIN book_group_classify b ON a.book_group_classify_id = b.id AND b.is_delete = 0
LEFT JOIN book_group_qrcode c ON b.id = c.classify_id AND c.is_delete = 0
LEFT JOIN book_group d ON b.book_group_id = d.id
<where>
<if test="name!=null or bookIds != null and bookIds.size()>0">
<trim prefix="(" suffix=")" prefixOverrides="OR">
<if test="name!=null">
a.name LIKE CONCAT("%",#{name},"%")
</if>
<if test="bookIds.size()>0">
OR b.book_id IN
<foreach collection="bookIds" open="(" separator="," close=")" index="index" item="item">
${item}
</foreach>
</if>
</trim>
</if>
<if test="proLabelId!=null">
AND c.pro_label_id = #{proLabelId}
</if>
<if test="depLabelId!=null">
AND c.dep_label_id = #{depLabelId}
</if>
<if test="joinType != null">
AND a.join_type = #{joinType}
</if>
AND a.is_delete = 0
</where>
GROUP BY a.id
ORDER BY a.create_time DESC
</select>
<select id="getById" resultMap="BaseResultMap" parameterType="long" >
<select id="getTishBookSchoolList" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO" parameterType="map" >
SELECT
a.id,
a.id groupActivityId,
a.`name`,
a.description as `desc`,
a.join_type AS joinType,
c.classify AS classifyName,
a.book_group_classify_id classifyId,
c.book_group_id bookGroupId,
a.first_classify AS firstClassify,
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId,
d.related_book_group_id AS relatedBookGroupId,
c.id AS classifyId,
c.book_group_id AS bookGroupId,
d.related_book_group_id AS relatedBookGroupId,
c.price AS price,
a.group_type as grouType,
group_extLink as groupLink
FROM
pcloud_group_activity a
LEFT JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
LEFT JOIN book_group_qrcode b ON b.classify_id = c.id AND b.is_delete = 0
LEFT JOIN book_group d ON c.book_group_id = d.id
WHERE
a.is_delete = 0 AND a.is_show = 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>
GROUP BY a.id
ORDER BY a.id DESC
LIMIT #{limit}
</select>
<select id="getById" resultMap="BaseResultMap" parameterType="long" >
SELECT
a.id,
a.`name`,
......@@ -165,43 +263,46 @@
a.second_classify,
a.grade_label_id,
a.subject_label_id,
a.is_show
a.is_show,
a.number,
a.group_extLink,
a.group_type
FROM pcloud_group_activity a LEFT JOIN book_group_classify b ON a.book_group_classify_id = b.id
WHERE a.id = #{id,jdbcType=INTEGER}
</select>
<!-- 立享权益加入 编辑端群 add by pansy 2020/7/2 -->
<select id="getGroupClassifyByIds" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO">
SELECT
c.id,
a.id groupActivityId,
c.classify_introduce AS `desc`,
a.join_type AS joinType,
c.classify AS name,
b.user_number userNumber,
c.id classifyId,
c.book_group_id bookGroupId,
a.first_classify AS firstClassify,
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId
FROM
book_group_classify c
LEFT JOIN pcloud_group_activity a ON a.book_group_classify_id = c.id
LEFT JOIN book_group_qrcode b on b.classify_id = c.id
where
c.is_delete = 0 and b.is_delete = 0
and
c.id IN
<foreach collection="list" item="item" open="(" close=")" separator=",">
${item}
</foreach>
GROUP BY c.id
ORDER BY c.id DESC
SELECT
c.id,
a.id groupActivityId,
c.classify_introduce AS `desc`,
a.join_type AS joinType,
c.classify AS name,
b.user_number userNumber,
c.id classifyId,
c.book_group_id bookGroupId,
a.first_classify AS firstClassify,
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId
FROM
book_group_classify c
LEFT JOIN pcloud_group_activity a ON a.book_group_classify_id = c.id
LEFT JOIN book_group_qrcode b on b.classify_id = c.id
where
c.is_delete = 0 and b.is_delete = 0
and
c.id IN
<foreach collection="list" item="item" open="(" close=")" separator=",">
${item}
</foreach>
GROUP BY c.id
ORDER BY c.id DESC
</select>
<select id="getByIds" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO">
SELECT
<select id="getByIds" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO">
SELECT
a.id,
a.id groupActivityId,
a.`name`,
......@@ -216,127 +317,174 @@
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId,
c.price AS price,
d.related_book_group_id relatedBookGroupId
FROM
pcloud_group_activity a
INNER JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
INNER JOIN book_group_qrcode b on b.classify_id = c.id AND b.is_delete = 0
INNER JOIN book_group d ON c.book_group_id = d.id
WHERE
a.is_delete = 0
AND a.id IN
<foreach collection="list" item="item" open="(" close=")" separator=",">
${item}
</foreach>
GROUP BY a.id
ORDER BY a.id DESC
</select>
d.related_book_group_id relatedBookGroupId,
a.group_type as groupType,
a.group_extLink groupLink
FROM
pcloud_group_activity a
left JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
left JOIN book_group_qrcode b on b.classify_id = c.id AND b.is_delete = 0
left JOIN book_group d ON c.book_group_id = d.id
WHERE
a.is_delete = 0
<if test="isShow != null">
AND a.is_show = #{isShow}
</if>
AND a.id IN
<foreach collection="list" item="item" open="(" close=")" separator=",">
${item}
</foreach>
GROUP BY a.id
ORDER BY a.id DESC
</select>
<select id="getGroupActivity4Applet" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO" parameterType="map">
SELECT
a.id,
a.id groupActivityId,
a.`name`,
a.description as `desc`,
a.join_type AS joinType,
a.group_pic AS groupPic,
b.group_name AS groupName,
b.user_number userNumber,
b.classify_id classifyId,
c.book_group_id bookGroupId,
a.first_classify AS firstClassify,
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId
FROM
pcloud_group_activity a
INNER JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
INNER JOIN book_group_qrcode b on c.id = b.classify_id AND b.is_delete = 0
WHERE
a.is_delete = 0 AND a.is_show = 1
<if test="firstClassify != null">
<!--根据id获取第三方群信息 -->
<select id="getThridPartByIds" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO">
SELECT
a.id,
a.id groupActivityId,
a.`name`,
a.description as `desc`,
a.join_type AS joinType,
a.`name` AS groupName,
null userNumber,
null classifyId,
null bookGroupId,
a.first_classify AS firstClassify,
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId,
null AS price,
null relatedBookGroupId,
a.group_type as groupType,
a.group_extLink as groupLink
FROM
pcloud_group_activity a
WHERE
a.is_delete = 0 AND a.is_show = 1
and group_type ='1'
AND a.id IN
<foreach collection="list" item="item" open="(" close=")" separator=",">
${item}
</foreach>
GROUP BY a.id
ORDER BY a.id DESC
</select>
<select id="getGroupActivity4Applet" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO" parameterType="map">
SELECT
a.id,
a.id groupActivityId,
a.`name`,
a.description as `desc`,
a.join_type AS joinType,
a.group_pic AS groupPic,
b.group_name AS groupName,
b.user_number userNumber,
b.classify_id classifyId,
c.book_group_id bookGroupId,
a.first_classify AS firstClassify,
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId
FROM
pcloud_group_activity a
INNER JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
INNER JOIN book_group_qrcode b on c.id = b.classify_id AND b.is_delete = 0
WHERE
a.is_delete = 0 AND a.is_show = 1
<if test="firstClassify != null">
and a.first_classify = #{firstClassify}
</if>
<if test="secondClassify != null">
</if>
<if test="secondClassify != null">
and a.second_classify = #{secondClassify}
</if>
<if test="gradeLabelId != null">
</if>
<if test="gradeLabelId != null">
and a.grade_label_id = #{gradeLabelId}
</if>
<if test="subjectLabelId != null">
</if>
<if test="subjectLabelId != null">
and a.subject_label_id = #{subjectLabelId}
</if>
GROUP BY a.id
ORDER BY a.id DESC
LIMIT 1
</select>
</if>
GROUP BY a.id
ORDER BY a.id DESC
LIMIT 1
</select>
<insert id="insert" parameterType="com.pcloud.book.skill.entity.PcloudGroupActivity" >
<insert id="insert" parameterType="com.pcloud.book.skill.entity.PcloudGroupActivity" >
insert into pcloud_group_activity (id, name,
description, join_type, group_pic, pro_label_id, dep_label_id,
pur_label_id, book_group_classify_id, create_time,
create_user, update_time, update_user,
is_delete, first_classify, second_classify, grade_label_id, subject_label_id)
create_user, update_time, update_user,
is_delete, first_classify, second_classify, grade_label_id, subject_label_id,number,group_type,group_extLink)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
#{desc,jdbcType=VARCHAR}, #{joinType,jdbcType=INTEGER}, #{groupPic,jdbcType=VARCHAR}, #{proLabelId,jdbcType=INTEGER}, #{depLabelId,jdbcType=INTEGER},
#{purLabelId,jdbcType=INTEGER}, #{bookGroupClassifyId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{createUser,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER},
#{createUser,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER},
#{isDelete,jdbcType=BIT}, #{firstClassify,jdbcType=BIGINT}, #{secondClassify,jdbcType=BIGINT},
#{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT})
#{gradeLabelId,jdbcType=BIGINT}, #{subjectLabelId,jdbcType=BIGINT}, #{number,jdbcType=BIGINT}, #{groupType,jdbcType=BIGINT}, #{groupExtLink,jdbcType=VARCHAR})
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.pcloud.book.skill.entity.PcloudGroupActivity" >
update pcloud_group_activity
<set >
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="desc != null" >
description = #{desc,jdbcType=VARCHAR},
</if>
<if test="joinType != null" >
join_type = #{joinType,jdbcType=INTEGER},
</if>
<if test="groupPic != null" >
group_pic = #{groupPic,jdbcType=VARCHAR},
</if>
<if test="proLabelId != null" >
pro_label_id = #{proLabelId,jdbcType=INTEGER},
</if>
<if test="depLabelId != null" >
dep_label_id = #{depLabelId,jdbcType=INTEGER},
</if>
<if test="purLabelId != null" >
pur_label_id = #{purLabelId,jdbcType=INTEGER},
</if>
<if test="bookGroupClassifyId != null" >
book_group_classify_id = #{bookGroupClassifyId,jdbcType=INTEGER},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createUser != null" >
create_user = #{createUser,jdbcType=INTEGER},
</if>
<if test="updateTime != null" >
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateUser != null" >
update_user = #{updateUser,jdbcType=INTEGER},
</if>
<if test="isDelete != null" >
is_delete = #{isDelete,jdbcType=BIT},
</if>
<if test="isShow != null" >
is_show = #{isShow,jdbcType=BIT},
</if>
first_classify = #{firstClassify,jdbcType=BIGINT},
second_classify = #{secondClassify,jdbcType=BIGINT},
grade_label_id = #{gradeLabelId,jdbcType=BIGINT},
subject_label_id = #{subjectLabelId,jdbcType=BIGINT},
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="update" parameterType="com.pcloud.book.skill.entity.PcloudGroupActivity" >
<update id="updateByPrimaryKeySelective" parameterType="com.pcloud.book.skill.entity.PcloudGroupActivity" >
update pcloud_group_activity
<set >
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="desc != null" >
description = #{desc,jdbcType=VARCHAR},
</if>
<if test="joinType != null" >
join_type = #{joinType,jdbcType=INTEGER},
</if>
<if test="groupPic != null" >
group_pic = #{groupPic,jdbcType=VARCHAR},
</if>
<if test="proLabelId != null" >
pro_label_id = #{proLabelId,jdbcType=INTEGER},
</if>
<if test="depLabelId != null" >
dep_label_id = #{depLabelId,jdbcType=INTEGER},
</if>
<if test="purLabelId != null" >
pur_label_id = #{purLabelId,jdbcType=INTEGER},
</if>
<if test="bookGroupClassifyId != null" >
book_group_classify_id = #{bookGroupClassifyId,jdbcType=INTEGER},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createUser != null" >
create_user = #{createUser,jdbcType=INTEGER},
</if>
<if test="updateTime != null" >
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateUser != null" >
update_user = #{updateUser,jdbcType=INTEGER},
</if>
<if test="isDelete != null" >
is_delete = #{isDelete,jdbcType=BIT},
</if>
<if test="isShow != null" >
is_show = #{isShow,jdbcType=BIT},
</if>
<if test="number !=null">
number = #{number,jdbcType=VARCHAR},
</if>
<if test="groupExtLink !=null">
group_extLink = #{groupExtLink,jdbcType=VARCHAR},
</if>
<if test="groupType !=null">
group_type = #{groupType,jdbcType=BIT},
</if>
first_classify = #{firstClassify,jdbcType=BIGINT},
second_classify = #{secondClassify,jdbcType=BIGINT},
grade_label_id = #{gradeLabelId,jdbcType=BIGINT},
subject_label_id = #{subjectLabelId,jdbcType=BIGINT},
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="update" parameterType="com.pcloud.book.skill.entity.PcloudGroupActivity" >
update pcloud_group_activity
set name = #{name,jdbcType=VARCHAR},
description = #{desc,jdbcType=VARCHAR},
......@@ -359,17 +507,17 @@
where id = #{id,jdbcType=INTEGER}
</update>
<select id="mayByIds" parameterType="long" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from pcloud_group_activity
where id in
<foreach collection="list" index="i" item="item" open="(" separator="," close=")">
${item}
</foreach>
</select>
<select id="mayByIds" parameterType="long" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from pcloud_group_activity
where id in
<foreach collection="list" index="i" item="item" open="(" separator="," close=")">
${item}
</foreach>
</select>
<select id="getGroupListByBookTemplet" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletGroupManageDTO">
SELECT
<select id="getGroupListByBookTemplet" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletGroupManageDTO">
SELECT
a.id,
a.id groupActivityId,
a.`name`,
......@@ -385,28 +533,60 @@
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId,
c.price,
g.related_book_group_id relatedBookGroupId
FROM
g.related_book_group_id relatedBookGroupId,
a.group_type as groupType,
a.group_extLink groupLink
FROM
pcloud_group_activity a
INNER JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
INNER JOIN book_group_qrcode b on c.id = b.classify_id AND b.is_delete = 0
LEFT JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
LEFT JOIN book_group_qrcode b on c.id = b.classify_id AND b.is_delete = 0
LEFT JOIN book_group g ON g.id = c.book_group_id
WHERE
WHERE
a.is_delete = 0 AND a.is_show = 1
<if test="firstClassify != null">
and a.first_classify = #{firstClassify}
and a.first_classify = #{firstClassify}
</if>
<if test="secondClassify != null">
and a.second_classify = #{secondClassify}
and a.second_classify = #{secondClassify}
</if>
<if test="gradeLabelId != null">
and a.grade_label_id = #{gradeLabelId}
and a.grade_label_id = #{gradeLabelId}
</if>
<if test="subjectLabelId != null">
and a.subject_label_id = #{subjectLabelId}
and a.subject_label_id = #{subjectLabelId}
</if>
GROUP BY a.id
ORDER BY a.id DESC
GROUP BY a.id
ORDER BY a.id DESC
</select>
<select id="getLocalGroup" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletGroupManageDTO">
SELECT
a.id,
a.id groupActivityId,
a.`name`,
a.description as `desc`,
a.join_type AS joinType,
a.group_pic AS groupPic,
c.classify AS classifyName,
b.user_number userNumber,
b.classify_id classifyId,
c.book_group_id bookGroupId,
a.first_classify AS firstClassify,
a.second_classify AS secondClassify,
a.grade_label_id AS gradeLabelId,
a.subject_label_id AS subjectLabelId,
c.price,
g.related_book_group_id relatedBookGroupId
FROM
pcloud_group_activity a
INNER JOIN book_group_classify c ON a.book_group_classify_id = c.id AND c.is_delete = 0
INNER JOIN book_group_qrcode b on c.id = b.classify_id AND b.is_delete = 0
LEFT JOIN book_group g ON g.id = c.book_group_id
WHERE
a.is_delete = 0 AND a.is_show = 1
and c.city_code = #{cityCode}
GROUP BY a.id
ORDER BY a.id DESC
</select>
</mapper>
\ No newline at end of file
package test;
import com.pcloud.book.BookApplication;
import com.pcloud.book.adnews.biz.AdNewsBiz;
import com.pcloud.book.book.biz.BookKeywordWarehouseBiz;
import com.pcloud.book.book.constant.BookConstant;
import com.pcloud.book.book.vo.BookKeywordDetailVO;
......
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