Ver Fonte

修改检验的查询语句

xiaochan há 1 ano atrás
pai
commit
294a883067

+ 21 - 15
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/JianYanJianChaDao.java

@@ -453,21 +453,27 @@ public interface JianYanJianChaDao {
      *
      * @return
      */
-    @Select("select distinct        rtrim(zy_order_code) as code,  " +
-            "                       rtrim(name)          as name,  " +
-            "                       rtrim(class)         as classes,  " +
-            "                       exec_unit,  " +
-            "    exec_unit_name   = (select name from zd_unit_code where zd_unit_code.code = exec_unit),  " +
-            "                       '2'                  as type,  " +
-            "                       inspect_stuff        as inspectStuff,  " +
-            "    inspectStuffName = (select rtrim(name) from jy_zd_sample with (NOLOCK) where code = inspect_stuff) ," +
-            "   note , collection_info , gender_restriction , min_age_restriction, max_age_restriction, rtrim(a.py_code) as py_code , rtrim(a.d_code) as d_code " +
-            "from jy_zd_item a  " +
-            "         left join zy_tc_detail_yj b on (a.zy_order_code = b.order_code) " +
-            "         left join yz_order_item c on (c.order_code = a.zy_order_code)  " +
-            "where isnull(a.del_flag, '0') <> '1'  " +
-            "  and isnull(zy_flag, '0')  <> '1'" +
-            "  and isnull(c.del_flag, '0')  <> '1' ")
+    @Select("select                 rtrim(a.zy_order_code)          as code,\n" +
+            "                       rtrim(a.name)                   as name,\n" +
+            "                       rtrim(a.class)                  as classes,\n" +
+            "                       exec_unit,\n" +
+            "    exec_unit_name   = (select name from zd_unit_code where code = a.exec_unit),\n" +
+            "                       '2'                             as type,\n" +
+            "                       isnull(b.sample, a.sample_code) as inspectStuff,\n" +
+            "    inspectStuffName = (select rtrim(name)\n" +
+            "                        from jy_zd_sample with (NOLOCK)\n" +
+            "                        where code = isnull(b.sample, a.sample_code)),\n" +
+            "                       note,\n" +
+            "                       collection_info,\n" +
+            "                       gender_restriction,\n" +
+            "                       min_age_restriction,\n" +
+            "                       max_age_restriction,\n" +
+            "                       rtrim(a.py_code)                as py_code,\n" +
+            "                       rtrim(a.d_code)                 as d_code\n" +
+            "from jy_zd_item a\n" +
+            "         left join yz_order_item b on (a.zy_order_code = b.order_code)\n" +
+            "where isnull(a.del_flag, '0') != '1'\n" +
+            "  and isnull(b.del_flag, '0') <> '1'")
     List<JyJcItem> getJyDetailedItems();