Commit 9955a5b1 by 郑永强

【1002925】书刊权益配置支持独立选择配置资讯功能

parent 16c932de
...@@ -13,6 +13,7 @@ import com.pcloud.book.applet.vo.AppletNewsShowStateVO; ...@@ -13,6 +13,7 @@ import com.pcloud.book.applet.vo.AppletNewsShowStateVO;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 小程序资讯 * 小程序资讯
...@@ -74,7 +75,7 @@ public interface AppletNewsBiz { ...@@ -74,7 +75,7 @@ public interface AppletNewsBiz {
*/ */
PageBeanNew<AppletNewsDTO> listAppletNews(Integer currentPage, Integer numPerPage, String name, PageBeanNew<AppletNewsDTO> listAppletNews(Integer currentPage, Integer numPerPage, String name,
Long firstClassify,Long secondClassify,Long gradeLabelId, Long firstClassify,Long secondClassify,Long gradeLabelId,
Long subjectLabelId,Long rightsClassifyId,String source, Long newsClassifyId); Long subjectLabelId,Long rightsClassifyId,String source,Integer showState, Long newsClassifyId);
/** /**
* 获取所有资讯栏目 * 获取所有资讯栏目
...@@ -202,4 +203,11 @@ public interface AppletNewsBiz { ...@@ -202,4 +203,11 @@ public interface AppletNewsBiz {
PageBeanNew<AppletNewsDTO> listAppletNews4Analysis(Integer currentPage, Integer numPerPage, String name, PageBeanNew<AppletNewsDTO> listAppletNews4Analysis(Integer currentPage, Integer numPerPage, String name,
Long firstClassify,Long secondClassify,Long gradeLabelId, Long firstClassify,Long secondClassify,Long gradeLabelId,
Long subjectLabelId,Integer linkOnly,Long rightsClassifyId); Long subjectLabelId,Integer linkOnly,Long rightsClassifyId);
/**
*
* @param appletNewsId
* @return
*/
Map<Long, AppletNewsDTO> getByIds(List<Long> appletNewsId);
} }
...@@ -148,11 +148,12 @@ public class AppletNewsBizImpl implements AppletNewsBiz { ...@@ -148,11 +148,12 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
@Override @Override
public PageBeanNew<AppletNewsDTO> listAppletNews(Integer currentPage, Integer numPerPage, String name, public PageBeanNew<AppletNewsDTO> listAppletNews(Integer currentPage, Integer numPerPage, String name,
Long firstClassify,Long secondClassify,Long gradeLabelId, Long firstClassify,Long secondClassify,Long gradeLabelId,
Long subjectLabelId,Long rightsClassifyId,String source, Long newsClassifyId) { Long subjectLabelId,Long rightsClassifyId,String source,Integer showState, Long newsClassifyId) {
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("name", name); paramMap.put("name", name);
paramMap.put("rightsClassifyId", rightsClassifyId); paramMap.put("rightsClassifyId", rightsClassifyId);
paramMap.put("source", source); paramMap.put("source", source);
paramMap.put("showState", showState);
paramMap.put("newsClassifyId", newsClassifyId); paramMap.put("newsClassifyId", newsClassifyId);
//处理分类 //处理分类
if (null!=firstClassify){ if (null!=firstClassify){
...@@ -525,6 +526,14 @@ public class AppletNewsBizImpl implements AppletNewsBiz { ...@@ -525,6 +526,14 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
} }
@Override @Override
public Map<Long, AppletNewsDTO> getByIds(List<Long> appletNewsIds) {
if(ListUtils.isEmpty(appletNewsIds)){
new HashMap<>();
}
return appletNewsDao.getByIds(appletNewsIds);
}
@Override
public void addUserNewsClassify(List<Long> newsClassifyIds, Long wechatUserId) { public void addUserNewsClassify(List<Long> newsClassifyIds, Long wechatUserId) {
if (null == wechatUserId){ if (null == wechatUserId){
return; return;
......
...@@ -6,6 +6,7 @@ import com.pcloud.book.applet.vo.AppletNewsClassifyVO; ...@@ -6,6 +6,7 @@ import com.pcloud.book.applet.vo.AppletNewsClassifyVO;
import com.pcloud.book.applet.vo.AppletNewsShowStateVO; import com.pcloud.book.applet.vo.AppletNewsShowStateVO;
import com.pcloud.common.core.dao.BaseDao; import com.pcloud.common.core.dao.BaseDao;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
...@@ -81,4 +82,6 @@ public interface AppletNewsDao extends BaseDao<AppletNews> { ...@@ -81,4 +82,6 @@ public interface AppletNewsDao extends BaseDao<AppletNews> {
* * @param null * * @param null
*/ */
Boolean urlNumberExist(String jumpUrl, String urlNumber, Long id); Boolean urlNumberExist(String jumpUrl, String urlNumber, Long id);
Map<Long, AppletNewsDTO> getByIds(List<Long> appletNewsIds);
} }
...@@ -117,4 +117,9 @@ public class AppletNewsDaoImpl extends BaseDaoImpl<AppletNews> implements Applet ...@@ -117,4 +117,9 @@ public class AppletNewsDaoImpl extends BaseDaoImpl<AppletNews> implements Applet
return getSessionTemplate().selectOne(getStatement("urlNumberExist"), map); return getSessionTemplate().selectOne(getStatement("urlNumberExist"), map);
} }
@Override
public Map<Long, AppletNewsDTO> getByIds(List<Long> list) {
return this.getSqlSession().selectMap(getStatement("getByIds"), list, "id");
}
} }
...@@ -452,6 +452,7 @@ public class AppletHomeFacade { ...@@ -452,6 +452,7 @@ public class AppletHomeFacade {
@RequestParam(value = "subjectLabelId", required = false) @ApiParam("科目标签")Long subjectLabelId, @RequestParam(value = "subjectLabelId", required = false) @ApiParam("科目标签")Long subjectLabelId,
@RequestParam(value = "rightsClassifyId", required = false) @ApiParam("权益分类") Long rightsClassifyId, @RequestParam(value = "rightsClassifyId", required = false) @ApiParam("权益分类") Long rightsClassifyId,
@RequestParam(value = "source", required = false) @ApiParam("来源") String source, @RequestParam(value = "source", required = false) @ApiParam("来源") String source,
@RequestParam(value = "showState", required = false) @ApiParam("上架") Integer showState,
@RequestParam(value = "newsClassifyId", required = false) @ApiParam("资讯栏目id") Long newsClassifyId @RequestParam(value = "newsClassifyId", required = false) @ApiParam("资讯栏目id") Long newsClassifyId
) throws PermissionException { ) throws PermissionException {
SessionUtil.getInfoToken4Redis(token); SessionUtil.getInfoToken4Redis(token);
...@@ -459,7 +460,7 @@ public class AppletHomeFacade { ...@@ -459,7 +460,7 @@ public class AppletHomeFacade {
throw new BookBizException(BookBizException.PARAM_IS_NULL,"缺少分页参数"); throw new BookBizException(BookBizException.PARAM_IS_NULL,"缺少分页参数");
} }
return new ResponseDto<>(appletNewsBiz.listAppletNews(currentPage, numPerPage, name, firstClassify,secondClassify,gradeLabelId, return new ResponseDto<>(appletNewsBiz.listAppletNews(currentPage, numPerPage, name, firstClassify,secondClassify,gradeLabelId,
subjectLabelId,rightsClassifyId,source,newsClassifyId)); subjectLabelId,rightsClassifyId,source,showState,newsClassifyId));
} }
@ApiOperation("客户端资讯列表") @ApiOperation("客户端资讯列表")
......
...@@ -52,4 +52,6 @@ public interface CustomPlanBiz { ...@@ -52,4 +52,6 @@ public interface CustomPlanBiz {
List<PlanReadTypeDto> getPlanReadTypesByBookId(Long bookId); List<PlanReadTypeDto> getPlanReadTypesByBookId(Long bookId);
List<CustomPlan> listByCustomPlanIds(List<Long> customPlanIds); List<CustomPlan> listByCustomPlanIds(List<Long> customPlanIds);
Map<Long, CustomPlan> getByIds(List<Long> planIds);
} }
...@@ -72,6 +72,7 @@ import java.util.Arrays; ...@@ -72,6 +72,7 @@ import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.dcg.coolq.sdk.CoolQSDK.sendPrivateMsg; import static com.dcg.coolq.sdk.CoolQSDK.sendPrivateMsg;
...@@ -542,4 +543,13 @@ public class CustomPlanBizImpl implements CustomPlanBiz { ...@@ -542,4 +543,13 @@ public class CustomPlanBizImpl implements CustomPlanBiz {
public List<CustomPlan> listByCustomPlanIds(List<Long> customPlanIds) { public List<CustomPlan> listByCustomPlanIds(List<Long> customPlanIds) {
return customPlanMapper.getCustomPlanByIds(customPlanIds); return customPlanMapper.getCustomPlanByIds(customPlanIds);
} }
@Override
public Map<Long, CustomPlan> getByIds(List<Long> planIds) {
List<CustomPlan> customPlan = customPlanMapper.getCustomPlanByIds(planIds);
if(ListUtils.isEmpty(customPlan)){
return new HashMap<>();
}
return customPlan.stream().collect(Collectors.toMap(x -> x.getId().longValue(), Function.identity()));
}
} }
package com.pcloud.book.rightsSetting.dao;
import com.pcloud.book.rightsSetting.entity.RightsSettingItemDetail;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
/**
* (RightsSettingItemDetail)表数据库访问层
*
* @author makejava
* @since 2020-05-18 22:28:12
*/
public interface RightsSettingItemDetailDao extends BaseDao<RightsSettingItemDetail> {
void deleteByItemIds(List<Long> rightsSettingItemIds);
List<RightsSettingItemDetail> getByItemIds(List<Long> itemIds);
}
\ No newline at end of file
package com.pcloud.book.rightsSetting.dao.impl;
import com.pcloud.book.rightsSetting.entity.RightsSettingItemDetail;
import com.pcloud.book.rightsSetting.dao.RightsSettingItemDetailDao;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* (RightsSettingItemDetail)表数据库访问层
*
* @author makejava
* @since 2020-05-18 22:28:12
*/
@Repository("rightsSettingItemDetailDaoImpl")
public class RightsSettingItemDetailDaoImpl extends BaseDaoImpl<RightsSettingItemDetail> implements RightsSettingItemDetailDao {
@Override
public void deleteByItemIds(List<Long> list) {
this.getSqlSession().delete(getStatement("deleteByItemIds"), list);
}
@Override
public List<RightsSettingItemDetail> getByItemIds(List<Long> list) {
return this.getSqlSession().selectList(getStatement("getByItemIds"), list);
}
}
\ No newline at end of file
package com.pcloud.book.rightsSetting.entity; package com.pcloud.book.rightsSetting.entity;
import com.pcloud.book.skill.dto.GroupActivity4AppletDTO;
import com.pcloud.common.entity.BaseEntity; import com.pcloud.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -68,6 +69,17 @@ public class RightsNowItem extends BaseEntity { ...@@ -68,6 +69,17 @@ public class RightsNowItem extends BaseEntity {
private Integer useType; private Integer useType;
@ApiModelProperty("兑换地址") @ApiModelProperty("兑换地址")
private String exchangeAddress; private String exchangeAddress;
@ApiModelProperty("社群名称")
private String groupName;
@ApiModelProperty("社群简介")
private String groupDesc;
@ApiModelProperty("社群二维码")
private String groupQrCode;
@ApiModelProperty("社群信息")
private GroupActivity4AppletDTO groupActivity4AppletDTO;
@ApiModelProperty("资讯名称")
private String newsName;
@ApiModelProperty("资讯图")
private String newsSource;
} }
...@@ -48,6 +48,10 @@ public class RightsSettingItem extends BaseEntity { ...@@ -48,6 +48,10 @@ public class RightsSettingItem extends BaseEntity {
timezone = "GMT+8" timezone = "GMT+8"
) )
private Date createTime; private Date createTime;
/**
* 开启
*/
private Integer openState;
/** /**
* 权益标题 * 权益标题
...@@ -79,6 +83,8 @@ public class RightsSettingItem extends BaseEntity { ...@@ -79,6 +83,8 @@ public class RightsSettingItem extends BaseEntity {
@ApiModelProperty("社群") @ApiModelProperty("社群")
private List<GroupActivity4AppletDTO> groupActivity4AppletList; private List<GroupActivity4AppletDTO> groupActivity4AppletList;
@ApiModelProperty("服务类型;GROUP、NEWS、PLAN")
private String serveType;
/** /**
* 轻松阅读 * 轻松阅读
*/ */
......
package com.pcloud.book.rightsSetting.entity;
import java.util.Date;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pcloud.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* (RightsSettingItemDetail)实体类
*
* @author makejava
* @since 2020-05-18 22:28:12
*/
@Data
public class RightsSettingItemDetail extends BaseEntity {
private static final long serialVersionUID = 861375509249616760L;
@ApiModelProperty("即享权益项id")
private Long id;
@ApiModelProperty("权益子项id")
private Long rightsSettingItemId;
@ApiModelProperty("社群或资讯id")
private Long serveId;
@ApiModelProperty("社群、资讯")
private String serveType;
@ApiModelProperty("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
}
\ No newline at end of file
package com.pcloud.book.rightsSetting.entity; package com.pcloud.book.rightsSetting.entity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import lombok.Data; import lombok.Data;
@Data @Data
public class RightsSettingTitle { public class RightsSettingTitle implements Serializable {
private Long id; private Long id;
private Long rightsSettingId; private Long rightsSettingId;
...@@ -31,6 +33,8 @@ public class RightsSettingTitle { ...@@ -31,6 +33,8 @@ public class RightsSettingTitle {
) )
private Date updateTime; private Date updateTime;
private String serveType;
/** /**
* 列表 * 列表
*/ */
......
package com.pcloud.book.rightsSetting.enums;
public enum RightsServeTypeEnum {
/**
* 共读社群
*/
GROUP(1),
/**
* 小程序资讯
*/
NEWS(2),
/**
* 方案
*/
PLAN(3);
public final Integer value;
RightsServeTypeEnum(Integer value) {
this.value = value;
}
}
...@@ -9,6 +9,9 @@ import com.pcloud.common.page.PageBeanNew; ...@@ -9,6 +9,9 @@ import com.pcloud.common.page.PageBeanNew;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
public interface PcloudGroupActivityBiz { public interface PcloudGroupActivityBiz {
/** /**
...@@ -44,4 +47,10 @@ public interface PcloudGroupActivityBiz { ...@@ -44,4 +47,10 @@ public interface PcloudGroupActivityBiz {
* @return * @return
*/ */
GroupActivity4AppletDTO getGroupActivity4Applet(Long rightSettingId, Long adviserId, Long bookId, Long channelId, Integer readType); GroupActivity4AppletDTO getGroupActivity4Applet(Long rightSettingId, Long adviserId, Long bookId, Long channelId, Integer readType);
/**
* 根据id获取社群共读
* @param ids
* @return
*/
Map<Long, GroupActivity4AppletDTO> getByIds(List<Long> ids);
} }
...@@ -323,4 +323,21 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz { ...@@ -323,4 +323,21 @@ public class PcloudGroupActivityBizImpl implements PcloudGroupActivityBiz {
groupActivity4AppletDTO.setStatementDTOList(statementDTOS); groupActivity4AppletDTO.setStatementDTOList(statementDTOS);
return groupActivity4AppletDTO; return groupActivity4AppletDTO;
} }
@Override
public Map<Long, GroupActivity4AppletDTO> getByIds(List<Long> ids) {
if(ListUtils.isEmpty(ids)){
return new HashMap<>();
}
Map<Long, GroupActivity4AppletDTO> mapDto = pcloudGroupActivityDao.getByIds(ids);
if(mapDto.isEmpty()){
return new HashMap<>();
}
for(GroupActivity4AppletDTO groupActivity4AppletDTO: mapDto.values()){
String filterStr = StringUtilParent.replaceHtml(groupActivity4AppletDTO.getDesc());
String subStr = filterStr.length() > 60 ? filterStr.substring(0, 60) + "..." : filterStr;
groupActivity4AppletDTO.setCutDesc(subStr);
}
return mapDto;
}
} }
...@@ -18,4 +18,6 @@ public interface PcloudGroupActivityDao extends BaseDao<PcloudGroupActivity> { ...@@ -18,4 +18,6 @@ public interface PcloudGroupActivityDao extends BaseDao<PcloudGroupActivity> {
GroupActivity4AppletDTO getGroupActivity4Applet(Long firstClassify,Long secondClassify,Long gradeLabelId,Long subjectLabelId); GroupActivity4AppletDTO getGroupActivity4Applet(Long firstClassify,Long secondClassify,Long gradeLabelId,Long subjectLabelId);
List<GroupActivity4AppletDTO> getTishBookSchoolList(BaseTempletClassify baseTempletClassify, Integer limit); List<GroupActivity4AppletDTO> getTishBookSchoolList(BaseTempletClassify baseTempletClassify, Integer limit);
Map<Long, GroupActivity4AppletDTO> getByIds(List<Long> ids);
} }
\ No newline at end of file
...@@ -47,4 +47,8 @@ public class PcloudGroupActivityDaoImpl extends BaseDaoImpl<PcloudGroupActivity> ...@@ -47,4 +47,8 @@ public class PcloudGroupActivityDaoImpl extends BaseDaoImpl<PcloudGroupActivity>
return super.getSqlSession().selectList(getStatement("getTishBookSchoolList"), map); return super.getSqlSession().selectList(getStatement("getTishBookSchoolList"), map);
} }
@Override
public Map<Long, GroupActivity4AppletDTO> getByIds(List<Long> list) {
return super.getSqlSession().selectMap(getStatement("getByIds"), list,"id");
}
} }
...@@ -384,6 +384,39 @@ ...@@ -384,6 +384,39 @@
ORDER BY n.create_time DESC ORDER BY n.create_time DESC
</select> </select>
<select id="getByIds" resultType="com.pcloud.book.applet.dto.AppletNewsDTO">
SELECT
n.id,
n.news_name newsName,
n.source,
n.news_classify_id newsClassifyId,
n.pro_label_id proLabelId,
n.dep_label_id depLabelId,
n.pur_label_id purLabelId,
n.type,
n.digest,
n.pic1,
n.pic2,
n.pic3,
n.show_state showState,
n.create_time createTime,
n.first_classify firstClassify,
n.second_classify secondClassify,
n.grade_label_id gradeLabelId,
n.subject_label_id subjectLabelId,
n.rights_classify_id rightsClassifyId,
n.jump_type jumpType,
n.jump_url jumpUrl,
n.url_number urlNumber
FROM applet_news n
WHERE n.show_state = 1
AND n.id IN
<foreach collection="list" item="item" separator="," open="(" close=")" >
${item}
</foreach>
ORDER BY n.create_time DESC
</select>
<select id="listAppletNews4Wechat" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletNewsDTO"> <select id="listAppletNews4Wechat" parameterType="map" resultType="com.pcloud.book.applet.dto.AppletNewsDTO">
SELECT 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.rightsSetting.dao.impl.RightsSettingItemDetailDaoImpl">
<resultMap id="BaseResultMap" type="com.pcloud.book.rightsSetting.entity.RightsSettingItemDetail">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="rights_setting_item_id" property="rightsSettingItemId" jdbcType="BIGINT"/>
<result column="serve_id" property="serveId" jdbcType="BIGINT"/>
<result column="serve_type" property="serveType" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id, rights_setting_item_id, serve_id, serve_type, create_time
</sql>
<select id="getById" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM rights_setting_item_detail
WHERE id = #{id}
</select>
<select id="getByItemIds" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM rights_setting_item_detail
WHERE rights_setting_item_id IN
<foreach collection="list" item="item" open="(" separator="," close=")">
${item}
</foreach>
</select>
<select id="getList" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM rights_setting_item_detail
</select>
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
INSERT INTO rights_setting_item_detail(
rights_setting_item_id,
serve_id,
serve_type,
create_time
) VALUES (
#{rightsSettingItemId, jdbcType=BIGINT},
#{serveId, jdbcType=BIGINT},
#{serveType, jdbcType=VARCHAR},
NOW()
)
</insert>
<insert id="batchInsert" keyProperty="id" useGeneratedKeys="true">
INSERT INTO rights_setting_item_detail (
rights_setting_item_id,
serve_id,
serve_type,
create_time
) VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.rightsSettingItemId, jdbcType=BIGINT},
#{item.serveId, jdbcType=BIGINT},
#{item.serveType, jdbcType=VARCHAR},
NOW()
)
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
UPDATE rights_setting_item_detail
<set>
<if test="rightsSettingItemId != null">
rights_setting_item_id = #{rightsSettingItemId},
</if>
<if test="serveId != null">
serve_id = #{serveId},
</if>
<if test="serveType != null and serveType != ''">
serve_type = #{serveType},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
</set>
WHERE id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
DELETE FROM rights_setting_item_detail where id = #{id}
</delete>
<delete id="deleteByItemIds">
DELETE FROM rights_setting_item_detail where
rights_setting_item_id IN
<foreach collection="list" item="item" open="(" separator="," close=")">
${item}
</foreach>
</delete>
</mapper>
\ No newline at end of file
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="title" column="title" jdbcType="VARCHAR"/> <result property="title" column="title" jdbcType="VARCHAR"/>
<result property="uuid" column="uuid" jdbcType="VARCHAR"/> <result property="uuid" column="uuid" jdbcType="VARCHAR"/>
<result property="openState" column="open_state" jdbcType="INTEGER" />
<result property="serviceDesc" column="service_desc" jdbcType="VARCHAR"/>
<result property="serveType" column="serve_type" jdbcType="VARCHAR"/>
<result property="easyRead" column="easy_read" jdbcType="TINYINT" /> <result property="easyRead" column="easy_read" jdbcType="TINYINT" />
<result property="efficientRead" column="efficient_read" jdbcType="TINYINT" /> <result property="efficientRead" column="efficient_read" jdbcType="TINYINT" />
<result property="deepRead" column="deep_read" jdbcType="TINYINT" /> <result property="deepRead" column="deep_read" jdbcType="TINYINT" />
...@@ -21,10 +24,9 @@ ...@@ -21,10 +24,9 @@
select select
i.id, i.rights_setting_id rightsSettingId, i.id, i.rights_setting_id rightsSettingId,
i.rights_type rightsType, i.rights_classify_id rightsClassifyId, i.rights_type rightsType, i.rights_classify_id rightsClassifyId,
i.description, i.create_time createTime, i.title,i.uuid,IFNULL(p.is_open,0) isOpen,p.service_desc serviceDesc, i.description, i.create_time createTime, i.title,i.uuid,i.open_state openState,i.service_desc serviceDesc,i.serve_type serveType,
c.book_id bookId, i.easy_read easyRead,i.efficient_read efficientRead,i.deep_read deepRead c.book_id bookId, i.easy_read easyRead,i.efficient_read efficientRead,i.deep_read deepRead
from book.rights_setting_item i from book.rights_setting_item i
left join book.rights_read_plan p on i.id=p.rights_setting_item_id
LEFT JOIN rights_setting c ON c.id=i.rights_setting_id LEFT JOIN rights_setting c ON c.id=i.rights_setting_id
<where> <where>
<if test="id != null"> <if test="id != null">
...@@ -56,9 +58,9 @@ ...@@ -56,9 +58,9 @@
<!--新增所有列--> <!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true"> <insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into book.rights_setting_item(rights_setting_id, rights_type, rights_classify_id, description, create_time,title,uuid, insert into book.rights_setting_item(rights_setting_id, rights_type, rights_classify_id, description, create_time,title,uuid,open_state,serve_type,
easy_read,efficient_read,deep_read) easy_read,efficient_read,deep_read)
values (#{rightsSettingId}, #{rightsType}, #{rightsClassifyId}, #{description}, NOW(), #{title},#{uuid}, values (#{rightsSettingId}, #{rightsType}, #{rightsClassifyId}, #{description}, NOW(), #{title},#{uuid},#{openState},#{serveType},
#{easyRead},#{efficientRead},#{deepRead}) #{easyRead},#{efficientRead},#{deepRead})
</insert> </insert>
...@@ -74,7 +76,7 @@ ...@@ -74,7 +76,7 @@
<!--批量新增--> <!--批量新增-->
<insert id="batchInsert" useGeneratedKeys="true" parameterType="java.util.List"> <insert id="batchInsert" useGeneratedKeys="true" parameterType="java.util.List">
insert into book.rights_setting_item ( insert into book.rights_setting_item (
rights_setting_id, rights_type, rights_classify_id, description, create_time,title,uuid, rights_setting_id, rights_type, rights_classify_id, description, create_time,title,uuid,open_state,serve_type,
easy_read,efficient_read,deep_read easy_read,efficient_read,deep_read
) )
values values
...@@ -87,6 +89,8 @@ ...@@ -87,6 +89,8 @@
NOW(), NOW(),
#{item.title}, #{item.title},
#{item.uuid}, #{item.uuid},
#{item.openState},
#{item.serveType}
#{item.easyRead},#{item.efficientRead},#{item.deepRead} #{item.easyRead},#{item.efficientRead},#{item.deepRead}
) )
</foreach> </foreach>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="rights_setting_now_type" jdbcType="TINYINT" property="rightsSettingNowType" /> <result column="rights_setting_now_type" jdbcType="TINYINT" property="rightsSettingNowType" />
<result column="serve_type" jdbcType="VARCHAR" property="serveType" />
<result column="easy_read" jdbcType="TINYINT" property="easyRead" /> <result column="easy_read" jdbcType="TINYINT" property="easyRead" />
<result column="efficient_read" jdbcType="TINYINT" property="efficientRead" /> <result column="efficient_read" jdbcType="TINYINT" property="efficientRead" />
<result column="deep_read" jdbcType="TINYINT" property="deepRead" /> <result column="deep_read" jdbcType="TINYINT" property="deepRead" />
...@@ -18,15 +19,15 @@ ...@@ -18,15 +19,15 @@
<sql id="baseSql"> <sql id="baseSql">
id, rights_setting_id, rights_setting_title, id, rights_setting_id, rights_setting_title,
rights_setting_desc, open_state, create_time, rights_setting_desc, open_state, create_time,
update_time,rights_setting_now_type,easy_read,efficient_read,deep_read update_time,rights_setting_now_type,serve_type,easy_read,efficient_read,deep_read
</sql> </sql>
<insert id="insert" parameterType="com.pcloud.book.rightsSetting.entity.RightsSettingTitle"> <insert id="insert" parameterType="com.pcloud.book.rightsSetting.entity.RightsSettingTitle">
insert into rights_setting_title (id, rights_setting_id, rights_setting_title, insert into rights_setting_title (id, rights_setting_id, rights_setting_title,
rights_setting_desc, open_state, create_time, rights_setting_desc, open_state, create_time,
update_time,rights_setting_now_type,easy_read,efficient_read,deep_read) update_time,rights_setting_now_type,serve_type,easy_read,efficient_read,deep_read)
values (#{id,jdbcType=BIGINT}, #{rightsSettingId,jdbcType=BIGINT}, #{rightsSettingTitle,jdbcType=VARCHAR}, values (#{id,jdbcType=BIGINT}, #{rightsSettingId,jdbcType=BIGINT}, #{rightsSettingTitle,jdbcType=VARCHAR},
#{rightsSettingDesc,jdbcType=VARCHAR}, #{openState,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, #{rightsSettingDesc,jdbcType=VARCHAR}, #{openState,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},#{rightsSettingNowType},#{easyRead},#{efficientRead},#{deepRead}) #{updateTime,jdbcType=TIMESTAMP},#{rightsSettingNowType},#{serveType},#{easyRead},#{efficientRead},#{deepRead})
</insert> </insert>
<insert id="insertSelective" parameterType="com.pcloud.book.rightsSetting.entity.RightsSettingTitle"> <insert id="insertSelective" parameterType="com.pcloud.book.rightsSetting.entity.RightsSettingTitle">
insert into rights_setting_title insert into rights_setting_title
...@@ -52,6 +53,9 @@ ...@@ -52,6 +53,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time, update_time,
</if> </if>
<if test="serveType != null">
serve_type,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -75,6 +79,9 @@ ...@@ -75,6 +79,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="serveType != null">
#{serve_type,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
...@@ -89,12 +96,12 @@ ...@@ -89,12 +96,12 @@
<insert id="batchInsert" parameterType="com.pcloud.book.rightsSetting.entity.RightsSettingTitle"> <insert id="batchInsert" parameterType="com.pcloud.book.rightsSetting.entity.RightsSettingTitle">
insert into rights_setting_title (id, rights_setting_id, rights_setting_title, insert into rights_setting_title (id, rights_setting_id, rights_setting_title,
rights_setting_desc, open_state, create_time, update_time,rights_setting_now_type, rights_setting_desc, open_state, create_time, update_time,rights_setting_now_type,serve_type,
easy_read,efficient_read,deep_read) easy_read,efficient_read,deep_read)
values values
<foreach collection="list" item="item" index="index" separator=","> <foreach collection="list" item="item" index="index" separator=",">
(#{item.id,jdbcType=BIGINT}, #{item.rightsSettingId,jdbcType=BIGINT}, #{item.rightsSettingTitle,jdbcType=VARCHAR}, (#{item.id,jdbcType=BIGINT}, #{item.rightsSettingId,jdbcType=BIGINT}, #{item.rightsSettingTitle,jdbcType=VARCHAR},
#{item.rightsSettingDesc,jdbcType=VARCHAR}, #{item.openState,jdbcType=TINYINT}, now(), now(),#{item.rightsSettingNowType}, #{item.rightsSettingDesc,jdbcType=VARCHAR}, #{item.openState,jdbcType=TINYINT}, now(), now(),#{item.rightsSettingNowType},#{item.serveType},
#{item.easyRead},#{item.efficientRead},#{item.deepRead}) #{item.easyRead},#{item.efficientRead},#{item.deepRead})
</foreach> </foreach>
</insert> </insert>
...@@ -118,6 +125,11 @@ ...@@ -118,6 +125,11 @@
when id=#{item.id} then #{item.openState} when id=#{item.id} then #{item.openState}
</foreach> </foreach>
</trim> </trim>
<trim prefix="serve_type =case" suffix="end,">
<foreach collection="list" item="item" index="index">
when id=#{item.id} then #{item.serveType}
</foreach>
</trim>
<trim prefix="easy_read =case" suffix="end,"> <trim prefix="easy_read =case" suffix="end,">
<foreach collection="list" item="item" index="index"> <foreach collection="list" item="item" index="index">
when id=#{item.id} then #{item.easyRead} when id=#{item.id} then #{item.easyRead}
......
...@@ -132,6 +132,36 @@ ...@@ -132,6 +132,36 @@
where a.id = #{id,jdbcType=INTEGER} where a.id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="getByIds" 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.group_pic AS groupPic,
a.book_group_qrcode_id AS bookGroupQrcodeId,
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_qrcode b on a.book_group_qrcode_id = b.id AND b.is_delete = 0
INNER JOIN book_group_classify c ON b.classify_id = c.id AND c.is_delete = 0
WHERE
a.is_delete = 0
AND a.id IN
<foreach collection="list" item="item" open="(" close=")" separator=",">
${item}
</foreach>
ORDER BY id DESC
</select>
<select id="getGroupActivity4Applet" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO" parameterType="map"> <select id="getGroupActivity4Applet" resultType="com.pcloud.book.skill.dto.GroupActivity4AppletDTO" parameterType="map">
SELECT SELECT
a.id, a.id,
......
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