[TCO]従業員の稼働状態

30979 ワード

さぎょうじょうたい

  • 仕事中、仕事状態、遅刻か早退か、仕事状態
  • をチェックすることもできます.
  • 各画像ボタンを押すと、メールと従業員情報ウィンドウに移動します.
  • コード#コード#

  • mapper.xml
  • <!-- 전직원 기본 정보  -->
      <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE mapper
      PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
      "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
    <mapper namespace="kr.or.tco.att.mapper.AttMapper">
      
    <select id="attchecklist" resultType="empVO">
    	SELECT E.EMP_NM, E.EMP_IMG, E.CMNCD_CD, W.WORKSTTS_CK, W.CMNCD_CD AS CMNCD_CDD, E.EMP_ID
    	  FROM EMP E, WORKSTTS W
    	WHERE E.EMP_SE ='정규직'
    	  AND TO_CHAR(W.WORKSTTS_DT, 'YYYY/MM/DD')=TO_CHAR(SYSDATE, 'YYYY/MM/DD')
    	  AND E.EMP_ID = W.EMP_ID
    </select>
    
     <!-- 공통코드로 이루어진 직책을 이름으로 가져옴  -->
    <select id="sdselect" parameterType="String" resultType="cmncdVO">
    	SELECT CMNCD_GU_NM, CMNCD_NM1, CMNCD_NM2
    	  FROM CMNCD
    	 WHERE CMNCD_CD = #{cmncdCd}
    </select>
    
    <!-- 공통코드로 이루어진 근태상태를 이름으로 가져옴  -->
    <select id="sdselect2" parameterType="String" resultType="String">
    	SELECT CMNCD_NM1
    	  FROM CMNCD
    	 WHERE CMNCD_CD = #{cmncdCd}
    </select>
    
    
    </mapper>
    
  • Controller
  • 	// 업무 상태 리스트
    	@GetMapping("/attcheck")
    	public String attcheck(Model model) {
    		List<EmpVO> list = attService.attchecklist();
    		logger.info("attchecklist"+ list.toString());
    		
    		  for(EmpVO empVO : list) { 
    			  
    		logger.info("empVO"+ empVO);
    	      CmncdVO cmncdVO = new CmncdVO(); 
    	      cmncdVO = empService.sdselect(empVO.getCmncdCd());
    		  
    			
    	      logger.info("근태상태능? "+ empVO.getCmncdCdd());
    			String CmncdCdd =  empVO.getCmncdCdd();
    	      if(CmncdCdd!=null) {
    	    	  
    	    	  empVO.setCmncdCdd(attService.sdselect2(CmncdCdd)); 
    	      }else {
    	    	  empVO.setCmncdCdd(""); 
    	      }
    			 
    		  
    		  logger.info("머누"+cmncdVO.toString());
    		  
    		  empVO.setOpt(cmncdVO.getCmncdGuNm()); 
    		  empVO.setDptopt(cmncdVO.getCmncdNm1());
    		  empVO.setLelopt(cmncdVO.getCmncdNm2());
    		  
    		  
    		  }
    		 
    		
    		model.addAttribute("list", list);
    		logger.info("업무리스트: " + list);
    		return "att/attcheck";
    	}
  • view
  • <%@ page language="java" contentType="text/html; charset=UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
     <!-- start page title -->
                            <div class="row">
                                <div class="col-12">
                                    <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                       
    										<h1 class="mb-sm-0 font-size-20" >💻업무상태</h1>
                                        <div class="page-title-right">
                                            <ol class="breadcrumb m-0">
                                                <li class="breadcrumb-item"><a href="javascript: void(0);">근태관리</a></li>
                                                <li class="breadcrumb-item active">업무상태</li>
                                            </ol>
                                        </div>
    
                                    </div>
                                </div>
                            </div>
                            <!-- end page title -->
                            <div class="row">
    					<c:forEach var="list" items="${list}">
                                <div class="col-xl-3 col-sm-6">
                                    <div class="card text-center">
                                        <div class="card-body">
                                            <div class="mb-4">
                                               <img class="rounded-circle avatar-sm" src="${list.empImg}" alt="">
                                            </div>
                                            <h5 class="font-size-15 mb-1"><a href="javascript: void(0);" class="text-dark">${list.empNm}</a></h5>
                                            <p class="text-muted">[${list.opt}]${list.dptopt}/${list.lelopt}</p>
    
                                            <div>
                                                <a href="javascript: void(0);" class="badge bg-primary font-size-11 m-1">${list.worksttsCk}</a>
                                                <c:if test="${empty list.worksttsCk}">
                                                 <a href="javascript: void(0);" class="badge bg-primary font-size-11 m-1">업무전</a>
                                                </c:if>
                                                  <a href="javascript: void(0);" class="badge bg-warning font-size-11 m-1">${list.cmncdCdd}</a>
                                            </div>
                                        </div>
                                        <div class="card-footer bg-transparent border-top">
                                            <div class="contact-links d-flex font-size-20">
                                                <div class="flex-fill">
                                                    <a href="javascript: void(0);"><i class="bx bx-message-square-dots"></i></a>
                                                </div>
                                                <div class="flex-fill">
                                                    <a href="javascript: void(0);"><i class="bx bx-pie-chart-alt"></i></a>
                                                </div>
                                                <div class="flex-fill">
                                                    <a href="/emp/empdetail?empId=${list.empId}"><i class="bx bx-user-circle"></i></a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
    </c:forEach>
                                </div>
                            <div class="row">
                                <div class="col-12">
                                    <div class="text-center my-3">
                                        <a href="javascript:void(0);" class="text-success"><i class="bx bx-hourglass bx-spin me-2"></i> Load more </a>
                                    </div>
                                </div> <!-- end col-->
                            </div>
                            <!-- end row -->