瀏覽代碼

动态查询获取配置信息

wangfeng 6 年之前
父節點
當前提交
f19a6ae078

+ 4 - 3
icss-service/src/main/java/com/diagbot/dto/SysSetInfoDTO.java

@@ -55,15 +55,16 @@ public class SysSetInfoDTO {
     /**
      * 配置名称
      */
-    private String deployName;
+    private String name;
+    
     /**
      * 配置编码
      */
-    private String deployCode;
+    private String code;
     /**
      * 配置值
      */
-    private Integer deployValue;
+    private Integer value;
 
     /**
      * 备注

+ 15 - 0
icss-service/src/main/java/com/diagbot/vo/HospitalSetVO.java

@@ -14,4 +14,19 @@ import lombok.Setter;
 public class HospitalSetVO {
 
 	private String hospitalCode;
+
+	/**
+	 * 访问的系统类型
+	 * 1:user-service,2:diagbotman-service,3:uaa-service,4:log-service,5:bi-service,6:knowledge-service,7:feedback-service,8:icss-web
+	 */
+	private Integer sysType;
+
+	/**
+	 * 配置名称
+	 */
+	private String name;
+	/**
+	 * 配置编码
+	 */
+	private String code;
 }

+ 3 - 3
tran-service/src/main/java/com/diagbot/dto/SysSetInfoDTO.java

