78 lines
3.1 KiB
XML
78 lines
3.1 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.CaseAttachMapper">
|
|
<resultMap type="CaseAttach" 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="userId" column="use_id" />
|
|
<result property="userName" column="use_account" />
|
|
</resultMap>
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="annexId">
|
|
INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account)
|
|
VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName})
|
|
</insert>
|
|
<delete id="deleteByFileIds">
|
|
delete from case_attach
|
|
where annex_id in
|
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
|
|
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
|
|
from case_attach
|
|
where case_appli_id =#{id}
|
|
</select>
|
|
|
|
<select id="queryCaseAttachList" resultMap="CaseAttachResult">
|
|
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
|
|
from 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>
|
|
|
|
<update id="updateCaseAttach" parameterType="CaseAttach">
|
|
update case_attach
|
|
set
|
|
case_appli_id= #{caseAppliId}
|
|
where annex_id = #{annexId}
|
|
</update>
|
|
|
|
<update id="updateCaseAttachBycaseid" parameterType="CaseAttach">
|
|
update 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> |