ToolMapper.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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.platform.dao.mapper.tool.ToolMapper">
  4. <sql id="Base_Column_List">
  5. tool.id,
  6. tool.name,
  7. tool.ggxh,
  8. tool.no,
  9. tool.num,
  10. tool.check_user_id,
  11. tool.producer,
  12. tool.hg_flag,
  13. tool.check_flag,
  14. tool.content,
  15. tool.remark,
  16. tool.created_time,
  17. tool.update_time,
  18. tool.created_user_id,
  19. tool.created_user_name,
  20. tool.update_user_id,
  21. tool.update_user_name,
  22. tool.position,
  23. tool.check_date,
  24. tool.next_check_date,
  25. tool.period,
  26. tool.warn_day
  27. </sql>
  28. <sql id="Ref_Column_List">
  29. tool.name,
  30. tool.ggxh,
  31. tool.no,
  32. tool.num,
  33. tool.check_user_id,
  34. tool.producer,
  35. tool.hg_flag,
  36. tool.check_flag,
  37. tool.content,
  38. tool.remark,
  39. tool.position,
  40. tool.check_date,
  41. tool.next_check_date,
  42. tool.period,
  43. tool.warn_day
  44. </sql>
  45. <sql id="List_Condition">
  46. <if test="id != null and id != ''">
  47. and tool.id = #{id}
  48. </if>
  49. <if test="name != null and name != ''">
  50. and tool.name = #{name}
  51. </if>
  52. <if test="ggxh != null and ggxh != ''">
  53. and tool.ggxh = #{ggxh}
  54. </if>
  55. <if test="no != null">
  56. and tool.no = #{no}
  57. </if>
  58. <if test="num != null">
  59. and tool.num = #{num}
  60. </if>
  61. <if test="checkUserId != null and checkUserId != ''">
  62. and tool.check_user_id = #{checkUserId}
  63. </if>
  64. <if test="producer != null and producer != ''">
  65. and tool.producer = #{producer}
  66. </if>
  67. <if test="hgFlag != null and hgFlag != ''">
  68. and tool.hg_flag = #{hgFlag}
  69. </if>
  70. <if test="checkFlag != null">
  71. and tool.check_flag = #{checkFlag}
  72. </if>
  73. <if test="content != null">
  74. and tool.content = #{content}
  75. </if>
  76. <if test="remark != null and remark != ''">
  77. and tool.remark = #{remark}
  78. </if>
  79. <if test="createdTimeStart != null">
  80. and tool.created_time <![CDATA[>=]]>; #{createdTimeStart}
  81. </if>
  82. <if test="createdTimeEnd != null">
  83. and tool.created_time <![CDATA[<=]]> #{createdTimeEnd}
  84. </if>
  85. <if test="createdTime != null">
  86. and tool.created_time = #{createdTime}
  87. </if>
  88. <if test="updateTimeStart != null">
  89. and tool.update_time <![CDATA[>=]]>; #{updateTimeStart}
  90. </if>
  91. <if test="updateTimeEnd != null">
  92. and tool.update_time <![CDATA[<=]]> #{updateTimeEnd}
  93. </if>
  94. <if test="updateTime != null">
  95. and tool.update_time = #{updateTime}
  96. </if>
  97. <if test="createdUserId != null and createdUserId != ''">
  98. and tool.created_user_id = #{createdUserId}
  99. </if>
  100. <if test="createdUserName != null and createdUserName != ''">
  101. and tool.created_user_name = #{createdUserName}
  102. </if>
  103. <if test="updateUserId != null and updateUserId != ''">
  104. and tool.update_user_id = #{updateUserId}
  105. </if>
  106. <if test="updateUserName != null and updateUserName != ''">
  107. and tool.update_user_name = #{updateUserName}
  108. </if>
  109. <if test="position != null and position != ''">
  110. and tool.position = #{position}
  111. </if>
  112. <if test="checkDateStart != null">
  113. and tool.check_date <![CDATA[>=]]>; #{checkDateStart}
  114. </if>
  115. <if test="checkDateEnd != null">
  116. and tool.check_date <![CDATA[<=]]> #{checkDateEnd}
  117. </if>
  118. <if test="checkDate != null and checkDate != ''">
  119. and tool.check_date = #{checkDate}
  120. </if>
  121. <if test="nextCheckDateStart != null">
  122. and tool.next_check_date <![CDATA[>=]]>; #{nextCheckDateStart}
  123. </if>
  124. <if test="nextCheckDateEnd != null">
  125. and tool.next_check_date <![CDATA[<=]]> #{nextCheckDateEnd}
  126. </if>
  127. <if test="status != null">
  128. and TIMESTAMPDIFF( DAY, CURDATE( ), tool.next_check_date ) <![CDATA[ <= ]]> tool.warn_day
  129. </if>
  130. <if test="nextCheckDate != null">
  131. and tool.next_check_date = #{nextCheckDate}
  132. </if>
  133. <if test="period != null">
  134. and tool.period = #{period}
  135. </if>
  136. <if test="warnDay != null">
  137. and tool.warn_day = #{warnDay}
  138. </if>
  139. <if test="keyword != null and keyword != ''">
  140. and tool.name like concat(concat('%',#{keyword}),'%')
  141. </if>
  142. </sql>
  143. <select id="selectList" parameterType="com.platform.dao.dto.tool.ToolDTO"
  144. resultType="com.platform.dao.vo.query.tool.ToolVO">
  145. select tool.*
  146. from t_tool as tool
  147. <where>
  148. <include refid="List_Condition"/>
  149. </where>
  150. </select>
  151. </mapper>