调解系统后端服务

MsCaseAttachMapper.xml 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. <delete id="deleteCaseAttachByCasedIdAndType">
  61. delete from ms_case_attach
  62. where case_appli_id = #{caseAppliId}
  63. <if test="annexType != null ">
  64. and annex_type = #{annexType}
  65. </if>
  66. </delete>
  67. <delete id="batchDelete">
  68. delete from ms_case_attach
  69. where case_appli_id in
  70. <foreach collection="ids" item="id" open="(" separator="," close=")">
  71. #{id}
  72. </foreach>
  73. </delete>
  74. <select id="queryCaseAttachList" resultMap="CaseAttachResult">
  75. select *
  76. from ms_case_attach
  77. <where>
  78. <if test="id != null ">
  79. AND case_appli_id = #{id}
  80. </if>
  81. <if test="annexType != null ">
  82. AND annex_type = #{annexType}
  83. </if>
  84. <if test="annexTypeList != null and annexTypeList.size() > 0">
  85. and annex_type in
  86. <foreach item="annexType" collection="annexTypeList" open="(" separator="," close=")">
  87. #{annexType}
  88. </foreach>
  89. </if>
  90. </where>
  91. </select>
  92. <select id="queryAnnexById" resultMap="CaseAttachResult">
  93. select *
  94. from ms_case_attach
  95. <where>
  96. <if test="annexId != null ">
  97. AND annex_id = #{annexId}
  98. </if>
  99. </where>
  100. </select>
  101. <select id="countByfileName" resultType="java.lang.Integer">
  102. select count(1) from ms_case_attach where case_appli_id=#{caseAppliId} and annex_name=#{annexName}
  103. </select>
  104. <update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach">
  105. update ms_case_attach
  106. set
  107. <if test="otherSysFileId != null and otherSysFileId != ''"> other_sys_file_id=#{otherSysFileId},</if>
  108. case_appli_id= #{caseAppliId}
  109. where annex_id = #{annexId}
  110. </update>
  111. <update id="batchUpdate">
  112. <foreach collection="list" item="item" >
  113. update ms_case_attach
  114. set
  115. case_appli_id= #{item.caseAppliId}
  116. where annex_id = #{item.annexId};
  117. </foreach>
  118. </update>
  119. <update id="updateCaseAttachBycaseid" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" >
  120. update ms_case_attach
  121. <set>
  122. <if test="annexName != null and annexName != ''">annex_name = #{annexName},</if>
  123. <if test="otherSysFileId != null and otherSysFileId != ''"> other_sys_file_id=#{otherSysFileId},</if>
  124. <if test="annexPath != null and annexPath != ''">annex_path = #{annexPath}</if>
  125. </set>
  126. <where>
  127. <if test="caseAppliId != null ">
  128. AND case_appli_id = #{caseAppliId}
  129. </if>
  130. <if test="annexType != null ">
  131. AND annex_type = #{annexType}
  132. </if>
  133. </where>
  134. </update>
  135. </mapper>