2023-10-23 17:54:51 +08:00
<?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.ruoyi.wisdomarbitrate.mapper.CaseEvidenceDirectoryMapper" >
<resultMap type= "CaseEvidenceDirectory" id= "CaseEvidenceDirectoryResult" >
<id property= "id" column= "id" />
<result property= "parentId" column= "parent_id" />
<result property= "evidenceName" column= "evidence_name" />
2023-10-24 10:36:41 +08:00
<result property= "annexId" column= "annex_id" />
2023-10-23 17:54:51 +08:00
<result property= "series" column= "series" />
2023-10-24 10:36:41 +08:00
<result property= "caseId" column= "case_appli_id" />
<result property= "createTime" column= "create_time" />
<result property= "updateTime" column= "update_time" />
<result property= "createBy" column= "create_by" />
<result property= "updateBy" column= "update_by" />
2023-10-25 16:56:37 +08:00
<result property= "annexName" column= "annex_name" />
<result property= "annexPath" column= "annex_path" />
2023-10-23 17:54:51 +08:00
</resultMap>
2023-10-24 10:36:41 +08:00
<insert id= "save" parameterType= "CaseEvidenceDirectory" useGeneratedKeys= "true" keyProperty= "id" >
insert into case_evidence_directory(
<if test= "parentId != null " > parent_id,</if>
<if test= "evidenceName != null and evidenceName != ''" > evidence_name,</if>
<if test= "annexId != null " > annex_id,</if>
<if test= "series != null " > series,</if>
<if test= "caseId != null " > case_appli_id,</if>
<if test= "createBy != null and createBy != ''" > create_by,</if>
create_time
)values(
<if test= "parentId != null " > #{parentId},</if>
<if test= "evidenceName != null and evidenceName != ''" > #{evidenceName},</if>
<if test= "annexId != null " > #{annexId},</if>
<if test= "series != null " > #{series},</if>
<if test= "caseId != null " > #{caseId},</if>
<if test= "createBy != null and createBy != ''" > #{createBy},</if>
sysdate()
)
2023-10-23 17:54:51 +08:00
</insert>
2023-10-24 17:23:58 +08:00
<select id= "selectList" parameterType= "CaseEvidenceDirectory" resultMap= "CaseEvidenceDirectoryResult" >
2023-10-25 16:56:37 +08:00
select ced.id,ced.parent_id,ced.evidence_name,ced.annex_id,ced.series,ced.create_time
,ced.update_time,ced.case_appli_id,ced.create_by,ced.update_by,ca.annex_name,ca.annex_path
from case_evidence_directory ced
left join case_attach ca on ced.annex_id = ca.annex_id
<where>
2023-10-23 17:54:51 +08:00
<if test= "id != null " >
2023-10-25 16:56:37 +08:00
AND ced.id = #{id}
2023-10-23 17:54:51 +08:00
</if>
<if test= "parentId != null " >
2023-10-25 16:56:37 +08:00
AND ced.parent_id = #{parentId}
2023-10-23 17:54:51 +08:00
</if>
<if test= "evidenceName != null " >
2023-10-25 16:56:37 +08:00
AND ced.evidence_name = #{evidenceName}
2023-10-23 17:54:51 +08:00
</if>
<if test= "annexId != null " >
2023-10-25 16:56:37 +08:00
AND ced.annex_id = #{annexId}
2023-10-23 17:54:51 +08:00
</if>
<if test= "series != null " >
2023-10-25 16:56:37 +08:00
AND ced.series = #{series}
2023-10-23 17:54:51 +08:00
</if>
2023-10-24 10:36:41 +08:00
<if test= "caseId != null " >
2023-10-25 16:56:37 +08:00
AND ced.case_appli_id = #{caseId}
2023-10-24 10:36:41 +08:00
</if>
2023-10-25 16:56:37 +08:00
order by ced.parent_id
2023-10-23 17:54:51 +08:00
</where>
</select>
<select id= "selectDeptListByEvidenceName" resultType= "INTEGER" >
select ced.id
from case_evidence_directory ced
left join case_attach ca on ced.annex_id = ca.annex_id
where ced.evidence_name = #{evidenceName}
<if test= "deptCheckStrictly" >
and ced.annex_id not in (select ced.parent_id from case_evidence_directory ced inner join case_attach ca on ced.annex_id = ca.annex_id and ced.evidence_name = #{evidenceName})
</if>
order by ced.parent_id
</select>
</mapper>