提交 2c0285d6 authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 0c72d302
......@@ -91,20 +91,20 @@ public class AnnexLibraryController {
@ApiOperation(value = "批量修改分类", notes = "批量修改分类")
@PostMapping(value = ResourceRequestPath.BATCH_UPDATE_DIYTIPE)
public CallBack<Boolean> updateDivType(@RequestBody BatchUpdateAnnexLibraryForm form) {
List<AnnexLibraryDiyType> list = new ArrayList<AnnexLibraryDiyType>();
form.getIds().forEach(alId -> {
//刪除原有的分类
AnnexLibraryDiyType ob = new AnnexLibraryDiyType();
ob.setAnnexId(alId);
vdrService.delete(ob);
//添加
List<AnnexLibraryDiyType> ls = form.getDiyType();
ls.forEach(l -> l.setAnnexId(alId));
list.addAll(ls);
for (AnnexLibraryDiyType diyType : form.getDiyType()) {
AnnexLibraryDiyType annex = new AnnexLibraryDiyType();
annex.setCode(diyType.getCode());
annex.setDtId(diyType.getDtId());
annex.setAnnexId(alId);
vdrService.insert(annex);
}
});
if (!vdrService.insertUuidList(list)) {
throw new BusinessValidateException("操作失败");
}
return CallBack.success();
}
......
......@@ -191,7 +191,7 @@ public class ArticleLibraryController {
@ApiOperation(value = "查询", notes = "根据ID查询")
@GetMapping(value = "/get/oid")
public CallBack<ArticleLibraryOneVO> getById(@PathVariable String oid) {
public CallBack<ArticleLibraryOneVO> getById(String oid) {
ArticleLibrary entity = service.selectByPrimaryKey(oid);
ArticleLibraryOneVO vo = new ArticleLibraryOneVO();
BeanUtils.copyProperties(entity, vo);
......
......@@ -15,7 +15,7 @@ import com.zrqx.core.vo.resource.annexlibrary.AnnexLibraryListVO;
*/
public interface AnnexLibraryMapper extends BaseMapper<AnnexLibrary> {
@Select("<script>"
+ "<if test='form.diyTypeCode==null"
+ "<if test='form.diyTypeCode==null'>"
+ "select a.id,a.name,a.source,a.uploadTime from res_annex_library a "
+ "</if>"
+ "<if test='" + NOTBLANK + "(form.diyTypeCode)'>"
......
......@@ -23,13 +23,13 @@ public interface ArticleLibraryMapper extends BaseMapper<ArticleLibrary> {
+ "<if test = 'form.diyTypeCode == null' >"
+ "select a.id,a.name,a.author,a.source,a.uploadTime,a.status "
+ "from res_Article_Library a "
+ "</if>"
+ "</if>"
+ "<if test = 'form.diyTypeCode != null' >"
+ "select a.id,a.name,a.author,a.source,a.uploadTime,a.status "
+ "from res_Article_Library a left join res_Article_Library_Diy_Type ad "
+ "on a.id = ad.alid "
+ "</if>"
+ "where 1=1 "
+ "</if>"
+ " where 1=1 "
+ "<if test = 'form.diyTypeCode != null' >"
+ " and ad.code like concat('%', #{form.diyTypeCode},'%'))"
+ "</if>"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论