27ffacca by 夏齐

档案销毁相关操作接口新增

1 parent 084a502b
......@@ -3,6 +3,9 @@ package com.pashanhoo.archive.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pashanhoo.archive.entity.DgArchivesDO;
import com.pashanhoo.archive.entity.vo.DgArchivesSearchRequest;
import java.util.List;
/**
* <p>
......@@ -14,4 +17,5 @@ import com.pashanhoo.archive.entity.DgArchivesDO;
*/
public interface DgArchivesMapper extends BaseMapper<DgArchivesDO> {
}
......
......@@ -78,8 +78,26 @@ public class DgArchivesServiceImpl extends ServiceImpl<DgArchivesMapper, DgArchi
//设置默认排序
wrapper = "desc".equals(request.getSortOrder()) ? wrapper.orderByDesc(request.getSortField()) : wrapper.orderByAsc(request.getSortField());
//TODO 根据当前情况设置wrapper条件
//增加条件
// lt:less than 小于
// le:less than or equal to 小于等于
// eq:equal to 等于
// ne:not equal to 不等于
// ge:greater than or equal to 大于等于
// gt:greater than 大于
wrapper = "desc".equals(request.getSortOrder()) ? wrapper.orderByDesc(request.getSortField()) : wrapper.orderByAsc(request.getSortField());
wrapper.eq(request.getAjbt()!=null,"AJBT",request.getAjbt());
wrapper.eq(request.getFlh()!=null,"FLH",request.getFlh());
wrapper.eq(request.getMlh()!=null,"MLH",request.getMlh());
wrapper.eq(request.getAjh()!=null,"AJH",request.getAjh());
wrapper.eq(request.getNd()!=null,"ND",request.getNd());
wrapper.eq(request.getDazt()!=null,"DAZT",request.getDazt());
wrapper.eq(request.getMj()!=null,"MJ",request.getMj());
wrapper.ge(request.getQsrq()!=null,"QSRQ",request.getQsrq());
wrapper.le(request.getZzrq()!=null,"ZZRQ",request.getZzrq());
wrapper.eq(request.getHh()!=null,"HH",request.getHh());
wrapper.eq(request.getCfwz()!=null,"CFWZ",request.getCfwz());
wrapper.eq(request.getZtc()!=null,"ZTC",request.getZtc());
Page page = this.page(pageParam, wrapper);
//将查询出来的DO List转为 ListVO List并重新设置到page对象中,并返回page对象
return page.setRecords(dgarchivesConverter.doList2ListVOList(page.getRecords()));
......
package com.pashanhoo.destroy.controller;
import com.pashanhoo.archive.entity.vo.DgArchivesSearchRequest;
import com.pashanhoo.common.Result;
import com.pashanhoo.destroy.entity.vo.AddDgArchivesDestructionRequest;
import com.pashanhoo.destroy.entity.vo.DgArchivesDestructionSearchRequest;
import com.pashanhoo.destroy.entity.vo.UpdateDgArchivesDestructionRequest;
import com.pashanhoo.destroy.service.DgArchivesDestructionService;
import com.pashanhoo.destroycatalog.entity.vo.AddDgDestructionCatalogRequest;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
......@@ -30,25 +32,44 @@ public class DgArchivesDestructionController {
@Autowired
private DgArchivesDestructionService dgarchivesdestructionService;
@PostMapping("search")
@ApiOperation(value = "根据条件进行列表查询")
public Result searchDgArchivesDestructionList(@RequestBody DgArchivesDestructionSearchRequest request) {
return dgarchivesdestructionService.searchDgArchivesDestructionList(request);
}
@GetMapping("deleteDgArchivesDestructionByIds")
@ApiOperation(value = "根据销毁记录标识码删除档案销毁记录")
public Result deleteDgArchivesDestructionByIds(@ApiParam("档案销毁ID") @RequestParam(value = "bsm_destruction") String bsm_destruction) {
return dgarchivesdestructionService.deleteDgArchivesDestruction(bsm_destruction);
}
@PostMapping("insertDgArchivesDestruction")
@ApiOperation("新增档案销毁")
public Result insertDgArchivesDestruction(@RequestBody AddDgArchivesDestructionRequest request) {
if (dgarchivesdestructionService.insertDgArchivesDestruction(request)) {
return Result.ok();
return dgarchivesdestructionService.insertDgArchivesDestruction(request);
}
return Result.error("新增失败");
@PostMapping("showArchivesForDestruction")
@ApiOperation("展示可以选择销毁的列表")
public Result showArchivesForDestruction(@RequestBody DgArchivesSearchRequest request) {
return dgarchivesdestructionService.showArchivesForDestruction(request);
}
@DeleteMapping("deleteDgArchivesDestructionByIds")
@ApiOperation(value = "批量删除档案销毁")
public Result deleteDgArchivesDestructionByIds(@ApiParam("档案销毁ID列表") @RequestParam(value = "idList") List<String> idList) {
if (dgarchivesdestructionService.removeByIds(idList)) {
return Result.ok("删除成功");
@PostMapping("addDestructionArchivesInfo")
@ApiOperation(value = "选择销毁档案List")
public Result addDestructionArchivesInfo(@RequestBody List<AddDgDestructionCatalogRequest> archivesList) {
return dgarchivesdestructionService.addDestructionArchivesInfo(archivesList);
}
return Result.error("删除失败");
@PostMapping("queryArchivesInfo")
@ApiOperation(value = "档案列表信息展示")
public Result queryArchivesInfo(@ApiParam("档案销毁记录ID") @RequestParam(value = "bsm_destruction") String bsm_destruction) {
return dgarchivesdestructionService.queryArchivesInfo(bsm_destruction);
}
@PutMapping("updateDgArchivesDestruction")
@GetMapping("deleteArchivesInfo")
@ApiOperation(value = "删除档案列表中的档案信息")
public Result deleteArchivesInfo(@ApiParam("档案销毁记录ID") @RequestParam(value = "bsm_destruction") String bsm_destruction) {
return dgarchivesdestructionService.deleteDestructionArchivescataLog(bsm_destruction);
}
@PostMapping("updateDgArchivesDestruction")
@ApiOperation("修改档案销毁")
public Result updateDgArchivesDestruction(@RequestBody UpdateDgArchivesDestructionRequest request) {
if (dgarchivesdestructionService.updateDgArchivesDestruction(request)) {
......@@ -56,18 +77,29 @@ public class DgArchivesDestructionController {
}
return Result.error("修改失败");
}
@GetMapping("getDgArchivesDestructionDetailById")
@ApiOperation(value = "读取明细")
public Result getDgArchivesDestructionDetailById(@ApiParam("档案销毁ID") @RequestParam String id) {
return Result.ok(dgarchivesdestructionService.getDgArchivesDestructionDetailById(id));
@ApiOperation(value = "查询档案销毁信息")
public Result getDgArchivesDestructionDetailById(@ApiParam("档案销毁ID") @RequestParam String bsm_destruction) {
return Result.ok(dgarchivesdestructionService.getDgArchivesDestructionDetailById(bsm_destruction));
}
@PostMapping("search")
@ApiOperation(value = "根据条件进行列表查询")
public Result searchDgArchivesDestructionList(@RequestBody DgArchivesDestructionSearchRequest request) {
//TODO 默认排序条件设置
request.defaultFillPageProp("", "");
return Result.ok(dgarchivesdestructionService.searchDgArchivesDestructionList(request));
@GetMapping("getDestructionArchivescataLog")
@ApiOperation(value = "查询档案销毁目录信息")
public Result getDestructionArchivescataLog(@ApiParam("档案销毁ID") @RequestParam(value = "bsm_destruction") String bsm_destruction) {
return dgarchivesdestructionService.queryArchivesInfo(bsm_destruction);
}
@GetMapping("deleteDestructionArchivescataLog")
@ApiOperation(value = "删除档案销毁目录信息")
public Result deleteDestructionArchivescataLog(@ApiParam("档案销毁ID") @RequestParam(value = "bsm_destruction") String bsm_destruction) {
return dgarchivesdestructionService.deleteDestructionArchivescataLog(bsm_destruction);
}
@PostMapping("updateStateByArchives")
@ApiOperation(value = "新增档案销毁列表中的档案销毁操作")
public Result updateStateByArchives(@ApiParam("档案业务信息ID列表") @RequestParam(value = "idList") List<String> idList) {
return dgarchivesdestructionService.updateStateByArchives(idList);
}
@GetMapping("updateArchivesStateByDestruction")
@ApiOperation(value = "编辑中的销毁操作")
public Result updateArchivesStateByDestruction(@ApiParam("档案销毁记录ID") @RequestParam(value = "bsm_destruction") String bsm_destruction) {
return dgarchivesdestructionService.updateArchivesStateByDestruction(bsm_destruction);
}
}
......
......@@ -18,7 +18,6 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="档案销毁列表VO")
//TODO 该类属性暂时是完整的全部属性,需进行个性化的增删
public class DgArchivesDestructionListVO implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -76,6 +75,10 @@ public class DgArchivesDestructionListVO implements Serializable {
*/
@ApiModelProperty(name = "xhrq", value = "销毁日期")
private Date xhrq;
/**
* 数量(卷)
*/
@ApiModelProperty(name = "ajNum", value = "数量(卷)")
private String ajNum;
}
......
......@@ -19,58 +19,21 @@ import com.pashanhoo.common.PageInfo;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="档案销毁列表查询请求实体")
//TODO 初始查询条件是全部,需要根据情况自行删减
public class DgArchivesDestructionSearchRequest extends PageInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 销毁标识码
*/
@ApiModelProperty(name = "bsmDestruction", value = "销毁标识码")
private String bsmDestruction;
/**
* 销毁清册编号
*/
@ApiModelProperty(name = "xhqcbh", value = "销毁清册编号")
private String xhqcbh;
/**
* 发起人
*/
@ApiModelProperty(name = "fqr", value = "发起人")
private String fqr;
/**
* 发起日期
*/
@ApiModelProperty(name = "fqrq", value = "发起日期")
private Date fqrq;
/**
* 销毁原因
*/
@ApiModelProperty(name = "xhyy", value = "销毁原因")
private String xhyy;
/**
* 审核人
*/
@ApiModelProperty(name = "shry", value = "审核人")
private String shry;
/**
* 审批意见
*/
@ApiModelProperty(name = "shyj", value = "审批意见")
private String shyj;
/**
* 监销人
* 档案号
*/
@ApiModelProperty(name = "xhr", value = "监销人")
private String xhr;
@ApiModelProperty(name = "ajh", value = "档案号")
private String ajh;
/**
* 销毁日期
......
......@@ -2,7 +2,13 @@ package com.pashanhoo.destroy.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pashanhoo.archive.entity.vo.DgArchivesListVO;
import com.pashanhoo.destroy.entity.DgArchivesDestructionDO;
import com.pashanhoo.destroy.entity.vo.DgArchivesDestructionListVO;
import com.pashanhoo.destroy.entity.vo.DgArchivesDestructionSearchRequest;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
......@@ -14,4 +20,11 @@ import com.pashanhoo.destroy.entity.DgArchivesDestructionDO;
*/
public interface DgArchivesDestructionMapper extends BaseMapper<DgArchivesDestructionDO> {
List<DgArchivesDestructionListVO> selectXhResult(DgArchivesDestructionSearchRequest request);
boolean updateArchivesStatus(@Param("bsm_destruction") String bsm_destruction,@Param("dazt") String dazt);
List<DgArchivesListVO> queryArchivesInfo(@Param("bsm_destruction") String bsm_destruction);
boolean updateArchivesStatusBatch(@Param("idList") List<String> idList,@Param("dazt") String dazt);
}
......
package com.pashanhoo.destroy.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pashanhoo.destroy.entity.*;
import com.pashanhoo.archive.entity.vo.DgArchivesSearchRequest;
import com.pashanhoo.common.Result;
import com.pashanhoo.destroy.entity.DgArchivesDestructionDO;
import com.pashanhoo.destroy.entity.vo.AddDgArchivesDestructionRequest;
import com.pashanhoo.destroy.entity.vo.DgArchivesDestructionDetailVO;
import com.pashanhoo.destroy.entity.vo.DgArchivesDestructionSearchRequest;
import com.pashanhoo.destroy.entity.vo.UpdateDgArchivesDestructionRequest;
import com.pashanhoo.destroycatalog.entity.vo.AddDgDestructionCatalogRequest;
import java.util.List;
/**
* <p>
......@@ -18,14 +22,63 @@ import com.pashanhoo.destroy.entity.vo.UpdateDgArchivesDestructionRequest;
* @since 2021-11-05
*/
public interface DgArchivesDestructionService extends IService<DgArchivesDestructionDO> {
/**
* 新增记录
* 根据条件进行列表查询
* @param request
* @return
*/
boolean insertDgArchivesDestruction(AddDgArchivesDestructionRequest request);
Result searchDgArchivesDestructionList(DgArchivesDestructionSearchRequest request);
/**
* 删除记录
* @param bsm_destruction
* @return
*/
Result deleteDgArchivesDestruction(String bsm_destruction);
/**
* 根据条件进行列表查询
* @param bsm_destruction
* @return
*/
Result queryArchivesInfo(String bsm_destruction);
/**
* 根据条件进行列表查询
* @param bsm_destruction
* @return
*/
Result deleteDestructionArchivescataLog(String bsm_destruction);
/**
* 选择销毁档案List
* @param archivesList
* @return
*/
Result addDestructionArchivesInfo(List<AddDgDestructionCatalogRequest> archivesList);
/**
* 销毁接口
* @param bsm_destruction
* @return
*/
Result updateArchivesStateByDestruction(String bsm_destruction);
/**
* 新增档案销毁列表中的档案销毁操作
* @param idList
* @return
*/
Result updateStateByArchives(List<String> idList);
/**
* 新增记录
* @param request
* @return
*/
Result insertDgArchivesDestruction(AddDgArchivesDestructionRequest request);
/**
* 展示可以销毁的档案列表
* @param request
* @return
*/
Result showArchivesForDestruction( DgArchivesSearchRequest request);
/**
* 根据主键查询记录详情
* @param id
* @return
......@@ -39,10 +92,5 @@ public interface DgArchivesDestructionService extends IService<DgArchivesDestruc
*/
boolean updateDgArchivesDestruction(UpdateDgArchivesDestructionRequest request);
/**
* 根据条件进行列表查询
* @param request
* @return
*/
Page searchDgArchivesDestructionList(DgArchivesDestructionSearchRequest request);
}
......
package com.pashanhoo.destroy.service.impl;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pashanhoo.destroy.entity.*;
import com.pashanhoo.destroy.entity.vo.AddDgArchivesDestructionRequest;
import com.pashanhoo.destroy.entity.vo.DgArchivesDestructionDetailVO;
import com.pashanhoo.destroy.entity.vo.DgArchivesDestructionSearchRequest;
import com.pashanhoo.destroy.entity.vo.UpdateDgArchivesDestructionRequest;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pashanhoo.archive.entity.vo.DgArchivesSearchRequest;
import com.pashanhoo.archive.service.DgArchivesService;
import com.pashanhoo.common.Result;
import com.pashanhoo.destroy.entity.DgArchivesDestructionConverter;
import com.pashanhoo.destroy.entity.DgArchivesDestructionDO;
import com.pashanhoo.destroy.entity.vo.*;
import com.pashanhoo.destroy.mapper.DgArchivesDestructionMapper;
import com.pashanhoo.destroy.service.DgArchivesDestructionService;
import com.pashanhoo.destroycatalog.entity.DgDestructionCatalogConverter;
import com.pashanhoo.destroycatalog.entity.DgDestructionCatalogDO;
import com.pashanhoo.destroycatalog.entity.vo.AddDgDestructionCatalogRequest;
import com.pashanhoo.destroycatalog.service.DgDestructionCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.math.BigDecimal;
import java.util.List;
/**
* <p>
......@@ -32,15 +41,32 @@ public class DgArchivesDestructionServiceImpl extends ServiceImpl<DgArchivesDest
@Autowired
private DgArchivesDestructionMapper dgarchivesdestructionMapper;
@Autowired
private DgDestructionCatalogService catalogService;
@Autowired
private DgDestructionCatalogConverter catalogConverter;
@Autowired
private DgArchivesService archivesService;
/**
* 新增记录
* @param request
* @return
*/
@Override
public boolean insertDgArchivesDestruction(AddDgArchivesDestructionRequest request) {
public Result insertDgArchivesDestruction(AddDgArchivesDestructionRequest request) {
DgArchivesDestructionDO dgarchivesdestructionDO = dgarchivesdestructionConverter.addRequest2DO(request);
return this.save(dgarchivesdestructionDO);
String id= IdWorker.get32UUID();
dgarchivesdestructionDO.setBsmDestruction(id);
this.save(dgarchivesdestructionDO);
return Result.ok(id);
}
@Override
public Result showArchivesForDestruction(DgArchivesSearchRequest request) {
request.setDazt(new BigDecimal("4"));
return Result.ok(archivesService.searchDgArchivesList(request));
}
/**
......@@ -71,17 +97,57 @@ public class DgArchivesDestructionServiceImpl extends ServiceImpl<DgArchivesDest
* @return
*/
@Override
public Page searchDgArchivesDestructionList(DgArchivesDestructionSearchRequest request) {
Page<DgArchivesDestructionDO> pageParam = new Page<DgArchivesDestructionDO>(request.getCurrentPage(), request.getPageSize());
QueryWrapper<DgArchivesDestructionDO> wrapper = new QueryWrapper<>();
//设置默认排序
wrapper = "desc".equals(request.getSortOrder()) ? wrapper.orderByDesc(request.getSortField()) : wrapper.orderByAsc(request.getSortField());
public Result searchDgArchivesDestructionList(DgArchivesDestructionSearchRequest request) {
PageHelper.startPage(request.getCurrentPage(), request.getPageSize());
List<DgArchivesDestructionListVO> jyListVOList = dgarchivesdestructionMapper.selectXhResult(request);
PageInfo<DgArchivesDestructionListVO> pageInfo = new PageInfo<DgArchivesDestructionListVO>(jyListVOList);
return Result.ok(pageInfo);
//TODO 根据当前情况设置wrapper条件
}
Page page = this.page(pageParam, wrapper);
//将查询出来的DO List转为 ListVO List并重新设置到page对象中,并返回page对象
return page.setRecords(dgarchivesdestructionConverter.doList2ListVOList(page.getRecords()));
@Override
@Transactional(rollbackFor = Exception.class)
public Result deleteDgArchivesDestruction(String bsm_destruction) {
//删除销毁记录表数据
dgarchivesdestructionMapper.deleteById(bsm_destruction);
//删除档案销毁目录数据
catalogService.deleteDestructionCatalog(bsm_destruction);
//修改档案信息表状态
dgarchivesdestructionMapper.updateArchivesStatus(bsm_destruction,"4");
return Result.ok();
}
@Override
public Result queryArchivesInfo(String bsm_destruction) {
return Result.ok(dgarchivesdestructionMapper.queryArchivesInfo(bsm_destruction));
}
@Override
public Result deleteDestructionArchivescataLog(String bsm_destruction) {
catalogService.deleteDestructionCatalog(bsm_destruction);
return Result.ok();
}
@Override
public Result addDestructionArchivesInfo(List<AddDgDestructionCatalogRequest> archivesList) {
List<DgDestructionCatalogDO> list=catalogConverter.addRequestList2DO(archivesList);
catalogService.saveBatch(list);
return Result.ok();
}
@Override
public Result updateArchivesStateByDestruction(String bsm_destruction) {
//修改档案信息表状态
dgarchivesdestructionMapper.updateArchivesStatus(bsm_destruction,"6");
return Result.ok();
}
@Override
public Result updateStateByArchives(List<String> idList) {
dgarchivesdestructionMapper.updateArchivesStatusBatch(idList,"6");
return Result.ok();
}
}
......
......@@ -22,4 +22,6 @@ public interface DgDestructionCatalogConverter{
DgDestructionCatalogListVO do2ListVO(DgDestructionCatalogDO dgdestructioncatalogDO);
List<DgDestructionCatalogListVO> doList2ListVOList(List<DgDestructionCatalogDO> dgdestructioncatalogDOList);
List<DgDestructionCatalogDO> addRequestList2DO(List<AddDgDestructionCatalogRequest> request);
}
......
......@@ -26,8 +26,8 @@ public class DgDestructionCatalogDO implements Serializable {
/**
* 销毁目录标识码
*/
@TableId(value = "BSM_LENDCATALOG", type = IdType.UUID)
private String bsmLendcatalog;
@TableId(value = "BSM_DESTRUCTIONCATALOG", type = IdType.UUID)
private String bsmDestructioncatalog;
/**
* 档案标识码
......
package com.pashanhoo.destroycatalog.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pashanhoo.archive.entity.DgArchivesDO;
import com.pashanhoo.destroycatalog.entity.DgDestructionCatalogDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
......@@ -13,4 +17,7 @@ import com.pashanhoo.destroycatalog.entity.DgDestructionCatalogDO;
*/
public interface DgDestructionCatalogMapper extends BaseMapper<DgDestructionCatalogDO> {
List<DgArchivesDO> getDestructionCatalog(@Param("bsmDestruction") String bsmDestruction);
}
......
package com.pashanhoo.destroycatalog.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pashanhoo.common.Result;
import com.pashanhoo.destroycatalog.entity.DgDestructionCatalogDO;
import com.pashanhoo.destroycatalog.entity.vo.AddDgDestructionCatalogRequest;
import com.pashanhoo.destroycatalog.entity.vo.DgDestructionCatalogDetailVO;
......@@ -44,4 +45,18 @@ public interface DgDestructionCatalogService extends IService<DgDestructionCatal
* @return
*/
Page searchDgDestructionCatalogList(DgDestructionCatalogSearchRequest request);
/**
* 通过销毁标识码删除档案销毁目录数据
*/
Result deleteDestructionCatalog(String bsmDestruction);
/**
* 通过档案标识码删除档案销毁目录数据
*/
Result deleteCatalogByarchiveId(String bsm_archives);
/**
* 通过档案标识码查询档案销毁目录数据
*/
Result getDestructionCatalog(String bsm_archives);
}
......
package com.pashanhoo.destroycatalog.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pashanhoo.common.Result;
import com.pashanhoo.destroycatalog.entity.DgDestructionCatalogConverter;
import com.pashanhoo.destroycatalog.entity.DgDestructionCatalogDO;
import com.pashanhoo.destroycatalog.entity.vo.AddDgDestructionCatalogRequest;
......@@ -84,4 +85,40 @@ public class DgDestructionCatalogServiceImpl extends ServiceImpl<DgDestructionCa
return page.setRecords(dgdestructioncatalogConverter.doList2ListVOList(page.getRecords()));
}
@Override
public Result deleteDestructionCatalog(String bsmDestruction) {
QueryWrapper<DgDestructionCatalogDO> wrapper = new QueryWrapper<>();
wrapper.eq(bsmDestruction!=null && !"".equals(bsmDestruction),"BSM_DESTRUCTION",bsmDestruction);
int result=dgdestructioncatalogMapper.delete(wrapper);
if(result!=0){
return Result.ok();
}else{
return Result.error("操作失败");
}
}
@Override
public Result deleteCatalogByarchiveId(String bsm_archives) {
QueryWrapper<DgDestructionCatalogDO> wrapper = new QueryWrapper<>();
wrapper.eq(bsm_archives!=null && !"".equals(bsm_archives),"BSM_ARCHIVES",bsm_archives);
int result=dgdestructioncatalogMapper.delete(wrapper);
if(result!=0){
return Result.ok();
}else{
return Result.error("操作失败");
}
}
@Override
public Result getDestructionCatalog(String bsm_archives) {
QueryWrapper<DgDestructionCatalogDO> wrapper = new QueryWrapper<>();
wrapper.eq(bsm_archives!=null && !"".equals(bsm_archives),"BSM_ARCHIVES",bsm_archives);
dgdestructioncatalogMapper.selectOne(wrapper);
return null;
}
}
......
<?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.pashanhoo.destroy.mapper.DgArchivesDestructionMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.pashanhoo.destroy.entity.DgArchivesDestructionDO">
<id column="BSM_DESTRUCTION" property="bsmDestruction" />
......@@ -14,9 +13,97 @@
<result column="XHR" property="xhr" />
<result column="XHRQ" property="xhrq" />
</resultMap>
<!-- 销毁页面记录查询 -->
<resultMap id="ShowDestructionResultMap" type="com.pashanhoo.destroy.entity.vo.DgArchivesDestructionListVO">
<id column="BSM_DESTRUCTION" property="bsmDestruction" />
<result column="XHQCBH" property="xhqcbh" />
<result column="FQR" property="fqr" />
<result column="FQRQ" property="fqrq" />
<result column="XHYY" property="xhyy" />
<result column="SHRY" property="shry" />
<result column="SHYJ" property="shyj" />
<result column="XHR" property="xhr" />
<result column="XHRQ" property="xhrq" />
<result column="AJ_NUM" property="ajNum" />
</resultMap>
<!-- 档案列表记录查询 -->
<resultMap id="ShowArchivesInfoResultMap" type="com.pashanhoo.archive.entity.vo.DgArchivesListVO">
<id column="BSM_ARCHIVES" property="bsmArchives" />
<result column="AJBT" property="ajbt" />
<result column="ZTC" property="ztc" />
<result column="FLH" property="flh" />
<result column="MLH" property="mlh" />
<result column="AJH" property="ajh" />
<result column="ND" property="nd" />
<result column="JS" property="js" />
<result column="YS" property="ys" />
<result column="BGQX" property="bgqx" />
<result column="QSRQ" property="qsrq" />
<result column="ZZRQ" property="zzrq" />
<result column="MJ" property="mj" />
<result column="HH" property="hh" />
<result column="CFWZ" property="cfwz" />
<result column="CJR" property="cjr" />
<result column="CJRQ" property="cjrq" />
<result column="HCR" property="hcr" />
<result column="BZ" property="bz" />
<result column="SMZT" property="smzt" />
<result column="DAZT" property="dazt" />
<result column="CDJGBM" property="cdjgbm" />
<result column="DALY" property="daly" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
BSM_DESTRUCTION, XHQCBH, FQR, FQRQ, XHYY, SHRY, SHYJ, XHR, XHRQ
</sql>
<update id="updateArchivesStatus" parameterType="java.lang.String">
update dg_archives b
set b.dazt = #{dazt,jdbcType=VARCHAR}
where exists (select 1
from DG_DESTRUCTION_CATALOG a
where a.bsm_destruction = #{bsm_destruction,jdbcType=VARCHAR}
and b.bsm_archives = a.bsm_archives)
</update>
<update id="updateArchivesStatusBatch">
update dg_archives b
set b.dazt = #{dazt,jdbcType=VARCHAR} where bsm_archives in
<foreach collection="idList" index="index" item="item"
separator="," open="(" close=")">
#{item,jdbcType=VARCHAR}
</foreach>
</update>
<select id="selectXhResult" resultMap="ShowDestructionResultMap">
select a.BSM_DESTRUCTION,
a.XHQCBH,
a.FQR,
a.FQRQ,
a.XHYY,
a.SHRY,
a.SHYJ,
a.XHR,
a.XHRQ,
count(1) over(partition by b.bsm_destruction, b.bsm_archives) aj_num
from dg_archives_destruction a, dg_destruction_catalog b
where a.bsm_destruction = b.bsm_destruction
and exists
(select 1 from dg_archives c where c.bsm_archives = b.bsm_archives
<if test="ajh!=null and ajh!='' ">
and c.ajh=#{ajh,jdbcType=VARCHAR}
</if>
)
<if test="xhqcbh!=null and xhqcbh!='' ">
and a.xhqcbh=#{xhqcbh,jdbcType=VARCHAR}
</if>
<if test="xhrq!=null and xhrq!='' ">
and a.XHRQ=#{xhrq,jdbcType=TIMESTAMP}
</if>
order by a.XHRQ desc
</select>
<select id="queryArchivesInfo" resultMap="ShowArchivesInfoResultMap">
select * from dg_archives b
where exists (select 1
from DG_DESTRUCTION_CATALOG a
where a.bsm_destruction = #{bsm_destruction,jdbcType=VARCHAR}
and b.bsm_archives = a.bsm_archives)
</select>
</mapper>
......
......@@ -33,4 +33,5 @@
<sql id="Base_Column_List">
BSM_ARCHIVES, AJBT, ZTC, FLH, MLH, AJH, ND, JS, YS, BGQX, QSRQ, ZZRQ, MJ, HH, CFWZ, CJR, CJRQ, HCR, BZ, SMZT, DAZT, CDJGBM, DALY
</sql>
</mapper>
......
......@@ -4,13 +4,16 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.pashanhoo.destroycatalog.entity.DgDestructionCatalogDO">
<id column="BSM_LENDCATALOG" property="bsmLendcatalog" />
<id column="BSM_DESTRUCTIONCATALOG" property="bsmDestructioncatalog" />
<result column="BSM_ARCHIVES" property="bsmArchives" />
<result column="BSM_DESTRUCTION" property="bsmDestruction" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
BSM_LENDCATALOG, BSM_ARCHIVES, BSM_DESTRUCTION
BSM_DESTRUCTIONCATALOG, BSM_ARCHIVES, BSM_DESTRUCTION
</sql>
<select id="getDestructionCatalog" resultType="com.pashanhoo.archive.entity.DgArchivesDO">
</select>
</mapper>
......