瀏覽代碼

科室药品维护专用标记调整

WANGJIALIANG 2 年之前
父節點
當前提交
1eb16603d3
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpZdDeptMapper.java

+ 2 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpZdDeptMapper.java

@@ -27,7 +27,7 @@ public interface YpZdDeptMapper {
      * @return
      */
     @Insert("insert into yp_zd_dept (dept_code,charge_code,use_flag)" +
-            " SELECT  dept_code,#{chargeCode},'1' FROM zy_adtward WITH(NOLOCK) where dept_code!=#{deptCode}")
+            " SELECT  code,#{chargeCode},'1' FROM zd_unit_code WITH(NOLOCK) where isnull(del_flag,0)=0 and class_code in (1,2) and code!=#{deptCode}")
     int insertExclusiveYpZdDept(YpZdDept ypZdDept);
 
     /**
@@ -76,7 +76,7 @@ public interface YpZdDeptMapper {
      */
     @Select("<script>" +
             "select (case" +
-            "        when sum(1)=(SELECT  sum(1) as number FROM zy_adtward WITH(NOLOCK))-1" +
+            "        when sum(1)=(SELECT  sum(1) as number FROM zd_unit_code WITH(NOLOCK) where isnull(del_flag,0)=0 and class_code in (1,2))-1" +
             "        then (select case when sum(1)<![CDATA[>]]>0 then 0 else 1 end from yp_zd_dept WITH(NOLOCK) where charge_code=#{chargeCode} and dept_code=#{deptCode})" +
             "        else '0'" +
             "        end) as exclusive_use_flag" +