Commit a361b5d1 by Suvalue

病组相关修改

parent 37832e4b
......@@ -12,7 +12,7 @@ public class DiseaseLevel {
private String mdcNum;
private BigDecimal parentId;
private BigDecimal level;
private BigDecimal orgId;
private String orgId;
private String orgName;
private List<DiseaseLevel> diseaseLevelList;
......@@ -72,11 +72,11 @@ public class DiseaseLevel {
this.level = level;
}
public BigDecimal getOrgId() {
public String getOrgId() {
return orgId;
}
public void setOrgId(BigDecimal orgId) {
public void setOrgId(String orgId) {
this.orgId = orgId;
}
......
......@@ -24,7 +24,7 @@
<result column="MDC_NUM" jdbcType="VARCHAR" property="mdcNum"/>
<result column="PARENT_ID" jdbcType="DECIMAL" property="parentId"/>
<result column="LEVEL" jdbcType="DECIMAL" property="level"/>
<result column="ORG_ID" jdbcType="DECIMAL" property="orgId"/>
<result column="ORG_ID" jdbcType="VARCHAR" property="orgId"/>
<result column="ORG_NAME" jdbcType="VARCHAR" property="orgName"/>
</resultMap>
<insert id="insert" parameterType="com.bsoft.api.model.SerDisease">
......@@ -71,11 +71,8 @@
<select id="selectByMdcName" resultMap="BaseResultMap">
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.`STATE`, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from dic_disease d,dic_disease_doc_rs rs
where 1 = 1 and STATE=1 and rs.MDC_CODE=d.MDC_CODE
<if test="deptCode!=null">
and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR}
</if>
from dic_disease d
where 1 = 1 and STATE=1
<if test="mdcName!=null">
and INSTR(d.MDC_NAME,#{mdcName,jdbcType=VARCHAR})>0
</if>
......@@ -85,13 +82,12 @@
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.`STATE`, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from dic_disease d
join dic_disease_doc_rs rs on rs.MDC_CODE=d.MDC_CODE
<if test="deptCode!=null">
join (select ZBZBM,KSBM,SUM(ZLS) as ZLS
from val_block_values_1_2_2
where TIME=#{date} and ZLS>0
and KSBM=#{deptCode,jdbcType=VARCHAR}
group by ZBZBM,KSBM) val on val.ZBZBM = d.MDC_CODE and val.KSBM=rs.DEPT_CODE
group by ZBZBM,KSBM) val on val.ZBZBM = d.MDC_CODE
</if>
<if test="deptCode==null">
join (select ZBZBM,SUM(ZLS) as ZLS
......@@ -103,44 +99,28 @@
<if test="level!=null">
and d.`LEVEL` = #{level,jdbcType=DECIMAL}
</if>
<if test="deptCode!=null">
and rs.DEPT_CODE = #{deptCode,jdbcType=VARCHAR}
</if>
order by val.ZLS desc
</select>
<select id="selectByLevelNoZBZ" resultMap="DiseaseLevel">
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.`STATE`, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from dic_disease d,dic_disease_doc_rs rs
where 1 = 1 and STATE=1 and rs.MDC_CODE=d.MDC_CODE
from dic_disease d
where 1 = 1 and STATE=1
<if test="level!=null">
and d.`LEVEL` = #{level,jdbcType=DECIMAL}
</if>
<if test="deptCode!=null">
and rs.DEPT_CODE = #{deptCode,jdbcType=VARCHAR}
</if>
<if test="deptCode==null">
and EXISTS(select o2.ORG_CODE as DEPT_CODE
from sys_user_sbj_rs rs2
join sys_subject o2 on o2.id = rs2.ORG_ID and rs2.STATE = 1
where o2.STATE = 1
and rs2.USER_ID = #{userId,jdbcType=DECIMAL}
and o2.ORG_CODE = rs.DEPT_CODE
)
</if>
order by d.MDC_NUM
</select>
<select id="selectByParentId" resultMap="DiseaseLevel">
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.`STATE`, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from dic_disease d
join dic_disease_doc_rs rs on rs.MDC_CODE=d.MDC_CODE
<if test="deptCode!=null">
join (select ZBZBM,KSBM,SUM(ZLS) as ZLS
from val_block_values_1_2_2
where TIME=#{date} and ZLS>0
and KSBM=#{deptCode,jdbcType=VARCHAR}
group by ZBZBM,KSBM) val on val.ZBZBM = d.MDC_CODE and val.KSBM=rs.DEPT_CODE
group by ZBZBM,KSBM) val on val.ZBZBM = d.MDC_CODE
</if>
<if test="deptCode==null">
join (select ZBZBM,SUM(ZLS) as ZLS
......@@ -152,22 +132,18 @@
<if test="parentId!=null">
and d.PARENT_ID = #{parentId,jdbcType=DECIMAL}
</if>
<if test="deptCode!=null">
and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR}
</if>
order by val.ZLS desc
</select>
<select id="selectByParentIdNoZbz" resultMap="DiseaseLevel">
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.`STATE`, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from dic_disease d
join dic_disease_doc_rs rs on rs.MDC_CODE=d.MDC_CODE
<if test="deptCode!=null">
join (select ZBZBM,KSBM,SUM(ZLS) as ZLS
from val_block_values_1_5_2
where TIME=#{date}
and KSBM=#{deptCode,jdbcType=VARCHAR}
group by ZBZBM,KSBM) val on val.ZBZBM = d.MDC_CODE and val.KSBM=rs.DEPT_CODE
group by ZBZBM,KSBM) val on val.ZBZBM = d.MDC_CODE
</if>
<if test="deptCode==null">
join (select ZBZBM,SUM(ZLS) as ZLS
......@@ -179,9 +155,6 @@
<if test="parentId!=null">
and d.PARENT_ID = #{parentId,jdbcType=DECIMAL}
</if>
<if test="deptCode!=null">
and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR}
</if>
order by val.ZLS desc
</select>
<select id="selectParentById" resultMap="DiseaseLevel">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment