단속정보 상세조회 메서드 추가

main
이범준 1 year ago
parent 4b953f9737
commit b14f564283

@ -23,5 +23,14 @@ public interface CrdnMapper extends AbstractMapper {
List<DataObject> getCrdnList(CrdnQuery req); List<DataObject> getCrdnList(CrdnQuery req);
List<DataObject> getCrdns(CrdnQuery req); List<DataObject> getCrdns(CrdnQuery req);
/** .
* @param crdnId
* @return
*/
default DataObject getCrdnInfo(String crdnId) {
List<DataObject> list = getCrdnList(new CrdnQuery().setCrdnId(crdnId));
return !list.isEmpty() ? list.get(0) : null;
}
} }

@ -6,8 +6,18 @@ public class CrdnQuery extends QueryRequest {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String crdnId;
private String schVhrno; private String schVhrno;
public String getCrdnId() {
return ifEmpty(crdnId, () -> null);
}
public <T extends CrdnQuery> T setCrdnId(String crdnId) {
this.crdnId = crdnId;
return self();
}
public String getSchVhrno() { public String getSchVhrno() {
return ifEmpty(schVhrno, () -> null); return ifEmpty(schVhrno, () -> null);
} }
@ -16,5 +26,7 @@ public class CrdnQuery extends QueryRequest {
this.schVhrno = schVhrno; this.schVhrno = schVhrno;
return self(); return self();
} }
} }

@ -20,5 +20,11 @@ public interface CrdnService {
* @return * @return
*/ */
List<DataObject> getCrdnList(CrdnQuery req); List<DataObject> getCrdnList(CrdnQuery req);
/** .
* @param crdnId
* @return
*/
DataObject getCrdnInfo(String crdnId);
} }

@ -29,4 +29,12 @@ public class CrdnBean extends AbstractComponent {
public List<DataObject> getCrdnList(CrdnQuery req) { public List<DataObject> getCrdnList(CrdnQuery req) {
return crdnMapper.getCrdnList(req.setOrderBy("CRDN_ID")); return crdnMapper.getCrdnList(req.setOrderBy("CRDN_ID"));
} }
/** .
* @param crdnId
* @return
*/
public DataObject getCrdnInfo(String crdnId) {
return crdnMapper.getCrdnInfo(crdnId);
}
} }

@ -26,5 +26,10 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
public List<DataObject> getCrdnList(CrdnQuery req) { public List<DataObject> getCrdnList(CrdnQuery req) {
return crdnBean.getCrdnList(req); return crdnBean.getCrdnList(req);
} }
@Override
public DataObject getCrdnInfo(String crdnId) {
return crdnBean.getCrdnInfo(crdnId);
}
} }

@ -32,4 +32,19 @@ public class AbstractCrdnController extends AbstractController {
"crdn" "crdn"
); );
} }
/** .
* @param crdnId
* @return fims/crdn/initData-info
* <pre><code> {
* "crdnInfo": {...}
* }</code></pre>
*/
public ModelAndView getCrdnInfo(String crdnId) {
ModelAndView mav = new ModelAndView("fims/crdn/initData-info");
if (!isEmpty(crdnId)) {
mav.addObject("crdnInfo", crdnService.getCrdnInfo(crdnId));
}
return mav;
}
} }

@ -1,5 +1,8 @@
package cokr.xit.fims.crdn.web; package cokr.xit.fims.crdn.web;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -7,6 +10,8 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.code.service.CodeService;
import cokr.xit.fims.crdn.service.CrdnQuery; import cokr.xit.fims.crdn.service.CrdnQuery;
import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.CrdnService;
import cokr.xit.foundation.web.AbstractController; import cokr.xit.foundation.web.AbstractController;
@ -18,6 +23,9 @@ import cokr.xit.foundation.web.AbstractController;
@Controller @Controller
@RequestMapping(name="단속관리", value="/crdn") @RequestMapping(name="단속관리", value="/crdn")
public class CrdnController extends AbstractCrdnController { public class CrdnController extends AbstractCrdnController {
@Resource(name = "codeService")
private CodeService codeService;
/** . /** .
* @return fims/crdn/initData-main * @return fims/crdn/initData-main
@ -27,9 +35,24 @@ public class CrdnController extends AbstractCrdnController {
ModelAndView mav = new ModelAndView(); ModelAndView mav = new ModelAndView();
mav.setViewName("fims/crdn/initData-main"); mav.setViewName("fims/crdn/initData-main");
mav.addObject("pageSuffix","initData-main"); mav.addObject("pageSuffix","initData-main");
setCommonCodes(mav);
return mav; return mav;
} }
private void setCommonCodes(ModelAndView mav) {
Map<String, List<CommonCode>> byGroups = codeService.getCodesOf(
"FIM001"
, "FIM002"
);
if ("jsonView".equals(mav.getViewName())) {
mav.addAllObjects(byGroups);
} else {
byGroups.forEach((k, v) -> {
mav.addObject(k, toJson(v));
});
}
}
@RequestMapping(name="주정차과태료업무 단속자료 목록", value="/PVS/list.do") @RequestMapping(name="주정차과태료업무 단속자료 목록", value="/PVS/list.do")
public ModelAndView getPvsCrdnList(CrdnQuery req) { public ModelAndView getPvsCrdnList(CrdnQuery req) {
return getCrdnList(req); return getCrdnList(req);
@ -46,5 +69,21 @@ public class CrdnController extends AbstractCrdnController {
public ModelAndView getEcaCrdnList(CrdnQuery req) { public ModelAndView getEcaCrdnList(CrdnQuery req) {
return getCrdnList(req); return getCrdnList(req);
} }
@RequestMapping(name="주정차과태료업무 단속자료 정보", value="/PVS/info.do")
public ModelAndView getPvsCrdnInfo(String crdnId) {
return getCrdnInfo(crdnId);
}
@RequestMapping(name="전용차로과태료업무 단속자료 정보", value="/BPV/info.do")
public ModelAndView getBpvCrdnInfo(String crdnId) {
return getCrdnInfo(crdnId);
}
@RequestMapping(name="장애인과태료업무 단속자료 정보", value="/DPV/info.do")
public ModelAndView getDpvCrdnInfo(String crdnId) {
return getCrdnInfo(crdnId);
}
@RequestMapping(name="전기차과태료업무 단속자료 정보", value="/ECA/info.do")
public ModelAndView getEcaCrdnInfo(String crdnId) {
return getCrdnInfo(crdnId);
}
} }

@ -85,6 +85,7 @@
FROM TB_CRDN A FROM TB_CRDN A
WHERE DEL_YN = 'N' WHERE DEL_YN = 'N'
<if test="term != null">AND A.${by} LIKE CONCAT('%', #{term}, '%')</if> <if test="term != null">AND A.${by} LIKE CONCAT('%', #{term}, '%')</if>
<if test="crdnId != null">AND A.CRDN_ID = #{crdnId}</if>
<if test="schVhrno != null">AND A.VHRNO LIKE CONCAT('%', #{schVhrno}, '%')</if> <if test="schVhrno != null">AND A.VHRNO LIKE CONCAT('%', #{schVhrno}, '%')</if>
<include refid="utility.orderBy" /> <include refid="utility.orderBy" />
<include refid="utility.paging-suffix"/> <include refid="utility.paging-suffix"/>

Loading…
Cancel
Save