feat: mpower 적용 - 거주자 / 장애인
parent
c4a6e4acad
commit
85e212501a
@ -1,8 +1,82 @@
|
||||
package com.xit.biz.ctgy.v2.repository;
|
||||
|
||||
import com.xit.biz.ctgy.dto.JudgeTargetDto;
|
||||
import com.xit.biz.ctgy.entity.MinSimsaUser680Sc;
|
||||
import com.xit.core.config.database.BaseMpowerDaoSupport;
|
||||
import com.xit.core.support.sql.parser.QueryGenerator;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
|
||||
private static final String NAME_SPACE = "residentAndDisabled";
|
||||
|
||||
public int getJudgeStdCnt(@NotNull final Long msMaincode) {
|
||||
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudegStdCount")
|
||||
.setParameter("msMaincode", msMaincode)
|
||||
.getQueryString();
|
||||
return Integer.parseInt(selectOneColumn(sql));
|
||||
}
|
||||
|
||||
public void updateMsResult(@NotNull final Long msMaincode, @NotNull final String msSeq, @NotNull final String msResult) {
|
||||
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudegStdCount")
|
||||
.setParameter("msMaincode", msMaincode)
|
||||
.setParameter("msSeq", msSeq)
|
||||
.setParameter("msResult", msResult)
|
||||
.getQueryString();
|
||||
|
||||
update(sql);
|
||||
}
|
||||
|
||||
public List<JudgeTargetDto> findJudgeTargets(@NotNull final JudgeTargetDto dto) {
|
||||
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudgeTarget")
|
||||
.setParameter("scDatagb", dto.getScDatagb())
|
||||
.setParameter("scSeq1", dto.getScSeq1())
|
||||
.setParameter("scSeq2", dto.getScSeq2())
|
||||
.setParameter("scTransfer", dto.getScTransfer())
|
||||
.getQueryString();
|
||||
final String fieldStrs = "scCode, scSeq, scCarno, scName, scContDoc, scIngb, scCdate, scContDocNm, scIngbNm";
|
||||
return selectList(JudgeTargetDto.class, sql, fieldStrs);
|
||||
}
|
||||
|
||||
public int insertJudgeTargetIntoSelect(@NotNull final JudgeTargetDto dto) {
|
||||
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "insertJudgeTargetIntoSelect")
|
||||
.setParameter("scCode", dto.getScCode())
|
||||
.setParameter("msYear", dto.getMsYear())
|
||||
.setParameter("msChasu", dto.getMsChasu())
|
||||
.setParameter("msSdate", dto.getMsSdate())
|
||||
.setParameter("msStartsi", dto.getMsStartsi())
|
||||
.setParameter("msEdate", dto.getMsEdate())
|
||||
.setParameter("msCdate", dto.getMsCdate())
|
||||
.setParameter("msClosesi", dto.getMsClosesi())
|
||||
.setParameter("msResult", dto.getMsResult())
|
||||
.getQueryString();
|
||||
|
||||
insert(sql);
|
||||
return 1;
|
||||
}
|
||||
|
||||
public void updateTransfer(@NotNull final Long scCode, @NotNull final String scTransfer) {
|
||||
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateTransfer")
|
||||
.setParameter("scCode", scCode)
|
||||
.setParameter("scTransfer", scTransfer)
|
||||
.getQueryString();
|
||||
|
||||
update(sql);
|
||||
}
|
||||
|
||||
public void saveJudgeUsers(@NotNull final List<MinSimsaUser680Sc> list) {
|
||||
for(MinSimsaUser680Sc vo : list) {
|
||||
insert(
|
||||
QueryGenerator.createNamedQuery(NAME_SPACE, "updateTransfer")
|
||||
.setParameter("msuCode", vo.getMsuCode())
|
||||
.setParameter("msuResult", vo.getMsuResult())
|
||||
.setParameter("msuTeam", vo.getMsuTeam())
|
||||
.setParameter("msuUserid", vo.getMsuUserid())
|
||||
.getQueryString()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,52 +1,62 @@
|
||||
package com.xit.biz.ctgy.v2.repository;
|
||||
|
||||
import com.xit.biz.ctgy.dto.MinUserinfoDto;
|
||||
import com.xit.biz.ctgy.entity.MinSimsaUser680Sc;
|
||||
import com.xit.biz.ctgy.entity.MinUserinfo;
|
||||
import com.xit.core.config.database.BaseMpowerDaoSupport;
|
||||
import com.xit.core.support.sql.parser.QueryGenerator;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
@Slf4j
|
||||
public class UserDao extends BaseMpowerDaoSupport {
|
||||
public Optional<MinUserinfoDto> findByUserid(final String userid){
|
||||
String sql = QueryGenerator.createNamedQuery("user", "selectUserInfo")
|
||||
private static final String NAME_SPACE = "user";
|
||||
|
||||
public Optional<MinUserinfoDto> findByUserid(@NotNull final String userid){
|
||||
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectUserInfo")
|
||||
.setParameter("userid", userid)
|
||||
.getQueryString();
|
||||
String fieldsStrs = "userid, passwd, name, regnum, mphone, email, accesstype, team, isenable, gu";
|
||||
final String fieldsStrs = "userid, passwd, name, regnum, mphone, email, accesstype, team, isenable, gu";
|
||||
return Optional.ofNullable(selectOne(MinUserinfoDto.class, sql, fieldsStrs));
|
||||
}
|
||||
|
||||
public String queryGetPasswdEncode(final String passwd){
|
||||
String sql = QueryGenerator.createNamedQuery("user", "selectPasswdEnc")
|
||||
public String queryGetPasswdEncode(@NotNull final String passwd){
|
||||
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectPasswdEnc")
|
||||
.setParameter("passwd", passwd)
|
||||
.getQueryString();
|
||||
return selectOneColumn(sql);
|
||||
}
|
||||
|
||||
//@Query(value = "SELECT ECL_DECRYPT(MU.passwd) AS passwd FROM min_userinfo MU WHERE MU.userid = ?1", nativeQuery = true)
|
||||
public String queryGetPasswd(final String userid){
|
||||
String sql = QueryGenerator.createNamedQuery("user", "selectPasswdDec")
|
||||
public String queryGetPasswd(@NotNull final String userid){
|
||||
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectPasswdDec")
|
||||
.setParameter("userid", userid)
|
||||
.getQueryString();
|
||||
return selectOneColumn(sql);
|
||||
}
|
||||
|
||||
// public MinUserinfo findMinUserinfoByUserid(final String userid){
|
||||
// public MinUserinfo findMinUserinfoByUserid(@NotNull final String userid){
|
||||
// return null;
|
||||
// }
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// 주정차위반 심사대상 등록 - 등록 대상 심사자 조회
|
||||
//-------------------------------------------------------------------------
|
||||
public List<MinUserinfo> findAllByTeamAndIsenableAndAccesstype(String msuTeam, String isenabled, String accesstype){
|
||||
return null;
|
||||
}
|
||||
public List<MinUserinfoDto> findAllByTeamAndIsenableAndAccesstype(@NotNull final String team, @NotNull final String isenabled, @NotNull final String accesstype){
|
||||
String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectAllByTeamAndIsenableAndAccesstype")
|
||||
.setParameter("team", team)
|
||||
.setParameter("isenable", isenabled)
|
||||
.setParameter("accesstype", accesstype)
|
||||
.getQueryString();
|
||||
final String fieldStrs = "userid, accesstype, email, gu, isenable, mphone, passwd, regdate, regnum, team";
|
||||
|
||||
public void save(MinUserinfoDto dto) {
|
||||
return selectList(MinUserinfoDto.class, sql, fieldStrs);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,344 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity-mappings namespace="residentAndDisabled">
|
||||
|
||||
<native-query id="selectParkingList">
|
||||
/* residentAndDisabled-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">
|
||||
/* residentAndDisabled-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="insertJudgeTargetIntoSelect">
|
||||
/* residentAndDisabled-mapper|insertJudgeTargetIntoSelect|julim */
|
||||
INSERT
|
||||
INTO min_simsa680_sc(
|
||||
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,
|
||||
ms_datagb
|
||||
)
|
||||
SELECT sc_code,
|
||||
sc_seq,
|
||||
sc_carnum,
|
||||
#{msYear},
|
||||
#{msChasu},
|
||||
#{msSdate},
|
||||
#{msStartsi},
|
||||
#{msEdate},
|
||||
#{msCdate},
|
||||
#{msClosesi},
|
||||
sc_wdate,
|
||||
sc_dong||''||sc_pos,
|
||||
#{msResult},
|
||||
sc_jbtime,
|
||||
sc_datagb
|
||||
FROM gn_recall_sc
|
||||
WHERE sc_code = #{scCode}
|
||||
AND sc_transfer = '1'
|
||||
AND sc_state = '1'
|
||||
</native-query>
|
||||
|
||||
<native-query id="updateTransfer">
|
||||
/* residentAndDisabled-mapper|updateTransfer|julim */
|
||||
UPDATE gn_recall_sc
|
||||
SET sc_transfer = #{scTransfer}
|
||||
WHERE sc_code = #{scCode}
|
||||
</native-query>
|
||||
|
||||
<native-query id="insertJudgeUser">
|
||||
/* minuserinfo-mapper|insertJudgeUser|julim */
|
||||
INSERT
|
||||
INTO min_simsa_user680_sc (
|
||||
msu_maincode,
|
||||
msu_code,
|
||||
msu_result,
|
||||
msu_team,
|
||||
msu_userid
|
||||
) VALUES (
|
||||
min_simsa_user680_sc_seq.NEXTVAL,
|
||||
#{msuCode}
|
||||
#{msuResult},
|
||||
#{msuTeam},
|
||||
#{msuUserid},
|
||||
)
|
||||
</native-query>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<native-query id="selectTotParkingJudgeResultGroupByTeamAndChasu">
|
||||
/* residentAndDisabled-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">
|
||||
/* residentAndDisabled-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">
|
||||
/* residentAndDisabled-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">
|
||||
/* residentAndDisabled-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">
|
||||
/* residentAndDisabled-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="selectJudegStdCount">
|
||||
/* residentAndDisabled-mapper|selectJudegStdCount|julim */
|
||||
SELECT count(msu_code)
|
||||
FROM min_simsa_user680_sc
|
||||
WHERE ms_maincode = #{msuMaincode}
|
||||
AND msu_result= '2'
|
||||
</native-query>
|
||||
|
||||
<native-query id="updateJudegResult">
|
||||
/* residentAndDisabled-mapper|updateJudegResult|julim */
|
||||
UPDATE min_simsa680_sc
|
||||
SET ms_result = #{msResult}
|
||||
WHERE ms_maincode = #{msMaincode}
|
||||
AND ms_seq = #{msSeq}
|
||||
</native-query>
|
||||
|
||||
<native-query id="selectJudgeTarget">
|
||||
/* parking-mapper|selectJudgeTarget|julim */
|
||||
SELECT GRC.sc_code,
|
||||
GRC.sc_seq,
|
||||
GRC.sc_carno,
|
||||
GRC.sc_name,
|
||||
GRC.sc_cont_doc,
|
||||
GRC.sc_ingb,
|
||||
GRC.sc_cdate,
|
||||
(SELECT code_nm
|
||||
FROM tb_cmm_code_s
|
||||
WHERE GRC.rc_cont_doc = code_cd
|
||||
AND code_grp_id = 'TRAFFIC'
|
||||
AND code_lcd = 'GANGNAM_SIMSA'
|
||||
AND code_mcd = 'RC_CONT_DOC') as rcContDocNm,
|
||||
(SELECT code_nm
|
||||
FROM tb_cmm_code_s
|
||||
WHERE GRC.rc_ingb = code_cd
|
||||
AND code_grp_id = 'TRAFFIC'
|
||||
AND code_lcd = 'GANGNAM_SIMSA'
|
||||
AND code_mcd = 'RC_INGB') as rcIngbNm,
|
||||
FROM gn_recall_sc GRC
|
||||
WHERE GRC.sc_datagb = #{scDatagb}
|
||||
AND GRC.sc_state = '1'
|
||||
AND GRC.sc_transfer = #{scTransfer}
|
||||
AND GRC.sc_seq >= #{scSeq1}
|
||||
AND GRC.sc_seq <= #{scSeq2}
|
||||
ORDER BY GRC.sc_seq
|
||||
</native-query>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<native-query id="selectDashboardJudgeList">
|
||||
/* residentAndDisabled-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