강석 최 2022-09-20 18:04:00 +09:00
commit 18eed66a0e
6 changed files with 252 additions and 21 deletions

View File

@ -39,8 +39,9 @@ public class EquipController {
@GetMapping("/equipStatus")
public ModelAndView equipStatus() {
public ModelAndView equipStatus(Equip equip) {
ModelAndView mav = new ModelAndView("equip/equipStatus");
mav.addObject("equipList", equipService.selectEquipStatus(equip));
return mav;
}

View File

@ -1,5 +1,6 @@
package com.dbnt.faisp.equip.mapper;
import com.dbnt.faisp.equip.model.Equip;
import com.dbnt.faisp.translator.model.Translator;
import com.dbnt.faisp.translator.model.TranslatorCrr;
import com.dbnt.faisp.userInfo.model.UserInfo;
@ -12,6 +13,8 @@ import java.util.List;
@Mapper
public interface EquipMapper {
List<ParamMap> selectEquipStatus(Equip equip);
}

View File

@ -6,12 +6,6 @@ import com.dbnt.faisp.equip.model.Equip;
import com.dbnt.faisp.equip.model.EquipFile;
import com.dbnt.faisp.equip.repository.EquipFileRepository;
import com.dbnt.faisp.equip.repository.EquipRepository;
import com.dbnt.faisp.translator.mapper.TranslatorMapper;
import com.dbnt.faisp.translator.model.Translator;
import com.dbnt.faisp.translator.model.Translator.TranslatorId;
import com.dbnt.faisp.translator.model.TranslatorCrr;
import com.dbnt.faisp.translator.repository.TranslatorCareerRepository;
import com.dbnt.faisp.translator.repository.TranslatorRepository;
import com.dbnt.faisp.util.ParamMap;
import com.dbnt.faisp.util.Utils;
@ -23,10 +17,8 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.core.env.Environment;
import java.io.File;
import java.time.LocalDateTime;
import java.util.*;
@Service
@ -114,5 +106,9 @@ public class EquipService {
}
}
public List<ParamMap> selectEquipStatus(Equip equip) {
return equipMapper.selectEquipStatus(equip);
}
}

View File

@ -4,6 +4,197 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dbnt.faisp.equip.mapper.EquipMapper">
<select id="selectEquipStatus" resultType="com.dbnt.faisp.util.ParamMap" parameterType="Equip">
select category_cd,
equ_type,
item_value,
item_cd,
sum( cnt_bon+
cnt_center+
cnt_incheon+
cnt_pyeongtaek+
cnt_taean+
cnt_boryeong+
cnt_west+
cnt_mokpo+
cnt_buan+
cnt_gunsan+
cnt_yusu+
cnt_wando+
cnt_south+
cnt_ulsan+
cnt_busan+
cnt_changwon+
cnt_tongyong+
cnt_sacheon+
cnt_east+
cnt_sokcho+
cnt_donghe+
cnt_ulgin+
cnt_pohang+
cnt_jeju+
cnt_jejuseo+
cnt_seoguipo) as total,
sum(cnt_bon) as cnt_bon,
sum(cnt_center) as cnt_center,
sum(cnt_incheon) as cnt_incheon,
sum(cnt_pyeongtaek) as cnt_pyeongtaek,
sum(cnt_taean) as cnt_taean,
sum(cnt_boryeong) as cnt_boryeong,
sum(cnt_west) as cnt_west,
sum(cnt_mokpo) as cnt_mokpo,
sum(cnt_buan) as cnt_buan,
sum(cnt_gunsan) as cnt_gunsan,
sum(cnt_yusu) as cnt_yusu,
sum(cnt_wando) as cnt_wando,
sum(cnt_south) as cnt_south,
sum(cnt_ulsan) as cnt_ulsan,
sum(cnt_busan) as cnt_busan,
sum(cnt_changwon) as cnt_changwon,
sum(cnt_tongyong) as cnt_tongyong,
sum(cnt_sacheon) as cnt_sacheon,
sum(cnt_east) as cnt_east,
sum(cnt_sokcho) as cnt_sokcho,
sum(cnt_donghe) as cnt_donghe,
sum(cnt_ulgin) as cnt_ulgin,
sum(cnt_pohang) as cnt_pohang,
sum(cnt_jeju) as cnt_jeju,
sum(cnt_jejuseo) as cnt_jejuseo,
sum(cnt_seoguipo) as cnt_seoguipo
from(
select a.category_cd,
a.item_cd,
(select item_value from code_mgt cmt where a.category_cd = cmt.item_cd) as equ_type,
a.item_value,
case
when b.mgt_organ = 'OG001' then b.item_qty
else 0
end as cnt_bon,
case
when b.mgt_organ = 'OG002' then b.item_qty
else 0
end as cnt_center,
case
when b.mgt_organ = 'OG007' then b.item_qty
else 0
end as cnt_incheon,
case
when b.mgt_organ = 'OG008' then b.item_qty
else 0
end as cnt_pyeongtaek,
case
when b.mgt_organ = 'OG009' then b.item_qty
else 0
end as cnt_taean,
case
when b.mgt_organ = 'OG010' then b.item_qty
else 0
end as cnt_boryeong,
case
when b.mgt_organ = 'OG003' then b.item_qty
else 0
end as cnt_west,
case
when b.mgt_organ = 'OG011' then b.item_qty
else 0
end as cnt_mokpo,
case
when b.mgt_organ = 'OG012' then b.item_qty
else 0
end as cnt_buan,
case
when b.mgt_organ = 'OG013' then b.item_qty
else 0
end as cnt_gunsan,
case
when b.mgt_organ = 'OG014' then b.item_qty
else 0
end as cnt_yusu,
case
when b.mgt_organ = 'OG015' then b.item_qty
else 0
end as cnt_wando,
case
when b.mgt_organ = 'OG004' then b.item_qty
else 0
end as cnt_south,
case
when b.mgt_organ = 'OG016' then b.item_qty
else 0
end as cnt_ulsan,
case
when b.mgt_organ = 'OG017' then b.item_qty
else 0
end as cnt_busan,
case
when b.mgt_organ = 'OG018' then b.item_qty
else 0
end as cnt_changwon,
case
when b.mgt_organ = 'OG019' then b.item_qty
else 0
end as cnt_tongyong,
case
when b.mgt_organ = 'OG020' then b.item_qty
else 0
end as cnt_sacheon,
case
when b.mgt_organ = 'OG005' then b.item_qty
else 0
end as cnt_east,
case
when b.mgt_organ = 'OG021' then b.item_qty
else 0
end as cnt_sokcho,
case
when b.mgt_organ = 'OG022' then b.item_qty
else 0
end as cnt_donghe,
case
when b.mgt_organ = 'OG023' then b.item_qty
else 0
end as cnt_ulgin,
case
when b.mgt_organ = 'OG024' then b.item_qty
else 0
end as cnt_pohang,
case
when b.mgt_organ = 'OG006' then b.item_qty
else 0
end as cnt_jeju,
case
when b.mgt_organ = 'OG025' then b.item_qty
else 0
end as cnt_jejuseo,
case
when b.mgt_organ = 'OG026' then b.item_qty
else 0
end as cnt_seoguipo
from (select category_cd,
item_cd,
item_value
from code_mgt
where category_cd in('IT1','IT2','IT3','IT4')
order by category_cd,item_cd asc) a left outer join
(select a.equ_key,
a.version_no,
mgt_organ,
equ_type,
detail_type,
item_qty
from equ_mgt a,
(select equ_key,max(version_no) as lastVer
from equ_mgt group by equ_key) b,
code_mgt cm
where a.equ_key = b.equ_key
and a.version_no = b.lastVer
group by a.equ_key,a.version_no) b on a.item_cd = b.detail_type
order by a.category_cd,a.item_cd asc
) c
group by c.category_cd,c.equ_type,c.item_value,item_cd
order by category_cd,item_cd asc
</select>
</mapper>

