Ver Fonte

违规收费分析可以搜索已停用的内容。

lighter há 3 anos atrás
pai
commit
95240e9c41

+ 7 - 11
src/main/java/thyyxxk/webserver/dao/his/reports/IllegalChargesAnalysisDao.java

@@ -38,17 +38,13 @@ public interface IllegalChargesAnalysisDao {
     @Delete("delete from t_illegal_charge_template where id like #{id}")
     void deleteTemplate(@Param("id") String id);
 
-    @Select("select distinct rtrim(code) as code, rtrim(name) as name from zd_charge_item where isnull(del_flag,0)!=1 and py_code like #{pyCode} union " +
-            "select distinct rtrim(code) as code, rtrim(name) as name from yp_zd_dict where isnull(del_flag,0)!=1 and py_code like #{pyCode} ")
-    List<PureCodeName> selectChargeItemByPyCode(@Param("pyCode") String pyCode);
-
-    @Select("select distinct rtrim(code) as code, rtrim(name) as name from zd_charge_item where isnull(del_flag,0)!=1 and code like #{code} union " +
-            "select distinct rtrim(code) as code, rtrim(name) as name from yp_zd_dict where isnull(del_flag,0)!=1 and code like #{code}")
-    List<PureCodeName> selectChargeItemByCode(@Param("code") String code);
-
-    @Select("select distinct rtrim(code) as code, rtrim(name) as name from zd_charge_item where isnull(del_flag,0)!=1 and name like #{name} union " +
-            "select distinct rtrim(code) as code, rtrim(name) as name from yp_zd_dict where isnull(del_flag,0)!=1 and name like #{name}")
-    List<PureCodeName> selectChargeItemByName(@Param("name") String name);
+    @Select("select distinct rtrim(code) as code, rtrim(name) as name from zd_charge_item where " +
+            "isnull(del_flag,0) ${include} and ${method} like #{content} union " +
+            "select distinct rtrim(code) as code, rtrim(name) as name from yp_zd_dict where " +
+            "isnull(del_flag,0) ${include} and ${method} like #{content} ")
+    List<PureCodeName> selectChargeItem(@Param("method") String method,
+                                        @Param("content") String content,
+                                        @Param("include") String include);
 
     @Update("update t_illegal_charge_template set label=#{label}, value=#{value},attribute=#{attribute} where id=#{id}")
     void updateTemplate(IllegalChargeTemplate template);

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/reports/illegalchargesanalysis/SearchChargeItem.java

@@ -11,4 +11,5 @@ import lombok.Data;
 public class SearchChargeItem {
     private String method;
     private String content;
+    private Boolean includeDeactivate;
 }

+ 10 - 6
src/main/java/thyyxxk/webserver/service/reports/IllegalChargesAnalysisService.java

@@ -112,17 +112,21 @@ public class IllegalChargesAnalysisService {
     }
 
     public ResultVo<List<PureCodeName>> searchChargeItem(SearchChargeItem param) {
-        String pyCode = "%" + param.getContent().toUpperCase() + "%";
+        String content = "%" + param.getContent().toUpperCase() + "%";
+        String method;
         switch (param.getMethod()) {
             case "alpha":
-                return ResultVoUtil.success(dao.selectChargeItemByPyCode(pyCode));
+                method = "py_code";
+                break;
             case "code":
-                return ResultVoUtil.success(dao.selectChargeItemByCode(pyCode));
-            case "name":
-                return ResultVoUtil.success(dao.selectChargeItemByName(pyCode));
+                method = "code";
+                break;
             default:
-                return ResultVoUtil.success(new ArrayList<>());
+                method = "name";
+                break;
         }
+        String include = param.getIncludeDeactivate() ? "like '%%'" : "!=1";
+        return ResultVoUtil.success(dao.selectChargeItem(method, content, include));
     }
 
     public ResultVo<String> saveTemplateChanges(IllegalChargeTemplate template) {