Merge branch 'develop_3' into 'develop_master'

Develop 3  feat: 标准库 左侧树 相关 配置标准 更新记录相关等

See merge request !18
This commit is contained in:
super_liu
2021-07-08 14:59:10 +00:00
16 changed files with 444 additions and 34 deletions
@@ -1,12 +1,17 @@
package com.adc.da;
import org.apache.catalina.connector.Connector;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
@EnableEurekaClient
@EnableFeignClients
@@ -19,4 +24,16 @@ public class AdcDaApplication {
SpringApplication.run(AdcDaApplication.class, args);
}
@Bean
public ConfigurableServletWebServerFactory webServerFactory() {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
@Override
public void customize(Connector connector) {
connector.setProperty("relaxedQueryChars", "|{}[]");
}
});
return factory;
}
}
@@ -4,15 +4,19 @@ package com.adc.da.slrs.sarResource.controller;
import com.adc.da.base.web.BaseController;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarMenuStandard.entity.SarMenuStandard;
import com.adc.da.slrs.sarResource.entity.TsResource;
import com.adc.da.slrs.sarResource.service.ITsResourceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
@@ -28,6 +32,20 @@ import java.util.List;
public class TsResourceController extends BaseController<TsResource> {
@Autowired
private ITsResourceService tsResourceService;
@ApiOperation("根据ID查询菜单")
@GetMapping("/getMenuById")
public ResponseMessage<TsResource> getMenuById(@RequestParam String menuId){
TsResource sarMenus = tsResourceService.getById(menuId);
if(sarMenus != null && sarMenus.getParentIds() != null && StringUtils.isNotBlank(sarMenus.getParentIds())){
List<TsResource> menuStandards = tsResourceService.getMenuByIds(Arrays.asList(sarMenus.getParentIds().split(",")));
if(!menuStandards.isEmpty()){
String parentIdsName = menuStandards.stream().map(TsResource::getMenuName).collect(Collectors.joining(","));
sarMenus.setParentIdsName(parentIdsName);
}
}
return Result.success(sarMenus);
}
@ApiOperation("查询所有资源")
@GetMapping
@@ -87,4 +87,8 @@ public class TsResource extends BaseEntity {
@TableField(exist = false)
private List<TsResource> children;
@ApiModelProperty(value = "上级菜单名称")
@TableField(exist = false)
private String parentIdsName;
}
@@ -1,6 +1,7 @@
package com.adc.da.slrs.sarResource.service;
import com.adc.da.http.ResponseMessage;
import com.adc.da.slrs.sarMenuStandard.entity.SarMenuStandard;
import com.adc.da.slrs.sarResource.entity.TsResource;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -16,6 +17,15 @@ import java.util.List;
*/
public interface ITsResourceService extends IService<TsResource> {
List<String> getParentMenuId(String menuId);
/**
* 通过Ids查询menu
* @param menuIds :菜单Ids
* @return List<Menu>
*/
List<TsResource> getMenuByIds(List<String> menuIds);
List<TsResource> getAll(TsResource tsResource);
ResponseMessage<Object> addResource(TsResource tsResource);
@@ -3,6 +3,8 @@ package com.adc.da.slrs.sarResource.service.impl;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarMenu.entity.SarMenu;
import com.adc.da.slrs.sarMenuStandard.entity.SarMenuStandard;
import com.adc.da.slrs.sarResource.dao.TsResourceDao;
import com.adc.da.slrs.sarResource.entity.TsResource;
import com.adc.da.slrs.sarResource.service.ITsResourceService;
@@ -29,6 +31,36 @@ import java.util.List;
public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource> implements ITsResourceService {
@Autowired
private TsResourceDao dao;
public List<String> getParentMenuId (String menuId) {
List<String> parentIds = new ArrayList<>();
if (StringUtils.isNotEmpty(menuId)) {
List<TsResource> sarMenuEOList = dao.selectList(new QueryWrapper<>());
Tree tree = new Tree(sarMenuEOList);
TreeNode treeNode = tree.getTreeNode(menuId);
while (treeNode.getParent() != null) {
parentIds.add(treeNode.getParent().getNodeId());
treeNode = treeNode.getParent();
}
}
return parentIds;
}
/**
* 通过Ids查询menu
* @param menuIds :菜单Ids
* @return List<Menu>
*/
@Override
public List<TsResource> getMenuByIds(List<String> menuIds) {
if(menuIds!=null&&menuIds.size()>0){
QueryWrapper<TsResource> sarMenuQueryWrapper=new QueryWrapper<>();
sarMenuQueryWrapper.in("id",menuIds);
return dao.selectList(sarMenuQueryWrapper);
}
return new ArrayList<>();
}
/**
* 查询所有菜单
* @param tsResource
@@ -54,7 +86,7 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
*/
@Override
public ResponseMessage<Object> addResource(TsResource TsResource) {
if(TsResource.getParentId()!=null){
if(TsResource.getParentId() != null && StringUtils.isNotBlank(TsResource.getParentId())){
TsResource parent=dao.selectById(TsResource.getParentId());
if(parent==null){
return Result.error("该父菜单不存在");
@@ -75,7 +107,7 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
if(oldResource==null){
return Result.error("该菜单不存在");
}
if(TsResource.getParentId()!=null){
if(TsResource.getParentId() != null && StringUtils.isNotBlank(TsResource.getParentId())){
TsResource parent=dao.selectById(TsResource.getParentId());
if(parent==null){
return Result.error("父节点不存在");
@@ -1,6 +1,8 @@
package com.adc.da.slrs.sarStandardsInfo.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.hutool.core.util.ZipUtil;
import com.adc.da.att.entity.AttFileEO;
import com.adc.da.common.FileUnZip;
@@ -38,6 +40,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -67,6 +70,10 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
@Value("${file.downloadUrl}")
private String fileDownloadPath;
private static String stringTy = "UTF8";
private static String responseParam1 = "Content-Disposition";
private static String responseParam2 = "attachment;filename=";
@Autowired
ISarLawsInfoService sarLawsInfoEOService;
@@ -197,7 +204,7 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
response.setHeader("Content-Disposition",
"attachment; filename=" + ReadExcel.encodeFileName(standardsInfoExcelVO.getExportName()+".xlsx",
request));
response.setContentType("application/force-download");
// response.setContentType("application/force-download");
// 导出所有数据
List<SarStandardsInfo> datas = sarStandardsInfoEOService.getExportDatas(standardsInfoExcelVO);
workbook = StandExportUtil.exportDatas(datas,standardsInfoExcelVO.getStandType());
@@ -419,20 +426,31 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
@PostMapping("/saveStandardsMenu")
//@RequiresPermissions("lawss:sarStandardsInfo:saveStandardsMenu")
public ResponseMessage saveStandardsMenu(@RequestBody SarStandardsInfoEOPage standardsInfoEO) throws Exception {
if ("wdsc".equals(standardsInfoEO.getMenuId()) || "gxhbq".equals(standardsInfoEO.getMenuId())) {
return Result.error("所选节点不支持配置标准");
} else {
boolean flag = false;
try {
flag = sarStandardsInfoEOService.updateStandardsMenu(standardsInfoEO);
}catch (NullPointerException e){
flag = sarStandardsInfoEOService.updateStandInfo(standardsInfoEO);
}
if (flag){
return Result.success("200","配置成功",true);
}
return Result.error("-1","配置失败");
// if ("wdsc".equals(standardsInfoEO.getMenuId()) || "gxhbq".equals(standardsInfoEO.getMenuId())) {
// return Result.error("所选节点不支持配置标准");
// } else {
// boolean flag = false;
// try {
// flag = sarStandardsInfoEOService.updateStandardsMenu(standardsInfoEO);
// }catch (NullPointerException e){
// flag = sarStandardsInfoEOService.updateStandInfo(standardsInfoEO);
// }
// if (flag){
// return Result.success("200","配置成功",true);
// }
// return Result.error("-1","配置失败");
// }
boolean flag = false;
try {
flag = sarStandardsInfoEOService.updateStandardsMenu(standardsInfoEO);
}catch (NullPointerException e){
flag = sarStandardsInfoEOService.updateStandInfo(standardsInfoEO);
}
if (flag){
return Result.success("200","配置成功",true);
}
return Result.error("-1","配置失败");
}
@ApiOperation(value = "|SarStandardsInfoEO|详情页面查询相近标准")
@@ -32,7 +32,9 @@ public interface ISarStandardsInfoService extends IService<SarStandardsInfo> {
List<SarStandardsInfo> selectStandardsByStandnumber(String replaceStandNum, String standType);
SarStandardsInfo selectStandardsInfoByKey(String id) throws Exception;
public void attrInfoDetails (SarStandardsInfo row) throws Exception;
boolean updateStandardsMenu(SarStandardsInfoEOPage standardsInfoEO);
boolean updateStandInfo(SarStandardsInfoEOPage standardsInfoEO);
@@ -94,7 +94,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
private SarStandardsInfoDao dao;
@Autowired
private ISarMenuService sarMenuEOService;
private ITsResourceService sarMenuEOService;
@Autowired
private SarSarAccessInfoDao sarSarAccessInfoEODao;
@@ -1122,7 +1122,8 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
page = (SarStandardsInfoEOPage) JSONObject.toBean(jsonObject, SarStandardsInfoEOPage.class);
page.setStandType(standardsInfoExcelVO.getStandType());
//查询当前登录人角色拥有权限的菜单
List<String> getMenuIdList = sarMenuEOService.queryRoleMenuIdList(page.getStandType() + "_STAND", null);
List<String> getMenuIdList=tsUserService.getResourceId(new TsResource());
// List<String> getMenuIdList = sarMenuEOService.queryRoleMenuIdList(page.getStandType() + "_STAND", null);
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
page.setMenuRoleList(getMenuIdList);
} else {
@@ -1,12 +1,21 @@
package com.adc.da.slrs.sarUpdLog.controller;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarUpdLog.entity.SarUpdLogEOPage;
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import com.adc.da.slrs.sarUpdLog.entity.SarUpdLog;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.adc.da.base.web.BaseController;
import java.util.List;
/**
* <p>
* 前端控制器
@@ -17,7 +26,16 @@ import com.adc.da.base.web.BaseController;
*/
@RestController
@Api(description = "|SarUpdLog|")
@RequestMapping("/SarUpdLog/sar-upd-log")
@RequestMapping("/${restPath}/lawss/sarUpdLog")
public class SarUpdLogController extends BaseController<SarUpdLog> {
@Autowired
private ISarUpdLogService iSarUpdLogService;
@ApiOperation(value = "|SarUpdLogEO|查询")
@GetMapping("/getLogList")
public ResponseMessage<List<SarUpdLog>> list(SarUpdLogEOPage page) throws Exception {
page.setOrderBy("SAR_UPD_LOG.creation_time desc,id");
return Result.success(iSarUpdLogService.queryByList(page));
}
}
@@ -1,8 +1,11 @@
package com.adc.da.slrs.sarUpdLog.dao;
import com.adc.da.slrs.sarUpdLog.entity.SarUpdLog;
import com.adc.da.slrs.sarUpdLog.entity.SarUpdLogEOPage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/**
* <p>
* Mapper 接口
@@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface SarUpdLogDao extends BaseMapper<SarUpdLog> {
List<SarUpdLog> queryByList(SarUpdLogEOPage page);
}
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -45,10 +46,13 @@ public class SarUpdLog extends BaseEntity {
@ApiModelProperty(value = "创建时间")
@TableField("CREATION_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date creationTime;
@TableField("CREATION_USER")
private String creationUser;
@ApiModelProperty(value = "创建用户名称")
@TableField(exist = false)
private String creationUserName;
}
@@ -0,0 +1,122 @@
package com.adc.da.slrs.sarUpdLog.entity;
import com.adc.da.base.page.BasePage;
/**
* <b>功能:</b>SAR_UPD_LOG SarUpdLogEOPage<br>
* <b>作者:</b>code generator<br>
* <b>日期:</b> 2020-12-08 <br>
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
*/
public class SarUpdLogEOPage extends BasePage {
private String id;
private String idOperator = "=";
private String sarType;
private String sarTypeOperator = "=";
private String sarId;
private String sarIdOperator = "=";
private String content;
private String contentOperator = "=";
private String creationTime;
private String creationTime1;
private String creationTime2;
private String creationTimeOperator = "=";
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getIdOperator() {
return this.idOperator;
}
public void setIdOperator(String idOperator) {
this.idOperator = idOperator;
}
public String getSarType() {
return this.sarType;
}
public void setSarType(String sarType) {
this.sarType = sarType;
}
public String getSarTypeOperator() {
return this.sarTypeOperator;
}
public void setSarTypeOperator(String sarTypeOperator) {
this.sarTypeOperator = sarTypeOperator;
}
public String getSarId() {
return this.sarId;
}
public void setSarId(String sarId) {
this.sarId = sarId;
}
public String getSarIdOperator() {
return this.sarIdOperator;
}
public void setSarIdOperator(String sarIdOperator) {
this.sarIdOperator = sarIdOperator;
}
public String getContent() {
return this.content;
}
public void setContent(String content) {
this.content = content;
}
public String getContentOperator() {
return this.contentOperator;
}
public void setContentOperator(String contentOperator) {
this.contentOperator = contentOperator;
}
public String getCreationTime() {
return this.creationTime;
}
public void setCreationTime(String creationTime) {
this.creationTime = creationTime;
}
public String getCreationTime1() {
return this.creationTime1;
}
public void setCreationTime1(String creationTime1) {
this.creationTime1 = creationTime1;
}
public String getCreationTime2() {
return this.creationTime2;
}
public void setCreationTime2(String creationTime2) {
this.creationTime2 = creationTime2;
}
public String getCreationTimeOperator() {
return this.creationTimeOperator;
}
public void setCreationTimeOperator(String creationTimeOperator) {
this.creationTimeOperator = creationTimeOperator;
}
}
@@ -1,8 +1,10 @@
package com.adc.da.slrs.sarUpdLog.service;
import com.adc.da.slrs.sarUpdLog.entity.SarUpdLog;
import com.adc.da.slrs.sarUpdLog.entity.SarUpdLogEOPage;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
/**
@@ -15,6 +17,8 @@ import java.util.Map;
*/
public interface ISarUpdLogService extends IService<SarUpdLog> {
List<SarUpdLog> queryByList(SarUpdLogEOPage page);
void createBaseLog(String sarId, String sarType, String content) throws Exception;
void createUpdateLog(String sarType, String sarId, Map<String, Object> oldMap, Map<String, Object> newMap, String standContent) throws Exception;
@@ -4,6 +4,7 @@ import com.adc.da.common.SarTypeEnum;
import com.adc.da.slrs.sarStandAttrDetails.dao.SarStandAttrDetailsDao;
import com.adc.da.slrs.sarUpdLog.entity.SarUpdLog;
import com.adc.da.slrs.sarUpdLog.dao.SarUpdLogDao;
import com.adc.da.slrs.sarUpdLog.entity.SarUpdLogEOPage;
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
import com.adc.da.util.LoginUserUtil;
@@ -48,6 +49,11 @@ public class SarUpdLogServiceImpl extends ServiceImpl<SarUpdLogDao, SarUpdLog> i
private List<String> notCheckFieldList = Arrays.asList(notCheckField.split(","));
@Override
public List<SarUpdLog> queryByList(SarUpdLogEOPage page){
return dao.queryByList(page);
}
public void createUpdateLog (String sarType, String sarId, Map<String,Object> oldMap, Map<String,Object> newMap,String standContent) throws Exception {
SarUpdLog sarUpdLogEO = new SarUpdLog();
sarUpdLogEO.setId(UUIDUtils.randomUUID20());
@@ -1,5 +1,155 @@
<?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.sarUpdLog.dao.SarUpdLogDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarUpdLog.entity.SarUpdLog" >
<id column="id" property="id" />
<result column="sar_type" property="sarType" />
<result column="sar_id" property="sarId" />
<result column="content" property="content" />
<result column="creation_time" property="creationTime" />
<result column="creation_user" property="creationUser" />
<result column="creationUserName" property="creationUserName" />
</resultMap>
<!-- SAR_UPD_LOG table all fields -->
<sql id="Base_Column_List" >
SAR_UPD_LOG.id, sar_type, sar_id, content, SAR_UPD_LOG.creation_time,SAR_UPD_LOG.creation_user
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1
<trim suffixOverrides="," >
<if test="id != null" >
and id ${idOperator} #{id}
</if>
<if test="sarType != null" >
and sar_type ${sarTypeOperator} #{sarType}
</if>
<if test="sarId != null" >
and sar_id ${sarIdOperator} #{sarId}
</if>
<if test="content != null" >
and content ${contentOperator} #{content}
</if>
<if test="creationTime != null" >
and creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and creation_time &lt;= #{creationTime2}
</if>
</trim>
</sql>
<!-- 插入记录 -->
<insert id="insert" parameterType="com.adc.da.slrs.sarUpdLog.entity.SarUpdLog" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_SAR_UPD_LOG.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_UPD_LOG(<include refid="Base_Column_List" />)
values (#{id, jdbcType=VARCHAR}, #{sarType, jdbcType=VARCHAR}, #{sarId, jdbcType=VARCHAR}, #{content, jdbcType=CLOB}, #{creationTime, jdbcType=TIMESTAMP})
</insert>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.slrs.sarUpdLog.entity.SarUpdLog" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_SAR_UPD_LOG.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_UPD_LOG
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >id,</if>
<if test="sarType != null" >sar_type,</if>
<if test="sarId != null" >sar_id,</if>
<if test="content != null" >content,</if>
<if test="creationTime != null" >creation_time,</if>
<if test="creationUser != null" >creation_user,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
<if test="sarType != null" >#{sarType, jdbcType=VARCHAR},</if>
<if test="sarId != null" >#{sarId, jdbcType=VARCHAR},</if>
<if test="content != null" >#{content, jdbcType=CLOB},</if>
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
<if test="creationUser != null" >#{creationUser, jdbcType=VARCHAR},</if>
</trim>
</insert>
<!-- 根据pk,修改记录-->
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.sarUpdLog.entity.SarUpdLog" >
update SAR_UPD_LOG
set sar_type = #{sarType},
sar_id = #{sarId},
content = #{content},
creation_time = #{creationTime}
where id = #{id}
</update>
<!-- 修改记录,只修改只不为空的字段 -->
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.sarUpdLog.entity.SarUpdLog" >
update SAR_UPD_LOG
<set >
<if test="sarType != null" >
sar_type = #{sarType},
</if>
<if test="sarId != null" >
sar_id = #{sarId},
</if>
<if test="content != null" >
content = #{content},
</if>
<if test="creationTime != null" >
creation_time = #{creationTime},
</if>
<if test="creationUser != null" >
creation_user = #{creationUser},
</if>
</set>
where id = #{id}
</update>
<!-- 根据id查询 SAR_UPD_LOG -->
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_UPD_LOG
where id = #{value}
</select>
<!-- 删除记录 -->
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from SAR_UPD_LOG
where id = #{value}
</delete>
<!-- SAR_UPD_LOG 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from SAR_UPD_LOG
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询SAR_UPD_LOG列表 -->
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List" /> from
(select tmp_tb.* from
(select <include refid="Base_Column_List" /> from SAR_UPD_LOG
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/>,TS_USER.uname as creationUserName from SAR_UPD_LOG
left join TS_USER on SAR_UPD_LOG.creation_user = TS_USER.usid
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
</mapper>
@@ -392,11 +392,11 @@
</if>
<!-- 基本搜索项 -->
<!-- 国家、地区 -->
<if test="country != null">
<if test="country != null and country != ''">
and country = #{country}
</if>
<!-- 标准编号 -->
<if test="standNumber != null">
<if test="standNumber != null and standNumber != ''">
and (
(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR != '')
@@ -406,27 +406,27 @@
)
</if>
<!-- 标准名称 -->
<if test="standName != null">
<if test="standName != null and standName != ''">
and stand_name like concat(concat('%',#{standName}),'%')
</if>
<if test="standEnName != null">
<if test="standEnName != null and standEnName != ''">
and stand_en_name like concat(concat('%',#{standEnName}),'%')
</if>
<!-- 标准状态 -->
<if test="standState != null">
<if test="standState != null and standState != ''">
and stand_state = #{standState}
</if>
<!-- 高级检索项 -->
<!-- 标准性质 -->
<if test="standNature != null">
<if test="standNature != null and standNature != ''">
and stand_nature = #{standNature}
</if>
<!-- 代替标准 允许输入的时候输入多个-->
<if test="replaceStandNum != null">
<if test="replaceStandNum != null and replaceStandNum != ''">
and replace_stand_num like concat(concat('%',#{replaceStandNum}),'%')
</if>
<!-- 被代替标准 -->
<if test="replacedStandNum != null">
<if test="replacedStandNum != null and replacedStandNum != ''">
and replaced_stand_num like concat(concat('%',#{replacedStandNum}),'%')
</if>
<!-- 目录判断 -->
@@ -488,14 +488,14 @@
#{item}
</foreach>
</if>
<if test="standSort != null" >
<if test="standSort != null and standSort != ''" >
and SAR_STANDARDS_INFO.stand_sort = #{standSort}
</if>
<!--内容摘要-->
<if test="synopsis != null" >
<if test="synopsis != null and synopsis != ''" >
AND dbms_lob.instr(SYNOPSIS, #{synopsis} ,1,1) > 0
</if>
<if test="collectMenuId != null">
<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
and (collect_type='INLAND_STAND' or collect_type='FOREIGN_STAND')
@@ -508,13 +508,13 @@
<if test='labelMenuId != null and labelMenuId != "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{labelMenuId}),'%')
</if>
<if test="applyArctic != null">
<if test="applyArctic != null and applyArctic != ''">
and SAR_STAND_ATTR_INFO.SYCLLX = #{applyArctic}
</if>
<if test="isRelateAccess != null" >
<if test="isRelateAccess != null and isRelateAccess != ''" >
and is_relate_access = #{isRelateAccess}
</if>
<if test="advanceSearchStr != null">
<if test="advanceSearchStr != null and advanceSearchStr != ''">
and (${advanceSearchStr})
</if>
</trim>