View File

@ -1,3 +1,17 @@
$(document).ready(function(){
$(".table_id").each(function(){
var rows = $(".table_id:contains('"+$(this).text()+"')");
if(rows.length > 1){
rows.eq(0).attr("rowspan", rows.length);
rows.not(":eq(0)").remove();
}
})
});
$(document).on('click', '#addEquip', function (){
$.ajax({
url: '/equip/equipEditModal',

View File

@ -61,7 +61,12 @@
<table class="table table-striped">
<thead>
<tr>
<th colspan="5"></th>
<tr>
<th rowspan="2">연번</th>
<th rowspan="2">분류</th>
<th rowspan="2">세부분류</th>
<th rowspan="2">총계</th>
<th rowspan="2">본청</th>
<th colspan="5">중부</th>
<th colspan="7">서해</th>
<th colspan="6">남해</th>
@ -69,15 +74,6 @@
<th colspan="3">제주</th>
</tr>
<tr>
<th>연번</th>
<th>분류</th>
<th>세부분류</th>
<th>총계</th>
<th>본청</th>
<th colspan="25"></th>
</tr>
<tr>
<th colspan="5"></th>
<th></th>
<th>인천서</th>
<th>평택서</th>
@ -106,7 +102,37 @@
</tr>
</thead>
<tbody>
<tr class="">
<tr class="" th:each="equip,index:${equipList}">
<td th:text="${index.index+1}"></td>
<td class="table_id" th:text="${equip.equ_type}"></td>
<td th:text="${equip.item_value}"></td>
<td th:text="${equip.total}"></td>
<td th:text="${equip.cnt_bon}"></td>
<td th:text="${equip.cnt_center}"></td>
<td th:text="${equip.cnt_incheon}"></td>
<td th:text="${equip.cnt_pyeongtaek}"></td>
<td th:text="${equip.cnt_taean}"></td>
<td th:text="${equip.cnt_boryeong}"></td>
<td th:text="${equip.cnt_west}"></td>
<td th:text="${equip.cnt_mokpo}"></td>
<td th:text="${equip.cnt_buan}"></td>
<td th:text="${equip.cnt_gunsan}"></td>
<td th:text="${equip.cnt_yusu}"></td>
<td th:text="${equip.cnt_wando}"></td>
<td th:text="${equip.cnt_south}"></td>
<td th:text="${equip.cnt_ulsan}"></td>
<td th:text="${equip.cnt_busan}"></td>
<td th:text="${equip.cnt_changwon}"></td>
<td th:text="${equip.cnt_tongyong}"></td>
<td th:text="${equip.cnt_sacheon}"></td>
<td th:text="${equip.cnt_east}"></td>
<td th:text="${equip.cnt_sokcho}"></td>
<td th:text="${equip.cnt_donghe}"></td>
<td th:text="${equip.cnt_ulgin}"></td>
<td th:text="${equip.cnt_pohang}"></td>
<td th:text="${equip.cnt_jeju}"></td>
<td th:text="${equip.cnt_jejuseo}"></td>
<td th:text="${equip.cnt_seoguipo}"></td>
</tr>
</tbody>
</table>