1. 指标结果查询添加搜索条件:指标分析结果、指标名称、原子指标名称、指标 有/无笔录

topo_dev
xueqingkun 9 months ago
parent 841ff915ac
commit c9cc3b8a3e

@ -1,11 +1,10 @@
package com.supervision.police.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.supervision.common.domain.R;
import com.supervision.police.domain.CasePerson;
import com.supervision.police.domain.ModelCase;
import com.supervision.police.dto.IndexDetail;
import com.supervision.police.dto.IndexResultQuery;
import com.supervision.police.dto.ModelCaseBase;
import com.supervision.police.dto.ModelCaseDTO;
import com.supervision.police.service.ModelCaseService;
@ -126,16 +125,16 @@ public class ModelCaseController {
/**
*
*
* @param caseId
* @param indexType
* @param query
* @param page
* @param size
* @return
*/
@PostMapping("/getIndexDetail")
public R<IPage<IndexDetail>> getIndexDetail(@RequestParam String caseId,
@RequestParam String indexType,
public R<IPage<IndexDetail>> getIndexDetail(@RequestBody IndexResultQuery query,
@RequestParam(required = false, defaultValue = "1") Integer page,
@RequestParam(required = false, defaultValue = "20") Integer size) {
IPage<IndexDetail> indexDetail = modelCaseService.getIndexDetail(caseId, indexType, page, size);
IPage<IndexDetail> indexDetail = modelCaseService.getIndexDetail(query, page, size);
return R.ok(indexDetail);
}

@ -20,4 +20,7 @@ public class DictionaryByTypeParam implements Serializable {
@ApiModelProperty(value = "是否返回树形结构, 1返回, 0不返回, 默认为1")
public Integer isTree = 1;
@ApiModelProperty(value = "字典状态, 0不可用1可用")
private String status;
}

@ -0,0 +1,26 @@
package com.supervision.police.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class IndexResultQuery {
@Schema(description = "案件id")
private String caseId;
@Schema(description = "指标类型")
private String indexType;
@Schema(description = "指标名称")
private String indexName;
@Schema(description = "指标结果 0未评估 1符合 2不符合")
private String indexResult;
@Schema(description = "指标是否有笔录 true:有笔录 false:无笔录")
private Boolean indexHasRecord;
@Schema(description = "原子指标名称")
private String atomicName;
}

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.supervision.police.domain.ModelCase;
import com.supervision.police.dto.AtomicIndexDTO;
import com.supervision.police.dto.IndexDetail;
import com.supervision.police.dto.IndexResultQuery;
import com.supervision.police.vo.ModelCaseVO;
import org.apache.ibatis.annotations.Param;
@ -44,6 +45,9 @@ public interface ModelCaseMapper extends BaseMapper<ModelCase> {
@Param("caseId") String caseId,
@Param("indexType") String indexType);
IPage<IndexDetail> pageListIndexResult(@Param("query") IndexResultQuery query, @Param("page") IPage<IndexDetail> page);
List<AtomicIndexDTO> getAtomicDetail(@Param("caseId") String caseId,
@Param("indexId") String indexId,
@Param("atomicIds") List<String> atomicIds);

@ -6,6 +6,7 @@ import com.supervision.common.domain.R;
import com.supervision.police.domain.CasePerson;
import com.supervision.police.domain.ModelCase;
import com.supervision.police.dto.IndexDetail;
import com.supervision.police.dto.IndexResultQuery;
import com.supervision.police.dto.ModelCaseBase;
import com.supervision.police.dto.ModelCaseDTO;
import com.supervision.police.vo.ModelCaseVO;
@ -46,7 +47,7 @@ public interface ModelCaseService extends IService<ModelCase> {
R<?> uploadCase(MultipartFile file);
IPage<IndexDetail> getIndexDetail(String caseId, String indexType, Integer page, Integer size);
IPage<IndexDetail> getIndexDetail(IndexResultQuery query, Integer page, Integer size);
}

@ -353,10 +353,16 @@ public class ModelCaseServiceImpl extends ServiceImpl<ModelCaseMapper, ModelCase
}
@Override
public IPage<IndexDetail> getIndexDetail(String caseId, String indexType, Integer page, Integer size) {
public IPage<IndexDetail> getIndexDetail(IndexResultQuery query, Integer page, Integer size) {
Assert.notEmpty(query.getCaseId(), "案件id不能为空");
Assert.notEmpty(query.getIndexType(), "指标类型不能为空");
IPage<IndexDetail> iPage = new Page<>(page, size);
iPage = modelCaseMapper.getIndexDetail(iPage, caseId, indexType);
iPage = modelCaseMapper.pageListIndexResult(query,iPage);
List<IndexDetail> records = iPage.getRecords();
// 添加 附属内容
for (IndexDetail record : records) {
String judgeLogic = record.getJudgeLogic();
if (StringUtils.isEmpty(judgeLogic)) {
@ -369,7 +375,7 @@ public class ModelCaseServiceImpl extends ServiceImpl<ModelCaseMapper, ModelCase
// 配置的指标的逻辑
Map<String, String> indexJundgeLogicMap = parseLogicMap(judgeLogic);
List<String> atomicIds = JudgeLogicUtil.pickAtomicIndexIds(judgeLogic);
List<AtomicIndexDTO> atomics = modelCaseMapper.getAtomicDetail(caseId, record.getIndexId(), atomicIds);
List<AtomicIndexDTO> atomics = modelCaseMapper.getAtomicDetail(query.getCaseId(), record.getIndexId(), atomicIds);
for (AtomicIndexDTO atomic : atomics) {
// 需要和原子指标的规则判断是否一致(解决出罪和入罪冲突的问题)
String s = indexJundgeLogicMap.get(atomic.getAtomicIndexId());

@ -85,4 +85,53 @@
and mi.index_type = #{indexType}
order by CASE mir.index_result WHEN 'true' THEN 1 WHEN 'false' THEN 2 else 0 END, mi.id desc
</select>
<select id="pageListIndexResult" resultType="com.supervision.police.dto.IndexDetail">
select mi.id as indexId,
mi.name as indexName,
mi.index_score as score,
mir.index_result,
mir.pre_result as preResult,
mir.atomic_ids,
mi.judge_logic as judgeLogic
from model_index mi
left join model_index_result mir on (mi.id = mir.index_id and mir.case_id = #{query.caseId})
WHERE mi.data_status = '1'
and mi.index_type = #{query.indexType}
<if test="query.indexName != null and query.indexName != ''">
and mi.name like concat('%', #{query.indexName}, '%')
</if>
<choose>
<when test="query.indexResult != null and query.indexResult == 0">
and mir.index_result is null
</when>
<when test="query.indexResult != null and query.indexResult == 1">
and mir.index_result = 'true'
</when>
<when test="query.indexResult != null and query.indexResult == 2">
and mir.index_result = 'false'
</when>
</choose>
and exists(select 1
from model_atomic_result mar
left join note_record_split nrs on mar.record_split_id = nrs.id
left join model_atomic_index mai on mar.atomic_id = mai.id
where mar.case_id = #{query.caseId}
<if test="query.atomicName != null and query.atomicName != ''">
and mai.name like concat('%', #{query.atomicName}, '%')
</if>
<choose>
<when test="query.indexHasRecord != null and query.indexHasRecord == false">
and nrs.id is null
</when>
<when test="query.indexHasRecord != null and query.indexHasRecord == true">
and nrs.id is not null
</when>
</choose>
and mi.id = mar.index_id)
order by CASE mir.index_result WHEN 'true' THEN 1 WHEN 'false' THEN 2 else 0 END, mi.id desc
</select>
</mapper>
Loading…
Cancel
Save