Browse Source

Merge branch 'master' into 'master'

修改科室医生下拉搜索

See merge request lighter/web-server!8
huangshuhua 3 years ago
parent
commit
8718ebcb8f

+ 42 - 0
src/main/java/thyyxxk/webserver/controller/ybkf/YbUtilController.java

@@ -0,0 +1,42 @@
+package thyyxxk.webserver.controller.ybkf;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.service.ybkf.YbUtilService;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName YbUtilController
+ * @Description 医保报表常用工具类
+ * @Author hsh
+ * @Date 2022/8/9 16:19
+ **/
+@RestController
+@RequestMapping("/ybUtil")
+public class YbUtilController {
+
+    private final YbUtilService service;
+
+    @Autowired
+    public YbUtilController(YbUtilService service) {
+        this.service = service;
+    }
+
+    @PostMapping("/selectSmallDept")
+    public ResultVo<List<Map<String, Object>>> selectSmallDept(@RequestBody @Validated Map<String, String> map){
+        return service.selectSmallDept(map);
+    }
+
+    @PostMapping("/selectDoctor")
+    public ResultVo<List<Map<String, Object>>> selectDoctor(@RequestBody @Validated Map<String, String> map){
+        return service.selectDoctor(map);
+    }
+
+}

+ 31 - 0
src/main/java/thyyxxk/webserver/dao/his/ybkf/YbUtilDao.java

@@ -0,0 +1,31 @@
+package thyyxxk.webserver.dao.his.ybkf;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface YbUtilDao {
+
+    @Select("<script> " +
+            "select top 40 rtrim(name) as name, rtrim(code) as code from zd_unit_code with(nolock) where code not like '8%' and del_flag = 0 " +
+            "<if test=\"str != null and str != '' \"> " +
+            " and (name like '%${str}%' or code like '%${str}%' or py_code like ('%' + upper(#{str}) + '%') or d_code like ('%' + upper(#{str}) + '%') ) " +
+            "</if> " +
+            "order by code " +
+            "</script> ")
+    List<Map<String, Object>> selectSmallDept(@Param("str") String str);
+
+    @Select("<script> " +
+            "select top 40 rtrim(name) as name, rtrim(code) as code from a_employee_mi with(nolock) where 1 = 1 " +
+            "<if test=\"str != null and str != '' \"> " +
+            " and (name like '%${str}%' or code like '%${str}%' or py_code like ('%' + upper(#{str}) + '%') or d_code like ('%' + upper(#{str}) + '%') ) " +
+            "</if> " +
+            "order by py_code " +
+            "</script> ")
+    List<Map<String, Object>> selectDoctor(@Param("str") String str);
+
+}

+ 41 - 0
src/main/java/thyyxxk/webserver/service/ybkf/YbUtilService.java

@@ -0,0 +1,41 @@
+package thyyxxk.webserver.service.ybkf;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import thyyxxk.webserver.dao.his.ybkf.YbUtilDao;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.utils.ResultVoUtil;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName YbUtilService
+ * @Description 医保报表统计工具类
+ * @Author hsh
+ * @Date 2022/8/9 16:24
+ **/
+@Service
+public class YbUtilService {
+
+    private final YbUtilDao dao;
+
+    @Autowired
+    public YbUtilService(YbUtilDao dao) {
+        this.dao = dao;
+    }
+
+    public ResultVo<List<Map<String, Object>>> selectSmallDept(Map<String, String> map) {
+        String str = map.get("str");
+        List<Map<String, Object>> list = dao.selectSmallDept(str);
+        return ResultVoUtil.success(list);
+    }
+
+    public ResultVo<List<Map<String, Object>>> selectDoctor(Map<String, String> map) {
+        String str = map.get("str");
+        List<Map<String, Object>> list = dao.selectDoctor(str);
+        return ResultVoUtil.success(list);
+    }
+
+
+}