导出国标病历
parent
e8df06ec93
commit
35a0f430af
@ -0,0 +1,22 @@
|
||||
package com.emr.dao;
|
||||
|
||||
import com.emr.vo.ExportTaskDetailsVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName ExportTaskDetailsMapper
|
||||
* @Description 批量导出详情接口
|
||||
* @Author linjj
|
||||
* @Date 2024/4/12 14:03
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface ExportTaskDetailsMapper {
|
||||
|
||||
List<ExportTaskDetailsVo> selectAllByTaskId(int taskId);
|
||||
|
||||
List<String> getMasterId(@Param("inpNo") String inpNo, @Param("dischargeDateTime") String dischargeDateTime);
|
||||
|
||||
int upStatc(@Param("state") int state,@Param("id") int id);
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.emr.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class Logger {
|
||||
public void log(String info) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd");
|
||||
String format = dateFormat.format (new Date());
|
||||
File file = new File ("D:\\export\\logs\\"+format);
|
||||
if(!file.isDirectory ()){
|
||||
file.mkdirs ();
|
||||
}
|
||||
OutputStream out = null;
|
||||
try {
|
||||
out = getOutputStream(file.getAbsolutePath ()+"\\log.log");
|
||||
out.write(info.getBytes("utf-8"));
|
||||
out.write("\r\n".getBytes());
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public OutputStream getOutputStream(String localpath) throws IOException {
|
||||
File file = new File(localpath);
|
||||
if (!file.exists()) {
|
||||
file.createNewFile();
|
||||
return new FileOutputStream(file);
|
||||
} else {
|
||||
return new FileOutputStream(file, true);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.emr.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName ExportTaskDetailsVo
|
||||
* @Description 导出任务详情
|
||||
* @Author linjj
|
||||
* @Date 2024/4/12 14:01
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ExportTaskDetailsVo {
|
||||
|
||||
private int id;
|
||||
//任务id
|
||||
private int taskId;
|
||||
//住院号
|
||||
private String inpNo;
|
||||
|
||||
//出院日期
|
||||
private String dischargeDateTime;
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
<?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.emr.dao.ExportTaskDetailsMapper">
|
||||
<update id="upStatc">
|
||||
update Export_Task_Details set state=#{state} where id=#{id}
|
||||
</update>
|
||||
|
||||
<select id="selectAllByTaskId" resultType="com.emr.vo.ExportTaskDetailsVo">
|
||||
SELECT id,
|
||||
taskId,
|
||||
inpNo,
|
||||
CONVERT(VARCHAR (100), dischargeDateTime, 23) as dischargeDateTime
|
||||
FROM Export_Task_Details
|
||||
WHERE taskId = #{taskId}
|
||||
AND state = 0
|
||||
</select>
|
||||
<select id="getMasterId" resultType="java.lang.String">
|
||||
select id from Archive_Master where inp_no=#{inpNo} AND CONVERT(VARCHAR (100), discharge_date_time, 23) = #{dischargeDateTime}
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue