junekeunsong 4 年之前
父节点
当前提交
2c9a634b9f

+ 95 - 88
src/main/java/com/lemon/lifecenter/controller/StaffController.java

@@ -1,88 +1,95 @@
-package com.lemon.lifecenter.controller;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.servlet.ModelAndView;
-
-import com.lemon.lifecenter.common.LifeCenterConfigVO;
-import com.lemon.lifecenter.common.LifeCenterController;
-import com.lemon.lifecenter.common.LifeCenterPaging;
-import com.lemon.lifecenter.dto.StaffDTO;
-import com.lemon.lifecenter.service.StaffService;
-
-// 의료진관리 contorller
-@Controller
-@RequestMapping("/staff")
-public class StaffController extends LifeCenterController {
-    private final Logger logger = LoggerFactory.getLogger(this.getClass());
-    
-    @Autowired
-    private StaffService memberService;
-    @Autowired
-    private LifeCenterConfigVO config;
-    private LifeCenterPaging paging;
-    
-    @RequestMapping("/new")
-    public ModelAndView staffNew() {
-        ModelAndView mv = setMV("staff/new");
-
-        return mv;
-    }
-    
-    @RequestMapping("/info")
-    public ModelAndView staffInfo() {
-        ModelAndView mv = setMV("staff/info");
-
-        return mv;
-    }
-
-    @RequestMapping("/edit")
-    public ModelAndView staffEdit() {
-        ModelAndView mv = setMV("staff/edit");
-
-        return mv;
-    }
-
-    @RequestMapping("/list")
-    public ModelAndView staffList(
-            @ModelAttribute("dto") final StaffDTO dto,
-            @RequestParam(value="selectState", required=false, defaultValue="") String selectState,
-            @RequestParam(value="sData", required=false, defaultValue="") String sData,
-            @RequestParam(value="useYn", required=false, defaultValue="") String useYn,
-            @RequestParam(value="page", required=false, defaultValue="1") int page) {
-        
-        logger.error("selectState -- > " + selectState);
-        logger.error("sData -- > " + sData);
-        logger.error("useYn -- > " + useYn);
-        
-        dto.setLimit( ( Integer.valueOf( page ) - 1 ) * config.pageDataSize );
-        dto.setLimitMax( config.pageDataSize );
-        
-        int total = memberService.selectMemeberListCount(dto);
-        List<StaffDTO> list = new ArrayList<StaffDTO>();
-        if (total > 0) {
-            list = memberService.selectMemberList(dto);
-        }
-        String param = "";
-        paging = LifeCenterPaging.getInstance();
-        paging.paging(config, total, page, param);
-        
-        ModelAndView mv = setMV("staff/list");
-        mv.addObject("total", total);
-        mv.addObject("selectState", selectState);
-        mv.addObject("sData", sData);
-        mv.addObject("useYn", useYn);
-        mv.addObject("item", list);
-        mv.addObject("paging", paging);
-        
-        return mv;
-    }
-}
+package com.lemon.lifecenter.controller;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.ModelAndView;
+
+import com.lemon.lifecenter.common.LifeCenterConfigVO;
+import com.lemon.lifecenter.common.LifeCenterController;
+import com.lemon.lifecenter.common.LifeCenterPaging;
+import com.lemon.lifecenter.dto.StaffDTO;
+import com.lemon.lifecenter.service.StaffService;
+
+// 의료진관리 contorller
+@Controller
+@RequestMapping("/staff")
+public class StaffController extends LifeCenterController {
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+    
+    @Autowired
+    private StaffService memberService;
+    @Autowired
+    private LifeCenterConfigVO config;
+    private LifeCenterPaging paging;
+    
+    @RequestMapping("/new")
+    public ModelAndView staffNew() {
+        ModelAndView mv = setMV("staff/new");
+
+        return mv;
+    }
+    
+    @RequestMapping("/info")
+    public ModelAndView staffInfo() {
+        ModelAndView mv = setMV("staff/info");
+
+        return mv;
+    }
+
+    @RequestMapping("/edit")
+    public ModelAndView staffEdit() {
+        ModelAndView mv = setMV("staff/edit");
+
+        return mv;
+    }
+    
+    @RequestMapping("/myinfo")
+    public ModelAndView staffMyinfo() {
+        ModelAndView mv = setMV("staff/myinfo");
+
+        return mv;
+    }
+
+    @RequestMapping("/list")
+    public ModelAndView staffList(
+            @ModelAttribute("dto") final StaffDTO dto,
+            @RequestParam(value="selectState", required=false, defaultValue="") String selectState,
+            @RequestParam(value="sData", required=false, defaultValue="") String sData,
+            @RequestParam(value="useYn", required=false, defaultValue="") String useYn,
+            @RequestParam(value="page", required=false, defaultValue="1") int page) {
+        
+        logger.error("selectState -- > " + selectState);
+        logger.error("sData -- > " + sData);
+        logger.error("useYn -- > " + useYn);
+        
+        dto.setLimit( ( Integer.valueOf( page ) - 1 ) * config.pageDataSize );
+        dto.setLimitMax( config.pageDataSize );
+        
+        int total = memberService.selectMemeberListCount(dto);
+        List<StaffDTO> list = new ArrayList<StaffDTO>();
+        if (total > 0) {
+            list = memberService.selectMemberList(dto);
+        }
+        String param = "";
+        paging = LifeCenterPaging.getInstance();
+        paging.paging(config, total, page, param);
+        
+        ModelAndView mv = setMV("staff/list");
+        mv.addObject("total", total);
+        mv.addObject("selectState", selectState);
+        mv.addObject("sData", sData);
+        mv.addObject("useYn", useYn);
+        mv.addObject("item", list);
+        mv.addObject("paging", paging);
+        
+        return mv;
+    }
+}

