feat: 주정차의견진술 - 심의목록, 심의결과 반영
parent
048d6b9d24
commit
c4a6e4acad
@ -1,4 +1,106 @@
|
||||
package com.xit.biz.ctgy.v2.repository;
|
||||
|
||||
public class ParkingDao {
|
||||
import com.xit.biz.ctgy.dto.BoardDto;
|
||||
import com.xit.biz.ctgy.dto.JudgeListDto;
|
||||
import com.xit.biz.ctgy.dto.ParkingTargetDto;
|
||||
import com.xit.core.config.database.BaseMpowerDaoSupport;
|
||||
import com.xit.core.support.sql.parser.QueryGenerator;
|
||||
import com.xit.core.util.ConvertUtils;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Repository
|
||||
public class ParkingDao extends BaseMpowerDaoSupport {
|
||||
|
||||
public Page<JudgeListDto> findParkings(JudgeListDto dto, Pageable pageable) {
|
||||
final String cntSql = QueryGenerator.createNamedQuery("parking", "selectParkingListCnt")
|
||||
.setParameter("msYear", dto.getMsYear())
|
||||
.setParameter("msChasu", dto.getMsChasu())
|
||||
.getQueryString();
|
||||
|
||||
final String listSql = QueryGenerator.createNamedQuery("parking", "selectParkingList")
|
||||
.setParameter("msYear", dto.getMsYear())
|
||||
.setParameter("msChasu", dto.getMsChasu())
|
||||
.setParameter("page", pageable.getPageNumber())
|
||||
.setParameter("size", pageable.getPageSize())
|
||||
.getQueryString();
|
||||
final String fieldStrs = "msYear, msChasu, msSdate, msStartsi, msEdate, msCdate, msClosesi, cnt";
|
||||
|
||||
return selectList(JudgeListDto.class, listSql, cntSql, fieldStrs, pageable);
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> selectParkingJudgeTeamGroupByChasuAndTeamList(JudgeListDto dto) {
|
||||
final String listSql = QueryGenerator.createNamedQuery("parking", "selectTotParkingJudgeResultGroupByTeamAndChasu")
|
||||
.setParameter("msuTeam", dto.getMsuTeam())
|
||||
.setParameter("msChasu", dto.getMsChasu())
|
||||
.setParameter("msSdate", dto.getMsSdate())
|
||||
.setParameter("msEdate", dto.getMsEdate())
|
||||
.getQueryString();
|
||||
final String fieldStrs = "msuTeam, BU, SEO, MIBU, TOT, NAME";
|
||||
|
||||
return selectMapList(listSql, fieldStrs);
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> selectParkingJurgeResultGroupByCarnum(JudgeListDto dto) {
|
||||
final String listSql = QueryGenerator.createNamedQuery("parking", "selectParkingJurgeResultGroupByCarnum")
|
||||
.setParameter("msuTeam", dto.getMsuTeam())
|
||||
.setParameter("msChasu", dto.getMsChasu())
|
||||
.setParameter("msSdate", dto.getMsSdate())
|
||||
.setParameter("msEdate", dto.getMsEdate())
|
||||
.getQueryString();
|
||||
final String fieldsStrs = "msMaincode, msSeq, msCarnum";
|
||||
|
||||
return selectMapList(listSql, fieldsStrs);
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> selectTotParkingJudgeResultGroupByUser(JudgeListDto dto) {
|
||||
final String listSql = QueryGenerator.createNamedQuery("parking", "selectTotParkingJudgeResultGroupByUser")
|
||||
.setParameter("msuTeam", dto.getMsuTeam())
|
||||
.setParameter("msChasu", dto.getMsChasu())
|
||||
.setParameter("msSdate", dto.getMsSdate())
|
||||
.setParameter("msEdate", dto.getMsEdate())
|
||||
.getQueryString();
|
||||
final String fieldStrs = "BU, SEO, MIBU, TOT, NAME";
|
||||
|
||||
return selectMapList(listSql, fieldStrs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<Map<String, Object>> selectParkingJudgeResultList(Map<String, Object> paramMap) {
|
||||
final String listSql = QueryGenerator.createNamedQuery("parking", "selectParkingJudgeResultList")
|
||||
.setParameter("msDatagb", String.valueOf(paramMap.get("msDatagb")))
|
||||
.setParameter("msuTeam", String.valueOf(paramMap.get("msuTeam")))
|
||||
.setParameter("msChasu", Long.parseLong(String.valueOf(paramMap.get("msChasu"))))
|
||||
.setParameter("msSdate", (LocalDate)paramMap.get("msSdate"))
|
||||
.setParameter("msEdate", (LocalDate) paramMap.get("msEdate"))
|
||||
.setParameter("seqList", (List)paramMap.get("seqList"))
|
||||
.setParameter("carnumList", (List)paramMap.get("carnumList"))
|
||||
.getQueryString();
|
||||
final String fieldsStrs = "msMaincode, msSeq, msCarnum, NAME, msResult, msResultNm, msuResult";
|
||||
|
||||
return selectMapList(listSql, fieldsStrs);
|
||||
}
|
||||
|
||||
// public List<ParkingTargetDto> findParkingJudgeTargets(ParkingTargetDto dto) {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// public List<Long> findAllMsMaincode(Long msChasu, LocalDate msSdate, LocalDate msEdate) {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// public void deleteById(Long msMaincode) {
|
||||
// }
|
||||
//
|
||||
// public List<JudgeListDto> findByUserJudges() {
|
||||
// return null;
|
||||
// }
|
||||
}
|
||||
|
@ -1,4 +1,8 @@
|
||||
package com.xit.biz.ctgy.v2.repository;
|
||||
|
||||
public class ResidentAndDisabledDao {
|
||||
import com.xit.core.config.database.BaseMpowerDaoSupport;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
|
||||
}
|
||||
|
@ -0,0 +1,237 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity-mappings namespace="parking">
|
||||
|
||||
<native-query id="selectParkingList">
|
||||
/* parking-mapper|selectParkingList|julim */
|
||||
SELECT ms_year,
|
||||
ms_chasu,
|
||||
ms_sdate,
|
||||
ms_startsi,
|
||||
ms_edate,
|
||||
ms_cdate,
|
||||
ms_closesi,
|
||||
cnt
|
||||
FROM (
|
||||
SELECT R.*, ROWNUM rn
|
||||
FROM (
|
||||
SELECT ms_year,
|
||||
ms_chasu,
|
||||
ms_sdate,
|
||||
ms_startsi,
|
||||
ms_edate,
|
||||
ms_cdate,
|
||||
ms_closesi,
|
||||
count(ms_maincode) AS cnt
|
||||
FROM min_simsa680
|
||||
WHERE ms_year = #{msYear}
|
||||
<if test="msChasu != null and msChasu != ''">
|
||||
AND ms_chasu = #{msChasu}
|
||||
</if>
|
||||
GROUP BY ms_year, ms_chasu, ms_sdate, ms_startsi, ms_edate, ms_cdate, ms_closesi
|
||||
ORDER BY ms_year DESC, ms_chasu DESC
|
||||
) R
|
||||
WHERE ROWNUM <= (#{page} + 1) * #{size}
|
||||
)
|
||||
WHERE rn > #{page} * #{size}
|
||||
AND ROWNUM <= #{size}
|
||||
</native-query>
|
||||
|
||||
<native-query id="selectParkingListCnt">
|
||||
/* parking-mapper|selectParkingListCnt|julim */
|
||||
SELECT count(*) AS totalCount
|
||||
FROM (
|
||||
SELECT ms_year
|
||||
FROM min_simsa680
|
||||
WHERE ms_year = #{msYear}
|
||||
<if test="msChasu != null and msChasu != ''">
|
||||
AND ms_chasu = #{msChasu}
|
||||
</if>
|
||||
GROUP BY ms_year, ms_chasu, ms_sdate, ms_startsi, ms_edate, ms_cdate, ms_closesi
|
||||
)
|
||||
</native-query>
|
||||
|
||||
|
||||
<native-query id="insertParkingJudgeTargetIntoSelect">
|
||||
/* parking-mapper|insertParkingJudgeTargetIntoSelect|julim */
|
||||
insert
|
||||
into min_simsa680(
|
||||
ms_maincode,
|
||||
ms_seq,
|
||||
ms_carnum,
|
||||
ms_year,
|
||||
ms_chasu,
|
||||
ms_sdate,
|
||||
ms_startsi,
|
||||
ms_edate,
|
||||
ms_cdate,
|
||||
ms_closesi,
|
||||
ms_wdate,
|
||||
ms_pos,
|
||||
ms_result,
|
||||
ms_jbtime
|
||||
) select TR.rc_code,
|
||||
TR.rc_seq,
|
||||
TM.mm_ocarno,
|
||||
#{msYear},
|
||||
#{msChasu},
|
||||
#{msSdate},
|
||||
#{msStartsi},
|
||||
#{msEdate},
|
||||
#{msCdate},
|
||||
#{msClosesi},
|
||||
TM.mm_wdate,
|
||||
TD.do_bname||''||TJ.mj_pos,
|
||||
#{msResult},
|
||||
TJ.mj_jbtime
|
||||
from tf680_recall TR
|
||||
join tf680_main TM on TR.rc_code = #{rcCode}
|
||||
and TM.mm_code = TR.rc_maincode
|
||||
and TR.rc_ir_transfer = '1'
|
||||
and TR.rc_state = '0'
|
||||
join tf680_jucha TJ on TM.mm_code = TJ.mj_code
|
||||
join tf680_dong TD
|
||||
on TJ.mj_dong = TD.do_code
|
||||
</native-query>
|
||||
|
||||
<native-query id="selectTotParkingJudgeResultGroupByTeamAndChasu">
|
||||
/* parking-mapper|selectTotParkingJudgeResultGroupByTeamAndChasu|julim */
|
||||
SELECT msu_team AS msuTeam
|
||||
, NVL(SUM(DECODE(MS.ms_result, '2', 1, 0)), 0) bu
|
||||
, 0 as seo
|
||||
, NVL(SUM(DECODE(MS.ms_result, '1', 1, 0)), 0) mibu
|
||||
, NVL(SUM(DECODE(MS.ms_result, '1', 1, '2', 1, 0)), 0) tot
|
||||
, '결과' as name
|
||||
FROM min_simsa680 MS
|
||||
, msu680_view MV
|
||||
WHERE MS.ms_maincode = MV.msu_maincode
|
||||
<if test="msuTeam != null and msuTeam != ''">
|
||||
AND MV.msu_team = #{msuTeam}
|
||||
</if>
|
||||
AND MS.ms_chasu = #{msChasu}
|
||||
AND MS.ms_sdate = #{msSdate}
|
||||
AND MS.ms_edate = #{msEdate}
|
||||
GROUP BY MV.msu_team, MS.ms_chasu
|
||||
</native-query>
|
||||
|
||||
<native-query id="selectParkingJudgeTeamGroupByChasuAndTeamList">
|
||||
/* parking-mapper|selectParkingJudgeTeamGroupByChasuAndTeamList|julim */
|
||||
SELECT MV.msu_team AS msuTeam
|
||||
, NVL(SUM(DECODE(MS.ms_result, '2', 1, 0)), 0) bu
|
||||
, 0 as seo
|
||||
, NVL(SUM(DECODE(MS.ms_result, '1', 1, 0)), 0) mibu
|
||||
, NVL(SUM(DECODE(MS.ms_result, '1', 1, '2', 1, 0)), 0) tot
|
||||
, '결과' as name
|
||||
FROM min_simsa680 MS
|
||||
, msu680_view MV
|
||||
WHERE MS.ms_maincode = MV.msu_maincode
|
||||
<if test='msuTeam != null and msuTeam != ""'>
|
||||
AND MV.msu_team = #{msuTeam}
|
||||
</if>
|
||||
AND MS.ms_chasu = #{msChasu}
|
||||
AND MS.ms_sdate = #{msSdate}
|
||||
AND MS.ms_edate = #{msEdate}
|
||||
GROUP BY MS.ms_chasu, MV.msu_team
|
||||
ORDER BY MS.ms_chasu, MV.msu_team
|
||||
</native-query>
|
||||
|
||||
<native-query id="selectTotParkingJudgeResultGroupByUser">
|
||||
/* parking-mapper|selectTotParkingJudgeResultByUser|julim */
|
||||
SELECT SUM(DECODE(MSU_RESULT, '2', 1, 0)) as bu
|
||||
, 0 as seo
|
||||
, SUM(DECODE(MSU_RESULT, '1', 1, 0)) as mibu
|
||||
, SUM(DECODE(MSU_RESULT, '1', 1, '2', 1, 0)) as tot
|
||||
, MU.name
|
||||
FROM min_simsa680 MS
|
||||
, min_simsa_user680 MSU
|
||||
, min_userinfo MU
|
||||
WHERE MS.ms_maincode = MSU.msu_maincode
|
||||
AND MS.ms_chasu = #{msChasu}
|
||||
AND MS.ms_sdate = #{msSdate}
|
||||
AND MS.ms_edate = #{msEdate}
|
||||
AND MSU.msu_userid = MU.userid
|
||||
<if test="msuTeam != null and msuTeam != ''">
|
||||
AND MSU.msu_team = #{msuTeam}
|
||||
</if>
|
||||
GROUP BY MSU.msu_userid, MU.name
|
||||
ORDER BY MSU.msu_userid, MU.name
|
||||
</native-query>
|
||||
|
||||
<native-query id="selectParkingJurgeResultGroupByCarnum">
|
||||
/* parking-mapper|selectParkingJurgeResultGroupByCarnum|julim */
|
||||
SELECT MS.ms_maincode AS msMaincode
|
||||
, MS.ms_seq AS msSeq
|
||||
, MS.ms_carnum AS msCarnum
|
||||
FROM min_simsa680 MS
|
||||
, min_simsa_user680 MSU
|
||||
WHERE MS.ms_maincode = MSU.msu_maincode
|
||||
AND MS.ms_chasu = #{msChasu}
|
||||
AND MS.ms_sdate = #{msSdate}
|
||||
AND MS.ms_edate = #{msEdate}
|
||||
<if test="msuTeam != null and msuTeam != ''">
|
||||
AND MSU.msu_team = #{msuTeam}
|
||||
</if>
|
||||
GROUP BY MS.ms_maincode, MS.ms_seq, MS.ms_carnum
|
||||
ORDER BY MS.ms_maincode, MS.ms_seq, MS.ms_carnum
|
||||
</native-query>
|
||||
|
||||
<native-query id="selectParkingJudgeResultList">
|
||||
/* parking-mapper|selectParkingJudgeResultList|julim */
|
||||
SELECT MS.ms_maincode AS msMaincode
|
||||
, MS.ms_seq AS msSeq
|
||||
, MS.ms_carnum AS msCarnum
|
||||
, MU.name
|
||||
, MS.ms_result AS msResult
|
||||
, (SELECT code_nm
|
||||
FROM tb_cmm_code_s
|
||||
WHERE code_grp_id = 'TRAFFIC'
|
||||
AND code_lcd = 'GANGNAM_SIMSA'
|
||||
AND code_mcd = 'RESULT'
|
||||
AND code_cd = MS.ms_result) as msResultNm
|
||||
, (SELECT code_nm
|
||||
FROM tb_cmm_code_s
|
||||
WHERE code_grp_id = 'TRAFFIC'
|
||||
AND code_lcd = 'GANGNAM_SIMSA'
|
||||
AND code_mcd = 'RESULT'
|
||||
AND code_cd = MSU.msu_result) as msuResult
|
||||
FROM min_simsa680 MS
|
||||
, min_simsa_user680 MSU
|
||||
, min_userinfo MU
|
||||
WHERE MS.ms_maincode = MSU.msu_maincode
|
||||
AND MS.ms_chasu = #{msChasu}
|
||||
AND MS.ms_sdate = #{msSdate}
|
||||
AND MS.ms_edate = #{msEdate}
|
||||
AND MS.ms_seq in #{seqList}
|
||||
AND MS.ms_carnum in #{carnumList}
|
||||
<if test="msuTeam != null and msuTeam != ''">
|
||||
AND MSU.msu_team = #{msuTeam}
|
||||
</if>
|
||||
AND MSU.msu_userid = MU.userid
|
||||
ORDER BY MSU.msu_userid, MU.name, MS.ms_maincode, MS.ms_seq, MS.ms_carnum
|
||||
</native-query>
|
||||
|
||||
|
||||
<native-query id="selectDashboardJudgeList">
|
||||
/* parking-mapper|selectDashboardJudgeList|julim */
|
||||
SELECT MS.ms_edate
|
||||
, MSU.msu_team
|
||||
, MU.name
|
||||
, SUM(DECODE(MSU.msu_result, 0, 0, 1)) jcnt
|
||||
, COUNT(*) tcnt
|
||||
FROM min_simsa680 MS
|
||||
, min_simsa_user680 MSU
|
||||
, min_userinfo MU
|
||||
, (SELECT *
|
||||
FROM (SELECT ms_edate
|
||||
FROM min_simsa680
|
||||
WHERE MS_RESULT = '0'
|
||||
ORDER BY ms_edate DESC)
|
||||
WHERE ROWNUM = 1) T
|
||||
WHERE MS.ms_maincode = MSU.msu_maincode
|
||||
AND MS.ms_result = '0'
|
||||
AND MSU.msu_userid = MU.userid
|
||||
AND MS.ms_edate = T.ms_edate
|
||||
GROUP BY MS.ms_edate, MSU.msu_team, MU.name
|
||||
ORDER BY MSU.msu_team, MU.name
|
||||
</native-query>
|
||||
|
||||
</entity-mappings>
|
Loading…
Reference in New Issue