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

60 lines
3.0 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>
<if test="modelCase.caseNo != null and modelCase.csaeNo != ''">
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>
</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>
<select id="getIndexDetail" resultType="com.supervision.police.dto.IndexDetail">
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">
select mai.name as indexName,
case when mar.atomic_result = '1' then 'true' else 'false' end as indexResult,
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>
</mapper>