Files
Arbitrate-Backend/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachLogMapper.xml
T
2023-11-24 19:22:32 +08:00

101 lines
3.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.CaseAttachLogMapper">
<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" />
<result property="sealStatus" column="seal_status" />
<result property="caseAppliLogId" column="case_appli_log_id" />
</resultMap>
<insert id="save" useGeneratedKeys="true" keyProperty="annexId">
INSERT INTO case_attach_log (case_appli_log_id, annex_id,annex_name, annex_path , annex_type,note,use_id,use_account,seal_status)
VALUES (#{caseAppliLogId},#{annexId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus})
</insert>
<delete id="deleteByFileIds">
delete from case_attach_log
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 *
from case_attach_log
where case_appli_log_id =#{id}
</select>
<select id="getCaseAttachByCaseIdAndType" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
select *
from case_attach_log
<where>
<if test="caseAppliLogId != null ">
AND case_appli_log_id = #{caseAppliLogId}
</if>
<if test="annexType != null ">
AND annex_type = #{annexType}
</if>
</where>
</select>
<select id="queryCaseAttachList" resultMap="CaseAttachResult">
select *
from case_attach_log
<where>
<if test="caseLogId != null ">
AND case_appli_log_id = #{caseLogId}
</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" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
select *
from case_attach_log
<where>
<if test="annexId != null ">
AND annex_id = #{annexId}
</if>
</where>
</select>
<update id="updateCaseAttach" parameterType="CaseAttach">
update case_attach_log
set
case_appli_log_id= #{caseAppliLogId}
where annex_id = #{annexId}
</update>
<update id="updateCaseAttachBycaseid" parameterType="CaseAttach" >
update case_attach_log
<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_log_id = #{caseAppliLogId}
</if>
<if test="annexType != null ">
AND annex_type = #{annexType}
</if>
</where>
</update>
</mapper>