archiveMapper.xml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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="com.gz.mapper.archive.ArchiveMapper">
  4. <select id="searchList" resultType="com.gz.rvo.archive.ArchiveRVO"
  5. parameterType="com.gz.vo.archive.SearchArchiveVO">
  6. SELECT
  7. d.dict_name mj_text,
  8. a.*
  9. FROM `tab_archives` a
  10. LEFT JOIN tab_dict d
  11. ON a.mj = d.dict_code
  12. <where>
  13. a.deleted = 0
  14. <if test="dh != null and dh != ''">
  15. AND a.dh = #{dh}
  16. </if>
  17. <if test="mlh != null and mlh != ''">
  18. AND a.mlh = #{mlh}
  19. </if>
  20. <if test="ml != null and ml != ''">
  21. AND a.ml = #{ml}
  22. </if>
  23. <if test="bgqx != null and bgqx != ''">
  24. AND a.bgqx = #{bgqx}
  25. </if>
  26. </where>
  27. </select>
  28. <select id="selectBorrowList" resultType="com.gz.rvo.borrow.ArchiveBorrowListRVO">
  29. <![CDATA[
  30. SELECT IF
  31. (
  32. (SELECT count(admin_id) num
  33. FROM tab_archive_borrow ab
  34. WHERE ab.archive_id = a.id
  35. AND ab.borrow_type = 1
  36. AND ab.audit_status = 2
  37. AND ab.return_status = 0) <= 0,
  38. '可借阅',
  39. '已借阅'
  40. ) original_status,
  41. a.*
  42. FROM tab_archives a
  43. WHERE a.deleted = 0
  44. ]]>
  45. </select>
  46. </mapper>