TableFileMapper.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="org.springblade.manager.mapper.TableFileMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="tableFileResultMap" type="org.springblade.manager.entity.TableFile">
  6. <result column="id" property="id"/>
  7. <result column="is_deleted" property="isDeleted"/>
  8. <result column="tab_id" property="tabId"/>
  9. <result column="domain_url" property="domainUrl"/>
  10. <result column="name" property="name"/>
  11. <result column="extension" property="extension"/>
  12. <result column="type" property="type"/>
  13. <result column="domain_pdf_url" property="domainPdfUrl"/>
  14. <result column="trial_record_id" property="trialRecordId"/>
  15. </resultMap>
  16. <resultMap id="TableFileVO" type="org.springblade.manager.vo.TableFileVO">
  17. <result column="id" property="id"/>
  18. <result column="is_deleted" property="isDeleted"/>
  19. <result column="tab_id" property="tabId"/>
  20. <result column="domain_url" property="domainUrl"/>
  21. <result column="name" property="name"/>
  22. <result column="extension" property="extension"/>
  23. <result column="type" property="type"/>
  24. <result column="domain_pdf_url" property="domainPdfUrl"/>
  25. <result column="url" property="url"/>
  26. <result column="trial_record_id" property="trialRecordId"/>
  27. </resultMap>
  28. <select id="selectTableFilePage" resultMap="tableFileResultMap">
  29. select * from m_table_file where is_deleted = 0
  30. </select>
  31. <select id="selectTableFileList" resultMap="TableFileVO">
  32. select *,domain_url as url from m_table_file where is_deleted = 0 and type=2 and tab_id = #{pKid}
  33. </select>
  34. <select id="getAllFileByIds" resultType="org.springblade.manager.entity.TableFile">
  35. SELECT mtf.* from m_table_file mtf WHERE is_deleted = 0 and classify = #{classify} and type = 2 and tab_id in
  36. <foreach collection="ids" item="id" open="(" close=")" separator=",">
  37. #{id}
  38. </foreach>
  39. </select>
  40. <delete id="delDataById">
  41. delete from m_table_file where id= #{id}
  42. <if test="recordId != null and recordId != ''">
  43. and trial_record_id = #{recordId}
  44. </if>
  45. </delete>
  46. <select id="selectTableFileListByTen" resultMap="TableFileVO">
  47. select *,domain_url as url from m_table_file where is_deleted = 0 and classify = #{classify} and type in (10,11,12,20,21,22) and tab_id = #{pKid}
  48. </select>
  49. <select id="selectTableFileList1" resultMap="TableFileVO">
  50. select *,domain_url as url from m_table_file where is_deleted = 0 and (type=20 or type=21 or type=22) and tab_id = #{pKid}
  51. </select>
  52. </mapper>