You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fu-hsi-service/src/main/resources/mapper/ModelCaseMapper.xml

69 lines
3.5 KiB
XML

10 months ago
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.supervision.police.mapper.ModelCaseMapper">
<select id="selectAll" resultType="com.supervision.police.domain.ModelCase">
select * from model_case
where data_status = '1'
<if test="modelCase.id != null and modelCase.id != ''">
and id = #{modelCase.id}
</if>
9 months ago
<if test="modelCase.caseNo != null and modelCase.caseNo != ''">
10 months ago
and case_no like concat('%', #{modelCase.caseNo}, '%')
</if>
<if test="modelCase.caseName != null and modelCase.caseName != ''">
and case_name like concat('%', #{modelCase.caseName}, '%')
</if>
<if test="modelCase.caseType != null and modelCase.caseType != null">
and FIND_IN_SET(#{modelCase.caseType}, case_type) > 0
</if>
<if test="modelCase.identifyResult != null and modelCase.identifyResult != ''">
and identify_result = #{modelCase.identifyResult}
</if>
<if test="modelCase.lawActor != null and modelCase.lawActor != ''">
and law_actor like concat('%', #{modelCase.lawActor}, '%')
</if>
<if test="modelCase.lawParty != null and modelCase.lawParty != ''">
and law_party like concat('%', #{modelCase.lawParty}, '%')
</if>
<if test="modelCase.updateStartTime != null">
and DATE_FORMAT(update_time, '%Y-%m-%d') >= DATE_FORMAT(#{modelCase.updateStartTime}, '%Y-%m-%d')
</if>
<if test="modelCase.updateEndTime != null">
and DATE_FORMAT(update_time, '%Y-%m-%d') &lt;= DATE_FORMAT(#{modelCase.updateEndTime}, '%Y-%m-%d')
</if>
9 months ago
order by index_num,update_time desc
10 months ago
</select>
<select id="selectMaxIndex" resultType="java.lang.Integer">
select ifnull(max(index_num), 0)
from model_case
where data_status = '1'
10 months ago
</select>
9 months ago
<select id="getCaseIndexDetail" resultType="com.supervision.police.dto.IndexDetail">
10 months ago
select mi.name as indexName, mi.index_score as score, mir.index_result, mir.atomic_ids
from model_index mi
left join model_index_result mir on mi.id = mir.index_id
WHERE mi.data_status = '1'
and mir.case_id = #{caseId}
and mi.index_type = #{indexType}
10 months ago
</select>
<select id="getAtomicDetail" resultType="com.supervision.police.dto.AtomicIndexDTO">
9 months ago
select mai.id as atomicIndexId,mai.name as indexName,mai.index_source as indexSource,
9 months ago
mar.atomic_result as atomicResult,
concat(nrs.question, nrs.answer) as record
10 months ago
from model_atomic_result mar
left join model_atomic_index mai on mar.atomic_id = mai.id
left join note_record_split nrs on mar.record_split_id = nrs.id
10 months ago
where mar.case_id = #{caseId} and mar.atomic_id in
<foreach collection="atomicIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
9 months ago
<select id="getIndexDetail" resultType="com.supervision.police.dto.IndexDetail">
9 months ago
select 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
9 months ago
from model_index mi
left join model_index_result mir on ( mi.id = mir.index_id and mir.case_id = #{caseId} )
WHERE mi.data_status = '1'
and mi.index_type = #{indexType}
9 months ago
order by mir.index_result desc
9 months ago
</select>
10 months ago
</mapper>