79 lines
3.7 KiB
XML
79 lines
3.7 KiB
XML
<?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" />
|
|
<result property="annexId" column="annex_id" />
|
|
<result property="series" column="series" />
|
|
<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" />
|
|
<result property="annexName" column="annex_name" />
|
|
<result property="annexPath" column="annex_path" />
|
|
</resultMap>
|
|
<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()
|
|
)
|
|
</insert>
|
|
<select id="selectList" parameterType="CaseEvidenceDirectory" resultMap="CaseEvidenceDirectoryResult">
|
|
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>
|
|
<if test="id != null ">
|
|
AND ced.id = #{id}
|
|
</if>
|
|
<if test="parentId != null ">
|
|
AND ced.parent_id = #{parentId}
|
|
</if>
|
|
<if test="evidenceName != null ">
|
|
AND ced.evidence_name = #{evidenceName}
|
|
</if>
|
|
<if test="annexId != null ">
|
|
AND ced.annex_id = #{annexId}
|
|
</if>
|
|
<if test="series != null ">
|
|
AND ced.series = #{series}
|
|
</if>
|
|
<if test="caseId != null ">
|
|
AND ced.case_appli_id = #{caseId}
|
|
</if>
|
|
order by ced.parent_id
|
|
</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> |