专业分类修改

This commit is contained in:
lims1@hunktimes.com
2023-08-06 19:53:01 +08:00
parent 2e9ec5b70a
commit 6b5a4b5d5d

View File

@@ -899,20 +899,21 @@ public class CasesServiceImpl implements ICasesService {
@Override
public List<DictItem> majorTypes() {
List<DictItem> major_type = sysDictionaryDao.findByKey("major_type");
String hql1 = "select major_type from Cases c where c.deleted=false and (c.filePath is not null and c.filePath != '')";
List<Object[]> listByHql = casesDao.findListByHql(hql1);
String hql1 = "select majorType from Cases c where c.deleted=false and (c.filePath is not null and c.filePath != '')";
List<String> listByHql = casesDao.findListByHql(hql1);
List<DictItem> dictItems = new ArrayList<>();
log.debug("--listByHql :{}", listByHql.size());
for (DictItem d : major_type) {
int i = 0;
for (Object[] objs : listByHql) {
String s = (String) objs[0];
if (s.contains(d.getCode())) {
i++;
d.setExplanation("0");
boolean flag = false;
for (String str : listByHql) {
if (str.contains(d.getCode()) && !d.getCode().equals("")) {
d.setExplanation(String.valueOf(Integer.parseInt(d.getExplanation()) + 1));
flag = true;
}
}
d.setExplanation(String.valueOf(i));
dictItems.add(d);
if (flag){
dictItems.add(d);
}
}
/* String hql = "select cm.majorId,count(cm.caseId) from CasesMajorType cm,Cases c where cm.caseId=c.id and c.deleted=false and (c.filePath is not null and c.filePath != '') group by cm.majorId";
List<Object[]> listByHql = casesDao.findListByHql(hql);