统计查询检索条件修改

gaoming_branch
ALW 3 years ago
parent b7500822d9
commit 1a13005b82

@ -83,7 +83,7 @@ public class ArchiveOtherExtController {
*/
@RequestMapping("submitUpdate")
@ResponseBody
public Msg submitUpdate(String ids,String notNursingIds,String detailIds,String jzh,String masterId,Integer sysFlag,HttpServletRequest request) throws Exception{
public Msg submitUpdate(String ids,String notNursingIds,String nursingIds,String detailIds,String jzh,String masterId,Integer sysFlag,HttpServletRequest request) throws Exception{
if(StringUtils.isBlank(ids)){
return Msg.fail("至少选中一个!");
}
@ -95,7 +95,7 @@ public class ArchiveOtherExtController {
return Msg.fail("masterId不能为空!");
}
}
archiveOtherExtService.updateSubmit(ids,notNursingIds,detailIds,jzh,masterId,sysFlag,request);
archiveOtherExtService.updateSubmit(ids,notNursingIds,nursingIds,detailIds,jzh,masterId,sysFlag,request);
return Msg.success();
}

@ -26,6 +26,8 @@ public interface ArchiveOtherExtMapper {
int updateSubmit(@Param("ids")String ids);
int updateNursingSubmit(@Param("nursingIdTemp")String nursingIdTemp);
/**
* ids
* @param ids

@ -9,6 +9,9 @@ import java.util.List;
public interface V_CountMapper {
List<V_Count> selectByCol(V_CountVo record);
V_Count selectday2Num(@Param("deptCode")String deptCode,@Param("startDate")String startDate,@Param("endDate")String endDate,@Param("dayNum")Integer dayNum);
// /**
// * 根据条件查找统计列表分页
// *

@ -64,6 +64,12 @@ public class ArchiveOtherExtService {
vo.setNursingEndTime(maxETime);
}
}
Integer statusFlag = vo.getStatusFlag();
if(statusFlag==3){
vo.setStatusFlagStr("完成");
} else {
vo.setStatusFlagStr("未完成");
}
//presulit为Done转换为完成
String presult = vo.getPresult();
if (StringUtils.isNoneBlank(presult) && "done".equalsIgnoreCase(presult)) {
@ -97,31 +103,34 @@ public class ArchiveOtherExtService {
}
}
}
String idTemp = vo.getIdTemp();
List<ArchiveOtherExtVo> archiveOtherExtVos = archiveOtherExtMapper.selectEmrBackInfo1(idTemp);
for (int i=0;archiveOtherExtVos.size()>i;i++){
if (null != archiveOtherExtVos) {
if (!archiveOtherExtVos.get(i).getC1().equals("")) {
vo.setStatusFlagStr("完成");
}else {
vo.setStatusFlagStr("未完成");
}
}
}
if (vo.getSysflag().equals(1)) {
archiveOtherExtVo.setPid(vo.getJzh());
List<ArchiveOtherExtVo> archiveOtherExtVos1 = archiveOtherExtMapper.selectEmrBackInfo2(archiveOtherExtVo);
if (null != archiveOtherExtVos1) {
for (int a = 0; archiveOtherExtVos1.size() > a; a++) {
if (!archiveOtherExtVos1.get(a).getC1().equals("")) {
vo.setStatusFlagStr("完成");
} else {
vo.setStatusFlagStr("未完成");
}
}
}
}
// if (!vo.getSysflag().equals(1)) {
// String idTemp = vo.getIdTemp();
// List<ArchiveOtherExtVo> archiveOtherExtVos = archiveOtherExtMapper.selectEmrBackInfo1(idTemp);
// for (int i = 0; archiveOtherExtVos.size() > i; i++) {
// if (null != archiveOtherExtVos) {
// if (!archiveOtherExtVos.get(i).getC1().equals("")) {
// vo.setStatusFlagStr("完成");
// } else {
// vo.setStatusFlagStr("未完成");
// }
// }
// }
// }
// if (vo.getSysflag().equals(1)) {
// archiveOtherExtVo.setPid(vo.getJzh());
// List<ArchiveOtherExtVo> archiveOtherExtVos1 = archiveOtherExtMapper.selectEmrBackInfo2(archiveOtherExtVo);
// if (null != archiveOtherExtVos1) {
// for (ArchiveOtherExtVo a : archiveOtherExtVos1) {
// if (a.getStatusFlag()==3) {
// vo.setStatusFlagStr("完成");
// break;
// } else {
// vo.setStatusFlagStr("未完成");
// break;
// }
// }
// }
// }
}
}
return list;
@ -181,7 +190,7 @@ public class ArchiveOtherExtService {
* @param masterId
* @param sysFlag
*/
public void updateSubmit(String ids,String notNursingIds, String detailIds,String jzh, String masterId, Integer sysFlag,HttpServletRequest request) throws Exception{
public void updateSubmit(String ids,String notNursingIds,String nursingIds, String detailIds,String jzh, String masterId, Integer sysFlag,HttpServletRequest request) throws Exception{
String idsStr = splitString2String(ids);
String idsTemp = idsStr;
//存在护理记录则调用护理按需采集功能
@ -190,8 +199,9 @@ public class ArchiveOtherExtService {
//调用护理按需采集功能
archiveOtherService.updateArchiveOther(jzh, masterId,null,null);
//ext表更新非护理记录
if(StringUtils.isNotBlank(notNursingIds)){
idsTemp = splitString2String(notNursingIds);
if(StringUtils.isNotBlank(nursingIds)){
String nursingIdTemp = splitString2String(nursingIds);
archiveOtherExtMapper.updateNursingSubmit(nursingIdTemp);
}
}
// if (null != sysFlag && sysFlag == 3){

@ -296,15 +296,15 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
for (Archive_Master_Vo masterVo : list) {
String archivestate = masterVo.getArchivestate();
String inpNo = masterVo.getPatientId();
// String sql = "SELECT FISZH FROM V_JSWZH_EMR_CALLBACK WHERE JZH='"+inpNo+"'";
// try {
// String select = OracleConnect.select(sql);
// masterVo.setHisStatic(select);
String sql = "SELECT FISZH FROM V_JSWZH_EMR_CALLBACK WHERE JZH='"+inpNo+"'";
try {
String select = OracleConnect.select(sql);
masterVo.setHisStatic(select);
// String hisStatic = masterVo.getHisStatic();
// } catch (Exception e) {
// ExceptionPrintUtil.printException(e);
// e.printStackTrace();
// }
} catch (Exception e) {
ExceptionPrintUtil.printException(e);
e.printStackTrace();
}
if (StringUtils.isNotBlank(archivestate)) {
//转换中文状态
boolean numeric = isNumeric(archivestate);

@ -25,19 +25,30 @@ public class V_CountServiceImpl implements V_CountService {
@Override
public List<V_Count> selectByCol(V_CountVo record) {
String startDate = record.getStartDate();
String endDate = record.getEndDate();
List<V_Count> counts = vCountMapper.selectByCol(record);
if(!CollectionUtils.isEmpty(counts)){
for(V_Count count :counts){
Integer outNum = count.getOutNum();
Integer fileNum = count.getFileNum();
Integer day2Num = count.getDay2Num();
Integer day3Num = count.getDay3Num();
Integer day7Num = count.getDay7Num();
int i = outNum - fileNum;
count.setUnfileNum(i);
java.text.NumberFormat numberformat=java.text.NumberFormat.getInstance();
numberformat.setMaximumFractionDigits(2);
String result1=numberformat.format((float)fileNum/(float)outNum*100);
String deptCode = count.getDeptCode();
//二日归档
V_Count v_count = vCountMapper.selectday2Num(deptCode, startDate, endDate,2);
Integer day2Num = v_count.getDay2Num();
String result2=numberformat.format((float)day2Num/(float)outNum*100);
//三日归档
V_Count v_count1 = vCountMapper.selectday2Num(deptCode, startDate, endDate, 3);
Integer day3Num = v_count1.getDay2Num();
String result3=numberformat.format((float)day3Num/(float)outNum*100);
//七日归档
V_Count v_count2 = vCountMapper.selectday2Num(deptCode, startDate, endDate, 7);
Integer day7Num = v_count2.getDay2Num();
String result7=numberformat.format((float)day7Num/(float)outNum*100);
count.setFileRate(result1);
count.setDay2Rate(result2);

@ -2,7 +2,6 @@ package com.emr.vo;
import com.emr.entity.ArchiveOtherExt;
import lombok.Data;
import org.apache.ibatis.annotations.Param;
/**
* @ProjectName:
@ -26,6 +25,8 @@ public class ArchiveOtherExtVo extends ArchiveOtherExt {
private String sysFlag3;
private Integer statusFlag;
private Integer timeStatus;
private String etimeStr;

@ -13,7 +13,7 @@
<result column="sysFlag3" property="sysFlag3" jdbcType="NVARCHAR" />
<result column="stime" property="stime" jdbcType="TIMESTAMP" />
<result column="eTime" property="etime" jdbcType="TIMESTAMP" />
<result column="statusFlag" property="statusflag" jdbcType="INTEGER" />
<result column="statusFlag" property="statusFlag" jdbcType="INTEGER" />
<result column="pResult" property="presult" jdbcType="NVARCHAR" />
<result column="MID" property="mid" jdbcType="NVARCHAR" />
<result column="DID" property="did" jdbcType="NVARCHAR" />
@ -439,26 +439,26 @@
archive_other_ext_submitTime.create_time,archive_other_ext_submitTime.str2 tempTime,
(case when temp.etimeStr &lt;= archive_other_ext_submitTime.create_time THEN '1'
when temp.etimeStr >=archive_other_ext_submitTime.create_time THEN '2' end
) as timeStatus,
CASE
WHEN sysFlag = 1 THEN
CASE
WHEN archive_other_ext_submitTime.str2 IS NOT NULL
AND archive_other_ext_submitTime.str2 >= (select top 1 convert(varchar(19),eTime,120) eTime from archive_other_ext where sysFlag = 1 and jzh = temp.jzh order by eTime desc) THEN
- 1
ELSE
statusFlag
END
ELSE
CASE
WHEN archive_other_ext_submitTime.str2 IS NOT NULL
AND archive_other_ext_submitTime.str2 >= etimeStr THEN
- 1
ELSE
statusFlag
END
END
statusFlagSort
) as timeStatus
-- CASE
-- WHEN sysFlag = 1 THEN
-- CASE
-- WHEN archive_other_ext_submitTime.str2 IS NOT NULL
-- AND archive_other_ext_submitTime.str2 >= (select top 1 convert(varchar(19),eTime,120) eTime from archive_other_ext where sysFlag = 1 and jzh = temp.jzh order by eTime desc) THEN
-- - 1
-- ELSE
-- statusFlag
-- END
-- ELSE
-- CASE
-- WHEN archive_other_ext_submitTime.str2 IS NOT NULL
-- AND archive_other_ext_submitTime.str2 >= etimeStr THEN
-- - 1
-- ELSE
-- statusFlag
-- END
-- END
-- statusFlagSort
from (
select
archive_other_ext.ID idTemp,
@ -526,7 +526,7 @@
and zd_assort.assort_id = #{assortId,jdbcType=NVARCHAR}
</if>
</where>
order by statusFlagSort
-- order by statusFlagSort
</select>
<select id="selectAllByIds" resultMap="BaseResultMap">
select *,
@ -543,6 +543,18 @@
</if>
</where>
</update>
<!--批量更新statusFlag = 0-->
<update id="updateNursingSubmit">
update archive_other_ext
set statusFlag = 0,T2 = '1801-02-03'
<where>
<if test="nursingIdTemp != null and nursingIdTemp != ''">
ID in (${nursingIdTemp})
</if>
</where>
</update>
<!--根据ids字段的查询与同步更新比较时间比较较晚时间的集合-->
<select id="selectAllByIdsAndSubmitTime" resultMap="BaseResultMap">
SELECT
@ -787,7 +799,7 @@
<select id="judgeCollectCompleted" resultType="com.emr.entity.ArchiveOtherExt">
select jzh,C1,C2,convert(varchar(19),eTime,120) sysUpdateTime from archive_other_ext with(nolock)
<where>
jzh = #{jzh}
jzh = #{jzh} AND C6!='该任务已被召回过,不为最新的任务'
<if test="sysFlag != null">
AND sysFlag = #{sysFlag}
</if>
@ -811,7 +823,7 @@
</select>
<select id="selectEmrBackInfo2" resultType="com.emr.vo.ArchiveOtherExtVo"
parameterType="com.emr.vo.ArchiveOtherExtVo">
select * from archive_other where pid=#{pid} and otherInfo='护理系统按需采集'
select * from archive_other_ext where jzh=#{jzh} and sysFlag=1
</select>
</mapper>

@ -21,53 +21,119 @@
<result column="endDate" jdbcType="NVARCHAR" property="endDate"/>
</resultMap>
<select id="selectByCol" parameterType="com.emr.entity.V_Count" resultMap="BaseResultMap">
<!--SELECT-->
<!--m.dept_name AS deptCode,-->
<!--d.name AS deptName,-->
<!--COUNT ( m.id ) outNum,-->
<!--ISNULL( a.fileNum, 0 ) fileNum,-->
<!--ISNULL( t.deathNum , 0 ) deathNum-->
<!--FROM-->
<!--archive_master m-->
<!--LEFT JOIN emr_dictionary d ON d.code= m.dept_name-->
<!--AND d.parent_id= 'dept_code'-->
<!--LEFT JOIN ( SELECT COUNT ( id ) AS fileNum, dept_name FROM archive_master-->
<!--<where> ArchiveState = '128'-->
<!--<if test="startDate != null and startDate != ''">-->
<!--and discharge_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)-->
<!--</if>-->
<!--<if test="endDate != null and endDate != ''">-->
<!--and discharge_date_time &lt;= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'-->
<!--</if>-->
<!--</where> GROUP BY dept_name ) a ON a.dept_name= m.dept_name-->
<!--LEFT JOIN ( SELECT COUNT ( id ) AS deathNum, dept_name FROM archive_master-->
<!--<where> DISCHARGE_DISPOSITION = '5'-->
<!--<if test="startDate != null and startDate != ''">-->
<!--and discharge_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)-->
<!--</if>-->
<!--<if test="endDate != null and endDate != ''">-->
<!--and discharge_date_time &lt;= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'-->
<!--</if>-->
<!--</where>-->
<!--GROUP BY dept_name )-->
<!--t ON t.dept_name= m.dept_name-->
<!--<where>-->
<!--m.discharge_date_time != '1801-02-03 00:00:00.000'-->
<!--AND m.discharge_date_time is not NULL-->
<!--<if test="deptCode != null and deptCode != ''">-->
<!--AND m.dept_name =#{deptCode}-->
<!--</if>-->
<!--<if test="startDate != null and startDate != ''">-->
<!--and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)-->
<!--</if>-->
<!--<if test="endDate != null and endDate != ''">-->
<!--and m.discharge_date_time &lt;= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'-->
<!--</if>-->
<!--</where>-->
<!--GROUP BY-->
<!--m.dept_name,-->
<!--d.name,-->
<!--a.fileNum,-->
<!--t.deathNum-->
SELECT
m.dept_name AS deptCode,
d.name AS deptName,
COUNT ( m.id ) outNum,
ISNULL( a.fileNum, 0 ) fileNum,
ISNULL( e.unfileNum, 0 ) unfileNum,
ISNULL( t.deathNum , 0 ) deathNum,
ISNULL( q.day2Num , 0 ) day2Num,
ISNULL( q1.day3Num , 0 ) day3Num,
ISNULL( q2.day7Num , 0 ) day7Num
COUNT(m.id) outNum,
COUNT(CASE WHEN m.ArchiveState = '128' THEN 1 end)fileNum,
COUNT(CASE WHEN m.DISCHARGE_DISPOSITION = '5' THEN 1 end)deathNum
FROM
archive_master m
LEFT JOIN emr_dictionary d ON d.code= m.dept_name AND d.parent_id= 'dept_code'
LEFT JOIN ( SELECT COUNT ( id ) AS fileNum, dept_name FROM archive_master WHERE ArchiveState = '128' GROUP BY dept_name ) a ON a.dept_name= m.dept_name
LEFT JOIN ( SELECT COUNT ( id ) AS unfileNum, dept_name FROM archive_master WHERE ArchiveState != '128' AND ArchiveState != '1024' AND discharge_date_time != '1801-02-03 00:00:00.000' GROUP BY dept_name ) e ON e.dept_name= m.dept_name
LEFT JOIN ( SELECT COUNT ( id ) AS deathNum, dept_name FROM archive_master WHERE DISCHARGE_DISPOSITION = '5' GROUP BY dept_name ) t ON t.dept_name= m.dept_name
LEFT JOIN (SELECT COUNT(id) day2Num,dept_name FROM archive_master WHERE discharge_date_time != '1801-02-03 00:00:00.000'
AND ArchiveState= '128' AND DATEDIFF(DAY, discharge_date_time, checked_datetime)-(SELECT COUNT(id) FROM emr_holiday_set WHERE [date]BETWEEN discharge_date_time AND checked_datetime AND flag=2 )&lt;=2 GROUP BY dept_name ) q ON q.dept_name=m.dept_name
LEFT JOIN (SELECT COUNT(id) day3Num,dept_name FROM archive_master WHERE discharge_date_time != '1801-02-03 00:00:00.000'
AND ArchiveState= '128' AND DATEDIFF(DAY, discharge_date_time, checked_datetime)-(SELECT COUNT(id) FROM emr_holiday_set WHERE [date]BETWEEN discharge_date_time AND checked_datetime AND flag=2 )&lt;=3 GROUP BY dept_name ) q1 ON q1.dept_name=m.dept_name
LEFT JOIN (SELECT COUNT(id) day7Num,dept_name FROM archive_master WHERE discharge_date_time != '1801-02-03 00:00:00.000'
AND ArchiveState= '128' AND DATEDIFF(DAY, discharge_date_time, checked_datetime)-(SELECT COUNT(id) FROM emr_holiday_set WHERE [date]BETWEEN discharge_date_time AND checked_datetime AND flag=2 )&lt;=7 GROUP BY dept_name ) q2 ON q2.dept_name=m.dept_name
LEFT JOIN emr_dictionary d ON d.code = m.dept_name
AND d.parent_id = 'dept_code'
<where>
1 = 1
AND m.discharge_date_time != '1801-02-03 00:00:00.000'
<if test="deptCode != null and deptCode != ''">
AND m.dept_name =#{deptCode}
</if>
<if test="startDate != null and startDate != '' and endDate != null and endDate != ''">
and m.discharge_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and
#{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</if>
<if test="startDate != null and startDate != ''">
and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)
</if>
<if test="endDate != null and endDate != ''">
and m.discharge_date_time &lt;= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</if>
</where>
GROUP BY
m.dept_name,
d.name ,
a.fileNum,
e.unfileNum,
t.deathNum,
q.day2Num,
q1.day3Num,
q2.day7Num
m.discharge_date_time != '1801-02-03 00:00:00.000'
AND m.discharge_date_time is not NULL
<if test="deptCode != null and deptCode != ''">
AND m.dept_name in (${deptCode})
</if>
<if test="startDate != null and startDate != ''">
and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)
</if>
<if test="endDate != null and endDate != ''">
and m.discharge_date_time &lt;= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</if>
</where>
GROUP BY
m.dept_name,d.Name
</select>
<select id="selectday2Num" resultType="com.emr.entity.V_Count">
SELECT
ISNULL(q.day2Num, 0)day2Num,
m.dept_name
FROM
archive_master m
LEFT JOIN (
SELECT COUNT
( id ) day2Num,
dept_name
FROM
archive_master
<where>
discharge_date_time != '1801-02-03 00:00:00.000'
AND ArchiveState = '128'
AND DATEDIFF( DAY, discharge_date_time, checked_datetime ) - ( SELECT COUNT ( id ) FROM emr_holiday_set WHERE [date] BETWEEN discharge_date_time AND checked_datetime AND flag = 2 ) &lt;=#{dayNum}
<if test="startDate != null and startDate != ''">
and discharge_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)
</if>
<if test="endDate != null and endDate != ''">
and discharge_date_time &lt;= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</if>
</where>
GROUP BY
dept_name
) q ON q.dept_name= m.dept_name
<where>
<if test="deptCode != null and deptCode != ''">
AND m.dept_name =#{deptCode}
</if>
<if test="startDate != null and startDate != ''">
and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120)
</if>
<if test="endDate != null and endDate != ''">
and m.discharge_date_time &lt;= #{endDate,jdbcType=NCHAR}+ ' 23:59:59'
</if>
</where>
GROUP BY m.dept_name,q.day2Num
</select>
</mapper>

@ -1255,11 +1255,15 @@ function initTable5(data,sidePagination) {
var id = row.idTemp;
var sysflag = row.sysflag;
var notNursingIds = '';
var nursingIds='';
if(sysflag = 1){
nursingIds= id;
}
if(sysflag != 1){
sysflag = '';
sysflag = '';
notNursingIds = id;
}
submitUpdate(id,notNursingIds,row.did,sysflag);
submitUpdate(id,notNursingIds,row.did,sysflag,nursingIds);
}
}
},
@ -1463,7 +1467,7 @@ function cancleListentingSuccess(){
}
//提交同步采集
function submitUpdate(ids,notNursingIds,detailIds,sysFlag) {
function submitUpdate(ids,notNursingIds,detailIds,sysFlag,nursingIds) {
//记录需要监听的数据
addListentingData(ids);
//撤销定时
@ -1472,7 +1476,7 @@ function submitUpdate(ids,notNursingIds,detailIds,sysFlag) {
$.ajax({
type:'post',
url:path+'/archiveExt/submitUpdate',
data:{ids:ids,notNursingIds:notNursingIds,detailIds:detailIds,jzh:jzh,masterId:$("#idLab").text(),sysFlag:sysFlag},
data:{ids:ids,notNursingIds:notNursingIds,nursingIds:nursingIds,detailIds:detailIds,jzh:jzh,masterId:$("#idLab").text(),sysFlag:sysFlag},
dataType:'json',
success:function (data) {
@ -1560,6 +1564,7 @@ $("#searchBtn6").click(function(){
var ids = '';
var sysflag = '';
var notNursingIds = '';
var nursingIds='';
var detailIds = '';
for (var i = 0; i < data.length; i++) {
var id = data[i].idTemp;
@ -1581,6 +1586,10 @@ $("#searchBtn6").click(function(){
if(data[i].sysflag == 1){
//判断包含护理
sysflag = 1;
if(nursingIds != ''){
nursingIds += ',';
}
nursingIds += id;
}else{
//拼接不包含护理的id
if(notNursingIds != ''){
@ -1589,6 +1598,6 @@ $("#searchBtn6").click(function(){
notNursingIds += id;
}
}
submitUpdate(ids,notNursingIds,detailIds,sysflag);
submitUpdate(ids,notNursingIds,detailIds,sysflag,nursingIds);
}
})

@ -907,10 +907,14 @@ function queryParams(params,_this,row){
_this.pageSize = currPageSize;
}
var deptName = row.deptCode;
var startDate = $("#startDate").val();
var endDate = $("#endDate").val();
var temp = {
offset:offset,
limit:limit,
deptName:deptName
deptName:deptName,
startDateTo:startDate,
endDateTo:endDate,
};
return temp;
}

Loading…
Cancel
Save