@@ -55,16 +55,16 @@ public class SysSetInfoDTO {
     /**
      * 配置名称
      */
-    private String deployName;
+    private String name;
     
     /**
      * 配置编码
      */
-    private String deployCode;
+    private String code;
     /**
      * 配置值
      */
-    private Integer deployValue;
+    private Integer value;
 
     /**
      * 备注

+ 112 - 107
tran-service/src/main/java/com/diagbot/entity/SysSet.java

@@ -1,10 +1,12 @@
 package com.diagbot.entity;
 
-import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.Date;
+
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
-import java.time.LocalDateTime;
-import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.TableName;
 
 /**
  * <p>
@@ -33,12 +35,12 @@ public class SysSet implements Serializable {
     /**
      * 记录创建时间
      */
-    private LocalDateTime gmtCreate;
+    private Date gmtCreate;
 
     /**
      * 记录修改时间,如果时间是1970年则表示纪录未修改
      */
-    private LocalDateTime gmtModified;
+    private Date gmtModified;
 
     /**
      * 创建人,0表示无创建人值
@@ -63,122 +65,125 @@ public class SysSet implements Serializable {
     /**
      * 配置名称
      */
-    private String deployName;
+    private String name;
 
     /**
      * 配置编码
      */
-    private String deployCode;
+    private String code;
     /**
      * 配置值
      */
-    private Integer deployValue;
+    private Integer value;
 
     /**
      * 备注
      */
     private String remark;
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-    public LocalDateTime getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(LocalDateTime gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-    public LocalDateTime getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(LocalDateTime gmtModified) {
-        this.gmtModified = gmtModified;
-    }
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-    public String getHospitalCode() {
-        return hospitalCode;
-    }
-
-    public void setHospitalCode(String hospitalCode) {
-        this.hospitalCode = hospitalCode;
-    }
-    public Integer getSysType() {
-        return sysType;
-    }
-
-    public void setSysType(Integer sysType) {
-        this.sysType = sysType;
-    }
-    public String getDeployName() {
-        return deployName;
-    }
-
-    public void setDeployName(String deployName) {
-        this.deployName = deployName;
-    }
-    public Integer getDeployValue() {
-        return deployValue;
-    }
-
-    public void setDeployValue(Integer deployValue) {
-        this.deployValue = deployValue;
-    }
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    public String getDeployCode() {
-		return deployCode;
-	}
-
-	public void setDeployCode(String deployCode) {
-		this.deployCode = deployCode;
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getIsDeleted() {
+		return isDeleted;
+	}
+
+	public void setIsDeleted(String isDeleted) {
+		this.isDeleted = isDeleted;
+	}
+
+	public Date getGmtCreate() {
+		return gmtCreate;
+	}
+
+	public void setGmtCreate(Date gmtCreate) {
+		this.gmtCreate = gmtCreate;
+	}
+
+	public Date getGmtModified() {
+		return gmtModified;
+	}
+
+	public void setGmtModified(Date gmtModified) {
+		this.gmtModified = gmtModified;
+	}
+
+	public String getCreator() {
+		return creator;
+	}
+
+	public void setCreator(String creator) {
+		this.creator = creator;
+	}
+
+	public String getModifier() {
+		return modifier;
+	}
+
+	public void setModifier(String modifier) {
+		this.modifier = modifier;
+	}
+
+	public String getHospitalCode() {
+		return hospitalCode;
+	}
+
+	public void setHospitalCode(String hospitalCode) {
+		this.hospitalCode = hospitalCode;
+	}
+
+	public Integer getSysType() {
+		return sysType;
+	}
+
+	public void setSysType(Integer sysType) {
+		this.sysType = sysType;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public Integer getValue() {
+		return value;
+	}
+
+	public void setValue(Integer value) {
+		this.value = value;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
 	}
 
 	@Override
-    public String toString() {
-        return "SysSet{" +
-        "id=" + id +
-        ", isDeleted=" + isDeleted +
-        ", gmtCreate=" + gmtCreate +
-        ", gmtModified=" + gmtModified +
-        ", creator=" + creator +
-        ", modifier=" + modifier +
-        ", hospitalCode=" + hospitalCode +
-        ", sysType=" + sysType +
-        ", deployName=" + deployName +
-        ", deployValue=" + deployValue +
-        ", remark=" + remark +
-        "}";
-    }
+	public String toString() {
+		return "SysSet [id=" + id + ", isDeleted=" + isDeleted + ", gmtCreate=" + gmtCreate + ", gmtModified="
+				+ gmtModified + ", creator=" + creator + ", modifier=" + modifier + ", hospitalCode=" + hospitalCode
+				+ ", sysType=" + sysType + ", name=" + name + ", code=" + code + ", value=" + value + ", remark="
+				+ remark + "]";
+	}
+
+   
 }

+ 3 - 3
tran-service/src/main/java/com/diagbot/facade/SysSetFacade.java

@@ -28,10 +28,10 @@ public class SysSetFacade extends SysSetServiceImpl{
 	 * @return
 	 */
 	public List<SysSetInfoDTO> getSysSetInfoData(HospitalSetVO hospitalSetVO) {
-		 QueryWrapper<SysSet> queryWrapper = new QueryWrapper<SysSet>();
+/*		 QueryWrapper<SysSet> queryWrapper = new QueryWrapper<SysSet>();
 	        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-	        			.in("hospital_code", hospitalSetVO.getHospitalCode());
-	        List<SysSet> sysSetData = this.list(queryWrapper);
+	        			.in("hospital_code", hospitalSetVO.getHospitalCode());*/
+	        List<SysSet> sysSetData = querySysSetInfo(hospitalSetVO);
 	        List<SysSetInfoDTO> data =   BeanUtil.listCopyTo(sysSetData, SysSetInfoDTO.class);
 		return data;
 	}

+ 6 - 1
tran-service/src/main/java/com/diagbot/mapper/SysSetMapper.java

@@ -1,7 +1,10 @@
 package com.diagbot.mapper;
 
-import com.diagbot.entity.SysSet;
+import java.util.List;
+
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.SysSet;
+import com.diagbot.vo.HospitalSetVO;
 
 /**
  * <p>
@@ -12,5 +15,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @since 2019-06-12
  */
 public interface SysSetMapper extends BaseMapper<SysSet> {
+	
+	public List<SysSet> querySysSetInfo(HospitalSetVO hospitalSetVO);
 
 }

+ 5 - 1
tran-service/src/main/java/com/diagbot/service/SysSetService.java

@@ -1,7 +1,10 @@
 package com.diagbot.service;
 
-import com.diagbot.entity.SysSet;
+import java.util.List;
+
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.SysSet;
+import com.diagbot.vo.HospitalSetVO;
 
 /**
  * <p>
@@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface SysSetService extends IService<SysSet> {
 
+	public List<SysSet> querySysSetInfo(HospitalSetVO hospitalSetVO);
 }

+ 11 - 2
tran-service/src/main/java/com/diagbot/service/impl/SysSetServiceImpl.java

@@ -1,10 +1,14 @@
 package com.diagbot.service.impl;
 
+import java.util.List;
+
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.entity.SysSet;
 import com.diagbot.mapper.SysSetMapper;
 import com.diagbot.service.SysSetService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
+import com.diagbot.vo.HospitalSetVO;
 
 /**
  * <p>
@@ -17,4 +21,9 @@ import org.springframework.stereotype.Service;
 @Service
 public class SysSetServiceImpl extends ServiceImpl<SysSetMapper, SysSet> implements SysSetService {
 
+	@Override
+	public List<SysSet> querySysSetInfo(HospitalSetVO hospitalSetVO) {
+		return baseMapper.querySysSetInfo(hospitalSetVO);
+	}
+
 }

+ 14 - 0
tran-service/src/main/java/com/diagbot/vo/HospitalSetVO.java

@@ -14,4 +14,18 @@ import lombok.Setter;
 public class HospitalSetVO {
 
 	private String hospitalCode;
+	
+	/**
+     * 访问的系统类型 1:user-service,2:diagbotman-service,3:uaa-service,4:log-service,5:bi-service,6:knowledge-service,7:feedback-service,8:icss-web
+     */
+    private Integer sysType;
+
+    /**
+     * 配置名称
+     */
+    private String name;
+    /**
+     * 配置编码
+     */
+    private String code;
 }

+ 33 - 16
tran-service/src/main/resources/mapper/SysSetMapper.xml

@@ -2,20 +2,37 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.diagbot.mapper.SysSetMapper">
 
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.diagbot.entity.SysSet">
-        <id column="id" property="id" />
-        <result column="is_deleted" property="isDeleted" />
-        <result column="gmt_create" property="gmtCreate" />
-        <result column="gmt_modified" property="gmtModified" />
-        <result column="creator" property="creator" />
-        <result column="modifier" property="modifier" />
-        <result column="hospital_code" property="hospitalCode" />
-        <result column="sys_type" property="sysType" />
-        <result column="deploy_name" property="deployName" />
-        <result column="deploy_code" property="deployCode" />
-        <result column="deploy_value" property="deployValue" />
-        <result column="remark" property="remark" />
-    </resultMap>
-
+	<!-- 通用查询映射结果 -->
+	<resultMap id="BaseResultMap" type="com.diagbot.entity.SysSet">
+		<id column="id" property="id" />
+		<result column="is_deleted" property="isDeleted" />
+		<result column="gmt_create" property="gmtCreate" />
+		<result column="gmt_modified" property="gmtModified" />
+		<result column="creator" property="creator" />
+		<result column="modifier" property="modifier" />
+		<result column="hospital_code" property="hospitalCode" />
+		<result column="sys_type" property="sysType" />
+		<result column="name" property="name" />
+		<result column="code" property="code" />
+		<result column="value" property="value" />
+		<result column="remark" property="remark" />
+	</resultMap>
+	<select id="querySysSetInfo" parameterType="com.diagbot.vo.HospitalSetVO" resultType="com.diagbot.entity.SysSet">
+		SELECT * FROM tran_sys_set 
+		<where>
+			is_deleted = "N"
+			<if test="hospitalCode != null and hospitalCode != '' ">
+				and hospital_code = #{hospitalCode}
+			</if>
+			<if test="sysType != null">
+				and sys_type = #{sysType}
+			</if>
+			<if test="name != null and name !=''">
+				and name = #{name}
+			</if>
+			<if test="code != null and code !=''">
+				and code = #{code}
+			</if>
+		</where>
+	</select>
 </mapper>