MaintainPlanMapper.xml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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.maintain.MaintainPlanMapper">
  4. <sql id="Base_Column_List">
  5. maintainplan.id,
  6. maintainplan.no,
  7. maintainplan.name,
  8. maintainplan.check_user_id,
  9. maintainplan.check_user_name,
  10. maintainplan.period,
  11. maintainplan.type,
  12. maintainplan.period_type,
  13. maintainplan.valid_time,
  14. maintainplan.valid_time_type,
  15. maintainplan.start_time,
  16. maintainplan.end_time,
  17. maintainplan.last_generated_time,
  18. maintainplan.enable,
  19. maintainplan.remark,
  20. maintainplan.created_user_id,
  21. maintainplan.update_user_id,
  22. maintainplan.created_user_name,
  23. maintainplan.update_user_name,
  24. maintainplan.created_time,
  25. maintainplan.update_time
  26. </sql>
  27. <sql id="Ref_Column_List">
  28. maintainplan.no,
  29. maintainplan.name,
  30. maintainplan.check_user_id,
  31. maintainplan.check_user_name,
  32. maintainplan.period,
  33. maintainplan.type,
  34. maintainplan.period_type,
  35. maintainplan.valid_time,
  36. maintainplan.valid_time_type,
  37. maintainplan.start_time,
  38. maintainplan.end_time,
  39. maintainplan.last_generated_time,
  40. maintainplan.enable,
  41. maintainplan.remark,
  42. </sql>
  43. <sql id="List_Condition">
  44. <if test="id != null and id != ''">
  45. and maintainplan.id = #{id}
  46. </if>
  47. <if test="no != null and no != ''">
  48. and maintainplan.no = #{no}
  49. </if>
  50. <if test="name != null and name != ''">
  51. and maintainplan.name = #{name}
  52. </if>
  53. <if test="checkUserId != null and checkUserId != ''">
  54. and maintainplan.check_user_id = #{checkUserId}
  55. </if>
  56. <if test="checkUserName != null and checkUserName != ''">
  57. and maintainplan.check_user_name = #{checkUserName}
  58. </if>
  59. <if test="period != null">
  60. and maintainplan.period = #{period}
  61. </if>
  62. <if test="type != null">
  63. and maintainplan.type = #{type}
  64. </if>
  65. <if test="periodType != null">
  66. and maintainplan.period_type = #{periodType}
  67. </if>
  68. <if test="validTime != null">
  69. and maintainplan.valid_time = #{validTime}
  70. </if>
  71. <if test="validTimeType != null">
  72. and maintainplan.valid_time_type = #{validTimeType}
  73. </if>
  74. <if test="startTimeStart != null">
  75. and maintainplan.start_time <![CDATA[>=]]>; #{startTimeStart}
  76. </if>
  77. <if test="startTimeEnd != null">
  78. and maintainplan.start_time <![CDATA[<=]]> #{startTimeEnd}
  79. </if>
  80. <if test="startTime != null">
  81. and maintainplan.start_time = #{startTime}
  82. </if>
  83. <if test="endTimeStart != null">
  84. and maintainplan.end_time <![CDATA[>=]]>; #{endTimeStart}
  85. </if>
  86. <if test="endTimeEnd != null">
  87. and maintainplan.end_time <![CDATA[<=]]> #{endTimeEnd}
  88. </if>
  89. <if test="currentDate != null">
  90. and maintainplan.start_time <![CDATA[<=]]> #{currentDate}
  91. and maintainplan.end_time <![CDATA[>=]]> #{currentDate}
  92. </if>
  93. <if test="endTime != null">
  94. and maintainplan.end_time = #{endTime}
  95. </if>
  96. <if test="lastGeneratedTimeStart != null">
  97. and maintainplan.last_generated_time <![CDATA[>=]]>; #{lastGeneratedTimeStart}
  98. </if>
  99. <if test="lastGeneratedTimeEnd != null">
  100. and maintainplan.last_generated_time <![CDATA[<=]]> #{lastGeneratedTimeEnd}
  101. </if>
  102. <if test="lastGeneratedTime != null">
  103. and maintainplan.last_generated_time = #{lastGeneratedTime}
  104. </if>
  105. <if test="enable != null">
  106. and maintainplan.enable = #{enable}
  107. </if>
  108. <if test="remark != null and remark != ''">
  109. and maintainplan.remark = #{remark}
  110. </if>
  111. <if test="createdUserId != null and createdUserId != ''">
  112. and maintainplan.created_user_id = #{createdUserId}
  113. </if>
  114. <if test="updateUserId != null and updateUserId != ''">
  115. and maintainplan.update_user_id = #{updateUserId}
  116. </if>
  117. <if test="createdUserName != null and createdUserName != ''">
  118. and maintainplan.created_user_name = #{createdUserName}
  119. </if>
  120. <if test="updateUserName != null and updateUserName != ''">
  121. and maintainplan.update_user_name = #{updateUserName}
  122. </if>
  123. <if test="createdTimeStart != null">
  124. and maintainplan.created_time <![CDATA[>=]]>; #{createdTimeStart}
  125. </if>
  126. <if test="createdTimeEnd != null">
  127. and maintainplan.created_time <![CDATA[<=]]> #{createdTimeEnd}
  128. </if>
  129. <if test="createdTime != null">
  130. and maintainplan.created_time = #{createdTime}
  131. </if>
  132. <if test="updateTimeStart != null">
  133. and maintainplan.update_time <![CDATA[>=]]>; #{updateTimeStart}
  134. </if>
  135. <if test="updateTimeEnd != null">
  136. and maintainplan.update_time <![CDATA[<=]]> #{updateTimeEnd}
  137. </if>
  138. <if test="updateTime != null">
  139. and maintainplan.update_time = #{updateTime}
  140. </if>
  141. <if test="keyword != null and keyword != ''">
  142. and maintainplan.id like concat('%',#{keyword},'%')
  143. </if>
  144. </sql>
  145. <select id="selectList" parameterType="com.platform.dao.dto.maintain.MaintainPlanDTO" resultType="com.platform.dao.vo.query.maintain.MaintainPlanVO">
  146. select maintainplan.*
  147. from t_maintain_plan as maintainplan
  148. <where>
  149. <include refid="List_Condition"/>
  150. </where>
  151. </select>
  152. <select id="selectPlanProjectList" resultType="com.platform.dao.vo.query.maintain.MaintainProjectVO">
  153. select project.*, sbinfo.name sbName,sbinfo.no sbNo,partinfo.no partName,partinfo.no partNo,standard.name standardName,standard.no standardNo,
  154. sbType.name sbType
  155. from t_maintain_project_plan_relation tcppr
  156. inner join t_maintain_plan plan on tcppr.plan_id = plan.id
  157. inner join t_maintain_project project on tcppr.project_id = project.id
  158. left join t_sb_info sbinfo on project.sb_id = sbinfo.id
  159. left join t_part_info partinfo on project.part_id = partinfo.id
  160. left join t_maintain_project_standard_relation cpsrelation on cpsrelation.project_id = project.id
  161. left join t_maintain_standard standard on standard.id = cpsrelation.standard_id
  162. left join t_sb_type sbType on sbinfo.type_id = sbType.id
  163. where tcppr.plan_id = #{planId}
  164. </select>
  165. </mapper>