三三维文件修改
This commit is contained in:
parent
720223f788
commit
6ac961b286
|
|
@ -9,6 +9,8 @@ import javax.validation.constraints.NotBlank;
|
|||
*/
|
||||
@Data
|
||||
public class AreaVo {
|
||||
|
||||
private String id;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
|
|
@ -56,9 +58,17 @@ public class AreaVo {
|
|||
*/
|
||||
private String gtName;
|
||||
/**
|
||||
* 是否是有些爱你空间
|
||||
* 是否是有限空间
|
||||
*/
|
||||
private String areaType;
|
||||
/**
|
||||
* 文件数量
|
||||
*/
|
||||
private String fileNum;
|
||||
/**
|
||||
* 删除的文件id
|
||||
*/
|
||||
private String delFile;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,40 @@ public class SystemGlobal {
|
|||
/**
|
||||
* 线路工程类型
|
||||
*/
|
||||
public final static String LINE_TYPE="1";
|
||||
public final static String LINE_TYPE="线路";
|
||||
/**
|
||||
* 预案类型
|
||||
*/
|
||||
public final static String EME_TYPE="1";
|
||||
|
||||
/**
|
||||
* 预案类型
|
||||
*/
|
||||
public final static String EME_TYPE2="2";
|
||||
|
||||
|
||||
/**
|
||||
* 文件资源类型
|
||||
* 应急预案
|
||||
*/
|
||||
public final static String YA_NAME="应急预案";
|
||||
|
||||
/**
|
||||
* 文件资源类型
|
||||
* 应急流程
|
||||
*/
|
||||
public final static String LC_NAME="应急流程";
|
||||
|
||||
/**
|
||||
* 文件资源类型
|
||||
* 应急流程
|
||||
*/
|
||||
public final static String SW_NAME="三维文件";
|
||||
|
||||
/**
|
||||
* 预案类型
|
||||
*/
|
||||
public final static String EME_TYPE3="3";
|
||||
/**
|
||||
* 成功数据数量
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.securitycontrol.entity.background.vo.AreaVo;
|
|||
import com.securitycontrol.entity.background.vo.DeviceVo;
|
||||
import com.securitycontrol.entity.background.vo.EmergencyPlanVo;
|
||||
import com.securitycontrol.entity.file.FileExportVo;
|
||||
import com.securitycontrol.entity.system.SystemGlobal;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -130,7 +131,7 @@ public class EmergencyController extends BaseController {
|
|||
@Log(title = "应急响应", menu = "应急响应->应急预案", grade = OperationType.ADD_BUSINESS, details = "新增预案", type = "业务日志")
|
||||
public Result<String> addYaFile(@RequestParam(value = "file[]", required = false) MultipartFile[] files,EmergencyPlanVo dto ) {
|
||||
dto.setEmergencyType("2");
|
||||
dto.setSourceType("应急预案");
|
||||
dto.setSourceType(SystemGlobal.YA_NAME);
|
||||
return service.addYaFile(files, dto);
|
||||
}
|
||||
|
||||
|
|
@ -139,7 +140,7 @@ public class EmergencyController extends BaseController {
|
|||
@PostMapping("updateYaFile")
|
||||
@Log(title = "应急响应", menu = "应急响应->应急预案", grade = OperationType.ADD_BUSINESS, details = "新增预案", type = "业务日志")
|
||||
public Result<String> updateYaFile(@RequestParam(value = "file[]", required = false) MultipartFile[] files,EmergencyPlanVo dto ) {
|
||||
dto.setSourceType("应急预案");
|
||||
dto.setSourceType(SystemGlobal.YA_NAME);
|
||||
return service.updateYaFile(files, dto);
|
||||
}
|
||||
|
||||
|
|
@ -150,7 +151,7 @@ public class EmergencyController extends BaseController {
|
|||
@Log(title = "应急响应", menu = "应急响应->流程预案", grade = OperationType.ADD_BUSINESS, details = "新增流程预案", type = "业务日志")
|
||||
public Result<String> addLcFile(@RequestParam(value = "file[]",required = false) MultipartFile[] files,EmergencyPlanVo dto ) {
|
||||
dto.setEmergencyType("3");
|
||||
dto.setSourceType("应急流程");
|
||||
dto.setSourceType(SystemGlobal.LC_NAME);
|
||||
return service.addYaFile(files, dto);
|
||||
}
|
||||
|
||||
|
|
@ -164,7 +165,7 @@ public class EmergencyController extends BaseController {
|
|||
@PostMapping("updateLcFile")
|
||||
@Log(title = "应急响应", menu = "应急响应->流程预案", grade = OperationType.ADD_BUSINESS, details = "修改流程预案", type = "业务日志")
|
||||
public Result<String> updateLcFile(@RequestParam(value = "file[]", required = false) MultipartFile[] files,EmergencyPlanVo dto ) {
|
||||
dto.setSourceType("应急流程");
|
||||
dto.setSourceType(SystemGlobal.LC_NAME);
|
||||
return service.updateYaFile(files, dto);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.securitycontrol.background.controller;
|
||||
|
||||
import com.securitycontrol.background.service.DeviceService;
|
||||
import com.securitycontrol.background.service.EmergencyService;
|
||||
import com.securitycontrol.background.service.TbAreaService;
|
||||
import com.securitycontrol.common.core.domain.Result;
|
||||
import com.securitycontrol.common.core.utils.WordUtils;
|
||||
import com.securitycontrol.common.core.web.controller.BaseController;
|
||||
import com.securitycontrol.common.core.web.page.TableDataInfo;
|
||||
import com.securitycontrol.common.log.annotation.Log;
|
||||
|
|
@ -11,12 +13,17 @@ import com.securitycontrol.entity.background.dto.AreaDto;
|
|||
import com.securitycontrol.entity.background.dto.DeviceDto;
|
||||
import com.securitycontrol.entity.background.vo.AreaVo;
|
||||
import com.securitycontrol.entity.background.vo.DeviceVo;
|
||||
import com.securitycontrol.entity.background.vo.EmergencyPlanVo;
|
||||
import com.securitycontrol.entity.background.vo.GtVo;
|
||||
import com.securitycontrol.entity.file.FileExportVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -34,6 +41,9 @@ public class TbAreaController extends BaseController {
|
|||
@Autowired
|
||||
private TbAreaService service;
|
||||
|
||||
@Autowired
|
||||
private EmergencyService emergencyService;
|
||||
|
||||
|
||||
@ApiOperation(value = "获取设备列表")
|
||||
@GetMapping("getAreaList")
|
||||
|
|
@ -157,8 +167,6 @@ public class TbAreaController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "获取三维文件列表")
|
||||
@GetMapping("getSwList")
|
||||
@Log(title = "三维文件管理", menu = "基础管理->三维文件管理", grade = OperationType.QUERY_BUSINESS, details = "查询三维文件列表", type = "业务日志")
|
||||
|
|
@ -173,15 +181,19 @@ public class TbAreaController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增三维文件")
|
||||
@PostMapping("addSwFile")
|
||||
@Log(title = "三维管理", menu = "应急响应->三维管理", grade = OperationType.ADD_BUSINESS, details = "新增三维文件", type = "业务日志")
|
||||
public Result<String> addYaFile(@RequestParam(value = "file[]", required = false) MultipartFile[] files, AreaVo dto ) {
|
||||
return service.addSwFile(files, dto);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "删除信息")
|
||||
@PostMapping("deleteSwFile")
|
||||
@Log(title = "三维管理", menu = "应急响应->三维管理", grade = OperationType.DELETE_BUSINESS, details = "删除三维文件", type = "业务日志")
|
||||
public Result<String> deleteSwFile(@RequestBody AreaVo dto ) {
|
||||
return service.deleteSwFile(dto);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ public interface EmergencyMapper {
|
|||
int deleteData(EmergencyPlanVo dto);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param vo
|
||||
* 查询信息详情
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<String> getSourceList(EmergencyPlanVo vo);
|
||||
EmergencyPlanVo getDetail(EmergencyPlanVo dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,4 +97,25 @@ public interface TbAreaMapper {
|
|||
* @return
|
||||
*/
|
||||
List<AreaVo> getSwList(AreaDto dto);
|
||||
|
||||
/**
|
||||
* 查询杆塔是否已存在
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int getSwData(AreaVo dto);
|
||||
|
||||
/**
|
||||
* 新增三维文件
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int addSwFile(AreaVo dto);
|
||||
|
||||
/**
|
||||
*删除数据
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int deleteData(AreaVo dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.securitycontrol.common.core.domain.Result;
|
|||
import com.securitycontrol.entity.background.dto.AreaDto;
|
||||
import com.securitycontrol.entity.background.vo.AreaVo;
|
||||
import com.securitycontrol.entity.background.vo.GtVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -90,4 +91,27 @@ public interface TbAreaService {
|
|||
* @return
|
||||
*/
|
||||
List<AreaVo> getSwList(AreaDto dto);
|
||||
|
||||
/**
|
||||
* 新增三维文件
|
||||
* @param files
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Result<String> addSwFile(MultipartFile[] files, AreaVo dto);
|
||||
|
||||
/**
|
||||
* 修改三维文件
|
||||
* @param files
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Result<String> updateSwFile(MultipartFile[] files, AreaVo dto);
|
||||
|
||||
/**
|
||||
* 删除三维文件
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Result<String> deleteSwFile( AreaVo dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.securitycontrol.background.service.EmergencyService;
|
|||
import com.securitycontrol.background.service.SourceFileService;
|
||||
import com.securitycontrol.common.core.constant.SecurityConstants;
|
||||
import com.securitycontrol.common.core.domain.Result;
|
||||
import com.securitycontrol.common.core.utils.aes.ListHelper;
|
||||
import com.securitycontrol.common.core.utils.aes.StringHelper;
|
||||
import com.securitycontrol.entity.background.vo.DeviceVo;
|
||||
import com.securitycontrol.entity.background.vo.EmergencyPlanVo;
|
||||
|
|
@ -56,7 +57,7 @@ public class EmergencyServiceImpl implements EmergencyService {
|
|||
@Override
|
||||
public List<EmergencyPlanVo> getList(EmergencyPlanVo dto) {
|
||||
List<EmergencyPlanVo> list= mapper.getList(dto);
|
||||
if(!SystemGlobal.LINE_TYPE.equals(dto.getEmergencyType())){
|
||||
if(!SystemGlobal.EME_TYPE.equals(dto.getEmergencyType())){
|
||||
list.forEach(vo->{
|
||||
List<FileExportVo> source=sourceFileService.getSourceList(vo.getId(),dto.getSourceType());
|
||||
vo.setSourceIds(source);
|
||||
|
|
@ -123,6 +124,27 @@ public class EmergencyServiceImpl implements EmergencyService {
|
|||
if(StringHelper.isEmpty(dto.getId())){
|
||||
return Result.fail("数据不存在");
|
||||
}
|
||||
EmergencyPlanVo vo=mapper.getDetail(dto);
|
||||
String type=vo.getEmergencyType();
|
||||
if(!SystemGlobal.EME_TYPE.equals(type)){
|
||||
String sourceType="";
|
||||
if(SystemGlobal.EME_TYPE2.equals(type)){
|
||||
sourceType=SystemGlobal.YA_NAME;
|
||||
}else{
|
||||
sourceType=SystemGlobal.LC_NAME;
|
||||
}
|
||||
|
||||
List<FileExportVo> fileId=sourceFileService.getSourceList(dto.getId(),sourceType);
|
||||
if(ListHelper.isNotEmpty(fileId)){
|
||||
fileId.forEach(file->{
|
||||
//删除资源数据
|
||||
sourceFileService.deleteSource(file.getFileId());
|
||||
//删除文件
|
||||
remoteFileService.delFile(file.getFileId(),SecurityConstants.INNER);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
int num=mapper.deleteData(dto);
|
||||
if(num==1) {
|
||||
return Result.ok("删除成功","删除成功");
|
||||
|
|
|
|||
|
|
@ -1,18 +1,25 @@
|
|||
package com.securitycontrol.background.service.impl;
|
||||
|
||||
import com.securitycontrol.background.mapper.TbAreaMapper;
|
||||
import com.securitycontrol.background.service.SourceFileService;
|
||||
import com.securitycontrol.background.service.TbAreaService;
|
||||
import com.securitycontrol.common.core.constant.SecurityConstants;
|
||||
import com.securitycontrol.common.core.domain.Result;
|
||||
import com.securitycontrol.common.core.utils.aes.ListHelper;
|
||||
import com.securitycontrol.common.core.utils.aes.StringHelper;
|
||||
import com.securitycontrol.common.core.utils.uuid.IdUtils;
|
||||
import com.securitycontrol.entity.background.dto.AreaDto;
|
||||
import com.securitycontrol.entity.background.vo.AreaVo;
|
||||
import com.securitycontrol.entity.background.vo.GtVo;
|
||||
import com.securitycontrol.entity.file.FileExportVo;
|
||||
import com.securitycontrol.entity.system.SystemGlobal;
|
||||
import com.securitycontrol.system.api.RemoteFileService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
|
@ -25,7 +32,10 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
@Slf4j
|
||||
public class TbAreaServiceImpl implements TbAreaService {
|
||||
|
||||
|
||||
@Resource
|
||||
private RemoteFileService remoteFileService;
|
||||
@Resource
|
||||
private SourceFileService sourceFileService;
|
||||
@Autowired
|
||||
private TbAreaMapper mapper;
|
||||
|
||||
|
|
@ -231,6 +241,87 @@ public class TbAreaServiceImpl implements TbAreaService {
|
|||
return mapper.getSwList(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<String> addSwFile(MultipartFile[] files, AreaVo dto) {
|
||||
try{
|
||||
if(files==null || files.length<1){
|
||||
return Result.fail("三维文件未上传");
|
||||
}
|
||||
String result=checkData(dto);
|
||||
if(StringHelper.isNotEmpty(result)){
|
||||
return Result.fail(result);
|
||||
}
|
||||
//依据工程编码查询工程类型
|
||||
String proType=mapper.getProjectTypeByBidCode(dto.getBidCode());
|
||||
if (SystemGlobal.LINE_TYPE.equals(proType)){
|
||||
if(files.length>1){
|
||||
return Result.fail("一个杆塔只能上传一个三维文件");
|
||||
}
|
||||
int num=mapper.getSwData(dto);
|
||||
if(num>SystemGlobal.MIN_NUM){
|
||||
return Result.fail("该杆塔的三维文件已维护");
|
||||
}
|
||||
}
|
||||
int num=mapper.addSwFile(dto);
|
||||
if(SystemGlobal.SUCCESS_NUM!=num){
|
||||
return Result.fail("新增失败");
|
||||
}
|
||||
Result result1 = remoteFileService.mostUploadFile(files,SecurityConstants.INNER);
|
||||
if(result1.getCode()!=SystemGlobal.SUCCESS_CODE){
|
||||
mapper.deleteData(dto);
|
||||
Result.fail("文件服务未连接,文件上传失败");
|
||||
}
|
||||
List<Object> list= (List<Object>) result1.getData();
|
||||
Result<String> result2= sourceFileService.addSourceList(list, dto.getId(),"三维文件","0");
|
||||
if(result2.getCode()!=SystemGlobal.SUCCESS_CODE){
|
||||
return result2;
|
||||
}
|
||||
return Result.ok("新增成功","新增成功");
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return Result.fail("系统升级中,请稍后重试!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改三维文件
|
||||
* @param files
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<String> updateSwFile(MultipartFile[] files, AreaVo dto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 啥删除三维文件
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<String> deleteSwFile( AreaVo dto) {
|
||||
try{
|
||||
List<FileExportVo> fileId=sourceFileService.getSourceList(dto.getId(),SystemGlobal.SW_NAME);
|
||||
if(ListHelper.isNotEmpty(fileId)){
|
||||
fileId.forEach(file->{
|
||||
//删除资源数据
|
||||
sourceFileService.deleteSource(file.getFileId());
|
||||
//删除文件
|
||||
remoteFileService.delFile(file.getFileId(),SecurityConstants.INNER);
|
||||
});
|
||||
}
|
||||
int num= mapper.deleteData(dto);
|
||||
if (num==SystemGlobal.SUCCESS_NUM){
|
||||
return Result.ok("删除成功","删除成功");
|
||||
}
|
||||
return Result.fail("删除失败,删除失败");
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return Result.fail("系统升级中,请稍后重试!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据校验
|
||||
* @param dto
|
||||
|
|
@ -247,27 +338,27 @@ public class TbAreaServiceImpl implements TbAreaService {
|
|||
}
|
||||
|
||||
/**
|
||||
* 数据校验
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public String checkData(AreaVo dto){
|
||||
if(StringHelper.isEmpty(dto.getAreaType())){
|
||||
dto.setAreaType("0");
|
||||
* 数据校验
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public String checkData(AreaVo dto){
|
||||
if(StringHelper.isEmpty(dto.getAreaType())){
|
||||
dto.setAreaType("0");
|
||||
}
|
||||
String bidCode=dto.getBidCode();
|
||||
if (StringHelper.isEmpty(bidCode)) {
|
||||
return "请选择工程";
|
||||
}
|
||||
//依据工程编码查询工程类型
|
||||
String proType=mapper.getProjectTypeByBidCode(bidCode);
|
||||
//线路工程
|
||||
if(SystemGlobal.LINE_TYPE.equals(proType)){
|
||||
if(StringHelper.isEmpty(dto.getGtId())){
|
||||
return "线路工程必须要选择杆塔";
|
||||
}
|
||||
String bidCode=dto.getBidCode();
|
||||
if (StringHelper.isEmpty(bidCode)) {
|
||||
return "请选择工程";
|
||||
}
|
||||
//依据工程编码查询工程类型
|
||||
String proType=mapper.getProjectTypeByBidCode(bidCode);
|
||||
//线路工程
|
||||
if(SystemGlobal.LINE_TYPE.equals(proType)){
|
||||
if(StringHelper.isEmpty(dto.getGtId())){
|
||||
return "线路工程必须要选择杆塔";
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,15 +17,15 @@
|
|||
select tp.id, ANY_VALUE(tp.emerge_type) emergencyType, ANY_VALUE(tp.emerge_name) emergencyName,
|
||||
ANY_VALUE(tp.emerge_source) emergencySource,ANY_VALUE(create_time) createTime,
|
||||
ANY_VALUE(tp.update_time) updateTime,count(trf.file_id) fileNum
|
||||
from tb_emergency_plan tp
|
||||
left join tb_resource_file trf on trf.source_id=tp.id
|
||||
<if test='emergencyType=="2"'> and trf.source_type='应急预案'</if>
|
||||
<if test='emergencyType=="3"'> and trf.source_type='应急流程'</if>
|
||||
WHERE tp.del_flag=0 AND tp.emerge_type=#{emergencyType}
|
||||
<if test="emergencyName!=null and emergencyName!=''">
|
||||
and INSTR(tp.emerge_name,#{emergencyName}) > 0
|
||||
</if>
|
||||
GROUP BY tp.id
|
||||
from tb_emergency_plan tp
|
||||
left join tb_resource_file trf on trf.source_id=tp.id and trf.del_flag=0
|
||||
<if test='emergencyType=="2"'> and trf.source_type='应急预案'</if>
|
||||
<if test='emergencyType=="3"'> and trf.source_type='应急流程'</if>
|
||||
WHERE tp.del_flag=0 AND tp.emerge_type=#{emergencyType}
|
||||
<if test="emergencyName!=null and emergencyName!=''">
|
||||
and INSTR(tp.emerge_name,#{emergencyName}) > 0
|
||||
</if>
|
||||
GROUP BY tp.id
|
||||
</select>
|
||||
<select id="getNumByData" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
|
|
@ -35,7 +35,11 @@
|
|||
AND id!=#{id}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getDetail" resultType="com.securitycontrol.entity.background.vo.EmergencyPlanVo">
|
||||
select tp.emerge_type emergencyType,tp.emerge_name emergencyName
|
||||
from tb_emergency_plan tp
|
||||
where tp.id=#{id}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -25,6 +25,9 @@
|
|||
#{gtId},#{gtName},#{gtCode},#{bidCode},#{lat},#{lon},0,now()
|
||||
)
|
||||
</insert>
|
||||
<insert id="addSwFile" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into tb_sw_source (bid_code,gt_id,del_flag) value (#{bidCode},#{gtId},0)
|
||||
</insert>
|
||||
<update id="updateData">
|
||||
update tb_area set area_name=#{areaName},bid_code=#{bidCode},remarks=#{remarks},gt_id=#{gtId},
|
||||
area_code=#{areaCode},update_time=now(),area_type=#{areaType}
|
||||
|
|
@ -40,6 +43,9 @@
|
|||
<update id="deleteGt">
|
||||
update t_pro_gt set del_flag=1 where gt_id=#{gtId}
|
||||
</update>
|
||||
<delete id="deleteData">
|
||||
delete from tb_sw_source where id=#{id}
|
||||
</delete>
|
||||
|
||||
<select id="getAreaList" resultMap="AreaMap">
|
||||
select area_id,area_name,pro.bid_code, remarks,area_code,pro.pro_name,
|
||||
|
|
@ -89,7 +95,18 @@
|
|||
where area.area_id=#{areaId}
|
||||
</select>
|
||||
<select id="getSwList" resultType="com.securitycontrol.entity.background.vo.AreaVo">
|
||||
|
||||
select sw.id,ANY_VALUE(pro.pro_name) proName,ANY_VALUE(gt.gt_name) gtName,count(rf.id) fileNum
|
||||
FROM tb_sw_source sw
|
||||
left join tb_resource_file rf on rf.source_id=sw.id and rf.source_type='三维文件' and rf.del_flag=0
|
||||
left join tb_project pro on pro.bid_code=sw.bid_code and pro.del_flag=0
|
||||
left join t_pro_gt gt on gt.gt_id=sw.gt_id and gt.del_flag=0
|
||||
where sw.del_flag=0
|
||||
GROUP BY sw.id
|
||||
</select>
|
||||
<select id="getSwData" resultType="java.lang.Integer">
|
||||
select count (1)
|
||||
from tb_sw_source sw
|
||||
where sw.del_flag=0 and sw.gt_id=#{gtId}
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue