Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
|
5e661ccee7 | 2 years ago |
|
1a6479b298 | 2 years ago |
|
e5acd54dd3 | 2 years ago |
|
0d03db237e | 2 years ago |
@ -0,0 +1 @@
|
||||
/target/
|
@ -0,0 +1,45 @@
|
||||
package com.docus.demo.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 = DbSqlserver2Config.PACKAGE, sqlSessionFactoryRef = "sqlserver2SqlSessionFactory")
|
||||
public class DbSqlserver2Config {
|
||||
// 这里一定要指定精准 否则后果不堪设想
|
||||
static final String PACKAGE = "com.docus.demo.mapper.sqlserver2";
|
||||
static final String MAPPER_LOCATION = "classpath:mapper/sqlserver2/*.xml";
|
||||
|
||||
@Bean(name = "sqlserver2DataSource")
|
||||
@ConfigurationProperties(prefix = "spring.datasource.dynamic.datasource.sqlserver2")
|
||||
public DataSource secondDataSource(){
|
||||
return new DruidDataSource();
|
||||
}
|
||||
|
||||
/*注入事务*/
|
||||
@Bean(name = "sqlserver2TransactionManager")
|
||||
public DataSourceTransactionManager secondTransactionManager() {
|
||||
return new DataSourceTransactionManager(secondDataSource());
|
||||
}
|
||||
|
||||
@Bean(name = "sqlserver2SqlSessionFactory")
|
||||
public SqlSessionFactory secondSqlSessionFactory(@Qualifier("sqlserver2DataSource") DataSource secondDataSource)
|
||||
throws Exception {
|
||||
final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
|
||||
sessionFactory.setDataSource(secondDataSource);
|
||||
sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
|
||||
.getResources(DbSqlserver2Config.MAPPER_LOCATION));
|
||||
return sessionFactory.getObject();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.docus.demo.entity.sqlserver2;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class BasicInfo {
|
||||
|
||||
private String id;
|
||||
|
||||
private String patientId;
|
||||
|
||||
private String patPath;
|
||||
|
||||
private String hostReason;
|
||||
|
||||
private String inpatientNo;
|
||||
|
||||
private Date disDate;
|
||||
|
||||
private int admissTimes;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.docus.demo.entity.sqlserver2;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Tscan {
|
||||
|
||||
private String patientId;
|
||||
|
||||
private String assortId;
|
||||
|
||||
private String scanPage;
|
||||
|
||||
private int upState;
|
||||
|
||||
private Date upDate;
|
||||
}
|
@ -1,11 +1,18 @@
|
||||
package com.docus.demo.mapper.sqlserver2;
|
||||
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.docus.demo.entity.sqlserver2.BasicInfo;
|
||||
import com.docus.demo.entity.sqlserver2.Tscan;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@DS("mapper/sqlserver2")
|
||||
public interface TscanMapper {
|
||||
|
||||
|
||||
List<Tscan> getOldScanListByPid(@Param("id") String patientId);
|
||||
|
||||
|
||||
void insertScanList(@Param("list") List<Tscan> insertList);
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger
|
||||
log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
|
@ -1,9 +0,0 @@
|
||||
<?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.demo.mapper.mysql.ArchiveFileMapper">
|
||||
|
||||
|
||||
|
||||
</mapper>
|
@ -1,42 +0,0 @@
|
||||
<?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.demo.mapper.mysql.BasicMapper">
|
||||
|
||||
|
||||
<select id="getBasicVoList" resultType="com.docus.demo.vo.BasicVo">
|
||||
SELECT
|
||||
patient_id as patient_id,
|
||||
admiss_times AS admissTimes,
|
||||
inpatient_no AS inpatientNo,
|
||||
dis_date AS disDate,
|
||||
b_column5 as bColumn5
|
||||
FROM docus_medicalrecord.t_basic
|
||||
<where>
|
||||
b_column5 is not null
|
||||
AND b_column8 = 1
|
||||
|
||||
<!-- <if test="dto.inpatientNoList !=null and dto.inpatientNoList.size() != 0 ">-->
|
||||
<!-- AND inpatient_no in-->
|
||||
<!-- <foreach collection="dto.inpatientNoList" item="inpatientNo" separator="," open="(" close=")">-->
|
||||
<!-- #{inpatientNo}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
|
||||
<if test="dto.startDate !=null and dto.startDate != ''">
|
||||
AND dis_date >=#{dto.startDate}
|
||||
</if>
|
||||
|
||||
<if test="dto.startDate !=null and dto.startDate != ''">
|
||||
AND dis_date <= #{dto.endDate}
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
</where>
|
||||
|
||||
limit #{pageStart} ,#{pageEnd}
|
||||
|
||||
</select>
|
||||
</mapper>
|
@ -1,46 +0,0 @@
|
||||
<?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.demo.mapper.mysql.ScanAssortMapper">
|
||||
|
||||
|
||||
<insert id="insertBatch">
|
||||
insert into docus_archivefile.t_scan_assort
|
||||
(id,patient_id,assort_id,file_title,image_path,scan_page,file_source,file_storage_type,file_pages,creater,create_time,sort)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.id},#{item.patientId},#{item.assortId},#{item.fileTitle},#{item.imagePath},#{item.scanPage},#{item.fileSource},#{item.fileStorageType},#{item.filePages},#{item.creater},#{item.createTime},#{item.sort})
|
||||
</foreach>
|
||||
|
||||
</insert>
|
||||
<insert id="insertOrUpdateBatch">
|
||||
|
||||
insert into docus_archivefile.t_scan_assort
|
||||
(id,patient_id,assort_id,file_title,image_path,scan_page,file_source,file_storage_type,file_pages,creater,create_time,sort)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index"
|
||||
separator=",">
|
||||
(#{item.id},#{item.patientId},#{item.assortId},#{item.fileTitle},#{item.imagePath},#{item.scanPage},#{item.fileSource},#{item.fileStorageType},#{item.filePages},#{item.creater},#{item.createTime},#{item.sort})
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE file_pages = VALUES(file_pages), update_time = NOW(),sort = VALUES(sort);
|
||||
|
||||
</insert>
|
||||
<select id="getListByPid" resultType="com.docus.demo.entity.ScanAssort">
|
||||
SELECT id,
|
||||
patient_id,
|
||||
assort_id,
|
||||
file_title,
|
||||
image_path,
|
||||
scan_page,
|
||||
file_source,
|
||||
file_storage_type,
|
||||
file_pages,
|
||||
creater,
|
||||
create_time,
|
||||
sort
|
||||
FROM docus_archivefile.t_scan_assort
|
||||
WHERE patient_id = #{pid}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -1,17 +0,0 @@
|
||||
<?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.demo.mapper.sqlserver.PictureMapper">
|
||||
|
||||
<select id="getPictureInfoByCid" resultType="com.docus.demo.entity.TPicture">
|
||||
SELECT
|
||||
PicName,
|
||||
PicKind,
|
||||
RotateDegree
|
||||
FROM
|
||||
T_picture
|
||||
where cuid = #{cuid}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -1,32 +0,0 @@
|
||||
<?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.demo.mapper.sqlserver1.PaintVisitMapper">
|
||||
|
||||
|
||||
<select id="getTpatientVisitList" resultType="com.docus.demo.entity.sqlserver1.Tpatientvisit">
|
||||
SELECT * FROM Tpatientvisit
|
||||
<where>
|
||||
|
||||
<if test="dto.inpatientNoList !=null and dto.inpatientNoList.size() != 0 ">
|
||||
AND fprn in
|
||||
<foreach collection="dto.inpatientNoList" item="inpatientNo" separator="," open="(" close=")">
|
||||
#{inpatientNo}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="dto.startDate !=null and dto.startDate != ''">
|
||||
AND fcydate >=#{dto.startDate}
|
||||
</if>
|
||||
|
||||
<if test="dto.startDate !=null and dto.startDate != ''">
|
||||
AND fcydate <= #{dto.endDate}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
</mapper>
|
@ -1,9 +0,0 @@
|
||||
<?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.demo.mapper.sqlserver1.TdiagnoseMapper">
|
||||
|
||||
|
||||
|
||||
</mapper>
|
@ -1,9 +0,0 @@
|
||||
<?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.demo.mapper.sqlserver1.TopreationMapper">
|
||||
|
||||
|
||||
|
||||
</mapper>
|
@ -1,8 +0,0 @@
|
||||
<?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.demo.mapper.sqlserver2.TscanMapper">
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue