단속조별 통계 수정

main
이범준 1 year ago
parent bc3105ac5a
commit 4761765b12

@ -18,26 +18,12 @@ public class CodeConverter {
List<DataObject> deptList = new ArrayList<DataObject>(); List<DataObject> deptList = new ArrayList<DataObject>();
List<DataObject> vltnList = new ArrayList<DataObject>(); List<DataObject> vltnList = new ArrayList<DataObject>();
List<DataObject> userList = new ArrayList<DataObject>(); List<DataObject> userList = new ArrayList<DataObject>();
List<DataObject> teamList = new ArrayList<DataObject>();
public CodeConverter(Map<String, List<CommonCode>> commonCodes){ public CodeConverter(Map<String, List<CommonCode>> commonCodes){
this.commonCodes = commonCodes; this.commonCodes = commonCodes;
} }
public void putSgg(DataObject dataobject){
this.sggList.add(dataobject);
}
public void putDept(DataObject dataobject){
this.deptList.add(dataobject);
}
public void putVltn(DataObject dataobject){
this.vltnList.add(dataobject);
}
public void putUser(DataObject dataobject){
this.userList.add(dataobject);
}
/** . /** .
* @param codeGroupName , value * @param codeGroupName , value
@ -124,65 +110,54 @@ public class CodeConverter {
return result; return result;
} }
/** ID . public void putOtherCode(String type, DataObject dataobject){
* @param vltnId ID switch(type) {
* @return case "SGG_CD" :
*/ this.sggList.add(dataobject);
public String vltnIdToValue(String vltnId){ break;
String result = ""; case "DEPT_CD" :
this.deptList.add(dataobject);
for(int i = 0; i < vltnList.size(); i++) { break;
if(vltnId.equals(vltnList.get(i).string("VLTN_ID"))) { case "VLTN_ID" :
result = vltnList.get(i).string("VLTN_NM"); this.vltnList.add(dataobject);
} break;
case "USER_ID" :
this.userList.add(dataobject);
break;
case "TEAM_ID" :
this.teamList.add(dataobject);
break;
} }
return result;
} }
/** . public String uniqOtherCodeToValue(String type, String uniqId) {
* @param sggCd
* @return
*/
public String sggCodeToValue(String sggCd){
String result = ""; String result = "";
for(int i = 0; i < sggList.size(); i++) { List<DataObject> otherCodeList = null;
if(sggCd.equals(sggList.get(i).string("SGG_CD"))) { switch(type) {
result = sggList.get(i).string("SGG_NM"); case "SGG_CD" :
} otherCodeList = this.sggList;
break;
case "DEPT_CD" :
otherCodeList = this.deptList;
break;
case "VLTN_ID" :
otherCodeList = this.vltnList;
break;
case "USER_ID" :
otherCodeList = this.userList;
break;
case "TEAM_ID" :
otherCodeList = this.teamList;
break;
} }
if(otherCodeList == null) {
return result; return result;
}
/** .
* @param deptCd
* @return
*/
public String deptCodeToValue(String deptCd){
String result = "";
for(int i = 0; i < deptList.size(); i++) {
if(deptCd.equals(deptList.get(i).string("DEPT_CD"))) {
result = deptList.get(i).string("DEPT_NM");
}
} }
return result; for(int i = 0; i < otherCodeList.size(); i++) {
} if(uniqId.equals(otherCodeList.get(i).string(type))) {
result = otherCodeList.get(i).string("NAME");
/** ID .
* @param userId ID
* @return
*/
public String userIdToUserName(String userId){
String result = "";
for(int i = 0; i < userList.size(); i++) {
if(userId.equals(userList.get(i).string("USER_ID"))) {
result = userList.get(i).string("USER_NM");
} }
} }

@ -16,4 +16,6 @@ public interface StatMapper extends AbstractMapper {
DataObject selectUserById(String userId); DataObject selectUserById(String userId);
DataObject selectTeamById(String teamId);
} }

@ -402,52 +402,19 @@ public class StatBean extends AbstractComponent {
} }
itemName = codeConverter.vltnCdToValue(taskSeCd, compositeItemId[i]); itemName = codeConverter.vltnCdToValue(taskSeCd, compositeItemId[i]);
} else if(dtlCtgr.equals("VLTN_ID")) {
String find = codeConverter.vltnIdToValue(compositeItemId[i]);
if(!find.equals("")) {
itemName = find;
} else {
DataObject findRow = statMapper.selectVltnById(compositeItemId[i]);
if(findRow != null){ } else if(dtlCtgr.equals("VLTN_ID") || dtlCtgr.equals("TEAM_ID")
itemName = findRow.string("VLTN_NM"); || dtlCtgr.equals("SGG_CD") || dtlCtgr.equals("DEPT_CD") || dtlCtgr.equals("USER_ID")) {
codeConverter.putVltn(findRow);
}
}
} else if(dtlCtgr.equals("SGG_CD")) {
String find = codeConverter.sggCodeToValue(compositeItemId[i]);
if(!find.equals("")) {
itemName = find;
} else {
DataObject findRow = statMapper.selectSggByCode(compositeItemId[i]);
if(findRow != null){
itemName = findRow.string("SGG_NM");
codeConverter.putSgg(findRow);
}
}
} else if(dtlCtgr.equals("DEPT_CD")) {
String find = codeConverter.deptCodeToValue(compositeItemId[i]);
if(!find.equals("")) {
itemName = find;
} else {
DataObject findRow = statMapper.selectDeptByCode(compositeItemId[i]);
if(findRow != null){ String find = codeConverter.uniqOtherCodeToValue(dtlCtgr,compositeItemId[i]);
itemName = findRow.string("DEPT_NM");
codeConverter.putDept(findRow);
}
}
} else if(dtlCtgr.equals("USER_ID")) {
String find = codeConverter.userIdToUserName(compositeItemId[i]);
if(!find.equals("")) { if(!find.equals("")) {
itemName = find; itemName = find;
} else { } else {
DataObject findRow = statMapper.selectUserById(compositeItemId[i]); DataObject findRow = this.selectOtherCode(dtlCtgr, compositeItemId[i]);
if(findRow != null){ if(findRow != null){
itemName = findRow.string("USER_NM"); itemName = findRow.string("NAME");
codeConverter.putUser(findRow); codeConverter.putOtherCode(dtlCtgr, findRow);
} }
} }
} }
@ -455,9 +422,6 @@ public class StatBean extends AbstractComponent {
} }
compositeItemName[i] = itemName; compositeItemName[i] = itemName;
} }
statItem.setItemName(compositeItemName); statItem.setItemName(compositeItemName);
@ -505,6 +469,30 @@ public class StatBean extends AbstractComponent {
} }
public DataObject selectOtherCode(String type, String uniqId) {
DataObject result = null;
switch(type) {
case "SGG_CD" :
result = statMapper.selectSggByCode(uniqId);
break;
case "DEPT_CD" :
result = statMapper.selectDeptByCode(uniqId);
break;
case "VLTN_ID" :
result = statMapper.selectVltnById(uniqId);
break;
case "USER_ID" :
result = statMapper.selectUserById(uniqId);
break;
case "TEAM_ID" :
result = statMapper.selectTeamById(uniqId);
break;
}
return result;
}
/** . /** .
* @param stat * @param stat
* @return * @return

@ -4,30 +4,37 @@
<select id="selectVltnById" parameterType="string" resultType="dataobject"> <select id="selectVltnById" parameterType="string" resultType="dataobject">
SELECT VLTN_ID SELECT VLTN_ID
, VLTN_NM , VLTN_NM AS NAME
FROM TB_VLTN_INFO FROM TB_VLTN_INFO
WHERE VLTN_ID = #{vltnId} WHERE VLTN_ID = #{vltnId}
</select> </select>
<select id="selectSggByCode" parameterType="string" resultType="dataobject"> <select id="selectSggByCode" parameterType="string" resultType="dataobject">
SELECT SGG_CD SELECT SGG_CD
, SGG_NM , SGG_NM AS NAME
FROM TB_SGG_INFO FROM TB_SGG_INFO
WHERE SGG_CD = #{sggCd} WHERE SGG_CD = #{sggCd}
</select> </select>
<select id="selectDeptByCode" parameterType="string" resultType="dataobject"> <select id="selectDeptByCode" parameterType="string" resultType="dataobject">
SELECT DEPT_CD SELECT DEPT_CD
, DEPT_NM , DEPT_NM AS NAME
FROM TB_DEPT_INFO FROM TB_DEPT_INFO
WHERE DEPT_CD = #{deptCd} WHERE DEPT_CD = #{deptCd}
</select> </select>
<select id="selectUserById" parameterType="string" resultType="dataobject"> <select id="selectUserById" parameterType="string" resultType="dataobject">
SELECT USER_ID SELECT USER_ID
, USER_NM , USER_NM AS NAME
FROM TB_USER FROM TB_USER
WHERE USER_ID = #{userId} WHERE USER_ID = #{userId}
</select> </select>
<select id="selectTeamById" parameterType="string" resultType="dataobject">
SELECT TEAM_ID
, TEAM_NM AS NAME
FROM TB_TEAM_INFO
WHERE TEAM_ID = #{teamId}
</select>
</mapper> </mapper>

@ -56,7 +56,7 @@
data-ref-col="TASK_SE_CD" data-ctgr-type="code" data-dtl-ctgr="FIM054" data-ref-col="TASK_SE_CD" data-ctgr-type="code" data-dtl-ctgr="FIM054"
>과태료</option> >과태료</option>
<option value="crdnTeam" <option value="crdnTeam"
data-ref-col="" data-ctgr-type="" data-dtl-ctgr="" data-ref-col="TEAM_ID" data-ctgr-type="otherCode" data-dtl-ctgr="TEAM_ID"
>단속조</option> >단속조</option>
<option value="crdnPlc" <option value="crdnPlc"
data-ref-col="CRDN_PLC" data-ctgr-type="" data-dtl-ctgr="" data-ref-col="CRDN_PLC" data-ctgr-type="" data-dtl-ctgr=""
@ -74,7 +74,7 @@
data-ref-col="CRDN_YMD" data-ctgr-type="date" data-dtl-ctgr="DAY_OF_WEEK" data-ref-col="CRDN_YMD" data-ctgr-type="date" data-dtl-ctgr="DAY_OF_WEEK"
>단속요일</option> >단속요일</option>
<option value="crdnHour" <option value="crdnHour"
data-ref-col="CRDN_TM" data-ctgr-type="date" data-dtl-ctgr="HH" data-ref-col="CRDN_TM" data-ctgr-type="date" data-dtl-ctgr="HH"
>단속시간대</option> >단속시간대</option>
<option value="crdnLine" <option value="crdnLine"
data-ref-col="" data-ctgr-type="" data-dtl-ctgr="" data-ref-col="" data-ctgr-type="" data-dtl-ctgr=""
@ -89,8 +89,8 @@
data-ref-col="CRDN_ROAD_NM" data-ctgr-type="" data-dtl-ctgr="" data-ref-col="CRDN_ROAD_NM" data-ctgr-type="" data-dtl-ctgr=""
>도로명</option> >도로명</option>
<option value="userId" <option value="userId"
data-ref-col="USER_ID" data-ctgr-type="otherCode" data-dtl-ctgr="USER_ID" data-ref-col="RGTR" data-ctgr-type="otherCode" data-dtl-ctgr="USER_ID"
>사용자</option> >자료입력사용자</option>
<option value="crdnSttsCd" <option value="crdnSttsCd"
data-ref-col="CRDN_STTS_CD" data-ctgr-type="code" data-dtl-ctgr="FIM010" data-ref-col="CRDN_STTS_CD" data-ctgr-type="code" data-dtl-ctgr="FIM010"
>처리상태</option> >처리상태</option>

@ -56,7 +56,7 @@
data-ref-col="TASK_SE_CD" data-ctgr-type="code" data-dtl-ctgr="FIM054" data-ref-col="TASK_SE_CD" data-ctgr-type="code" data-dtl-ctgr="FIM054"
>과태료</option> >과태료</option>
<option value="crdnTeam" <option value="crdnTeam"
data-ref-col="" data-ctgr-type="" data-dtl-ctgr="" data-ref-col="TEAM_ID" data-ctgr-type="otherCode" data-dtl-ctgr="TEAM_ID"
>단속조</option> >단속조</option>
<option value="crdnPlc" <option value="crdnPlc"
data-ref-col="CRDN_PLC" data-ctgr-type="" data-dtl-ctgr="" data-ref-col="CRDN_PLC" data-ctgr-type="" data-dtl-ctgr=""
@ -74,23 +74,14 @@
data-ref-col="CRDN_YMD" data-ctgr-type="date" data-dtl-ctgr="DAY_OF_WEEK" data-ref-col="CRDN_YMD" data-ctgr-type="date" data-dtl-ctgr="DAY_OF_WEEK"
>단속요일</option> >단속요일</option>
<option value="crdnHour" <option value="crdnHour"
data-ref-col="CRDN_TM" data-ctgr-type="date" data-dtl-ctgr="HH" data-ref-col="CRDN_TM" data-ctgr-type="date" data-dtl-ctgr="HH"
>단속시간대</option> >단속시간대</option>
<option value="crdnLine"
data-ref-col="" data-ctgr-type="" data-dtl-ctgr=""
>단속노선</option>
<option value="vhrno" <option value="vhrno"
data-ref-col="VHRNO" data-ctgr-type="" data-dtl-ctgr="" data-ref-col="VHRNO" data-ctgr-type="" data-dtl-ctgr=""
>차량번호</option> >차량번호</option>
<option value="crdnStdgNm" <option value="crdnStdgNm"
data-ref-col="CRDN_STDNG_NM" data-ctgr-type="" data-dtl-ctgr="" data-ref-col="CRDN_STDNG_NM" data-ctgr-type="" data-dtl-ctgr=""
>단속동</option> >단속동</option>
<option value="crdnRoadNm"
data-ref-col="CRDN_ROAD_NM" data-ctgr-type="" data-dtl-ctgr=""
>도로명</option>
<option value="userId"
data-ref-col="USER_ID" data-ctgr-type="otherCode" data-dtl-ctgr="USER_ID"
>사용자</option>
<option value="crdnSttsCd" <option value="crdnSttsCd"
data-ref-col="CRDN_STTS_CD" data-ctgr-type="code" data-dtl-ctgr="FIM010" data-ref-col="CRDN_STTS_CD" data-ctgr-type="code" data-dtl-ctgr="FIM010"
>처리상태</option> >처리상태</option>

Loading…
Cancel
Save