fix:민간통역인현황 엑셀다운추가
parent
f6ab73a07c
commit
9110d2164b
|
|
@ -29,6 +29,10 @@ dependencies {
|
||||||
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2'
|
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2'
|
||||||
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5:3.0.4.RELEASE'
|
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5:3.0.4.RELEASE'
|
||||||
implementation 'org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16'
|
implementation 'org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16'
|
||||||
|
//엑셀다운
|
||||||
|
implementation 'org.apache.poi:poi:4.1.0'
|
||||||
|
implementation 'org.apache.poi:poi-ooxml:4.1.0'
|
||||||
|
|
||||||
developmentOnly 'org.springframework.boot:spring-boot-devtools:2.7.2'
|
developmentOnly 'org.springframework.boot:spring-boot-devtools:2.7.2'
|
||||||
runtimeOnly 'org.postgresql:postgresql:42.3.6'
|
runtimeOnly 'org.postgresql:postgresql:42.3.6'
|
||||||
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor:2.7.2'
|
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor:2.7.2'
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,17 @@ import com.dbnt.faisp.translator.model.TranslatorCrr;
|
||||||
import com.dbnt.faisp.translator.service.TranslatorService;
|
import com.dbnt.faisp.translator.service.TranslatorService;
|
||||||
import com.dbnt.faisp.userInfo.model.UserInfo;
|
import com.dbnt.faisp.userInfo.model.UserInfo;
|
||||||
import com.dbnt.faisp.util.ParamMap;
|
import com.dbnt.faisp.util.ParamMap;
|
||||||
|
import com.dbnt.faisp.util.Utils;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
@ -30,17 +34,33 @@ public class TranslatorController {
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/info")
|
@GetMapping("/info")
|
||||||
public ModelAndView translatorInfo(@AuthenticationPrincipal UserInfo loginUser,Translator translator) {
|
public ModelAndView translatorInfo(@AuthenticationPrincipal UserInfo loginUser,Translator translator,HttpServletResponse response) {
|
||||||
ModelAndView mav = new ModelAndView("translator/translator");
|
ModelAndView mav = new ModelAndView("translator/translator");
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("userSeq", loginUser.getUserSeq());
|
params.put("userSeq", loginUser.getUserSeq());
|
||||||
params.put("menuUrl", "/translator/info");
|
params.put("menuUrl", "/translator/info");
|
||||||
|
translator.setOrganCdList(organConfigService.selectOrganListWhereUserOgCd(loginUser.getOgCd()));
|
||||||
|
//엑셀다운
|
||||||
|
if(translator.getExcel() != null && translator.getExcel().equals("Y")){
|
||||||
|
String[] headers = { "translator_key", "ogdp1", "tr_lang", "tr_career", "tr_name", "tr_age", "tr_nny", "tr_edu", "tr_cft", "dml_yn", "apt_dt", "tr_phone"};
|
||||||
|
String[] headerNames = { "연번", "관서명", "언어", "경력", "성명", "나이", "국적", "학력", "자격증", "해촉", "위촉일", "연락처" };
|
||||||
|
String[] columnType = { "String", "String", "String", "String", "String", "String", "String", "String", "String", "String", "String", "String"};
|
||||||
|
String sheetName = "민간 통역인 현황";
|
||||||
|
String excelFileName = "민간 통역인 현황";
|
||||||
|
List<ParamMap> translatorInfoList= translatorSevice.selectTranslatorListEx(translator);
|
||||||
|
|
||||||
|
try {
|
||||||
|
Utils.listToExcel(translatorInfoList, response, headers, headerNames, columnType, sheetName, excelFileName);
|
||||||
|
} catch (IOException e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
//메뉴권한 확인
|
//메뉴권한 확인
|
||||||
String accessAuth = authMgtService.selectAccessConfigList(params).get(0).getAccessAuth();
|
String accessAuth = authMgtService.selectAccessConfigList(params).get(0).getAccessAuth();
|
||||||
|
|
||||||
mav.addObject("mgtOrganList", loginUser.getOrganCdList());
|
mav.addObject("mgtOrganList", loginUser.getOrganCdList());
|
||||||
mav.addObject("accessAuth", accessAuth);
|
mav.addObject("accessAuth", accessAuth);
|
||||||
translator.setOrganCdList(organConfigService.selectOrganListWhereUserOgCd(loginUser.getOgCd()));
|
|
||||||
translator.setQueryInfo();
|
translator.setQueryInfo();
|
||||||
mav.addObject("translatorList", translatorSevice.selectTranslatorList(translator));
|
mav.addObject("translatorList", translatorSevice.selectTranslatorList(translator));
|
||||||
translator.setContentCnt(translatorSevice.selectTranslatorListCnt(translator));
|
translator.setContentCnt(translatorSevice.selectTranslatorListCnt(translator));
|
||||||
|
|
@ -136,10 +156,11 @@ public class TranslatorController {
|
||||||
public ModelAndView statisticsLang() {
|
public ModelAndView statisticsLang() {
|
||||||
ModelAndView mav = new ModelAndView("translator/translatorStatisticsLang");
|
ModelAndView mav = new ModelAndView("translator/translatorStatisticsLang");
|
||||||
mav.addObject("cntList", translatorSevice.selectStatisticsLangCnt());
|
mav.addObject("cntList", translatorSevice.selectStatisticsLangCnt());
|
||||||
|
mav.addObject("total", translatorSevice.selectStatisticsLangTotal());
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,4 +24,8 @@ public interface TranslatorMapper {
|
||||||
|
|
||||||
List<ParamMap> selectStatisticsLangCnt();
|
List<ParamMap> selectStatisticsLangCnt();
|
||||||
|
|
||||||
|
ParamMap selectStatisticsLangTotal();
|
||||||
|
|
||||||
|
List<ParamMap> selectTranslatorListEx(Translator translator);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import javax.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
|
@ -70,16 +71,9 @@ public class Translator extends BaseModel implements Serializable{
|
||||||
private String wrtOrgan;
|
private String wrtOrgan;
|
||||||
|
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private String excel;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "Translator [translatorKey=" + translatorKey + ", versionNo=" + versionNo + ", ogdp1=" + ogdp1 + ", trLang="
|
|
||||||
+ trLang + ", trCareer=" + trCareer + ", trName=" + trName + ", trSex=" + trSex + ", trPhone=" + trPhone
|
|
||||||
+ ", trNny=" + trNny + ", trAge=" + trAge + ", trCft=" + trCft + ", trVisa=" + trVisa + ", aptDt=" + aptDt
|
|
||||||
+ ", dmlYn=" + dmlYn + ", remark=" + remark + ", wrtNm=" + wrtNm + ", wrtDt=" + wrtDt + "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Embeddable
|
@Embeddable
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
|
@ -90,6 +84,23 @@ public static class TranslatorId implements Serializable {
|
||||||
private Integer versionNo;
|
private Integer versionNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getInt(String string) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getString(String string) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Translator [translatorKey=" + translatorKey + ", versionNo=" + versionNo + ", ogdp1=" + ogdp1 + ", trLang="
|
||||||
|
+ trLang + ", trCareer=" + trCareer + ", trName=" + trName + ", trSex=" + trSex + ", trPhone=" + trPhone
|
||||||
|
+ ", trNny=" + trNny + ", trAge=" + trAge + ", trEdu=" + trEdu + ", trCft=" + trCft + ", trVisa=" + trVisa
|
||||||
|
+ ", aptDt=" + aptDt + ", dmlYn=" + dmlYn + ", remark=" + remark + ", wrtNm=" + wrtNm + ", wrtDt=" + wrtDt
|
||||||
|
+ ", wrtOrgan=" + wrtOrgan + ", excel=" + excel + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,4 +131,12 @@ public class TranslatorService {
|
||||||
return translatorMapper.selectStatisticsLangCnt();
|
return translatorMapper.selectStatisticsLangCnt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ParamMap selectStatisticsLangTotal() {
|
||||||
|
return translatorMapper.selectStatisticsLangTotal();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ParamMap> selectTranslatorListEx(Translator translator) {
|
||||||
|
return translatorMapper.selectTranslatorListEx(translator);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,192 @@
|
||||||
|
package com.dbnt.faisp.util;
|
||||||
|
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.NetworkInterface;
|
||||||
|
import java.net.SocketException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Base64;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import javax.servlet.http.Cookie;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
|
import org.apache.poi.ss.usermodel.CellStyle;
|
||||||
|
import org.apache.poi.ss.usermodel.FillPatternType;
|
||||||
|
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||||
|
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||||
|
import org.apache.poi.ss.usermodel.Row;
|
||||||
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
|
import org.apache.poi.xssf.usermodel.XSSFDataFormat;
|
||||||
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
|
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.util.FileCopyUtils;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.dbnt.faisp.util.ParamMap;
|
||||||
|
|
||||||
|
public class Utils {
|
||||||
|
|
||||||
|
|
||||||
|
public static boolean isEmpty(final Object obj) {
|
||||||
|
return !isNotEmpty(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNotEmpty(final Object obj) {
|
||||||
|
if(null == obj) return false;
|
||||||
|
else {
|
||||||
|
if(obj instanceof String) return "".equals(obj) ? false : true;
|
||||||
|
else if(obj instanceof List) return !((List<?>)obj).isEmpty();
|
||||||
|
else if(obj instanceof Map) return !((Map<?,?>)obj).isEmpty();
|
||||||
|
// else if(obj instanceof Object[]) return 0 == Array.getLength(obj) ? false : true;
|
||||||
|
else if(obj instanceof Integer) return !(null == obj);
|
||||||
|
else if(obj instanceof Long) return !(null == obj);
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTimeStampString(final String format) {
|
||||||
|
return getTimeStampString(new Date(), format);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTimeStampString(final Date date) {
|
||||||
|
return getTimeStampString(date, "yyyyMMddHHmmss");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTimeStampString(final Date date, final String format){
|
||||||
|
java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat (format, java.util.Locale.KOREA);
|
||||||
|
return formatter.format(date);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTimeStampString(String date, final String format) {
|
||||||
|
try {
|
||||||
|
if(null == date || "".equals(date)) return "";
|
||||||
|
|
||||||
|
Date d = null;
|
||||||
|
date= date.replaceAll("-", "");
|
||||||
|
|
||||||
|
switch(date.length()) {
|
||||||
|
case 14: break;
|
||||||
|
case 12: date += "00"; break;
|
||||||
|
case 10: date += "0000"; break;
|
||||||
|
case 8: date += "000000"; break;
|
||||||
|
case 6: date += "01000000"; break;
|
||||||
|
case 4: date += "0101000000"; break;
|
||||||
|
default: return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
java.text.SimpleDateFormat tmpFormat = new java.text.SimpleDateFormat("yyyyMMddHHmmss", java.util.Locale.KOREA);
|
||||||
|
|
||||||
|
if("".equals(date)) d = new Date();
|
||||||
|
else {
|
||||||
|
tmpFormat.setLenient(true);
|
||||||
|
d = tmpFormat.parse(date);
|
||||||
|
}
|
||||||
|
|
||||||
|
return getTimeStampString(d, format);
|
||||||
|
} catch(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void listToExcel(List<ParamMap> list, HttpServletResponse response, String[] headers, String[] headerNames, String[] columnType, String sheetName, String excelFileName) throws IOException {
|
||||||
|
if(Utils.isNotEmpty(list)) {
|
||||||
|
// 메모리에 100개의 행을 유지합니다. 행의 수가 넘으면 디스크에 적습니다.
|
||||||
|
XSSFWorkbook wb = new XSSFWorkbook();
|
||||||
|
Sheet sheet = wb.createSheet(sheetName);
|
||||||
|
Row headerRow = sheet.createRow(0);
|
||||||
|
CellStyle cellStyle1 = wb.createCellStyle(); //쉼표들어간 숫자 양식
|
||||||
|
CellStyle cellStyle2 = wb.createCellStyle(); //숫자양식
|
||||||
|
CellStyle headerStyle = wb.createCellStyle(); //숫자양식
|
||||||
|
|
||||||
|
XSSFDataFormat format = wb.createDataFormat();
|
||||||
|
cellStyle1.setDataFormat(format.getFormat("#,##0"));
|
||||||
|
cellStyle2.setDataFormat(format.getFormat("#"));
|
||||||
|
headerStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||||
|
headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||||
|
headerStyle.setFillForegroundColor((short)3);
|
||||||
|
headerStyle.setFillForegroundColor(IndexedColors.LIME.getIndex());
|
||||||
|
|
||||||
|
for(int i=0; i<list.size(); i++) {
|
||||||
|
ParamMap rowData = list.get(i);
|
||||||
|
Row row = sheet.createRow(i+1);
|
||||||
|
|
||||||
|
for(int j=0; j<headers.length; j++) {
|
||||||
|
Cell cell = row.createCell(j);
|
||||||
|
|
||||||
|
if(columnType[j].equalsIgnoreCase("Money")) {
|
||||||
|
cell.setCellValue(rowData.getInt(headers[j]));
|
||||||
|
cell.setCellStyle(cellStyle1);
|
||||||
|
} else if(columnType[j].equalsIgnoreCase("Int")) {
|
||||||
|
cell.setCellValue(rowData.getInt(headers[j]));
|
||||||
|
cell.setCellStyle(cellStyle2);
|
||||||
|
} else if(columnType[j].equalsIgnoreCase("String")) {
|
||||||
|
cell.setCellValue(rowData.getString(headers[j]));
|
||||||
|
} else {
|
||||||
|
cell.setCellValue(rowData.getString(headers[j]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int j=0; j<headerNames.length; j++) {
|
||||||
|
Cell cell = headerRow.createCell(j);
|
||||||
|
cell.setCellValue(headerNames[j]);
|
||||||
|
cell.setCellStyle(headerStyle);
|
||||||
|
sheet.autoSizeColumn(j);
|
||||||
|
sheet.setColumnWidth(j, (sheet.getColumnWidth(j)) + 1000);
|
||||||
|
}
|
||||||
|
//엑셀이름 한글깨짐방지
|
||||||
|
String outputFileName = new String(excelFileName.getBytes("KSC5601"), "8859_1");
|
||||||
|
|
||||||
|
response.setHeader("Set-Cookie", "fileDownload=true; path=/");
|
||||||
|
response.setHeader("Content-Disposition", String.format("attachment; filename=\""+outputFileName+"_"+Utils.getTimeStampString("yyyyMMdd_HHmm")+".xlsx\""));
|
||||||
|
|
||||||
|
wb.write(response.getOutputStream());
|
||||||
|
wb.close();
|
||||||
|
} else {
|
||||||
|
response.setHeader("Content-Type", "text/html; charset=UTF-8");
|
||||||
|
PrintWriter out = response.getWriter();
|
||||||
|
|
||||||
|
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">");
|
||||||
|
out.write("<html lang=\"ko\">");
|
||||||
|
out.write("<head>");
|
||||||
|
out.write("<script type=\"text/javascript\">");
|
||||||
|
out.write("alert('데이터가 없습니다.');");
|
||||||
|
out.write("history.back(-1);");
|
||||||
|
out.write("</script>");
|
||||||
|
out.write("</head>");
|
||||||
|
out.write("</html>");
|
||||||
|
|
||||||
|
out.flush();
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -208,5 +208,108 @@
|
||||||
inner join code_mgt cm on d.lang=cm.item_cd
|
inner join code_mgt cm on d.lang=cm.item_cd
|
||||||
group by cm.item_value
|
group by cm.item_value
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStatisticsLangTotal" resultType="com.dbnt.faisp.util.ParamMap">
|
||||||
|
select sum(cnt_total) as total_total,
|
||||||
|
sum(cnt_center) as total_center,
|
||||||
|
sum(cnt_west) as total_west,
|
||||||
|
sum(cnt_south) as total_south,
|
||||||
|
sum(cnt_east) as total_east,
|
||||||
|
sum(jeju) as total_jeju
|
||||||
|
from(
|
||||||
|
select cm.item_value ,
|
||||||
|
sum(center+west+south+east+jeju) as cnt_total,
|
||||||
|
sum(center) as cnt_center,
|
||||||
|
sum(west) as cnt_west,
|
||||||
|
sum(south) as cnt_south,
|
||||||
|
sum(east) as cnt_east,
|
||||||
|
sum(jeju) as jeju
|
||||||
|
from (select
|
||||||
|
a.tr_lang as lang,
|
||||||
|
case
|
||||||
|
when c.organ_cd = 'OG002' or c.parent_organ = 'OG002' then 1
|
||||||
|
else 0
|
||||||
|
end as center,
|
||||||
|
case
|
||||||
|
when c.organ_cd = 'OG003' or c.parent_organ = 'OG003' then 1
|
||||||
|
else 0
|
||||||
|
end as west,
|
||||||
|
case
|
||||||
|
when c.organ_cd = 'OG004' or c.parent_organ = 'OG004' then 1
|
||||||
|
else 0
|
||||||
|
end as south,
|
||||||
|
case
|
||||||
|
when c.organ_cd = 'OG005' or c.parent_organ = 'OG005' then 1
|
||||||
|
else 0
|
||||||
|
end as east,
|
||||||
|
case
|
||||||
|
when c.organ_cd = 'OG006' or c.parent_organ = 'OG006' then 1
|
||||||
|
else 0
|
||||||
|
end as jeju
|
||||||
|
from translator_info a
|
||||||
|
inner join (select translator_key, max(version_no) as lastVer
|
||||||
|
from translator_info
|
||||||
|
group by translator_key) b
|
||||||
|
on a.translator_key =b.translator_key and a.version_no = b.lastVer
|
||||||
|
inner join organ_config c on a.ogdp1 = c.organ_cd) d
|
||||||
|
inner join code_mgt cm on d.lang=cm.item_cd
|
||||||
|
group by cm.item_value
|
||||||
|
) a
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTranslatorListEx" resultType="com.dbnt.faisp.util.ParamMap" parameterType="Translator">
|
||||||
|
select a.translator_key,
|
||||||
|
version_no,
|
||||||
|
c.item_value as ogdp1,
|
||||||
|
d.item_value as tr_lang,
|
||||||
|
tr_career,
|
||||||
|
tr_name,
|
||||||
|
e.item_value as tr_sex,
|
||||||
|
tr_age,
|
||||||
|
f.item_value as tr_nny,
|
||||||
|
g.item_value as tr_edu,
|
||||||
|
tr_cft,
|
||||||
|
h.item_value as tr_visa,
|
||||||
|
dml_yn,
|
||||||
|
apt_dt,
|
||||||
|
tr_phone
|
||||||
|
from translator_info a
|
||||||
|
inner join (select translator_key, max(version_no) as lastVer
|
||||||
|
from translator_info
|
||||||
|
group by translator_key) b
|
||||||
|
on a.translator_key =b.translator_key and a.version_no = b.lastVer
|
||||||
|
left outer join code_mgt c on a.ogdp1 = c.item_cd
|
||||||
|
left outer join code_mgt d on a.tr_lang = d.item_cd
|
||||||
|
left outer join code_mgt e on a.tr_sex = e.item_cd
|
||||||
|
left outer join code_mgt f on a.tr_nny = f.item_cd
|
||||||
|
left outer join code_mgt g on a.tr_edu = g.item_cd
|
||||||
|
left outer join code_mgt h on a.tr_visa = h.item_cd
|
||||||
|
where wrt_organ in
|
||||||
|
<foreach collection="organCdList" item="item" index="index" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
<if test='trLang != null and trLang != ""'>
|
||||||
|
and tr_lang = #{trLang}
|
||||||
|
</if>
|
||||||
|
<if test='ogdp1 != null and ogdp1 != ""'>
|
||||||
|
and ogdp1 = #{ogdp1}
|
||||||
|
</if>
|
||||||
|
<if test='trName != null and trName != ""'>
|
||||||
|
and tr_name = #{trName}
|
||||||
|
</if>
|
||||||
|
<if test='trNny != null and trNny != ""'>
|
||||||
|
and tr_nny = #{trNny}
|
||||||
|
</if>
|
||||||
|
<if test='trVisa != null and trVisa != ""'>
|
||||||
|
and tr_visa = #{trVisa}
|
||||||
|
</if>
|
||||||
|
<if test='aptDt != null'>
|
||||||
|
and to_char(apt_dt,'YYYY-MM-DD') = #{aptDt}::VARCHAR
|
||||||
|
</if>
|
||||||
|
<if test='dmlYn != null and dmlYn != ""'>
|
||||||
|
and dml_yn = #{dmlYn}
|
||||||
|
</if>
|
||||||
|
order by translator_key desc
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -411,6 +411,16 @@ $(document).on('click', '#trDeleteBtn', function (){
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$(document).on('click', '#goExcel', function (){
|
||||||
|
if(confirm("엑셀로 다운로드 하시겠습니까?")){
|
||||||
|
$('input[name=excel]').val('Y');
|
||||||
|
$('#searchFm').submit();
|
||||||
|
$('input[name=excel]').val('');
|
||||||
|
}else{
|
||||||
|
false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@
|
||||||
<div class="row mx-0">
|
<div class="row mx-0">
|
||||||
<div class="col-12 card text-center">
|
<div class="col-12 card text-center">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form method="get" th:action="@{/translator/info}">
|
<form id="searchFm" method="get" th:action="@{/translator/info}">
|
||||||
|
<input type="hidden" name="excel">
|
||||||
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
|
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
|
||||||
<div class="row justify-content-between pe-3 py-1">
|
<div class="row justify-content-between pe-3 py-1">
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
|
|
@ -171,6 +172,7 @@
|
||||||
</nav>
|
</nav>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<button data-bs-toggle="modal" data-bs-target="#translatorInsertModal" th:unless="${accessAuth eq 'ACC001'}">등록</button>
|
<button data-bs-toggle="modal" data-bs-target="#translatorInsertModal" th:unless="${accessAuth eq 'ACC001'}">등록</button>
|
||||||
|
<button id="goExcel">엑셀다운</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,6 @@
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<input type="hidden" id="selectedKey">
|
|
||||||
<input type="hidden" id="selectedVerNo">
|
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -34,17 +32,17 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th>연번</th>
|
<th>연번</th>
|
||||||
<th>계</th>
|
<th>계</th>
|
||||||
<th></th>
|
<th th:text="${total.total_total}"></th>
|
||||||
<th></th>
|
<th th:text="${total.total_center}"></th>
|
||||||
<th></th>
|
<th th:text="${total.total_west}"></th>
|
||||||
<th></th>
|
<th th:text="${total.total_south}"></th>
|
||||||
<th></th>
|
<th th:text="${total.total_east}"></th>
|
||||||
<th></th>
|
<th th:text="${total.total_jeju}"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class="" th:each="cnt:${cntList}">
|
<tr class="" th:each="cnt,index:${cntList}">
|
||||||
<td></td>
|
<td th:text="${index.index}"></td>
|
||||||
<td th:text="${cnt.lang}"></td>
|
<td th:text="${cnt.lang}"></td>
|
||||||
<td th:text="${cnt.cnt_total}"></td>
|
<td th:text="${cnt.cnt_total}"></td>
|
||||||
<td th:text="${cnt.cnt_center}"></td>
|
<td th:text="${cnt.cnt_center}"></td>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue