Merge remote-tracking branch 'origin/develop_master' into develop_master

This commit is contained in:
2510220824
2021-08-17 16:16:33 +08:00
21 changed files with 215 additions and 87 deletions
@@ -28,7 +28,7 @@ public class SendConvertMQService {
private static final Logger logger = LoggerFactory.getLogger(SendConvertMQService.class);
@RabbitListener(bindings = @QueueBinding(
value = @Queue(value = "createStandMQ_SQ_GSAR", durable = "true"),
value = @Queue(value = "createConvertStandMQ_SQ_GSAR", durable = "true"),
exchange = @Exchange(value = "convert-exchange_SQ_GSAR", ignoreDeclarationExceptions = "true"),
key = "convert-key_SQ_GSAR"))
public void createMQ(AttFileEO attFileEO, Message message, Channel channel) throws Exception{
@@ -18,12 +18,9 @@ public class CodeGen {
private static final String PACKAGE_PATH="/adc-da-slrs/src/main";
private static final String AUTHOR="zyl";
private static final String AUTHOR="super_liu";
// x.x.x.x:3306/xxxx --MYSQL
// 192.168.10.140:1521:foton_slrs_test
// foton_slrs_test@101.36.227.22
private static final String DB_IP="192.168.10.47/foton_slrs_test";
private static final String DB_IP="127.0.0.1:3306/foton_slrs_test";
private static final String DB_USER="root";
@@ -44,10 +44,10 @@ spring.mail.port=587
#spring.rabbitmq.username=uat_pcms
#spring.rabbitmq.password=VxsBLL5bJruwzXfS
# spring.rabbitmq.publisher-confirms=true
spring.rabbitmq.host=62.234.118.181
spring.rabbitmq.host=127.0.0.1
spring.rabbitmq.port=5672
spring.rabbitmq.username=admin
spring.rabbitmq.password=admin
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
# ==============================================
# 文档存储路径指向
# ==============================================
@@ -97,7 +97,7 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
result = elasticsearchService.updateDataByIdForMap(fullTextSearchEO,"fulltextserch","fulltextserch",id);
}
} else {
result = elasticsearchService.updateDataByIdForMap(fullTextSearchEO,"fulltextserch","fulltextserch",id);
result = elasticsearchService.addDataForMap(fullTextSearchEO,"fulltextserch","fulltextserch",id);
}
}
return result;
@@ -180,10 +180,12 @@ public class SendStandMQService {
// 动态存储属性字段
for (String field : fieldInfoList) {
saveMap.put(field,attrInfoMap.getOrDefault(field,""));
Object json= new JSONTokener(infoMap.get(field).toString()).nextValue();
String fieldValue = "";
if(!json.toString().equals("null")){
fieldValue = infoMap.get(field).toString();
if(infoMap.get(field) != null && StringUtils.isNotBlank(infoMap.get(field).toString())){
Object json= new JSONTokener(infoMap.get(field).toString()).nextValue();
if(!json.toString().equals("null")){
fieldValue = infoMap.get(field).toString();
}
}
saveMap.put(field+"Name",fieldValue);
}
@@ -115,4 +115,7 @@ public class LawsDto {
@ApiModelProperty(value = "文本状态")
private String textStatus;
@ApiModelProperty(value = "适用车型")
private String applyArctic;
}
@@ -51,6 +51,9 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
}
List<LawsDto> list = sarLawsAttrDetailedListDao.selectLawsById(lawsIds,sarFindDto);
for (LawsDto lawsDto:list){
if (StringUtils.isNoneEmpty(lawsDto.getApplyArctic())){
lawsDto.setApplyArctic(lawsDto.getApplyArctic());
}
QueryWrapper<SarLawsAttrDetailedList> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("stand_id",lawsDto.getId())
.eq("detailed_list_id",sarFindDto.getId());
@@ -33,4 +33,7 @@ public class FindSarItemsPageReqDTO {
@ApiModelProperty(value = "文件类型")
private String fileType;
@ApiModelProperty(value = "解读内容")
private String readContent;
}
@@ -66,4 +66,7 @@ public class SarItemVO extends BaseEntity {
@ApiModelProperty(value = "解读内容--核心技术要点")
private String interpretationContent;
@ApiModelProperty(value = "解读内容")
private String readContent;
}
@@ -184,5 +184,9 @@ public class SarStandItems extends BaseEntity {
@TableId("COMPLIANCE_REQUIR")
private String complianceRequire;
@ApiModelProperty(value = "解读内容")
@TableField("read_content")
private String readContent;
}
@@ -51,7 +51,7 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
}
@GetMapping("/queryProjectWorkFlow")
@ApiOperation("车型/项目库")
@ApiOperation("车型/项目库-!!!")
public ResponseMessage queryMaintenanceProjectWorkFlow(@RequestParam(defaultValue = "1", value = "Page")int Page, @RequestParam(defaultValue = "10", value = "PageSize") int PageSize,SarStandProjectLibraryDto sarDto) {
IPage<SarStandProjectLibrary> MaintenanceList = sarStandProjectLibraryService.queryMaintenanceProjectWorkFlow(Page,PageSize,sarDto);
Map<String, Object> map = new HashMap<String, Object>();
@@ -59,13 +59,16 @@ public class SarStandardComplianceAssessResultController {
if (eo.getStandApplicationType() == 1) {
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME");
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME,type");
if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) {
queryWrapper.like("STAND_NAME",eo.getStandName().trim());
}
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
queryWrapper.like("STAND_NUMBER",eo.getStandNumber().trim());
}
if (eo.getType() != null && !eo.getType().trim().equals("")) {
queryWrapper.like("type",eo.getType().trim());
}
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
while(page.getRecords().remove(null));
@@ -75,13 +78,16 @@ public class SarStandardComplianceAssessResultController {
if(eo.getPosition()==1){
QueryWrapper<SarInterpretationNationalStandard> queryWrapper = new QueryWrapper<>();
IPage<SarInterpretationNationalStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME");
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME,type");
if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) {
queryWrapper.like("STAND_NAME",eo.getStandName().trim());
}
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
queryWrapper.like("STAND_NUMBER",eo.getStandNumber().trim());
}
if (eo.getType() != null && !eo.getType().trim().equals("")) {
queryWrapper.like("type",eo.getType().trim());
}
IPage<SarInterpretationNationalStandard> page = iSarInterpretationNationalStandardService.page(iPage, queryWrapper);
while(page.getRecords().remove(null));
@@ -90,13 +96,16 @@ public class SarStandardComplianceAssessResultController {
}else{
QueryWrapper<SarInterpretationForeignStandard> queryWrapper = new QueryWrapper<>();
IPage<SarInterpretationForeignStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME");
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME,type");
if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) {
queryWrapper.like("STAND_NAME",eo.getStandName().trim());
}
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
queryWrapper.like("STAND_NUMBER",eo.getStandNumber().trim());
}
if (eo.getType() != null && !eo.getType().trim().equals("")) {
queryWrapper.like("type",eo.getType().trim());
}
IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper);
while(page.getRecords().remove(null));
@@ -158,14 +167,11 @@ public class SarStandardComplianceAssessResultController {
public ResponseMessage<IPage<SarStandardComplianceProductAssess>> selectProduct(SarStandardComplianceProductAssessEO eo) throws Exception {
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
if (eo.getType() !=null) queryWrapper.eq("type",eo.getType());
if (eo.getProductName() != null) queryWrapper.like("product_name", eo.getProductName());
if (eo.getStandId() != null) queryWrapper.like("STAND_ID", eo.getStandId());
if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
// while(page.getRecords().remove(null));
return Result.success(page);
}
@@ -117,6 +117,10 @@ public class SarStandardComplianceProductAssess extends BaseEntity {
@TableField("clause_name")
private String clauseName;
@ApiModelProperty(value = "流程UUID")
@TableField("type")
private String type;
private String id;
@@ -18,6 +18,10 @@ public class SarStandardComplianceProductAssessEO{
@TableField("STAND_ID")
private String standId;
@ApiModelProperty(value = "流程UUID")
@TableField("type")
private String type;
@ApiModelProperty(value = "'项目名称'")
private String productName;
@@ -25,6 +25,9 @@ public class SarStandardsInfoEO {
@ApiModelProperty(value = "国内1,国外2")
private Integer position=1;
@ApiModelProperty(value = "流程UUID")
@TableField("type")
private String type;
@ApiModelProperty("页数")
private Integer current=1;
@@ -130,36 +130,52 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
}
}
}
if (StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
List<SarAdvanceSearchVO> searchList = JSONObject.parseArray(page.getAdvanceSearchVOStr(),SarAdvanceSearchVO.class);
int i = 0;
for (SarAdvanceSearchVO sarAdvanceSearchVO:searchList){
if ("SVPPS".equals(sarAdvanceSearchVO.getField()) && StringUtils.isBlank(sarAdvanceSearchVO.getValue())){
isNull = i;
}
i++;
}
if (-1 != isNull) {
searchList.remove(isNull);
}
if (isNull == 0 && searchList.size() > 0){
searchList.get(0).setConnect("");
}
String advanceStr = SarAdvanceSearchUtil.createSql(searchList);
if (null != advanceStr) {
advanceStr = advanceStr.replace("stand_number", "concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',SAR_STANDARDS_INFO.STAND_YEAR)");
}
if (-1 != isNull && StringUtils.isBlank(advanceStr)){
advanceStr = advanceStr + " SVPPS is null";
}else if (-1 != isNull && StringUtils.isNotBlank(advanceStr)){
advanceStr = advanceStr + " and SVPPS is null";
}
String advanceStr = SarAdvanceSearchUtil.createStandSql(searchList);
if (StringUtils.isNotBlank(advanceStr)) {
page.setAdvanceSearchStr(advanceStr);
} else {
page.setAdvanceSearchStr(null);
}
}
// if (StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
// List<SarAdvanceSearchVO> searchList = JSONObject.parseArray(page.getAdvanceSearchVOStr(),SarAdvanceSearchVO.class);
// int i = 0;
// for (SarAdvanceSearchVO sarAdvanceSearchVO:searchList){
// if ("SVPPS".equals(sarAdvanceSearchVO.getField()) && StringUtils.isBlank(sarAdvanceSearchVO.getValue())){
// isNull = i;
// }
// i++;
// }
// if (-1 != isNull) {
// searchList.remove(isNull);
// }
// if (isNull == 0 && searchList.size() > 0){
// searchList.get(0).setConnect("");
// }
// String advanceStr = SarAdvanceSearchUtil.createSql(searchList);
// if (null != advanceStr) {
// advanceStr = advanceStr.replace("stand_number", "concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',SAR_STANDARDS_INFO.STAND_YEAR)");
// }
// if (-1 != isNull && StringUtils.isBlank(advanceStr)){
// advanceStr = advanceStr + " SVPPS is null";
// }else if (-1 != isNull && StringUtils.isNotBlank(advanceStr)){
// advanceStr = advanceStr + " and SVPPS is null";
// }
// if (StringUtils.isNotBlank(advanceStr)) {
// page.setAdvanceSearchStr(advanceStr);
// } else {
// page.setAdvanceSearchStr(null);
// }
// }
if(page.getUserId() == null || page.getUserId().equals("")){
page.setUserId(LoginUserUtil.getUserId());
}
@@ -87,5 +87,8 @@ public class SarStandardsInfoEOPage extends BasePage {
private String orderBy1 = "SAR_STANDARDS_INFO.issue_time";
private String order1 = "desc";
// zhaokaiyao
private String textStatus;//文本状态
}
@@ -68,6 +68,7 @@ import org.apache.poi.hwpf.extractor.WordExtractor;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.json.JSONTokener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
@@ -387,13 +388,19 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
}
public void attrInfoSearchDetails(SarStandardsInfo row) throws Exception {
public void attrInfoSearchDetails(SarStandardsInfo row,String type) throws Exception {
String fieldInfo = InitStandAttrUtil.queryField;
String collectId = personCollectEOService.queryCollectByUserAndId(row.getId());
row.setCollectId(collectId);
// 查询属性表数据
if (StringUtils.isNotBlank(fieldInfo)) {
Map<String, Object> getAttrMap = sarStandAttrInfoEODao.selectStandFieldAndData(fieldInfo, row.getId());
Map<String, Object> getAttrMap = new TreeMap<>();
if(type.equals("add")){
String sarStandAttrEOStr = row.getSarStandAttrEOStr();
getAttrMap = JSONObject.fromObject(sarStandAttrEOStr);
}else {
getAttrMap = sarStandAttrInfoEODao.selectStandFieldAndData(fieldInfo, row.getId());
}
if (InitStandAttrUtil.clobFieldList != null && !InitStandAttrUtil.clobFieldList.isEmpty()) {
// 遍历修改所有clob类型的值
for (String clobField : InitStandAttrUtil.clobFieldList) {
@@ -457,18 +464,28 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
}
public void attrInfoShowSearchDetails(SarStandardsInfo row) throws Exception {
public void attrInfoShowSearchDetails(SarStandardsInfo row,String type) throws Exception {
if (row != null) {
attrInfoSearchDetails(row);
attrInfoSearchDetails(row,type);
Map<String, Object> getAttrMap = row.getAttrInfoMap();
if (getAttrMap != null && getAttrMap.size() > 0) {
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey();
String value = "";
List<String> valArr = new ArrayList<>();
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
value = entry.getValue().toString();
List<String> valArr = Arrays.asList(value.split(","));
value = dicTypeEODao.getDicNamesByCodes(valArr);
if(StringUtils.isNotBlank(entry.getValue().toString())){
Object json= new JSONTokener(entry.getValue().toString()).nextValue();
if(json instanceof org.json.JSONArray){
valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(),String.class);
}else {
value = entry.getValue().toString();
valArr = Arrays.asList(value.split(","));
}
if(!valArr.isEmpty()){
value = dicTypeEODao.getDicNamesByCodes(valArr);
}
}
entry.setValue(value);
}
}
@@ -576,10 +593,20 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
String content = "新增" + number + "" + sarStandardsInfoEO.getStandName() + "";
sarUpdLogEOService.createBaseLog(sarStandardsInfoEO.getId(), sarStandardsInfoEO.getStandType() + "_STAND", content);
// if(elasflag) {
// // 消息队列
// createStandMQService.sendStandMQ(sarStandardsInfoEO,"add");
// }
if(elasflag) {
// 消息队列
attrInfoShowSearchDetails(sarStandardsInfoEO,"add");
FindSarItemsPageReqDTO pageInfo = new FindSarItemsPageReqDTO();
pageInfo.setStandId(sarStandardsInfoEO.getId());
pageInfo.setFileType("FBGBJBD");
List<SarItemVO> sarItemVOS = standItemsDao.querySarItemAndInterpretation(pageInfo);
if(!sarItemVOS.isEmpty()){
Map<String,String> collectMap = sarItemVOS.stream().filter((e) -> e.getItemsNum() != null && e.getItemsName() != null)
.collect(Collectors.toMap(SarItemVO::getItemsNum, SarItemVO::getItemsName));
sarStandardsInfoEO.setMapItems(collectMap);
}
createStandMQService.sendStandMQ(sarStandardsInfoEO,"add");
}
}
}
@@ -1148,7 +1175,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
// 记录修改日志
saveUpdateLog(sarStandardsInfoEO, beforeSarStandardsInfo);
if(elasflag) { //what?
attrInfoShowSearchDetails(sarStandardsInfoEO);
attrInfoShowSearchDetails(sarStandardsInfoEO,"upd");
FindSarItemsPageReqDTO pageInfo = new FindSarItemsPageReqDTO();
pageInfo.setStandId(sarStandardsInfoEO.getId());
pageInfo.setFileType("FBGBJBD");
@@ -14,61 +14,61 @@ import java.util.List;
public class SarAdvanceSearchUtil {
// 拼接sql语句
public static String createSql (List<SarAdvanceSearchVO> searchVOList) {
public static String createSql(List<SarAdvanceSearchVO> searchVOList) {
String sqlInfo = "";
StringBuilder sqlBuilder = new StringBuilder();
if (searchVOList != null && !searchVOList.isEmpty()) {
for (SarAdvanceSearchVO searchVO : searchVOList) {
String sql = "";
if (StringUtils.isNotBlank(searchVO.getValue())) {
if(searchVO.getValue().contains(",")){
sql += searchVO.getConnect()+"(";
if (searchVO.getValue().contains(",")) {
sql += searchVO.getConnect() + "(";
List<String> list = Arrays.asList(searchVO.getValue().split(","));
for(int i =0;i<list.size();i++){
if(i==list.size()-1){
sql += searchVO.getField() +" "+searchVO.getType() + " " + "concat(concat('%','"+ list.get(i) +"'),'%') ";
}else{
sql += searchVO.getField() +" "+searchVO.getType() + " " + "concat(concat('%','"+ list.get(i) +"'),'%') and ";
for (int i = 0; i < list.size(); i++) {
if (i == list.size() - 1) {
sql += searchVO.getField() + " " + searchVO.getType() + " " + "concat(concat('%','" + list.get(i) + "'),'%') ";
} else {
sql += searchVO.getField() + " " + searchVO.getType() + " " + "concat(concat('%','" + list.get(i) + "'),'%') and ";
}
}
sql += " )";
}else{
} else {
sql += searchVO.getConnect() + " " + searchVO.getField() + " ";
if (!"like".equals(searchVO.getType())) {
sql += searchVO.getType() + "'" + searchVO.getValue() + "'";
} else {
sql += searchVO.getType() + " " + "concat(concat('%','"+ searchVO.getValue() +"'),'%')";
sql += searchVO.getType() + " " + "concat(concat('%','" + searchVO.getValue() + "'),'%')";
}
}
sqlBuilder.append(sql);
} else if (StringUtils.isNotBlank(searchVO.getTimeSt()) || StringUtils.isNotBlank(searchVO.getTimeEd())) {
sql += searchVO.getConnect() + " ";
if (StringUtils.isNotBlank(searchVO.getTimeSt()) && StringUtils.isBlank(searchVO.getTimeEd())) {
sql += "("+searchVO.getField();
sql += (searchVO.getType().equals("!=")?" not ":"") + " between " + "'" + searchVO.getTimeSt() + "' and '2099-12-31'";
sql += " or "+searchVO.getField();
sql += (searchVO.getType().equals("!=")?" not ":"") + " between " + "'" + searchVO.getTimeSt() +" 00:00:00"+ "' and '2099-12-31 23:59:59'";
sql += " or "+searchVO.getField();
sql += " = 'TBD'";
sql += "(" + searchVO.getField();
sql += (searchVO.getType().equals("!=") ? " not " : "") + " between " + "'" + searchVO.getTimeSt() + "' and '2099-12-31'";
sql += " or " + searchVO.getField();
sql += (searchVO.getType().equals("!=") ? " not " : "") + " between " + "'" + searchVO.getTimeSt() + " 00:00:00" + "' and '2099-12-31 23:59:59'";
sql += " or " + searchVO.getField();
sql += " = 'TBD'";
sql += ")";
} else if (StringUtils.isBlank(searchVO.getTimeSt()) && StringUtils.isNotBlank(searchVO.getTimeEd())) {
sql += "("+searchVO.getField();
sql += (searchVO.getType().equals("!=")?" not ":"") +" between '1970-01-01' and " + "'" + searchVO.getTimeEd() + "'";
sql += " or "+searchVO.getField();
sql += (searchVO.getType().equals("!=")?" not ":"") +" between '1970-01-01 00:00:00' and " +
sql += "(" + searchVO.getField();
sql += (searchVO.getType().equals("!=") ? " not " : "") + " between '1970-01-01' and " + "'" + searchVO.getTimeEd() + "'";
sql += " or " + searchVO.getField();
sql += (searchVO.getType().equals("!=") ? " not " : "") + " between '1970-01-01 00:00:00' and " +
"'" + searchVO.getTimeEd() + " 23:59:59'";
sql += " or "+searchVO.getField();
sql += " = 'TBD'";
sql += " or " + searchVO.getField();
sql += " = 'TBD'";
sql += ")";
} else if (StringUtils.isNotBlank(searchVO.getTimeSt()) && StringUtils.isNotBlank(searchVO.getTimeEd())) {
sql += "("+searchVO.getField();
sql += (searchVO.getType().equals("!=")?" not ":"") + " between '" + searchVO.getTimeSt() + "' and '"
sql += "(" + searchVO.getField();
sql += (searchVO.getType().equals("!=") ? " not " : "") + " between '" + searchVO.getTimeSt() + "' and '"
+ searchVO.getTimeEd() + "'";
sql += " or "+searchVO.getField();
sql += (searchVO.getType().equals("!=")?" not ":"") + " between '" + searchVO.getTimeSt() +" 00:00:00"+ "' and '"
sql += " or " + searchVO.getField();
sql += (searchVO.getType().equals("!=") ? " not " : "") + " between '" + searchVO.getTimeSt() + " 00:00:00" + "' and '"
+ searchVO.getTimeEd() + " 23:59:59'";
sql += " or "+searchVO.getField();
sql += " = 'TBD'";
sql += " or " + searchVO.getField();
sql += " = 'TBD'";
sql += ")";
}
sqlBuilder.append(sql);
@@ -78,4 +78,33 @@ public class SarAdvanceSearchUtil {
}
return sqlInfo;
}
/**
* 国内外标准高级查询 对SAR_STAND_ATTR_INFO表自定义字段生成条件语句
* @param searchVOList
* @return
*/
public static String createStandSql(List<SarAdvanceSearchVO> searchVOList) {
String sqlInfo = "";
String tableName="SAR_STAND_ATTR_INFO.";
StringBuilder sqlBuilder = new StringBuilder();
if (searchVOList != null && !searchVOList.isEmpty()) {
for (int i = 0; i < searchVOList.size(); i++) {
String sql = "";
SarAdvanceSearchVO searchVO=searchVOList.get(i);
if (StringUtils.isNotBlank(searchVO.getValue()));
if (i==0){
sql+=tableName+searchVO.getField()+" " + searchVO.getType() + " " + "concat(concat('%','" +searchVO.getValue() + "'),'%') ";
}else {
sql+="AND"+" "+tableName+searchVO.getField()+" " + searchVO.getType() + " " + "concat(concat('%','" +searchVO.getValue() + "'),'%') ";
}
sqlBuilder.append(sql);
}
sqlInfo = sqlBuilder.toString();
}
return sqlInfo;
}
}
@@ -68,6 +68,7 @@
<result column="COMPLIANCE_REQUIR" property="complianceRequire"/>
<result column="FILE_TYPE" property="fileType"/>
<result column="core_technical_requirement" property="interpretationContent"/>
<result column="read_content" property="readContent"/>
</resultMap>
@@ -429,6 +429,9 @@
<if test="replacedStandNum != null and replacedStandNum != ''">
and replaced_stand_num like concat(concat('%',#{replacedStandNum}),'%')
</if>
<if test="isRelateAccess != null and isRelateAccess != ''" >
and is_relate_access = #{isRelateAccess}
</if>
<!-- 目录判断 -->
<if test="menuId != null and menuId !='nomenu' and menuAllChildrenIdList != null">
and SAR_STAND_MENU.MENU_ID in
@@ -490,11 +493,28 @@
</if>
<if test="standSort != null and standSort != ''" >
and SAR_STANDARDS_INFO.stand_sort = #{standSort}
</if>
<!--标准年份-->
<if test="standYear != null and standYear != ''">
and SAR_STANDARDS_INFO.STAND_YEAR = #{standYear}
</if>
<if test="issueTime != null and issueTime != ''">
and SAR_STANDARDS_INFO.ISSUE_TIME = #{issueTime}
</if>
<!--内容摘要-->
<if test="synopsis != null and synopsis != ''" >
AND dbms_lob.instr(SYNOPSIS, #{synopsis} ,1,1) > 0
</if>
<!--文本状态-->
<if test="textStatus != null and textStatus != ''" >
and SAR_STANDARDS_INFO.TEXT_STATUS = #{textStatus}
</if>
<!--是否纳入法规清单-->
<if test="isRelateAccess != null and isRelateAccess != ''" >
and SAR_STANDARDS_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
</if>
<if test="collectMenuId != null and collectMenuId != ''">
and SAR_STANDARDS_INFO.id in (
select COLLECT_RES_ID from TS_PERSON_COLLECT where TS_PERSON_COLLECT.VALID_FLAG=0
@@ -502,18 +522,18 @@
and TS_PERSON_COLLECT.user_id=#{userId}
)
</if>
<if test='labelMenuId != null and labelMenuId == "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ is not null
</if>
<if test='labelMenuId != null and labelMenuId != "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{labelMenuId}),'%')
</if>
<!--适用车型-->
<if test="applyArctic != null and applyArctic != ''">
and SAR_STAND_ATTR_INFO.SYCLLX = #{applyArctic}
</if>
<if test="isRelateAccess != null and isRelateAccess != ''" >
and is_relate_access = #{isRelateAccess}
and SAR_STAND_ATTR_INFO.CLLX = #{applyArctic}
</if>
<if test="advanceSearchStr != null and advanceSearchStr != ''">
and (${advanceSearchStr})
</if>