docus-active-query-service_1.3
tan 2 years ago
parent a8751d5b1e
commit 6bea4c6325

@ -0,0 +1,43 @@
package com.docus.bgts.config;
import com.alibaba.druid.pool.DruidDataSource;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import javax.sql.DataSource;
@Configuration
@MapperScan(basePackages = DbSqlserverConfig.PACKAGE, sqlSessionFactoryRef = "dbsqlserverSqlSessionFactory")
public class DbSqlserverConfig {
// 这里一定要指定精准 否则后果不堪设想
static final String PACKAGE = "com.docus.bgts.mapper.dbsqlserver";
static final String MAPPER_LOCATION = "classpath:mapper/dbsqlserver/*.xml";
@Bean(name = "dbsqlserverDataSource")
@ConfigurationProperties(prefix = "spring.datasource.sqlserver-docus")
public DataSource secondDataSource(){
return new DruidDataSource();
}
/*注入事务*/
@Bean(name = "dbsqlserverTransactionManager")
public DataSourceTransactionManager secondTransactionManager() {
return new DataSourceTransactionManager(secondDataSource());
}
@Bean(name = "dbsqlserverSqlSessionFactory")
public SqlSessionFactory secondSqlSessionFactory(@Qualifier("dbsqlserverDataSource") DataSource secondDataSource)
throws Exception {
final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
sessionFactory.setDataSource(secondDataSource);
sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
.getResources(DbSqlserverConfig.MAPPER_LOCATION));
return sessionFactory.getObject();
}
}

@ -0,0 +1,38 @@
package com.docus.bgts.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel("急诊电子病历视图 ")
public class PatientBL {
/**
*
*/
@ApiModelProperty("就诊号")
private String visitId;
/**
* id
*/
@ApiModelProperty("文件id")
private String mRFileId;
/**
*
*/
@ApiModelProperty("文件名")
private String mRFileName;
/**
* pdf
*/
@ApiModelProperty("pdf下载路径")
private String pDFFilePath;
/**
*
*/
@ApiModelProperty("归档时间")
private String recodeTime;
}

@ -0,0 +1,142 @@
package com.docus.bgts.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* @description
* @author jiashi
* @date 2022-08-03
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel("门急诊基础数据 ")
public class TBasicOut implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@ApiModelProperty("病案主键")
@TableId(value = "patient_id",type = IdType.ASSIGN_ID)
private String patientId;
/**
*
*/
@ApiModelProperty("登记号")
private String inpatientNo;
/**
*
*/
@ApiModelProperty("就诊号")
private String jzh;
/**
*
*/
@ApiModelProperty("档案号")
private String empId;
/**
*
*/
@ApiModelProperty("卡号")
private String admissId;
/**
*
*/
@ApiModelProperty("卡类型")
private String visitTypeCode;
/**
*
*/
@ApiModelProperty("患者姓名")
private String name;
/**
*
*/
@ApiModelProperty("就诊日期")
private Date disDate;
/**
*
*/
@ApiModelProperty("就诊科室")
private String disDept;
/**
*
*/
@ApiModelProperty("就诊科室名称")
private String disDeptName;
/**
*
*/
@ApiModelProperty("诊断医生代码")
private String diagDoctorCode;
/**
*
*/
@ApiModelProperty("诊断医生姓名")
private String diagDoctorName;
/**
* (01)
*/
@ApiModelProperty("是否作废(01是)")
private Integer isCancel;
/**
* 10
*/
@ApiModelProperty("是否归档 1已归档0未归档")
private Integer isArchive;
/**
*
*/
@ApiModelProperty("归档时间")
private Date archiveTime;
/**
* 1:af_archive_detail2:t_scan_assort
*/
@ApiModelProperty("文件来源 1:af_archive_detail2:t_scan_assort")
private Integer fileSource;
/**
*
*/
@ApiModelProperty("完整性描述")
private String integrityDesc;
/**
*
*/
@ApiModelProperty("创建时间")
private Date createTime;
/**
*
*/
@ApiModelProperty("修改时间")
private Date updateTime;
public TBasicOut() {}
}

@ -0,0 +1,13 @@
package com.docus.bgts.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Test {
private String ;
private String ;
}

@ -0,0 +1,20 @@
package com.docus.bgts.mapper.dbmysql;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.docus.bgts.entity.TBasicOut;
/**
* <p>
* Mapper
* </p>
*
* @author jiashi
* @since 2021-08-03
*/
public interface TBasicOutMapper extends BaseMapper<TBasicOut> {
int insert(TBasicOut tbasicOut);
int update(TBasicOut tbasicOut);
TBasicOut selectByJzh(String jzh);
}

@ -0,0 +1,10 @@
package com.docus.bgts.mapper.dbsqlserver;
import com.docus.bgts.entity.PatientBL;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface PatientBLMapper {
List<PatientBL> selectByVisitId(@Param("visitId") String visitId);
}

@ -0,0 +1,10 @@
package com.docus.bgts.mapper.dbsqlserver;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
public interface PatientBRMapper {
List<Map> selectAll(@RequestParam("size") int size, @RequestParam("current") int current,@RequestParam("startDate") String startDate,@RequestParam("endDate") String endDate);
}

