调解系统后端服务

MsCaseAttachMapper.xml 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper">
  6. <resultMap type="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" id="CaseAttachResult">
  7. <id property="annexId" column="annex_id" />
  8. <result property="caseAppliId" column="case_appli_id" />
  9. <result property="annexName" column="annex_name" />
  10. <result property="annexPath" column="annex_path" />
  11. <result property="annexType" column="annex_type" />
  12. <result property="note" column="note" />
  13. <result property="sealStatus" column="seal_status" />
  14. <result property="useId" column="use_id" />
  15. <result property="useAccount" column="use_account" />
  16. <result property="onlyOfficeFileId" column="only_office_file_id" />
  17. <result property="otherSysFileId" column="other_sys_file_id" />
  18. <result property="suffix" column="suffix" />
  19. </resultMap>
  20. <insert id="save" useGeneratedKeys="true" keyProperty="annexId">
  21. INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,only_office_file_id,suffix)
  22. VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{useId},#{useAccount},#{sealStatus},#{onlyOfficeFileId},#{suffix})
  23. </insert>
  24. <insert id="batchSave" useGeneratedKeys="true" keyProperty="annexId">
  25. INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,only_office_file_id,suffix)
  26. VALUES
  27. <foreach item="item" index="index" collection="list" separator=",">
  28. (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.useId},#{item.useAccount},#{item.sealStatus},#{item.onlyOfficeFileId},#{item.suffix})
  29. </foreach>
  30. </insert>
  31. <delete id="deleteByFileIds">
  32. delete from ms_case_attach
  33. where annex_id in
  34. <foreach collection="ids" item="id" open="(" separator="," close=")">
  35. #{id}
  36. </foreach>
  37. </delete>
  38. <delete id="deleteByCasedIdAndType">
  39. delete from ms_case_attach
  40. where case_appli_id = #{caseAppliId}
  41. and annex_type = #{annexType}
  42. </delete>
  43. <select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
  44. select *
  45. from ms_case_attach
  46. where case_appli_id =#{id}
  47. </select>
  48. <select id="listCaseAttachByCaseIdAndType" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
  49. select *
  50. from ms_case_attach
  51. <where>
  52. <if test="caseAppliId != null ">
  53. AND case_appli_id = #{caseAppliId}
  54. </if>
  55. <if test="annexType != null ">
  56. AND annex_type = #{annexType}
  57. </if>
  58. </where>
  59. </select>
  60. <select id="listCaseAttachByCaseIdAndTypes" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
  61. select *
  62. from ms_case_attach
  63. <where>
  64. <if test="caseAppliId != null ">
  65. AND case_appli_id = #{caseAppliId}
  66. </if>
  67. <if test="annexTypes != null and annexTypes.size()>0 ">
  68. AND annex_type in
  69. <foreach collection="annexTypes" item="annex_type" open="(" separator="," close=")">
  70. #{annex_type}
  71. </foreach>
  72. </if>
  73. </where>
  74. </select>
  75. <delete id="deleteCaseAttachByCasedIdAndType">
  76. delete from ms_case_attach
  77. where case_appli_id = #{caseAppliId}
  78. <if test="annexType != null ">
  79. and annex_type = #{annexType}
  80. </if>
  81. </delete>
  82. <delete id="batchDelete">
  83. delete from ms_case_attach
  84. where case_appli_id in
  85. <foreach collection="ids" item="id" open="(" separator="," close=")">
  86. #{id}
  87. </foreach>
  88. </delete>
  89. <select id="queryCaseAttachList" resultMap="CaseAttachResult">
  90. select *
  91. from ms_case_attach
  92. <where>
  93. <if test="id != null ">
  94. AND case_appli_id = #{id}
  95. </if>
  96. <if test="annexType != null ">
  97. AND annex_type = #{annexType}
  98. </if>
  99. <if test="annexTypeList != null and annexTypeList.size() > 0">
  100. and annex_type in
  101. <foreach item="annexType" collection="annexTypeList" open="(" separator="," close=")">
  102. #{annexType}
  103. </foreach>
  104. </if>
  105. </where>
  106. </select>
  107. <select id="queryAnnexById" resultMap="CaseAttachResult">
  108. select *
  109. from ms_case_attach
  110. <where>
  111. <if test="annexId != null ">
  112. AND annex_id = #{annexId}
  113. </if>
  114. </where>
  115. </select>
  116. <select id="countByfileName" resultType="java.lang.Integer">
  117. select count(1) from ms_case_attach where case_appli_id=#{caseAppliId} and annex_name=#{annexName}
  118. </select>
  119. <update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach">
  120. update ms_case_attach
  121. set
  122. <if test="otherSysFileId != null and otherSysFileId != ''"> other_sys_file_id=#{otherSysFileId},</if>
  123. case_appli_id= #{caseAppliId}
  124. where annex_id = #{annexId}
  125. </update>
  126. <update id="batchUpdate">
  127. <foreach collection="list" item="item" >
  128. update ms_case_attach
  129. set
  130. case_appli_id= #{item.caseAppliId}
  131. where annex_id = #{item.annexId};
  132. </foreach>
  133. </update>
  134. <update id="updateCaseAttachBycaseid" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" >
  135. update ms_case_attach
  136. <set>
  137. <if test="annexName != null and annexName != ''">annex_name = #{annexName},</if>
  138. <if test="otherSysFileId != null and otherSysFileId != ''"> other_sys_file_id=#{otherSysFileId},</if>
  139. <if test="annexPath != null and annexPath != ''">annex_path = #{annexPath}</if>
  140. </set>
  141. <where>
  142. <if test="caseAppliId != null ">
  143. AND case_appli_id = #{caseAppliId}
  144. </if>
  145. <if test="annexType != null ">
  146. AND annex_type = #{annexType}
  147. </if>
  148. </where>
  149. </update>
  150. <select id="selectByIds" resultMap="CaseAttachResult">
  151. select *
  152. from ms_case_attach
  153. where annex_id in
  154. <foreach collection="ids" item="id" open="(" separator="," close=")">
  155. #{id}
  156. </foreach>
  157. </select>
  158. </mapper>