143 lines
5.8 KiB
XML
143 lines
5.8 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.mscase.MsCaseAttachMapper">
|
|
<resultMap type="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" id="CaseAttachResult">
|
|
<id property="annexId" column="annex_id" />
|
|
<result property="caseAppliId" column="case_appli_id" />
|
|
<result property="annexName" column="annex_name" />
|
|
<result property="annexPath" column="annex_path" />
|
|
<result property="annexType" column="annex_type" />
|
|
<result property="note" column="note" />
|
|
<result property="sealStatus" column="seal_status" />
|
|
<result property="useId" column="use_id" />
|
|
<result property="useAccount" column="use_account" />
|
|
</resultMap>
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="annexId">
|
|
INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload)
|
|
VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{useId},#{useAccount},#{sealStatus},#{isBatchUpload})
|
|
</insert>
|
|
<insert id="batchSave" useGeneratedKeys="true" keyProperty="annexId">
|
|
INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload)
|
|
VALUES
|
|
<foreach item="item" index="index" collection="list" separator=",">
|
|
|
|
|
|
(#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.useId},#{item.useAccount},#{item.sealStatus},#{item.isBatchUpload})
|
|
</foreach>
|
|
</insert>
|
|
<delete id="deleteByFileIds">
|
|
delete from ms_case_attach
|
|
where annex_id in
|
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
<delete id="deleteByCasedIdAndType">
|
|
delete from ms_case_attach
|
|
where case_appli_id = #{caseAppliId}
|
|
and annex_type = #{annexType}
|
|
<if test="isBatchUpload != null ">
|
|
AND is_batch_upload = #{isBatchUpload}
|
|
</if>
|
|
</delete>
|
|
|
|
<select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
|
|
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
|
|
from ms_case_attach
|
|
where case_appli_id =#{id}
|
|
</select>
|
|
|
|
<select id="listCaseAttachByCaseIdAndType" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
|
|
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
|
|
from ms_case_attach
|
|
<where>
|
|
<if test="caseAppliId != null ">
|
|
AND case_appli_id = #{caseAppliId}
|
|
</if>
|
|
<if test="annexType != null ">
|
|
AND annex_type = #{annexType}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<delete id="deleteCaseAttachByCasedIdAndType">
|
|
delete from ms_case_attach
|
|
where case_appli_id = #{caseAppliId}
|
|
<if test="annexType != null ">
|
|
and annex_type = #{annexType}
|
|
</if>
|
|
</delete>
|
|
<delete id="batchDelete">
|
|
delete from ms_case_attach
|
|
where case_appli_id in
|
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="queryCaseAttachList" resultMap="CaseAttachResult">
|
|
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
|
|
from ms_case_attach
|
|
<where>
|
|
<if test="id != null ">
|
|
AND case_appli_id = #{id}
|
|
</if>
|
|
<if test="annexType != null ">
|
|
AND annex_type = #{annexType}
|
|
</if>
|
|
<if test="annexTypeList != null and annexTypeList.size() > 0">
|
|
and annex_type in
|
|
<foreach item="annexType" collection="annexTypeList" open="(" separator="," close=")">
|
|
#{annexType}
|
|
</foreach>
|
|
</if>
|
|
</where>
|
|
</select>
|
|
<select id="queryAnnexById" resultMap="CaseAttachResult">
|
|
select *
|
|
from ms_case_attach
|
|
<where>
|
|
<if test="annexId != null ">
|
|
AND annex_id = #{annexId}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
<select id="countByfileName" resultType="java.lang.Integer">
|
|
select count(1) from ms_case_attach where case_appli_id=#{caseAppliId} and annex_name=#{annexName}
|
|
</select>
|
|
|
|
<update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach">
|
|
update ms_case_attach
|
|
set
|
|
case_appli_id= #{caseAppliId}
|
|
where annex_id = #{annexId}
|
|
</update>
|
|
<update id="batchUpdate">
|
|
<foreach collection="list" item="item" >
|
|
update ms_case_attach
|
|
set
|
|
case_appli_id= #{item.caseAppliId}
|
|
|
|
where annex_id = #{item.annexId};
|
|
</foreach>
|
|
</update>
|
|
<update id="updateCaseAttachBycaseid" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" >
|
|
update ms_case_attach
|
|
<set>
|
|
<if test="annexName != null and annexName != ''">annex_name = #{annexName},</if>
|
|
<if test="annexPath != null and annexPath != ''">annex_path = #{annexPath}</if>
|
|
</set>
|
|
<where>
|
|
<if test="caseAppliId != null ">
|
|
AND case_appli_id = #{caseAppliId}
|
|
</if>
|
|
<if test="annexType != null ">
|
|
AND annex_type = #{annexType}
|
|
</if>
|
|
</where>
|
|
</update>
|
|
|
|
|
|
</mapper> |