|
|
|
@ -68,20 +68,25 @@ public class CaseCategoryServiceImpl extends BaseServiceImpl<CaseCategoryMapper,
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getCaseCategoryByParentId(Long parentId,Integer pageNum,Integer pageSize) {
|
|
|
|
|
CaseCategory findCaseCategory = new CaseCategory();
|
|
|
|
|
// CaseCategory findCaseCategory = new CaseCategory();
|
|
|
|
|
Example example = new Example(CaseCategory.class);
|
|
|
|
|
example.setOrderByClause("update_date_time DESC");
|
|
|
|
|
Example.Criteria criteria = example.createCriteria();
|
|
|
|
|
criteria.andEqualTo("state",Constants.STATE_VALID);
|
|
|
|
|
if (null == parentId){
|
|
|
|
|
CaseCategory findCaseCategory2 = new CaseCategory();
|
|
|
|
|
findCaseCategory2.setLevel(2);
|
|
|
|
|
findCaseCategory2.setState(Constants.STATE_VALID);
|
|
|
|
|
List<CaseCategory> caseCategoryList2 = caseCategoryMapper.select(findCaseCategory2);
|
|
|
|
|
findCaseCategory.setState(Constants.STATE_VALID);
|
|
|
|
|
// findCaseCategory.setState(Constants.STATE_VALID);
|
|
|
|
|
parentId = caseCategoryList2.get(0).getId();
|
|
|
|
|
findCaseCategory.setParentId(parentId);
|
|
|
|
|
// findCaseCategory.setParentId(parentId);
|
|
|
|
|
criteria.andEqualTo("parentId",parentId);
|
|
|
|
|
}else {
|
|
|
|
|
findCaseCategory.setState(Constants.STATE_VALID);
|
|
|
|
|
findCaseCategory.setParentId(parentId);
|
|
|
|
|
// findCaseCategory.setState(Constants.STATE_VALID);
|
|
|
|
|
criteria.andEqualTo("parentId",parentId);
|
|
|
|
|
}
|
|
|
|
|
List<CaseCategory> caseCategoryList = caseCategoryMapper.select(findCaseCategory);
|
|
|
|
|
List<CaseCategory> caseCategoryList = caseCategoryMapper.selectByExample(example);
|
|
|
|
|
JSONObject pageJson = PageUtils.page(caseCategoryList,pageNum,pageSize);
|
|
|
|
|
JSONArray jsonArray = pageJson.getJSONArray("list");
|
|
|
|
|
caseCategoryList = JSONObject.parseArray(JSONObject.toJSONString(jsonArray), CaseCategory.class);
|
|
|
|
|