feat: There is no way the, AWC 系统对完接口
This commit is contained in:
@@ -31,9 +31,14 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|||||||
addInterceptor.excludePathPatterns("/api/loginIdm");
|
addInterceptor.excludePathPatterns("/api/loginIdm");
|
||||||
addInterceptor.excludePathPatterns("/api/checkPage");
|
addInterceptor.excludePathPatterns("/api/checkPage");
|
||||||
addInterceptor.excludePathPatterns("/api/checkPageNoEncryption");
|
addInterceptor.excludePathPatterns("/api/checkPageNoEncryption");
|
||||||
/**
|
|
||||||
* TODO 测试流程 开放 login 接口 正式环境 关闭
|
/**
|
||||||
*/
|
* AWG 接口
|
||||||
|
*/
|
||||||
|
addInterceptor.excludePathPatterns("/api/regulations/searchStandData");
|
||||||
|
/**
|
||||||
|
* TODO 测试流程 开放 login 接口 正式环境 关闭
|
||||||
|
*/
|
||||||
addInterceptor.excludePathPatterns("/api/login");
|
addInterceptor.excludePathPatterns("/api/login");
|
||||||
addInterceptor.excludePathPatterns("/v2/api-docs");
|
addInterceptor.excludePathPatterns("/v2/api-docs");
|
||||||
addInterceptor.excludePathPatterns("/favicon.ico");
|
addInterceptor.excludePathPatterns("/favicon.ico");
|
||||||
|
|||||||
+90
@@ -0,0 +1,90 @@
|
|||||||
|
package com.adc.da.slrs.regulations.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.adc.da.Log.BusinessType;
|
||||||
|
import com.adc.da.Log.EpcLog;
|
||||||
|
import com.adc.da.base.web.BaseController;
|
||||||
|
import com.adc.da.common.ReadExcel;
|
||||||
|
import com.adc.da.http.PageInfo;
|
||||||
|
import com.adc.da.http.ResponseMessage;
|
||||||
|
import com.adc.da.http.Result;
|
||||||
|
import com.adc.da.person.service.IPersonCollectEOService;
|
||||||
|
import com.adc.da.slrs.regulations.entity.SearchStandContext;
|
||||||
|
import com.adc.da.slrs.regulations.entity.SearchStandResult;
|
||||||
|
import com.adc.da.slrs.regulations.entity.StandMessageCodeEnum;
|
||||||
|
import com.adc.da.slrs.regulations.entity.StandResult;
|
||||||
|
import com.adc.da.slrs.regulations.service.IStandDataService;
|
||||||
|
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||||
|
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStandExport;
|
||||||
|
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
|
||||||
|
import com.adc.da.slrs.sarResource.service.ITsResourceService;
|
||||||
|
import com.adc.da.slrs.sarStandardsInfo.entity.SarAdvanceSearchVO;
|
||||||
|
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
|
||||||
|
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||||
|
import com.adc.da.sys.entity.DicTypeEO;
|
||||||
|
import com.adc.da.sys.service.IDicTypeEOService;
|
||||||
|
import com.adc.da.util.LoginUserUtil;
|
||||||
|
import com.adc.da.util.exception.AdcDaBaseException;
|
||||||
|
import com.adc.da.util.utils.IOUtils;
|
||||||
|
import com.adc.da.util.utils.StringUtils;
|
||||||
|
import com.adc.da.utils.util.BussStandExportUtil;
|
||||||
|
import com.adc.da.utils.util.SarAdvanceSearchUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 标准信息表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author super_liu
|
||||||
|
* @since 2021-07-13
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@Api(tags = "福田标准法规--AWC查询标准")
|
||||||
|
@RequestMapping("/api/regulations")
|
||||||
|
public class StandDataController {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(StandDataController.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStandDataService iStandDataService;
|
||||||
|
/**
|
||||||
|
* 标准查询列表接口
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "|regulations|标准查询列表接口")
|
||||||
|
@PostMapping("/searchStandData")
|
||||||
|
public String searchStandData(@RequestBody SearchStandContext searchStandContext){
|
||||||
|
String resultJson = "";
|
||||||
|
if(StringUtils.isEmpty(searchStandContext.getUid())
|
||||||
|
|| StringUtils.isEmpty(searchStandContext.getUsername())
|
||||||
|
|| StringUtils.isEmpty(searchStandContext.getVppsCode())){
|
||||||
|
return StandResult.toJson(StandResult.error(verifyObj(searchStandContext.getUid()),
|
||||||
|
StandMessageCodeEnum.SOURCE.getCode(), StandMessageCodeEnum.ERROR_PARAM.getCode(),
|
||||||
|
"uid/username/vppsCode 为必填项"));
|
||||||
|
}
|
||||||
|
return iStandDataService.searchStandData(searchStandContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String verifyObj(String str){
|
||||||
|
return (str == null || str.equals("")) ? "" : str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.adc.da.slrs.regulations.dao;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.regulations.entity.FileResult;
|
||||||
|
import com.adc.da.slrs.regulations.entity.SearchStandContext;
|
||||||
|
import com.adc.da.slrs.regulations.entity.StandData;
|
||||||
|
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||||
|
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStandExport;
|
||||||
|
import com.adc.da.slrs.sarStandardsInfo.entity.RecommendVO;
|
||||||
|
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
|
||||||
|
import com.adc.da.sys.entity.UserEO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 标准信息表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author super_liu
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface StandDataDao extends BaseMapper<StandData> {
|
||||||
|
|
||||||
|
List<StandData> searchStandData(SearchStandContext searchStandContext);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.adc.da.slrs.regulations.entity;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: TODO
|
||||||
|
* @author: super_liu
|
||||||
|
* @date: 2022年04月25日 12:05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class FileResult {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "当前标准跳转到本系统内的链接地址")
|
||||||
|
@JSONField(ordinal=1)
|
||||||
|
private String documentName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标准分类+空格+标准号+空格+标准名称")
|
||||||
|
@JSONField(ordinal=2)
|
||||||
|
private String documentUrl;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.adc.da.slrs.regulations.entity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: TODO
|
||||||
|
* @author: super_liu
|
||||||
|
* @date: 2022年04月25日 12:05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SearchStandContext implements Serializable {
|
||||||
|
|
||||||
|
// 标准查询条件
|
||||||
|
@ApiModelProperty(value = "唯一标识")
|
||||||
|
private String uid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "VPPS码")
|
||||||
|
private String vppsCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "VPPS名称")
|
||||||
|
private String vppsName;
|
||||||
|
|
||||||
|
//其他
|
||||||
|
@ApiModelProperty(value = "物料号")
|
||||||
|
private String itemId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "零部件名称")
|
||||||
|
private String objectName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "版本")
|
||||||
|
private String itemRevisionId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所有者")
|
||||||
|
private String owningUser;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发布状态")
|
||||||
|
private String releaseStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "功能分组码")
|
||||||
|
private String vsgCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "功能分组名称")
|
||||||
|
private String vsgName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "功能位置码")
|
||||||
|
private String fpcCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "功能位置名称")
|
||||||
|
private String fpcName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "项目编号")
|
||||||
|
private String ItemNumber;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.adc.da.slrs.regulations.entity;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: TODO
|
||||||
|
* @author: super_liu
|
||||||
|
* @date: 2022年04月25日 12:05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SearchStandResult {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "请求参数中的uid直接带入即可")
|
||||||
|
@JSONField(ordinal=1)
|
||||||
|
private String uid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "SRMS 固定字符串 系统唯一标识")
|
||||||
|
@JSONField(ordinal=2)
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "返回状态 200 正常,-1 系统错误, -10 参数错误")
|
||||||
|
@JSONField(ordinal=3)
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "正常返回空字符串,系统错误时返回系统异常信息及对应描述")
|
||||||
|
@JSONField(ordinal=4)
|
||||||
|
private String errorMessage;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "返回结果集合")
|
||||||
|
@JSONField(ordinal=5)
|
||||||
|
@JsonProperty(value = "List")
|
||||||
|
private List<FileResult> List;
|
||||||
|
|
||||||
|
public SearchStandResult(String uid, String source, String status,String errorMessage) {
|
||||||
|
this.uid = uid;
|
||||||
|
this.source = source;
|
||||||
|
this.status = status;
|
||||||
|
this.errorMessage = errorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SearchStandResult(String uid, String source, String status,String errorMessage, List<FileResult> List) {
|
||||||
|
this.uid = uid;
|
||||||
|
this.source = source;
|
||||||
|
this.status = status;
|
||||||
|
this.errorMessage = errorMessage;
|
||||||
|
this.List = List;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.adc.da.slrs.regulations.entity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: TODO
|
||||||
|
* @author: super_liu
|
||||||
|
* @date: 2022年04月25日 12:05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StandData {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标准ID")
|
||||||
|
private String standId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标准类型")
|
||||||
|
private String standType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标准分类")
|
||||||
|
private String standSort;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标准号")
|
||||||
|
private String standNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标准名称")
|
||||||
|
private String standName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标准分类+空格+标准号+空格+标准名称")
|
||||||
|
private String documentName;
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
package com.adc.da.slrs.regulations.entity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: TODO
|
||||||
|
* @author: super_liu
|
||||||
|
* @date: 2022年04月25日 14:58
|
||||||
|
*/
|
||||||
|
public enum StandMessageCodeEnum {
|
||||||
|
SUCCESS("200"),
|
||||||
|
ERROR_SYS("-1"),
|
||||||
|
ERROR_PARAM("-10"),
|
||||||
|
SOURCE("SRMS");
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
private StandMessageCodeEnum(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.adc.da.slrs.regulations.entity;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: TODO
|
||||||
|
* @author: super_liu
|
||||||
|
* @date: 2022年04月25日 14:56
|
||||||
|
*/
|
||||||
|
public class StandResult {
|
||||||
|
|
||||||
|
public static SearchStandResult success(String uid, String source, String status,String errorMessage, List<FileResult> List) {
|
||||||
|
return new SearchStandResult(uid,source,status,errorMessage,List);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SearchStandResult error(String uid, String source, String status,String errorMessage) {
|
||||||
|
return new SearchStandResult(uid,source,status,errorMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toJson(SearchStandResult searchStandResult){
|
||||||
|
GsonBuilder gsonBuilder = getGsonBuilder();
|
||||||
|
Gson json = gsonBuilder.create();
|
||||||
|
return json.toJson(searchStandResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static GsonBuilder getGsonBuilder() {
|
||||||
|
return new GsonBuilder().disableHtmlEscaping().serializeNulls().enableComplexMapKeySerialization().serializeSpecialFloatingPointValues().setLenient();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.adc.da.slrs.regulations.service;
|
||||||
|
|
||||||
|
import com.adc.da.http.ResponseMessage;
|
||||||
|
import com.adc.da.slrs.regulations.entity.FileResult;
|
||||||
|
import com.adc.da.slrs.regulations.entity.SearchStandContext;
|
||||||
|
import com.adc.da.slrs.regulations.entity.SearchStandResult;
|
||||||
|
import com.adc.da.slrs.regulations.entity.StandData;
|
||||||
|
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||||
|
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStandExport;
|
||||||
|
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 标准信息表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author super_liu
|
||||||
|
*/
|
||||||
|
public interface IStandDataService extends IService<StandData> {
|
||||||
|
|
||||||
|
String searchStandData(SearchStandContext searchStandContext);
|
||||||
|
}
|
||||||
|
|
||||||
+75
@@ -0,0 +1,75 @@
|
|||||||
|
package com.adc.da.slrs.regulations.service.impl;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.regulations.dao.StandDataDao;
|
||||||
|
import com.adc.da.slrs.regulations.entity.*;
|
||||||
|
import com.adc.da.slrs.regulations.service.IStandDataService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import sun.misc.BASE64Encoder;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Base64;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 标准信息表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author super_liu
|
||||||
|
* @date: 2022年04月25日 14:56
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class StandDataServiceImpl extends ServiceImpl<StandDataDao, StandData> implements IStandDataService {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(StandDataServiceImpl.class);
|
||||||
|
|
||||||
|
private String webUrl = "https://srms.foton.com.cn/#/loginStandDetails";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String searchStandData(SearchStandContext searchStandContext){
|
||||||
|
List<FileResult> fileResultList = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
List<StandData> standDataQuery = this.baseMapper.searchStandData(searchStandContext);
|
||||||
|
if(!standDataQuery.isEmpty()){
|
||||||
|
// 重组数据集合 只需documentName 及 documentUrl
|
||||||
|
standDataQuery.stream().peek(standData -> {
|
||||||
|
FileResult fileResult = new FileResult();
|
||||||
|
fileResult.setDocumentName(verifyObj(standData.getStandSort(),standData.getStandNumber(),standData.getStandName()));
|
||||||
|
fileResult.setDocumentUrl(webUrl+"?userName="+encode(searchStandContext.getUsername())+"&dataId="+standData.getStandId()+"&datatype="+standData.getStandType());
|
||||||
|
fileResultList.add(fileResult);
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
return StandResult.toJson(StandResult.error(searchStandContext.getUid(),
|
||||||
|
StandMessageCodeEnum.SOURCE.getCode(),
|
||||||
|
StandMessageCodeEnum.ERROR_SYS.getCode(),
|
||||||
|
errFilter(e.getMessage())));
|
||||||
|
}
|
||||||
|
return StandResult.toJson(StandResult.success(searchStandContext.getUid(), StandMessageCodeEnum.SOURCE.getCode(), StandMessageCodeEnum.SUCCESS.getCode(),"",fileResultList));
|
||||||
|
}
|
||||||
|
|
||||||
|
private String verifyObj(String str1,String str2,String str3){
|
||||||
|
String res1 = (str1 == null || str1.equals("")) ? "" : (str1+" ");
|
||||||
|
String res2 = (str2 == null || str2.equals("")) ? "" : (str2+" ");
|
||||||
|
String res3 = (str3 == null || str3.equals("")) ? "" : str3;
|
||||||
|
return res1 + res2 + res3;
|
||||||
|
}
|
||||||
|
private String encode(String str){
|
||||||
|
String encodeStr = new BASE64Encoder().encodeBuffer(str.getBytes()).replaceAll("[\r\n]", "");;
|
||||||
|
return encodeStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String errFilter(String str){
|
||||||
|
if (str.contains("Cause")){
|
||||||
|
str = str.split("Cause")[0].replaceAll("\\r\\n###","");
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
<?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.adc.da.slrs.regulations.dao.StandDataDao">
|
||||||
|
|
||||||
|
<resultMap id="BaseResultMap" type="com.adc.da.slrs.regulations.entity.StandData" >
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="searchStandData" resultMap="BaseResultMap"
|
||||||
|
parameterType="com.adc.da.slrs.regulations.entity.SearchStandContext">
|
||||||
|
SELECT
|
||||||
|
t.standId,
|
||||||
|
t.standType,
|
||||||
|
t.standSort,
|
||||||
|
t.standNumber,
|
||||||
|
t.standName
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
sar_standards_info.id AS standId,
|
||||||
|
sar_standards_info.STAND_TYPE AS standType,
|
||||||
|
sar_standards_info.STAND_SORT AS standSort,
|
||||||
|
sar_standards_info.STAND_NUMBER AS standNumber,
|
||||||
|
sar_standards_info.STAND_NAME AS standName
|
||||||
|
FROM
|
||||||
|
sar_standards_info
|
||||||
|
LEFT JOIN SAR_STAND_ATTR_INFO ON (
|
||||||
|
SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id
|
||||||
|
AND SAR_STAND_ATTR_INFO.valid_flag = 0
|
||||||
|
)
|
||||||
|
WHERE sar_standards_info.valid_flag = 0
|
||||||
|
<if test="vppsCode != null and vppsCode != ''">
|
||||||
|
and (SAR_STAND_ATTR_INFO.KCCVPPSBM like concat('%',#{vppsCode},'%') or SAR_STAND_ATTR_INFO.CYCVPPSBM like concat('%',#{vppsCode},'%'))
|
||||||
|
</if>
|
||||||
|
<if test="vppsName != null and vppsName != ''">
|
||||||
|
and (SAR_STAND_ATTR_INFO.KCCVPPSCN like concat('%',#{vppsName},'%') or SAR_STAND_ATTR_INFO.CYCVPPSCN like concat('%',#{vppsName},'%'))
|
||||||
|
</if>
|
||||||
|
UNION
|
||||||
|
SELECT
|
||||||
|
sar_bussioness_stand.id AS standId,
|
||||||
|
'BUSINESS_STAND' AS standType,
|
||||||
|
sar_bussioness_stand.STAND_SORT AS standSort,
|
||||||
|
sar_bussioness_stand.STAND_NUMBER AS standNumber,
|
||||||
|
sar_bussioness_stand.STAND_NAME AS standName
|
||||||
|
FROM
|
||||||
|
sar_bussioness_stand
|
||||||
|
LEFT JOIN sar_buss_stand_attr_info ON (
|
||||||
|
sar_buss_stand_attr_info.stand_id = sar_bussioness_stand.id
|
||||||
|
AND sar_buss_stand_attr_info.valid_flag = 0
|
||||||
|
)
|
||||||
|
WHERE sar_bussioness_stand.valid_flag = 0
|
||||||
|
<if test="vppsCode != null and vppsCode != ''">
|
||||||
|
and (sar_buss_stand_attr_info.KCVPPSBMBUSS like concat('%',#{vppsCode},'%') or sar_buss_stand_attr_info.CYCVPPSBMBUSS like concat('%',#{vppsCode},'%'))
|
||||||
|
</if>
|
||||||
|
<if test="vppsName != null and vppsName != ''">
|
||||||
|
and (sar_buss_stand_attr_info.KCVPPSCNBUSS like concat('%',#{vppsName},'%') or sar_buss_stand_attr_info.CYCVPPSCNBUSS like concat('%',#{vppsName},'%'))
|
||||||
|
</if>
|
||||||
|
) t
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user