Files
Arbitrate-Backend/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml
T
2023-10-15 10:16:48 +08:00

70 lines
2.9 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>
<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>