commit
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,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…
Reference in New Issue