提交 6b32107d authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 9cd162ec
......@@ -185,6 +185,10 @@ public class EbookController {
example = new Example(EbookDiyType.class);
example.createCriteria().andIn("ebookId", ids);
dtservice.deleteByExample(example);
// ----图片封面轮播图
example = new Example(EbookImage.class);
example.createCriteria().andIn("ebookId", ids);
eBookImageService.deleteByExample(example);
//删除资源收藏相关信息
example = new Example(MemberCollection.class);
example.createCriteria().andIn("objectId", ids);
......
package com.zrqx.resource.bg.mapper.authorLibrary;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.zrqx.core.form.resource.bg.QueryResourceForPoPForm;
import com.zrqx.core.form.resource.bg.authorLibrary.QueryAuthorLibraryForm;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.authorLibrary.AuthorLibrary;
import com.zrqx.core.vo.resource.authorlibrary.AuthorLibraryListVO;
public interface AuthorLibraryMapper extends BaseMapper<AuthorLibrary> {
@Select("<script>"
+ "select a.id,a.name,a.institutionName,a.sex,a.education,a.department,a.title,a.post,a.description,a.faceImg,a.status,a.uploadTime "
+ "FROM res_author_library a left join res_author_library_diy_type t "
+ "on a.id = t.authorlibraryid where 1 = 1 "
+ "<if test='form.status != null'> "
+ " AND a.status = #{form.status} "
+ "</if> "
+ "<if test = '" + NOTBLANK + "(form.name)'> "
+ " AND a.name like concat('%',#{form.name},'%') "
+ "</if> "
+ "<if test = '" + NOTBLANK + "(form.title)'> "
+ " AND a.title like concat('%',#{form.title},'%') "
+ "</if> "
+ "<if test = '" + NOTBLANK + "(form.institutionName)'> "
+ " AND a.institutionName like concat('%',#{form.institutionName},'%') "
+ "</if> "
+ "<if test = '" + NOTBLANK + "(form.diyTypeCode)'> "
+ " AND t.diytypeCode like concat('%',#{form.diyTypeCode},'%') "
+ "</if>"
/*+ "<if test='form.diyTypeId != null and form.diyTypeId.size > 0'>"
+ "and t.diytypeid in "
+ " <foreach collection=\"form.diyTypeId\" index=\"index\" item=\"id\" open=\"(\" separator=\",\" close=\")\">"
+ "#{id}"
+ "</foreach>"
+ "</if>" */
+ "<if test = '" + NOTBLANK + "(form.beginTime)'> "
+ " AND a.uploadTime &gt;= concat(#{form.beginTime}, ' 00:00:00') "
+ "</if> "
+ "<if test = '" + NOTBLANK + "(form.endTime)'> "
+ " AND a.uploadTime &lt;= concat(#{form.endTime}, ' 23:59:59')"
+ "</if> "
+ " order by a.uploadTime desc "
+ "</script>")
List<AuthorLibraryListVO> queryAuthorLibraryByConditions(@Param("form")QueryAuthorLibraryForm form);
@Select("<script>"
+ "select a.id,a.name,a.institutionName,a.faceImg,a.status,a.uploadTime "
+ "FROM res_author_library a left join res_author_library_diy_type t "
+ "on a.id = t.authorlibraryid "
+ " where 1 = 1 and a.status = 1 "
+ "<if test = '" + NOTBLANK + "(form.title)'> "
+ " AND a.name like concat('%',#{form.title},'%') "
+ "</if> "
+ "<if test = '" + NOTBLANK + "(form.diyTypeCode)'> "
+ " AND t.diytypeCode like concat('%',#{form.diyTypeCode},'%') "
+ "</if>"
+ "<if test='form.ids != null and form.ids.size > 0'>"
+ "and a.id not in "
+ " <foreach collection=\"form.ids\" index=\"index\" item=\"id\" open=\"(\" separator=\",\" close=\")\">"
+ "#{id}"
+ "</foreach>"
+ "</if>"
+ "</script>")
List<AuthorLibraryListVO> queryByTileAndDiyType(@Param("form")QueryResourceForPoPForm form);
}
package com.zrqx.resource.bg.mapper.authorLibrary;
import java.util.List;
import org.apache.ibatis.annotations.Select;
import com.zrqx.core.form.resource.bg.QueryResourceRelationForm;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.authorLibrary.AuthorResource;
import com.zrqx.core.vo.resource.ResourceRelationVo;
public interface AuthorResourceMapper extends BaseMapper<AuthorResource> {
@Select("<script>"
+ "select id ,resourceId,resourceType,createTime,sort from res_author_resource "
+ "where authorId = #{id} "
+ "<if test='resourceType != null'> and resourceType = #{resourceType}</if>"
+ " order by sort desc , createTime desc "
+ "</script>")
List<ResourceRelationVo> queryByIdAndResourceType(QueryResourceRelationForm entity);
/**
* 获取关联资源最大排序
* @return
*/
@Select("select MAX(sort) from res_author_resource")
Integer getMax();
}
......@@ -17,8 +17,8 @@ import com.zrqx.core.model.resource.resourcerelation.ResourceRelation;
import com.zrqx.core.service.BaseServiceImpl;
import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.vo.resource.ResourceRelationVo;
import com.zrqx.resource.bg.mapper.ResourceRelationMapper;
import com.zrqx.resource.bg.mapper.annexlibrary.AnnexLibraryMapper;
import com.zrqx.resource.bg.mapper.authorLibrary.ResourceRelationMapper;
import com.zrqx.resource.bg.mapper.ebook.EbookMapper;
import com.zrqx.resource.bg.mapper.projectlibrary.ProjectLibraryMapper;
......
......@@ -33,10 +33,10 @@ import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.vo.resource.annexlibrary.AnnexLibraryListVO;
import com.zrqx.resource.bg.client.order.OrderClient;
import com.zrqx.resource.bg.mapper.ResourceRelationMapper;
import com.zrqx.resource.bg.mapper.annexlibrary.AnnexLibraryDiyTypeMapper;
import com.zrqx.resource.bg.mapper.annexlibrary.AnnexLibraryMapper;
import com.zrqx.resource.bg.mapper.annexlibrary.AnnexResourceMapper;
import com.zrqx.resource.bg.mapper.authorLibrary.ResourceRelationMapper;
import com.zrqx.resource.bg.mapper.marketing.PromotionContentMapper;
import com.zrqx.resource.bg.mapper.membercollection.MemberCollectionMapper;
import com.zrqx.resource.bg.mapper.recommend.RecommendResourceMapper;
......
package com.zrqx.resource.bg.service.authorLibrary;
import com.zrqx.core.form.resource.bg.QueryResourceForPoPForm;
import com.zrqx.core.form.resource.bg.authorLibrary.QueryAuthorLibraryForm;
import com.zrqx.core.form.resource.bg.authorLibrary.SaveUpdateAuthorForm;
import com.zrqx.core.model.resource.authorLibrary.AuthorLibrary;
import com.zrqx.core.service.BaseService;
import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.vo.resource.authorlibrary.AuthorLibraryListVO;
public interface AuthorLibraryService extends BaseService<AuthorLibrary,String> {
/**
* 查询作者库列表
* @param entity
* @param pageParam
* @return
* @author yzg
* @date: 2018年7月11日 下午3:10:24
*/
PageInfo<AuthorLibraryListVO> queryAuthorLibraryList(QueryAuthorLibraryForm entity, PageParam pageParam);
/**
* 添加或修改作者库
* @param authorLibrary
* @return
* @author yzg
* @date: 2018年7月11日 下午3:10:13
*/
Boolean saveOrUpdate(SaveUpdateAuthorForm entity);
/**
* 选择弹窗中的列表
* @param form
* @param pageParam
* @return
* @author ycw
* @date: 2019年1月3日 下午7:12:29
*/
PageInfo<AuthorLibraryListVO> pageByTitleAndDiyType(QueryResourceForPoPForm form, PageParam pageParam);
}
package com.zrqx.resource.bg.service.authorLibrary;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.zrqx.core.enums.AllResourceTypeEnum;
import com.zrqx.core.enums.resource.LibraryStatusEnum;
import com.zrqx.core.form.resource.bg.QueryResourceForPoPForm;
import com.zrqx.core.form.resource.bg.authorLibrary.QueryAuthorLibraryForm;
import com.zrqx.core.form.resource.bg.authorLibrary.SaveUpdateAuthorForm;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.authorLibrary.AuthorLibrary;
import com.zrqx.core.model.resource.authorLibrary.AuthorLibraryDiytype;
import com.zrqx.core.model.resource.authorLibrary.AuthorLibraryLabelContentDiyType;
import com.zrqx.core.service.BaseServiceImpl;
import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.vo.resource.authorlibrary.AuthorLibraryListVO;
import com.zrqx.resource.bg.mapper.authorLibrary.AuthorLibraryMapper;
@Service
public class AuthorLibraryServiceImpl extends BaseServiceImpl<AuthorLibrary, String> implements AuthorLibraryService {
@Autowired
private AuthorLibraryMapper authorLibraryMapper;
@Override
public BaseMapper<AuthorLibrary> getMapper() {
return authorLibraryMapper;
}
/**
* 查询作者列表
*/
@Override
public PageInfo<AuthorLibraryListVO> queryAuthorLibraryList(QueryAuthorLibraryForm entity, PageParam pageParam) {
PageHelper.startPage(pageParam.getPageNum(), pageParam.getPageSize(), pageParam.getOrderBy());
List<AuthorLibraryListVO> list = authorLibraryMapper.queryAuthorLibraryByConditions(entity);
return new PageInfo<AuthorLibraryListVO>(list);
}
/**
* 添加或修改作者库
*
* @param authorLibrary
* @return
*/
@Override
public Boolean saveOrUpdate(SaveUpdateAuthorForm form) {
AuthorLibrary authorLibrary = new AuthorLibrary();
BeanUtils.copyProperties(form, authorLibrary);
if (authorLibrary.getId() == null) {
authorLibrary.setUploadTime(new Date());
authorLibrary.setStatus(LibraryStatusEnum.STATUS_0.getCode());
authorLibrary.setResourceType(AllResourceTypeEnum.AUTHOR.getCode());
authorLibrary.setBrowseNum(50);
authorLibraryMapper.insertSelective(authorLibrary);
} else {
authorLibrary.setUpdateTime(new Date());
authorLibraryMapper.updateByPrimaryKeySelective(authorLibrary);
}
return true;
}
@Override
public PageInfo<AuthorLibraryListVO> pageByTitleAndDiyType(QueryResourceForPoPForm form, PageParam pageParam){
startPage(pageParam);
List<AuthorLibraryListVO> list = authorLibraryMapper.queryByTileAndDiyType(form);
if(!list.isEmpty()){
for(AuthorLibraryListVO ebookListVO : list){
ebookListVO.setStatus_zh(LibraryStatusEnum.getName(Integer.parseInt(ebookListVO.getStatus())));
}
}
return new PageInfo<AuthorLibraryListVO>(list);
}
}
package com.zrqx.resource.bg.service.authorLibrary;
import java.util.List;
import com.zrqx.core.form.resource.bg.QueryResourceRelationForm;
import com.zrqx.core.model.resource.authorLibrary.AuthorResource;
import com.zrqx.core.service.BaseService;
import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.vo.resource.ResourceRelationVo;
public interface AuthorResourceService extends BaseService<AuthorResource, Integer> {
/**
* 获取相关资源列表
* @param entity
* @param pageParam
* @return
* @author yzg
* @date: 2018年7月24日 上午9:09:34
*/
List<ResourceRelationVo> queryByIdAndResourceType(QueryResourceRelationForm entity, PageParam pageParam);
/**
* 获取资源最大排序
* @return
*/
Integer getMaxSort();
}
package com.zrqx.resource.bg.service.authorLibrary;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.zrqx.core.form.resource.bg.QueryResourceRelationForm;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.authorLibrary.AuthorResource;
import com.zrqx.core.service.BaseServiceImpl;
import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.vo.resource.ResourceRelationVo;
import com.zrqx.resource.bg.mapper.authorLibrary.AuthorResourceMapper;
@Service
public class AuthorResourceServiceImpl extends BaseServiceImpl<AuthorResource, Integer> implements AuthorResourceService{
@Autowired
private AuthorResourceMapper authorResourceMapper;
@Override
public BaseMapper<AuthorResource> getMapper() {
return authorResourceMapper;
}
/**
* 获取相关资源列表
* @see com.zrqx.resource.bg.service.articlelibrary.ArticleResourceService#queryByIdAndResourceType(com.zrqx.core.form.resource.bg.QueryResourceRelationForm, com.zrqx.core.util.page.PageParam)
* @param entity
* @param pageParam
* @return
* @author yzg
* @date: 2018年7月24日 上午9:10:11
*/
@Override
public List<ResourceRelationVo> queryByIdAndResourceType(QueryResourceRelationForm entity, PageParam pageParam) {
PageHelper.startPage(pageParam);
return authorResourceMapper.queryByIdAndResourceType(entity);
}
/**
* 获取资源最大排序
*/
@Override
public Integer getMaxSort() {
Integer sort = authorResourceMapper.getMax();
if(sort == null){
sort = 1;
}else{
sort += 1;
}
return sort;
}
}
......@@ -25,7 +25,7 @@ import com.zrqx.core.util.bean.BeanUtils;
import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.vo.resource.projectlibrary.ProjectLibraryListVO;
import com.zrqx.resource.bg.mapper.ResourceRelationMapper;
import com.zrqx.resource.bg.mapper.authorLibrary.ResourceRelationMapper;
import com.zrqx.resource.bg.mapper.projectlibrary.ProjectLibraryMapper;
import com.zrqx.resource.bg.mapper.recommend.RecommendResourceMapper;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论