ApplicationProcedureTemporaryMapper.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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.template.mapper.ApplicationProcedureTemporaryMapper">
  4. <select id="pageList" resultType="com.template.model.vo.ApplicationProcedureTemporaryVo">
  5. SELECT
  6. apu.id as id,
  7. apu.user_name as usersName,
  8. apu.start_time as startTime,
  9. apu.end_time as endTime,
  10. apu.department as department,
  11. apu.reason_application as reasonApplication,
  12. apu.submission_time as submissionTime,
  13. apu.`status` as status,
  14. apu.approver_user_name as approverUserName,
  15. apu.examine_and_approve_time as examineAndApproveTime,
  16. apu.examine_and_approve_remark as examineAndApproveRemark
  17. FROM
  18. (
  19. SELECT
  20. ap.id,
  21. u.user_name AS user_name ,
  22. ap.start_time,
  23. ap.end_time,
  24. ap.department,
  25. ap.reason_application,
  26. ap.submission_time,
  27. ap.`status`,
  28. u3.user_name as approver_user_name,
  29. ap.examine_and_approve_time,
  30. ap.examine_and_approve_remark
  31. FROM
  32. `application_procedure_temporary` ap
  33. LEFT JOIN users u ON ap.users_id = u.id
  34. LEFT JOIN users u3 ON ap.approver_id = u3.id
  35. WHERE ap.deleted=0
  36. ) apu
  37. <where>
  38. <if test="submissionStartTime != null and submissionStartTime != '' and submissionEndTime != null and submissionEndTime != '' ">
  39. and apu.submission_time >= #{submissionStartTime} and #{submissionEndTime}>= apu.submission_time
  40. </if>
  41. <if test="key != null and key != ''">
  42. AND ( apu.user_name LIKE '%' #{key} '%' OR apu.reason_application LIKE '%' #{key} '%' )
  43. </if>
  44. <if test="examineAndApproveStartTime != null and examineAndApproveStartTime != '' and examineAndApproveEndTime != null and examineAndApproveEndTime != '' ">
  45. and apu.examine_and_approve_time >= #{examineAndApproveStartTime} and #{examineAndApproveEndTime}>=
  46. apu.examine_and_approve_time
  47. </if>
  48. <if test="type != null and type != ''">
  49. and apu.status= #{type}
  50. </if>
  51. <if test="department != null and department != ''">
  52. and apu.department= #{department}
  53. </if>
  54. </where>
  55. ORDER BY apu.submission_time
  56. </select>
  57. <select id="parentPageList" resultType="com.template.model.vo.ApplicationProcedureTemporaryVo">
  58. SELECT
  59. apu.id as id,
  60. apu.user_name as usersName,
  61. apu.start_time as startTime,
  62. apu.end_time as endTime,
  63. apu.department as department,
  64. apu.reason_application as reasonApplication,
  65. apu.submission_time as submissionTime,
  66. apu.`status` as status,
  67. apu.approver_user_name as approverUserName,
  68. apu.examine_and_approve_time as examineAndApproveTime,
  69. apu.examine_and_approve_remark as examineAndApproveRemark
  70. FROM
  71. (
  72. SELECT
  73. ap.id,
  74. u.user_name AS user_name ,
  75. ap.start_time,
  76. ap.end_time,
  77. ap.department,
  78. ap.reason_application,
  79. ap.submission_time,
  80. ap.`status`,
  81. u3.user_name as approver_user_name,
  82. ap.examine_and_approve_time,
  83. ap.examine_and_approve_remark
  84. FROM
  85. `application_procedure_temporary` ap
  86. LEFT JOIN users u ON ap.users_id = u.id
  87. LEFT JOIN users u3 ON ap.approver_id = u3.id
  88. WHERE ap.deleted=0 and FIND_IN_SET(ap.status,#{type})
  89. ) apu
  90. <where>
  91. <if test="submissionStartTime != null and submissionStartTime != '' and submissionEndTime != null and submissionEndTime != '' ">
  92. and apu.submission_time >= #{submissionStartTime} and #{submissionEndTime}>= apu.submission_time
  93. </if>
  94. <if test="key != null and key != ''">
  95. AND ( apu.user_name LIKE '%' #{key} '%' OR apu.reason_application LIKE '%' #{key} '%' )
  96. </if>
  97. <if test="examineAndApproveStartTime != null and examineAndApproveStartTime != '' and examineAndApproveEndTime != null and examineAndApproveEndTime != '' ">
  98. and apu.examine_and_approve_time >= #{examineAndApproveStartTime} and #{examineAndApproveEndTime}>=
  99. apu.examine_and_approve_time
  100. </if>
  101. <!-- <if test="type != null and type != ''">
  102. and apu.status= #{type}
  103. </if>-->
  104. <if test="department != null and department != ''">
  105. and apu.department= #{department}
  106. </if>
  107. </where>
  108. ORDER BY apu.submission_time
  109. </select>
  110. </mapper>