+ 33 - 19
src/main/resources/mybatis/mapper/staff/staff.xml

@@ -27,19 +27,26 @@
             ]]>
         </if>
         <if test='selectState == "sId"'>
-            <![CDATA[
-                AND M.ID LIKE CONCAT('%', #{id}, '%')
-            ]]>
+            <if test="id != null and id != ''">
+                <![CDATA[
+                    AND M.ID LIKE CONCAT('%', #{id}, '%')
+                ]]>
+            </if>
         </if>
         <if test='selectState == "sName"'>
-            <![CDATA[
-                AND M.NAME LIKE CONCAT('%', #{name}, '%')
-            ]]>
+            <if test="name != null and name != ''">
+                <![CDATA[
+                    AND M.NAME LIKE CONCAT('%', #{name}, '%')
+                ]]>
+            </if>
+
         </if>
-        <if test='selectState == "centerName"'>
-            <![CDATA[
-                AND CI.CENTER_NAME LIKE CONCAT('%', #{centerName}, '%')
-            ]]>
+        <if test='selectState == "sCenterName"'>
+            <if test="centerName != null and centerName != ''">
+                <![CDATA[
+                    AND CI.CENTER_NAME LIKE CONCAT('%', #{centerName}, '%')
+                ]]>
+            </if>
         </if>
     </select>
     
@@ -64,19 +71,26 @@
             ]]>
         </if>
         <if test='selectState == "sId"'>
-            <![CDATA[
-                AND M.ID LIKE CONCAT('%', #{id}, '%')
-            ]]>
+            <if test="id != null and id != ''">
+                <![CDATA[
+                    AND M.ID LIKE CONCAT('%', #{id}, '%')
+                ]]>
+            </if>
         </if>
         <if test='selectState == "sName"'>
-            <![CDATA[
-                AND M.NAME LIKE CONCAT('%', #{name}, '%')
-            ]]>
+            <if test="name != null and name != ''">
+                <![CDATA[
+                    AND M.NAME LIKE CONCAT('%', #{name}, '%')
+                ]]>
+            </if>
+
         </if>
         <if test='selectState == "sCenterName"'>
-            <![CDATA[
-                AND CI.CENTER_NAME LIKE CONCAT('%', #{centerName}, '%')
-            ]]>
+            <if test="centerName != null and centerName != ''">
+                <![CDATA[
+                    AND CI.CENTER_NAME LIKE CONCAT('%', #{centerName}, '%')
+                ]]>
+            </if>
         </if>
 
         <![CDATA[

+ 13 - 25
src/main/webapp/WEB-INF/jsp/staff/list.jsp

@@ -10,29 +10,7 @@
         <jsp:include page="${data._INCLUDE}/sidebar.jsp"></jsp:include>
 
         <div class="main">
-            <nav class="navbar navbar-expand navbar-light bg-white">
-                <a class="sidebar-toggle d-flex mr-2">
-                    <i class="hamburger align-self-center"></i>
-                </a>
-
-                <div class="navbar-collapse collapse">
-                    <ul class="navbar-nav ml-auto">
-                        <li class="nav-item dropdown">
-                            <a class="nav-icon dropdown-toggle d-inline-block d-sm-none" href="#" data-toggle="dropdown">
-                                <i class="align-middle" data-feather="settings"></i>
-                            </a>
-
-                            <a class="nav-link dropdown-toggle d-none d-sm-inline-block" href="#" data-toggle="dropdown">
-                                <span class="text-dark">홍길동 선생님</span>
-                            </a>
-                            <div class="dropdown-menu dropdown-menu-right">
-                                <a class="dropdown-item" href="pages-profile.html"><i class="align-middle mr-1" data-feather="user"></i> 정보변경</a>
-                                <a class="dropdown-item" href="#"><i class="align-middle mr-1" data-feather="pie-chart"></i> 로그아웃</a>
-                            </div>
-                        </li>
-                    </ul>
-                </div>
-            </nav>
+            <jsp:include page="${data._INCLUDE}/top.jsp"></jsp:include>
 
             <main class="content">
                 <div class="container-fluid p-0">
@@ -144,14 +122,24 @@
                                                             <tr>
                                                                 <td><c:out value="${l.num}" /></td>
                                                                 <td>
-                                                                    <a href="javscript:;"><c:out value="${l.id}" /></a>
+                                                                    <a href="./info?staffId=${l.id}"><c:out value="${l.id}" /></a>
                                                                 </td>
                                                                 <td><c:out value="${l.name}" /></td>
                                                                 <td><c:out value="${l.centerName}" /></td>
                                                                 <td><c:out value="${l.groupIdx}" /></td>
                                                                 <td><c:out value="${l.lastLoginTime}" /></td>
                                                                 <td><c:out value="${l.createDate}" /></td>
-                                                                <td><c:out value="${l.useYn}" /></td>
+                                                                <td>
+                                                                    <c:choose>
+                                                                        <c:when test="${l.useYn == 'Y'}">
+                                                                            활성
+                                                                        </c:when>
+                                                                        <c:otherwise>
+                                                                            비활성
+                                                                        </c:otherwise>
+                                                                    
+                                                                    </c:choose>
+                                                                </td>
                                                             </tr>
                                                         </c:forEach>
                                                     </c:when>