提交 e4b36e41 authored 作者: 任建宇's avatar 任建宇

feat: 检索

1.resource
上级 cf09110a
......@@ -18,6 +18,7 @@ import com.zrqx.resource.model.form.videolibrary.BatchUpdateVideoLibraryForm;
import com.zrqx.resource.model.po.audiolibrary.AudioLabelPO;
import com.zrqx.resource.model.po.audiolibrary.AudioLibrary;
import com.zrqx.resource.model.po.audiolibrary.AudioLibraryDiyType;
import com.zrqx.resource.model.po.ebook.Ebook;
import com.zrqx.resource.model.po.resourcerelation.RelationAuthor;
import com.zrqx.resource.model.vo.audiolibrary.AudioLibraryListVO;
import com.zrqx.resource.model.vo.audiolibrary.AudioLibraryOneVO;
......@@ -169,13 +170,28 @@ public class AudioLibraryController {
@ApiOperation(value = "批量删除", notes = "批量删除")
@PostMapping(value = "/batch/delete")
public CallBack<Boolean> deleteByIds(@RequestBody List<String> ids) {
LambdaUpdateWrapper<AudioLibrary> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(AudioLibrary::getIsDelete,0);
lambdaUpdateWrapper.in(AudioLibrary::getId,ids);
service.update(lambdaUpdateWrapper);
return CallBack.success();
}
@ApiOperation(value = "回收站批量删除", notes = "回收站批量删除")
@PostMapping(value = "/batch/recycleDelete")
public CallBack<Boolean> recycleDeleteByIds(@RequestBody List<String> ids) {
if (service.batchDelete(ids)) {
// 删除索引
//solrManage.asyncDeleteIndex(ids);
}
return CallBack.success();
}
@ApiOperation(value = "回收站还原", notes = "回收站还原")
@PostMapping(value = "/batch/reduction")
public CallBack<Boolean> reduction(@RequestBody List<String> ids) {
LambdaUpdateWrapper<AudioLibrary> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(AudioLibrary::getIsDelete,1);
lambdaUpdateWrapper.in(AudioLibrary::getId,ids);
service.update(lambdaUpdateWrapper);
return CallBack.success();
}
@ApiOperation(value = "查询", notes = "根据ID查询")
@GetMapping(value = "/get/{oid}")
public CallBack<AudioLibraryOneVO> getById(@PathVariable String oid) {
......
......@@ -340,7 +340,32 @@ public class EbookController {
if (entity.getStatus().equals(EbookStatusEnum._1.getCode())) {
throw new ResourceBizException("不能删除已上架的资源");
}
entity.setIsDelete(0);
if (!ebookservice.updateById(entity)) {
throw new ResourceBizException("操作失败");
}
}
// 删除索引
solrManage.asyncDeleteIndex(ids);
return CallBack.success();
}
@ApiOperation(value = "回收站还原", notes = "回收站还原")
@PostMapping(value = "/batch/reduction")
public CallBack<Boolean> reduction(@RequestBody List<String> ids) {
List<Ebook> list = ebookservice.listByIds(ids);
for (Ebook entity : list) {
entity.setIsDelete(1);
if (!ebookservice.updateById(entity)) {
throw new ResourceBizException("操作失败");
}
}
// 增量索引
solrManage.asyncDeltaIndex();
return CallBack.success();
}
@ApiOperation(value = "回收站批量删除", notes = "回收站批量删除")
@PostMapping(value = "/batch/recycleDelete")
public CallBack<Boolean> recycleDelete(@RequestBody List<String> ids) {
// 这里需要级联删除其他接口关联资源
if (!ebookservice.batchDelete(ids)) {
throw new ResourceBizException("操作失败");
......@@ -371,20 +396,10 @@ public class EbookController {
LambdaQueryWrapper<ArticleToAudio> articleToAudioLambdaQueryWrapper = new LambdaQueryWrapper<>();
articleToAudioLambdaQueryWrapper.in(ArticleToAudio::getBookId, ids);
articleToAudioService.remove(articleToAudioLambdaQueryWrapper);
// ----推荐位内容
recommendResourceService.deleteByResourceIds(ids, AllResourceTypeEnum.EBOOK.getCode());
// 专题关联资源
projectModelResourceService.deleteByResourceIds(ids, AllResourceTypeEnum.EBOOK.getCode());
// 关联资源
resourceRelationService.deleteByResourceIds(ids, AllResourceTypeEnum.EBOOK.getCode());
// 删除原有关系表中的关系
LambdaQueryWrapper<EbookDiyType> ebookDiyTypeLambdaQueryWrapper = new LambdaQueryWrapper<>();
ebookDiyTypeLambdaQueryWrapper.in(EbookDiyType::getEbookId, ids);
dtservice.remove(ebookDiyTypeLambdaQueryWrapper);
// 删除原有标签关系表中的关系
LambdaQueryWrapper<EbookLabelContentDiyType> ebookLabelContentDiyTypeWrapper = new LambdaQueryWrapper<>();
ebookLabelContentDiyTypeWrapper.in(EbookLabelContentDiyType::getEbookId, ids);
lcdtservice.remove(ebookLabelContentDiyTypeWrapper);
//关联系列
LambdaQueryWrapper<ProjectModelResource> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(ProjectModelResource::getResourceId, ids);
......@@ -397,7 +412,6 @@ public class EbookController {
solrManage.asyncDeleteIndex(ids);
return CallBack.success();
}
@ApiOperation("查询电子书列表")
@GetMapping("/page")
public CallBack<PageInfo<EbookListVO>> getBookList(QueryEbookInfoForm form, PageParam pageParam) {
......@@ -630,6 +644,7 @@ public class EbookController {
ev.getEbook().setSales(0);
ev.getEbook().setShares(0);
ev.getEbook().setBookType(1);
ev.getEbook().setIsDelete(1);
ebookservice.save(ev.getEbook());
// 图书分类关联表
EbookDiyType edt = new EbookDiyType();
......@@ -788,6 +803,7 @@ public class EbookController {
ev.getEbook().setSales(0);
ev.getEbook().setShares(0);
ev.getEbook().setBookType(1);
ev.getEbook().setIsDelete(1);
ev.getEbook().setCreatedTime(new Date());
ev.getEbook().setUpdateTime(new Date());
ebookservice.save(ev.getEbook());
......
......@@ -19,6 +19,7 @@ import com.zrqx.resource.model.form.goodslibrary.QueryGoodsLibraryForm;
import com.zrqx.resource.model.form.goodslibrary.SaveGoodsLibraryForm;
import com.zrqx.resource.model.form.goodslibrary.SaveUpdateGoodsLibraryForm;
import com.zrqx.resource.model.form.goodslibrary.UpdateZipForm;
import com.zrqx.resource.model.po.audiolibrary.AudioLibrary;
import com.zrqx.resource.model.po.goodslibrary.GoodsLibraryDiyTypePO;
import com.zrqx.resource.model.po.goodslibrary.GoodsLibraryLabelContentDiyTypePO;
import com.zrqx.resource.model.po.goodslibrary.GoodsLibrary;
......@@ -173,11 +174,32 @@ public class GoodsLibraryController {
solrManage.asyncDeltaIndex();
return CallBack.success();
}
@ApiOperation(value = "回收站还原", notes = "回收站还原")
@PostMapping(value = "/batch/reduction")
public CallBack<Boolean> reduction(@RequestBody List<String> ids) {
LambdaUpdateWrapper<GoodsLibrary> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(GoodsLibrary::getIsDelete,1);
lambdaUpdateWrapper.in(GoodsLibrary::getId,ids);
service.update(lambdaUpdateWrapper);
solrManage.asyncDeltaIndex();
return CallBack.success();
}
@ApiOperation(value = "批量删除", notes = "批量删除")
@PostMapping(value = "/batch/delete")
public CallBack<Boolean> deleteByIds(@RequestBody List<String> ids) {
return CallBack.success(service.batchDelete(ids));
LambdaUpdateWrapper<GoodsLibrary> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(GoodsLibrary::getIsDelete,1);
lambdaUpdateWrapper.in(GoodsLibrary::getId,ids);
service.update(lambdaUpdateWrapper);
return CallBack.success();
}
@ApiOperation(value = "回收站批量删除", notes = "回收站批量删除")
@PostMapping(value = "/batch/recycleDelete")
public CallBack<Boolean> recycleDeleteByIds(@RequestBody List<String> ids) {
if (service.batchDelete(ids)) {
}
return CallBack.success();
}
@ApiOperation(value = "查询", notes = "根据ID查询")
......
......@@ -11,6 +11,7 @@ import com.zrqx.core.response.CallBack;
import com.zrqx.resource.exception.ResourceBizException;
import com.zrqx.resource.model.form.pdffilelibrary.*;
import com.zrqx.resource.model.po.ebook.Ebook;
import com.zrqx.resource.model.po.goodslibrary.GoodsLibrary;
import com.zrqx.resource.model.po.pdflibrary.PdfLibrary;
import com.zrqx.resource.model.po.pdflibrary.PdfLibraryDiyType;
import com.zrqx.resource.model.po.resourcerelation.RelationAuthor;
......@@ -101,9 +102,28 @@ public class PdfLibraryController {
@ApiOperation(value = "批量删除", notes = "批量删除")
@PostMapping(value = "/batch/delete")
public CallBack<Boolean> deleteByIds(@RequestBody List<String> ids) {
return CallBack.success(service.batchDelete(ids));
LambdaUpdateWrapper<PdfLibrary> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(PdfLibrary::getIsDelete,0);
lambdaUpdateWrapper.in(PdfLibrary::getId,ids);
service.update(lambdaUpdateWrapper);
return CallBack.success();
}
@ApiOperation(value = "回收站还原", notes = "回收站还原")
@PostMapping(value = "/batch/reduction")
public CallBack<Boolean> reduction(@RequestBody List<String> ids) {
LambdaUpdateWrapper<PdfLibrary> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(PdfLibrary::getIsDelete,1);
lambdaUpdateWrapper.in(PdfLibrary::getId,ids);
service.update(lambdaUpdateWrapper);
return CallBack.success();
}
@ApiOperation(value = "回收站批量删除", notes = "回收站批量删除")
@PostMapping(value = "/batch/recycleDelete")
public CallBack<Boolean> recycleDeleteByIds(@RequestBody List<String> ids) {
if (service.batchDelete(ids)) {
}
return CallBack.success();
}
@ApiOperation(value = "查询", notes = "根据ID查询")
@GetMapping(value = "/get/{oid}")
public CallBack<PdfLibraryOneVO> getById(@PathVariable String oid) {
......
......@@ -11,6 +11,7 @@ import com.zrqx.core.response.CallBack;
import com.zrqx.resource.exception.ResourceBizException;
import com.zrqx.resource.model.enums.ProjectStatusEnum;
import com.zrqx.resource.model.form.projectlibrary.*;
import com.zrqx.resource.model.po.pdflibrary.PdfLibrary;
import com.zrqx.resource.model.po.projectlibrary.ProjectDiyModel;
import com.zrqx.resource.model.po.projectlibrary.ProjectLibrary;
import com.zrqx.resource.model.po.projectlibrary.ProjectModelResource;
......@@ -99,9 +100,31 @@ public class ProjectLibraryController {
if (ids == null || ids.size() == 0) {
throw new ResourceBizException("没有选中任何数据,请重新选择");
}
return CallBack.success(service.batchDelete(ids));
LambdaUpdateWrapper<ProjectLibrary> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(ProjectLibrary::getIsDelete,0);
lambdaUpdateWrapper.in(ProjectLibrary::getId,ids);
service.update(lambdaUpdateWrapper);
return CallBack.success();
}
@ApiOperation(value = "回收站还原", notes = "回收站还原")
@PostMapping(value = "/batch/reduction")
public CallBack<Boolean> reduction(@RequestBody List<String> ids) {
LambdaUpdateWrapper<ProjectLibrary> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(ProjectLibrary::getIsDelete,1);
lambdaUpdateWrapper.in(ProjectLibrary::getId,ids);
service.update(lambdaUpdateWrapper);
return CallBack.success();
}
@ApiOperation(value = "回收站批量删除", notes = "回收站批量删除")
@PostMapping(value = "/batch/recycleDelete")
public CallBack<Boolean> recycleDeleteByIds(@RequestBody List<String> ids) {
if (ids == null || ids.size() == 0) {
throw new ResourceBizException("没有选中任何数据,请重新选择");
}
if (service.batchDelete(ids)) {
}
return CallBack.success();
}
@ApiOperation(value = "查询", notes = "根据ID查询")
@GetMapping(value = "/get/{oid}")
public CallBack<ProjectLibraryVO> getById(@PathVariable String oid) {
......
......@@ -15,6 +15,7 @@ import com.zrqx.resource.model.form.videolibrary.BatchUpdateVideoLibraryForm;
import com.zrqx.resource.model.form.videolibrary.QueryVideoLibraryForm;
import com.zrqx.resource.model.form.videolibrary.SaveUpdateVideoLibraryForm;
import com.zrqx.resource.model.form.videolibrary.SaveVideoLibraryForm;
import com.zrqx.resource.model.po.projectlibrary.ProjectLibrary;
import com.zrqx.resource.model.po.resourcerelation.RelationAuthor;
import com.zrqx.resource.model.po.videolibrary.VideoLabelPO;
import com.zrqx.resource.model.po.videolibrary.VideoLibrary;
......@@ -163,13 +164,31 @@ public class VideoLibraryController {
@ApiOperation(value = "批量删除", notes = "批量删除")
@PostMapping(value = "/batch/delete")
public CallBack<Boolean> deleteByIds(@RequestBody List<String> ids) {
LambdaUpdateWrapper<VideoLibrary> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(VideoLibrary::getIsDelete,0);
lambdaUpdateWrapper.in(VideoLibrary::getId,ids);
service.update(lambdaUpdateWrapper);
return CallBack.success();
}
@ApiOperation(value = "回收站还原", notes = "回收站还原")
@PostMapping(value = "/batch/reduction")
public CallBack<Boolean> reduction(@RequestBody List<String> ids) {
LambdaUpdateWrapper<VideoLibrary> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(VideoLibrary::getIsDelete,1);
lambdaUpdateWrapper.in(VideoLibrary::getId,ids);
service.update(lambdaUpdateWrapper);
return CallBack.success();
}
@ApiOperation(value = "回收站批量删除", notes = "回收站批量删除")
@PostMapping(value = "/batch/recycleDelete")
public CallBack<Boolean> recycleDeleteByIds(@RequestBody List<String> ids) {
if (ids == null || ids.size() == 0) {
throw new ResourceBizException("没有选中任何数据,请重新选择");
}
if (service.batchDelete(ids)) {
// 删除索引
// solrManage.asyncDeleteIndex(ids);
}
return CallBack.success();
}
@ApiOperation(value = "查询", notes = "根据ID查询")
@GetMapping(value = "/get/{oid}")
public CallBack<VideoLibraryOneVO> getById(@PathVariable String oid) {
......
......@@ -9,16 +9,13 @@ import com.zrqx.core.page.PageParam;
import com.zrqx.core.response.CallBack;
import com.zrqx.core.vo.GoodsBuyVO;
import com.zrqx.provider.feign.admin.AdminClient;
import com.zrqx.provider.model.form.GoodsForm;
import com.zrqx.provider.model.vo.resource.DiyTypeVO;
import com.zrqx.provider.model.vo.resource.OrderInfoVO;
import com.zrqx.resource.exception.ResourceBizException;
import com.zrqx.resource.manage.ResourceManage;
import com.zrqx.resource.mapper.label.LabelContentDiyTypeMapper;
import com.zrqx.resource.mapper.label.LabelMapper;
import com.zrqx.resource.model.enums.DiyTypeStatusEnum;
import com.zrqx.resource.model.enums.PriceOptionEnum;
import com.zrqx.resource.model.form.FgResourceQuery;
import com.zrqx.resource.model.form.QueryResourceRelationForm;
import com.zrqx.resource.model.form.ResourceQueryForm;
import com.zrqx.resource.model.form.label.QueryLabelListForm;
......@@ -38,21 +35,16 @@ import com.zrqx.resource.model.po.ebook.Ebook;
import com.zrqx.resource.model.po.ebook.EbookDiyType;
import com.zrqx.resource.model.po.imagelibrary.ImageLibrary;
import com.zrqx.resource.model.po.imagelibrary.ImageLibraryDiyType;
import com.zrqx.resource.model.po.label.LabelContentDiyType;
import com.zrqx.resource.model.po.phybook.PhysicalBook;
import com.zrqx.resource.model.po.projectlibrary.ProjectLibrary;
import com.zrqx.resource.model.po.resourcerelation.ResourceRelation;
import com.zrqx.resource.model.po.searchHistory.SearchHistory;
import com.zrqx.resource.model.po.videolibrary.VideoLibrary;
import com.zrqx.resource.model.po.videolibrary.VideoLibraryDiyType;
import com.zrqx.resource.model.vo.*;
import com.zrqx.resource.model.vo.ResorceTypeAndNumVO;
import com.zrqx.resource.model.vo.ResourceListInfoVO;
import com.zrqx.resource.model.vo.ResourceRelationVO;
import com.zrqx.resource.model.vo.ResultPage;
import com.zrqx.resource.model.vo.authorlibrary.AboutListVO;
import com.zrqx.resource.model.vo.courselibrary.CourseLibraryVO;
import com.zrqx.resource.model.vo.courselibrary.CourseResourceVO;
import com.zrqx.resource.model.vo.ebook.EbookVO;
import com.zrqx.resource.model.vo.ebook.EpubReadingProgressVO;
import com.zrqx.resource.model.vo.label.FgLabelContentDiyTypeVO;
import com.zrqx.resource.model.vo.label.FgLabelInfoVO;
import com.zrqx.resource.model.vo.label.LabelContentDiyTypeVO;
import com.zrqx.resource.model.vo.label.LabelInfoVO;
import com.zrqx.resource.model.vo.marketing.PromotionInfoOneVO;
......@@ -61,7 +53,6 @@ import com.zrqx.resource.service.impl.resource.ResourceContext;
import com.zrqx.util.PublicUtil;
import com.zrqx.util.datatype.ArrayUtils;
import com.zrqx.util.datatype.StringUtil;
import com.zrqx.util.redis.Redis;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
......
......@@ -32,6 +32,7 @@ public interface AudioLibraryMapper extends BaseMapper<AudioLibrary> {
+ " like(a.name,form.name) "
+ " eq(a.status,form.status) "
+ " rlike(a.departmentCode,form.departmentCode) "
+ " eq(a.isDelete,form.isDelete) "
+ MapperConstants.DATETIME_QUERY_CONDITION
+ " order by a.createdTime desc "
+ "</script>")
......@@ -41,7 +42,7 @@ public interface AudioLibraryMapper extends BaseMapper<AudioLibrary> {
+ "select DISTINCT a.id,a.name,a.author,a.source,a.realprice,a.createdTime,a.timeLength,a.size,a.status,a.cover,a.resourceType "
+ "from res_audio_library a left join res_Audio_Library_Diy_Type ad "
+ "on a.id = ad.audioid "
+ "where 1=1 and a.status = 1 "
+ "where 1=1 and a.status = 1 and a.isDelete=1 "
+ " rlike(ad.code,form.diyTypeCode) "
+ " like(a.name,form.name) "
+ "<if test='form.ids != null and form.ids.size > 0'>"
......@@ -107,7 +108,7 @@ public interface AudioLibraryMapper extends BaseMapper<AudioLibrary> {
@Select("<script>"
+ "select a.id,a.name,a.source,a.price,a.realPrice,a.createdTime,a.timeLength,a.size,a.status,a.author,a.cover,a.resourceType,a.clickNum,a.synopsis "
+ "from res_audio_Library a "
+ "where a.status = 1 "
+ "where a.status = 1 and a.isDelete=1 "
+ "<if test='form.resourceType != null' >"
+ "and a.resourceType = #{form.resourceType}"
+ "</if>"
......@@ -135,7 +136,7 @@ public interface AudioLibraryMapper extends BaseMapper<AudioLibrary> {
@Select("<script>"
+ "select a.id,a.name,a.source,a.price,a.realPrice,a.createdTime,a.timeLength,a.size,a.status,a.author,a.cover,a.resourceType,a.clickNum,a.synopsis "
+ "from res_audio_Library a "
+ "where a.status = 1 "
+ "where a.status = 1 and a.isDelete=1 "
+ " eq(a.resourceType,form.resourceType) "
+ "<if test='form.ids != null and form.ids.size > 0' >"
+ "and id not in "
......@@ -172,7 +173,7 @@ public interface AudioLibraryMapper extends BaseMapper<AudioLibrary> {
+ "left join res_ebook re "
+ "on rb.id = re.id "
+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on rb.id = a.resourceId "
+ "where re.status = 1 "
+ "where re.status = 1 and re.isDelete=1 "
+ "in(rb.id,reourceIds) "
+ "</script>")
List<AboutEbookListVO> getRelatedBooks(@Param("reourceIds") List<String> reourceIds);
......@@ -181,7 +182,7 @@ public interface AudioLibraryMapper extends BaseMapper<AudioLibrary> {
+ "from res_audio_Library t1 INNER JOIN res_resource_relation t2 on t1.id=t2.resourceId "
+ "left join res_audio_library_diy_type ad on t1.id = ad.audioid "
+ "left join res_audio_label ld on t1.id = ld.audioid "
+ "where 1=1 and t2.resourceType=6 and objectType=10 and t1.status=1 "
+ "where 1=1 and t2.resourceType=6 and objectType=10 and t1.status=1 and t1.isDelete=1 "
+ "LIKE(t1.name,form.keyWord) "
+ "eq(t1.priceOption,form.priceOption) "
+ "rlike(ad.code,form.diyTypeCode) "
......
......@@ -69,6 +69,7 @@ public interface EbookMapper extends BaseMapper<Ebook> {
+ " AND be.createdTime &lt;= concat(#{form.endTime}, ' 23:59:59')"
+ "</if>"
+ " rlike(bb.departmentCode,form.departmentCode) "
+ " eq(be.isDelete,form.isDelete) "
+ "</script>")
List<EbookListVO> page(@Param("form") QueryEbookInfoForm form);
......@@ -81,7 +82,7 @@ public interface EbookMapper extends BaseMapper<Ebook> {
+ " LEFT JOIN res_ebook be ON bb.id = be.id "
+ " LEFT JOIN res_ebook_diy_type bdt ON be.id = bdt.ebookid"
//+ " LEFT JOIN ( SELECT resourceId,author,authorId FROM res_relation_author GROUP BY resourceId HAVING MIN(id)) ba ON bb.id = ba.resourceId "
+ " WHERE 1 = 1 AND be.status = 1 "
+ " WHERE 1 = 1 AND be.status = 1 and be.isDelete=1"
+ " rlike(bdt.code,form.diyTypeCode) "
+ " LIKE(bb.name,form.name) "
+ " rlike(bb.departmentCode,form.departmentCode) "
......@@ -190,7 +191,7 @@ public interface EbookMapper extends BaseMapper<Ebook> {
+ "left join res_ebook re on rb.id = re.id "
+ "left join res_resource_relation rr on rb.id = rr.resourceId "
//+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on rb.id = a.resourceId "
+ "where re.status = 1 "
+ "where re.status = 1 and re.isDelete=1"
+ "eq(rr.objectId, resourceId) "
+ "</script>")
List<AboutEbookListVO> getRelatedBooks(@Param("resourceId") String resourceId);
......@@ -267,7 +268,7 @@ public interface EbookMapper extends BaseMapper<Ebook> {
+ "LEFT JOIN res_ebook_diy_type diy ON be.id = diy.ebookId "
+ "LEFT JOIN res_qr_code qr ON be.id = qr.resourceId "
//+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on be.id = a.resourceId "
+ "where be.status = 1 "
+ "where be.status = 1 and be.isDelete=1"
+ " rlike(diy.code,form.diyTypeCode) "
+ "<if test='form.ids != null and form.ids.size > 0' >"
+ "and bb.id not in "
......@@ -316,7 +317,7 @@ public interface EbookMapper extends BaseMapper<Ebook> {
+ " LEFT JOIN res_ebook be ON bb.id = be.id "
+ " LEFT JOIN res_ebook_diy_type bdt ON be.id = bdt.ebookId"
//+ " LEFT JOIN ( SELECT resourceId,author,authorId FROM res_relation_author GROUP BY resourceId HAVING MIN(id)) ba ON bb.id = ba.resourceId "
+ " WHERE be.status = 1 "
+ " WHERE be.status = 1 and be.isDelete=1"
+ " eq(be.priceOption,form.priceOption)"
+"</script>")
List<ResourceListInfoVO> queryResourcePageInfoList(@Param("form") ResourceQueryForm form);
......@@ -364,7 +365,7 @@ public interface EbookMapper extends BaseMapper<Ebook> {
+ " LEFT JOIN res_ebook be ON bb.id = be.id "
+ " LEFT JOIN res_ebook_diy_type bdt ON be.id = bdt.ebookId"
// + " LEFT JOIN ( SELECT resourceId,author,authorId FROM res_relation_author GROUP BY resourceId HAVING MIN(id)) ba ON bb.id = ba.resourceId "
+ " WHERE be.status = 1 "
+ " WHERE be.status = 1 and be.isDelete=1"
+ " ne(bb.id,bookid) "
+"</script>")
List<EbookListVO> getBookListTop(@Param("bookid") String bookid);
......
......@@ -44,6 +44,7 @@ public interface GoodsLibraryMapper extends BaseMapper<GoodsLibrary> {
+ "</if>"
+ " like(a.name,form.name) "
+ " eq(a.status,form.status) "
+ " eq(a.isDelete,form.isDelete) "
+ "<if test='" + MapperConstants.NOT_BLANK + "(form.departmentCode)'>"
+ " AND a.departmentCode LIKE CONCAT(#{form.departmentCode}, '%') "
+ "</if>"
......@@ -54,7 +55,7 @@ public interface GoodsLibraryMapper extends BaseMapper<GoodsLibrary> {
@Select("<script>"
+ "select DISTINCT a.id, a.name, a.cover, a.status, DATE_FORMAT(a.createdTime,'%Y-%m-%d %H:%i:%s') as createdTime "
+ "FROM res_goods_library a left join res_goods_library_diy_type t on a.id = t.goodslibraryid "
+ " where 1 = 1 and a.status = 1 "
+ " where 1 = 1 and a.status = 1 and a.isDelete=1 "
+ " like(a.name,form.name) "
+ " like(t.code,form.diyTypeCode) "
+ " like(a.departmentCode,form.departmentCode) "
......@@ -86,8 +87,8 @@ public interface GoodsLibraryMapper extends BaseMapper<GoodsLibrary> {
@Select("<script>"
+ "select b.createdTime,b.id,b.name,b.img,b.synopsis,b.resourceType,b.realPrice,b.price,b.browseNum,b.totalPeriods,b.defaultImg "
+ "from res_goods_Library b "
+ "where b.status = 1 "
+ "from res_goods_library b "
+ "where b.status = 1 and a.isDelete=1 "
+ "<if test='form.ids != null and form.ids.size > 0' >"
+ "and id not in "
+ " <foreach collection=\"form.ids\" index=\"index\" item=\"id\" open=\"(\" separator=\",\" close=\")\">"
......@@ -121,7 +122,7 @@ public interface GoodsLibraryMapper extends BaseMapper<GoodsLibrary> {
+ " from res_goods_library a "
+ " left join res_goods_library_diy_type ad on a.id = ad.goodsLibraryId "
+ " left join res_diy_type rdt on ad.dtid = rdt.id "
+ " where a.status = 1 "
+ " where a.status = 1 and a.isDelete=1 "
+ " eq(a.priceOption,form.priceOption)"
+"</script>")
List<ResourceListInfoVO> queryResourcePageInfoList(@Param("form") ResourceQueryForm form);
......@@ -143,7 +144,7 @@ public interface GoodsLibraryMapper extends BaseMapper<GoodsLibrary> {
+ " from res_goods_library a left join res_goods_library_diy_type ad "
+ " on a.id = ad.goodsLibraryId "
+ " left join res_diy_type rdt on ad.dtid = rdt.id "
+ " where 1=1 and a.status=1"
+ " where 1=1 and a.status=1 and a.isDelete=1"
//自定义分类
+ "<if test='" + MapperConstants.NOT_BLANK + "(form.diyTypeCode)'>"
+ " AND ad.code LIKE CONCAT(#{form.diyTypeCode}, '%') "
......@@ -184,7 +185,7 @@ public interface GoodsLibraryMapper extends BaseMapper<GoodsLibrary> {
+ " from res_goods_library a "
+ " left join res_goods_library_diy_type ad on a.id = ad.goodsLibraryId "
+ " left join res_diy_type rdt on ad.dtid = rdt.id "
+ " where 1=1 and a.status=1 "
+ " where 1=1 and a.status=1 and a.isDelete=1 "
//自定义分类
+ "<if test='" + MapperConstants.NOT_BLANK + "(form.diyTypeCode)'>"
+ " AND ad.code LIKE CONCAT(#{form.diyTypeCode}, '%') "
......
......@@ -27,7 +27,7 @@ public interface PdfLibraryMapper extends BaseMapper<PdfLibrary> {
+ " LIKE(a.source,form.source) "
+ " eq(a.status,form.status) "
+ " rlike(a.departmentCode,form.departmentCode) "
+ " eq(a.isDelete,form.isDelete) "
+ MapperConstants.DATETIME_QUERY_CONDITION
+ " ORDER BY a.createdTime DESC "
+ "</script>")
......@@ -37,7 +37,7 @@ public interface PdfLibraryMapper extends BaseMapper<PdfLibrary> {
+ "FROM res_Pdf_Library a LEFT JOIN res_Pdf_Library_Diy_Type ad "
+ "ON a.id = ad.pdfId "
+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) b ON a.id = b.resourceId "
+ "WHERE 1=1 "
+ "WHERE 1=1 and a.isDelete=1"
+ " rlike(ad.code,form.diyTypeCode) "
+ " LIKE(a.name,form.name) "
+ " LIKE(a.source,form.source) "
......
......@@ -36,6 +36,7 @@ public interface ProjectLibraryMapper extends BaseMapper<ProjectLibrary> {
+ " eq(a.template,form.template) "
+ " eq(a.status,form.status) "
+ " eq(a.type,form.type) "
+ " eq(a.isDelete,form.isDelete) "
+ " rlike(a.departmentCode,form.departmentCode) "
+ MapperConstants.DATETIME_QUERY_CONDITION
+ "</script>")
......@@ -44,7 +45,7 @@ public interface ProjectLibraryMapper extends BaseMapper<ProjectLibrary> {
@Select("<script>"
+ "SELECT a.id,a.name,a.cover,a.status,a.createdTime,a.resourceType,a.template "
+ "FROM res_project_library a "
+ " WHERE 1 = 1 AND a.status = 1 and type=1 "
+ " WHERE 1 = 1 AND a.status = 1 and type=1 and a.isDelete=1 "
+ " LIKE(a.name,form.name) "
+ "<if test='form.ids != null and form.ids.size > 0'>"
+ "AND a.id NOT IN "
......@@ -81,7 +82,7 @@ public interface ProjectLibraryMapper extends BaseMapper<ProjectLibrary> {
@Select("<script>"
+ "select a.id, a.name, a.cover, a.status, a.createdTime, a.updatedTime, a.resourceType, a.synopsis, a.browseNum "
+ "from res_project_library a "
+ "where a.status = 1 "
+ "where a.status = 1 and a.isDelete=1"
+ "<if test='" + MapperConstants.NOT_BLANK + "(form.resourceType)'>"
+ "and a.resourceType = #{form.resourceType}"
+ "</if>"
......@@ -109,7 +110,7 @@ public interface ProjectLibraryMapper extends BaseMapper<ProjectLibrary> {
@Select("<script>"
+ "select a.id, a.name, a.cover, a.status, a.createdTime, a.updatedTime, a.resourceType, a.synopsis, a.browseNum "
+ "from res_project_library a "
+ "where a.status = 1 "
+ "where a.status = 1 and a.isDelete=1"
+ "<if test='form.resourceType != null' >"
+ "and a.resourceType = #{form.resourceType}"
+ "</if>"
......
......@@ -31,6 +31,7 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> {
+ "ON a.id = ad.videoId "
+ "WHERE 1=1 "
+ " eq(a.status,form.status) "
+ " eq(a.isDelete,form.isDelete) "
+ " rlike(ad.code,form.diyTypeCode) "
+ " LIKE(a.name,form.name) "
+ " rlike(a.departmentCode,form.departmentCode) "
......@@ -43,7 +44,7 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> {
+ "SELECT DISTINCT a.id,a.name,a.author,a.realprice,a.timeLength,a.size,a.createdTime,a.status,a.cover,a.resourceType "
+ "FROM res_Video_Library a LEFT JOIN res_Video_Library_Diy_Type ad "
+ "ON a.id = ad.videoId "
+ "WHERE 1=1 AND a.status = 1 "
+ "WHERE 1=1 AND a.status = 1 and a.isDelete=1"
+ " rlike(ad.code,form.diyTypeCode) "
+ " LIKE(a.name, form.name) "
+ " rlike(a.departmentCode,form.departmentCode) "
......@@ -211,7 +212,7 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> {
@Select("<script>"
+ "select a.id,a.name,a.video,a.resourceType,a.cover,a.realPrice,a.browseNum "
+ "from res_video_Library a "
+ "where a.status = 1 "
+ "where a.status = 1 and a.isDelete=1"
+ "<if test='form.resourceType != null' >"
+ "and a.resourceType = #{form.resourceType} "
+ "</if>"
......@@ -238,8 +239,8 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> {
*/
@Select("<script>"
+ "select a.id,a.name,a.video,a.resourceType,a.cover,a.realPrice,a.browseNum,a.createdTime "
+ "from res_video_Library a "
+ "where a.status = 1 "
+ "from res_video_library a "
+ "where a.status = 1 and a.isDelete=1"
+ "<if test='form.resourceType != null' >"
+ "and a.resourceType = #{form.resourceType} "
+ "</if>"
......@@ -258,7 +259,7 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> {
@Select("<script>"
+ "select a.id,a.name,a.video,a.resourceType,a.cover,a.realPrice,a.browseNum,a.timeLength "
+ "from res_video_Library a "
+ "where a.status = 1 "
+ "where a.status = 1 and a.isDelete=1"
+ "<if test='form.resourceType != null' >"
+ "and a.resourceType = #{form.resourceType}"
+ "</if>"
......@@ -285,8 +286,8 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> {
*/
@Select("<script>"
+ "select a.id,a.name,a.video,a.resourceType,a.cover,a.realPrice,a.browseNum,a.createdTime,a.timeLength "
+ "from res_video_Library a "
+ "where a.status = 1 "
+ "from res_video_library a "
+ "where a.status = 1 and a.isDelete=1"
+ "<if test='form.resourceType != null' >"
+ "and a.resourceType = #{form.resourceType}"
+ "</if>"
......@@ -326,7 +327,7 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> {
+ "left join res_ebook re "
+ "on rb.id = re.id "
+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on rb.id = a.resourceId "
+ "where re.status = 1 "
+ "where re.status = 1 and re.isDelete=1"
+ "in(rb.id,reourceIds) "
+ "</script>")
List<AboutEbookListVO> getRelatedBooks(@Param("reourceIds") List<String> reourceIds);
......
......@@ -25,4 +25,6 @@ public class QueryAudioLibraryForm {
private String diyTypeCode;
@ApiModelProperty(value = "部门")
private String departmentCode;
@ApiModelProperty("删除状态 0:已删除 1:未删除")
private Integer isDelete;
}
......@@ -42,4 +42,7 @@ public class QueryEbookInfoForm {
private Integer departmentId;
@ApiModelProperty(value = "部门")
private String departmentCode;
@ApiModelProperty("删除状态 0:已删除 1:未删除")
private Integer isDelete;
}
......@@ -23,4 +23,6 @@ public class QueryGoodsLibraryForm {
private String departmentCode;
@ApiModelProperty("系列")
private String projectId;
@ApiModelProperty("删除状态 0:已删除 1:未删除")
private Integer isDelete;
}
......@@ -29,4 +29,6 @@ public class QueryPdfLibraryForm {
private Integer nationsType;
@ApiModelProperty(value = "部门")
private String departmentCode;
@ApiModelProperty("删除状态 0:已删除 1:未删除")
private Integer isDelete;
}
......@@ -29,4 +29,6 @@ public class QueryProjectLibraryForm {
private String departmentCode;
@ApiModelProperty("所属类型 1专题 2系列")
private String type;
@ApiModelProperty("删除状态 0:已删除 1:未删除")
private Integer isDelete;
}
......@@ -25,4 +25,6 @@ public class QueryVideoLibraryForm {
private String diyTypeCode;
@ApiModelProperty(value = "部门")
private String departmentCode;
@ApiModelProperty("删除状态 0:已删除 1:未删除")
private Integer isDelete;
}
......@@ -74,4 +74,6 @@ public class AudioLibrary {
private String departmentCode;
@ApiModelProperty("下载状态 0:下载 1:禁止下载")
private String isDownload;
@ApiModelProperty("删除状态 0:已删除 1:未删除")
private Integer isDelete;
}
......@@ -99,5 +99,6 @@ public class Ebook {
private Integer readerNum;
@ApiModelProperty("下载状态 0:下载 1:禁止下载")
private String isDownload;
@ApiModelProperty("删除状态 0:已删除 1:未删除")
private Integer isDelete;
}
......@@ -48,5 +48,6 @@ public class GoodsLibrary {
private Integer resourceType;
@ApiModelProperty(value = "zip文件")
private String fileName;
@ApiModelProperty("删除状态 0:已删除 1:未删除")
private Integer isDelete;
}
......@@ -48,4 +48,6 @@ public class PdfLibrary {
private String departmentCode;
@ApiModelProperty("下载状态 0:下载 1:禁止下载")
private String isDownload;
@ApiModelProperty("删除状态 0:已删除 1:未删除")
private Integer isDelete;
}
......@@ -48,4 +48,6 @@ public class ProjectLibrary extends BasePO {
private String isDownload;
@ApiModelProperty("所属类型 1专题 2系列")
private String type;
@ApiModelProperty("删除状态 0:已删除 1:未删除")
private Integer isDelete;
}
......@@ -76,4 +76,6 @@ public class VideoLibrary {
private String departmentCode;
@ApiModelProperty("下载状态 0:下载 1:禁止下载")
private String isDownload;
@ApiModelProperty("删除状态 0:已删除 1:未删除")
private Integer isDelete;
}
......@@ -145,6 +145,7 @@ public class AudioLibrarySerivceImpl extends ServiceImpl<AudioLibraryMapper, Aud
entity.setResourceType(AllResourceTypeEnum.AUDIO.getCode());
entity.setBrowseNum(50);
entity.setSalesNum(0);
entity.setIsDelete(1);
ObjectMapper mapper1 = new ObjectMapper();
String jsonString = systemAdminClient.infoJson(Integer.parseInt(tokenManager.getUserId()));
try {
......@@ -246,6 +247,7 @@ public class AudioLibrarySerivceImpl extends ServiceImpl<AudioLibraryMapper, Aud
entity.setRealPrice(new BigDecimal(0));
entity.setSalesNum(0);
entity.setShares(0);
entity.setIsDelete(1);
entity.setStatus(LibraryStatusEnum.STATUS_0.getCode());
entity.setCreatedTime(new Date());
entity.setUpdateTime(new Date());
......
......@@ -244,6 +244,7 @@ public class EbookServiceImpl extends ServiceImpl<EbookMapper, Ebook> implements
ebook.setShares(0);
ebook.setSales(0);
ebook.setGoodsType(GoodsTypeEnum.EBOOK.getCode());
ebook.setIsDelete(1);
ebookMapper.insert(ebook);
QrCode qrCode = new QrCode();
qrCode.setResourceId(book.getId());
......@@ -497,6 +498,7 @@ public class EbookServiceImpl extends ServiceImpl<EbookMapper, Ebook> implements
ebook.setBrowseNum(50); //浏览量
ebook.setShares(0);
ebook.setSales(0);
ebook.setIsDelete(1);
ebook.setGoodsType(GoodsTypeEnum.EBOOK.getCode());
b.setIsbn(excelBookExportVo.getIsbn());
b.setExecutiveEditor(b.getAuthor());
......
......@@ -157,6 +157,7 @@ public class GoodsLibraryServiceImpl extends ServiceImpl<GoodsLibraryMapper, Goo
entity.setUpdateTime(new Date());
entity.setStatus(LibraryStatusEnum.STATUS_0.getCode());
entity.setResourceType(16);
entity.setIsDelete(1);
ObjectMapper mapper1 = new ObjectMapper();
String jsonString = systemAdminClient.infoJson(Integer.parseInt(tokenManager.getUserId()));
try {
......
......@@ -90,6 +90,7 @@ public class PdfLibrarySerivceImpl extends ServiceImpl<PdfLibraryMapper, PdfLibr
//添加
entity.setStatus(LibraryStatusEnum.STATUS_0.getCode());
entity.setCreatedTime(new Date());
entity.setIsDelete(1);
ObjectMapper mapper1 = new ObjectMapper();
String jsonString = systemAdminClient.infoJson(Integer.parseInt(tokenManager.getUserId()));
try {
......@@ -157,6 +158,7 @@ public class PdfLibrarySerivceImpl extends ServiceImpl<PdfLibraryMapper, PdfLibr
obj.setCreatedTime(new Date());
obj.setStatus(LibraryStatusEnum.STATUS_0.getCode());
obj.setIsDownload("0");
obj.setIsDelete(1);
ObjectMapper mapper1 = new ObjectMapper();
String jsonString = systemAdminClient.infoJson(Integer.parseInt(tokenManager.getUserId()));
try {
......
......@@ -111,6 +111,7 @@ public class ProjectLibraryServiceImpl extends ServiceImpl<ProjectLibraryMapper,
//添加专题
entity.setResourceType(AllResourceTypeEnum.PROJECT.getCode());
entity.setBrowseNum(50);
entity.setIsDelete(1);
ObjectMapper mapper1 = new ObjectMapper();
String jsonString = systemAdminClient.infoJson(Integer.parseInt(tokenManager.getUserId()));
try {
......
......@@ -177,6 +177,7 @@ public class VideoLibrarySerivceImpl extends ServiceImpl<VideoLibraryMapper, Vid
entity.setBrowseNum(50);
entity.setShares(0);
entity.setSalesNum(0);
entity.setIsDelete(1);
entity.setSalesType(SalsesTypeEnum.STATUS_1.getCode());
ObjectMapper mapper1 = new ObjectMapper();
String jsonString = systemAdminClient.infoJson(Integer.parseInt(tokenManager.getUserId()));
......@@ -272,6 +273,7 @@ public class VideoLibrarySerivceImpl extends ServiceImpl<VideoLibraryMapper, Vid
entity.setCreatedTime(new Date());
entity.setCreatedTime(new Date());
entity.setIsDownload("0");
entity.setIsDelete(1);
if (StringUtils.isNotBlank(f.getVideoName())) {
entity.setName(f.getVideoName().substring(0, f.getVideoName().lastIndexOf(".")));
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论