@ -0,0 +1,16 @@
package com.docus.bgts.mapper.dbsqlserver;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
public interface ScanningMapper {
List<Map> selectAll(@RequestParam("size") int size, @RequestParam("current") int current, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate);
List<Map> selectAllByDisDate(@RequestParam("size") int size, @RequestParam("current") int current, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate);
List<Map> selectByInPatientId(@RequestParam("inPatientId") String inPatientId,@RequestParam("vistId") String vistId);
int selectRow(@RequestParam("inPatientId") String inPatientId,@RequestParam("vistId") String vistId);
}

@ -0,0 +1,10 @@
package com.docus.bgts.mapper.dbsqlserver;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
public interface TestttMapper {
List<Map> selectAll(@RequestParam("size") int size,@RequestParam("current") int current);
}

@ -0,0 +1,61 @@
<?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.docus.bgts.mapper.dbmysql.TBasicOutMapper">
<insert id="insert" >
insert into docus_medicalrecord.t_basic_out (patient_id,inpatient_no,jzh,admiss_id,name,dis_date,dis_dept,dis_dept_name,diag_doctor_code,diag_doctor_name,create_time)
values (#{patientId},#{inpatientNo},#{jzh},#{admissId},#{name},#{disDate},#{disDept},#{disDeptName},#{diagDoctorCode},#{diagDoctorName},#{createTime})
</insert>
<update id="update">
update docus_medicalrecord.t_basic_out
<set>
<if test="inpatientNo!=null">
inpatient_no=#{inpatientNo},
</if>
<if test="jzh!=null">
jzh=#{jzh},
</if>
<if test="admissId!=null">
admiss_id=#{admissId},
</if>
<if test="name!=null">
name=#{name},
</if>
<if test="disDate!=null">
dis_date=#{disDate},
</if>
<if test="disDept!=null">
dis_dept=#{disDept},
</if>
<if test="disDeptName!=null">
dis_dept_name=#{disDeptName},
</if>
<if test="diagDoctorCode!=null">
diag_doctor_code=#{diagDoctorCode},
</if>
<if test="diagDoctorName!=null">
diag_doctor_name=#{diagDoctorName},
</if>
<if test="updateTime!=null">
update_time=#{updateTime},
</if>
</set>
where patient_id=#{patientId}
</update>
<select id="selectByJzh" resultType="com.docus.bgts.entity.TBasicOut">
select *
from docus_medicalrecord.t_basic_out
where jzh=#{jzh}
</select>
</mapper>

@ -0,0 +1,9 @@
<?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.docus.bgts.mapper.dbsqlserver.PatientBLMapper">
<select id="selectByVisitId" resultType="com.docus.bgts.entity.PatientBL">
select * from view_patient_BL where VisitId=#{visitId} and PDFFilePath is not null
</select>
</mapper>

@ -0,0 +1,20 @@
<?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.docus.bgts.mapper.dbsqlserver.PatientBRMapper">
<select id="selectAll" resultType="map">
select * from (
select ROW_NUMBER() OVER(Order by DIS_DATE ) AS RowId,*
from view_patient_BR) t
where INHOSP_NO=600100123346
</select>
<select id="selectAlll" resultType="map">
select * from (
select ROW_NUMBER() OVER(Order by DIS_DATE ) AS RowId,*
from view_patient_BR) t
where RowId between #{size} and #{current} and DIS_DATE between #{startDate} and #{endDate};
</select>
</mapper>

@ -0,0 +1,44 @@
<?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.docus.bgts.mapper.dbsqlserver.ScanningMapper">
<select id="selectAll" resultType="map">
select *
from (
select ROW_NUMBER() OVER(Order by 扫描日期 ) AS RowId,*
from pat_sm
where 扫描日期 between #{startDate} and #{endDate}
and 扫描盘号 like 'G%') t
where RowId between #{size} and #{current}
</select>
<!-- <select id="selectAllByDisDate111" resultType="map">-->
<!-- select * from (-->
<!-- select ROW_NUMBER() OVER(Order by 出院日期 ) AS RowId,*-->
<!-- from pat_sm where 出院日期 between #{startDate} and #{endDate} and 扫描盘号 like 'G%') t-->
<!-- where RowId between #{size} and #{current}-->
<!-- </select>-->
<select id="selectAllByDisDate" resultType="map">
select *
from (
select ROW_NUMBER() OVER(Order by 出院日期 ) AS RowId,*
from pat_sm
where 出院日期 between #{startDate} and #{endDate}
and 扫描盘号 like 'G%') t
where RowId between #{size} and #{current}
</select>
<select id="selectByInpatientId" resultType="map">
select *
from pat_sm
where and 扫描盘号 like 'G%'
</select>
<select id="selectByInPatientId" resultType="map">
select * from pat_sm where 住院号=#{inPatientId} and 次数=#{vistId}
</select>
<select id="selectRow" resultType="int">
select count(*) from pat_sm where 住院号=#{inPatientId} and 次数=#{vistId}
</select>
</mapper>

@ -0,0 +1,13 @@
<?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.docus.bgts.mapper.dbsqlserver.TestttMapper">
<select id="selectAll" resultType="map">
select * from (
select ROW_NUMBER() OVER(Order by RecodeTime ) AS RowId,*
from patient_BL) t
where RowId between #{size} and #{current};
</select>
</mapper>
Loading…
Cancel
Save