BlockedMissCheckStatisticsMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.sundot.airport.blocked.mapper.BlockedMissCheckStatisticsMapper">
  6. <resultMap type="BlockedMissCheckStatistics" id="BlockedMissCheckStatisticsResult">
  7. <result property="id" column="id" />
  8. <result property="brigadeId" column="brigade_id" />
  9. <result property="brigadeName" column="brigade_name" />
  10. <result property="terminalId" column="terminal_id" />
  11. <result property="terminalName" column="terminal_name" />
  12. <result property="areaId" column="area_id" />
  13. <result property="areaName" column="area_name" />
  14. <result property="channelId" column="channel_id" />
  15. <result property="channelName" column="channel_name" />
  16. <result property="reviewedUserId" column="reviewed_user_id" />
  17. <result property="reviewedUserName" column="reviewed_user_name" />
  18. <result property="reviewUserId" column="review_user_id" />
  19. <result property="reviewUserName" column="review_user_name" />
  20. <result property="supervisorId" column="supervisor_id" />
  21. <result property="supervisorName" column="supervisor_name" />
  22. <result property="actingSupervisorId" column="acting_supervisor_id" />
  23. <result property="actingSupervisorName" column="acting_supervisor_name" />
  24. <result property="teamLeaderId" column="team_leader_id" />
  25. <result property="teamLeaderName" column="team_leader_name" />
  26. <result property="reviewDate" column="review_date" />
  27. <result property="missCheckTime" column="miss_check_time" />
  28. <result property="missCheckTimePeriod" column="miss_check_time_period" />
  29. <result property="missCheckItem" column="miss_check_item" />
  30. <result property="itemLocation" column="item_location" />
  31. <result property="difficultyLevel" column="difficulty_level" />
  32. <result property="discriminationType" column="discrimination_type" />
  33. <result property="isRecovered" column="is_recovered" />
  34. <result property="machineOperatingYears" column="machine_operating_years" />
  35. <result property="certificateLevel" column="certificate_level" />
  36. <result property="gender" column="gender" />
  37. <result property="missCheckReasonCategory" column="miss_check_reason_category" />
  38. <result property="monthlyAssessment" column="monthly_assessment" />
  39. <result property="selfTestHasMissCheck" column="self_test_has_miss_check" />
  40. <result property="createBy" column="create_by" />
  41. <result property="createTime" column="create_time" />
  42. <result property="updateBy" column="update_by" />
  43. <result property="updateTime" column="update_time" />
  44. <result property="remark" column="remark" />
  45. <result property="delFlag" column="del_flag" />
  46. </resultMap>
  47. <sql id="selectBlockedMissCheckStatisticsVo">
  48. select id, brigade_id, brigade_name, terminal_id, terminal_name, area_id, area_name,
  49. channel_id, channel_name, reviewed_user_id, reviewed_user_name, review_user_id,
  50. review_user_name, supervisor_id, supervisor_name, acting_supervisor_id,
  51. acting_supervisor_name, team_leader_id, team_leader_name, review_date,
  52. miss_check_time, miss_check_time_period, miss_check_item, item_location,
  53. difficulty_level, discrimination_type, is_recovered, machine_operating_years,
  54. certificate_level, gender, miss_check_reason_category, monthly_assessment,
  55. self_test_has_miss_check, create_by, create_time, update_by, update_time,
  56. remark, del_flag
  57. from blocked_miss_check_statistics
  58. </sql>
  59. <select id="selectBlockedMissCheckStatisticsList" parameterType="BlockedMissCheckStatistics" resultMap="BlockedMissCheckStatisticsResult">
  60. <include refid="selectBlockedMissCheckStatisticsVo"/>
  61. <where>
  62. del_flag = '0'
  63. <if test="brigadeId != null "> and brigade_id = #{brigadeId}</if>
  64. <if test="brigadeName != null and brigadeName != ''"> and brigade_name like concat('%', #{brigadeName}, '%')</if>
  65. <if test="terminalId != null "> and terminal_id = #{terminalId}</if>
  66. <if test="areaId != null "> and area_id = #{areaId}</if>
  67. <if test="channelId != null "> and channel_id = #{channelId}</if>
  68. <if test="reviewedUserId != null "> and reviewed_user_id = #{reviewedUserId}</if>
  69. <if test="reviewedUserName != null and reviewedUserName != ''"> and reviewed_user_name like concat('%', #{reviewedUserName}, '%')</if>
  70. <if test="reviewUserId != null "> and review_user_id = #{reviewUserId}</if>
  71. <if test="reviewDate != null "> and review_date = #{reviewDate}</if>
  72. <if test="missCheckTime != null "> and DATE_FORMAT(miss_check_time, '%Y-%m-%d %H:%i') = DATE_FORMAT(#{missCheckTime}, '%Y-%m-%d %H:%i')</if>
  73. <if test="difficultyLevel != null and difficultyLevel != ''"> and difficulty_level = #{difficultyLevel}</if>
  74. <if test="gender != null and gender != ''"> and gender = #{gender}</if>
  75. </where>
  76. order by review_date desc, miss_check_time desc
  77. </select>
  78. <select id="selectBlockedMissCheckStatisticsById" parameterType="Long" resultMap="BlockedMissCheckStatisticsResult">
  79. <include refid="selectBlockedMissCheckStatisticsVo"/>
  80. where id = #{id} and del_flag = '0'
  81. </select>
  82. <insert id="insertBlockedMissCheckStatistics" parameterType="BlockedMissCheckStatistics" useGeneratedKeys="true" keyProperty="id">
  83. insert into blocked_miss_check_statistics
  84. <trim prefix="(" suffix=")" suffixOverrides=",">
  85. <if test="brigadeId != null">brigade_id,</if>
  86. <if test="brigadeName != null and brigadeName != ''">brigade_name,</if>
  87. <if test="terminalId != null">terminal_id,</if>
  88. <if test="terminalName != null and terminalName != ''">terminal_name,</if>
  89. <if test="areaId != null">area_id,</if>
  90. <if test="areaName != null and areaName != ''">area_name,</if>
  91. <if test="channelId != null">channel_id,</if>
  92. <if test="channelName != null and channelName != ''">channel_name,</if>
  93. <if test="reviewedUserId != null">reviewed_user_id,</if>
  94. <if test="reviewedUserName != null and reviewedUserName != ''">reviewed_user_name,</if>
  95. <if test="reviewUserId != null">review_user_id,</if>
  96. <if test="reviewUserName != null and reviewUserName != ''">review_user_name,</if>
  97. <if test="supervisorId != null">supervisor_id,</if>
  98. <if test="supervisorName != null and supervisorName != ''">supervisor_name,</if>
  99. <if test="actingSupervisorId != null">acting_supervisor_id,</if>
  100. <if test="actingSupervisorName != null and actingSupervisorName != ''">acting_supervisor_name,</if>
  101. <if test="teamLeaderId != null">team_leader_id,</if>
  102. <if test="teamLeaderName != null and teamLeaderName != ''">team_leader_name,</if>
  103. <if test="reviewDate != null">review_date,</if>
  104. <if test="missCheckTime != null">miss_check_time,</if>
  105. <if test="missCheckTimePeriod != null and missCheckTimePeriod != ''">miss_check_time_period,</if>
  106. <if test="missCheckItem != null and missCheckItem != ''">miss_check_item,</if>
  107. <if test="itemLocation != null and itemLocation != ''">item_location,</if>
  108. <if test="difficultyLevel != null and difficultyLevel != ''">difficulty_level,</if>
  109. <if test="discriminationType != null and discriminationType != ''">discrimination_type,</if>
  110. <if test="isRecovered != null">is_recovered,</if>
  111. <if test="machineOperatingYears != null">machine_operating_years,</if>
  112. <if test="certificateLevel != null and certificateLevel != ''">certificate_level,</if>
  113. <if test="gender != null and gender != ''">gender,</if>
  114. <if test="missCheckReasonCategory != null and missCheckReasonCategory != ''">miss_check_reason_category,</if>
  115. <if test="monthlyAssessment != null and monthlyAssessment != ''">monthly_assessment,</if>
  116. <if test="selfTestHasMissCheck != null">self_test_has_miss_check,</if>
  117. <if test="createBy != null and createBy != ''">create_by,</if>
  118. <if test="createTime != null">create_time,</if>
  119. <if test="updateBy != null and updateBy != ''">update_by,</if>
  120. <if test="updateTime != null">update_time,</if>
  121. <if test="remark != null">remark,</if>
  122. <if test="delFlag != null and delFlag != ''">del_flag,</if>
  123. </trim>
  124. <trim prefix="values (" suffix=")" suffixOverrides=",">
  125. <if test="brigadeId != null">#{brigadeId},</if>
  126. <if test="brigadeName != null and brigadeName != ''">#{brigadeName},</if>
  127. <if test="terminalId != null">#{terminalId},</if>
  128. <if test="terminalName != null and terminalName != ''">#{terminalName},</if>
  129. <if test="areaId != null">#{areaId},</if>
  130. <if test="areaName != null and areaName != ''">#{areaName},</if>
  131. <if test="channelId != null">#{channelId},</if>
  132. <if test="channelName != null and channelName != ''">#{channelName},</if>
  133. <if test="reviewedUserId != null">#{reviewedUserId},</if>
  134. <if test="reviewedUserName != null and reviewedUserName != ''">#{reviewedUserName},</if>
  135. <if test="reviewUserId != null">#{reviewUserId},</if>
  136. <if test="reviewUserName != null and reviewUserName != ''">#{reviewUserName},</if>
  137. <if test="supervisorId != null">#{supervisorId},</if>
  138. <if test="supervisorName != null and supervisorName != ''">#{supervisorName},</if>
  139. <if test="actingSupervisorId != null">#{actingSupervisorId},</if>
  140. <if test="actingSupervisorName != null and actingSupervisorName != ''">#{actingSupervisorName},</if>
  141. <if test="teamLeaderId != null">#{teamLeaderId},</if>
  142. <if test="teamLeaderName != null and teamLeaderName != ''">#{teamLeaderName},</if>
  143. <if test="reviewDate != null">#{reviewDate},</if>
  144. <if test="missCheckTime != null">#{missCheckTime},</if>
  145. <if test="missCheckTimePeriod != null and missCheckTimePeriod != ''">#{missCheckTimePeriod},</if>
  146. <if test="missCheckItem != null and missCheckItem != ''">#{missCheckItem},</if>
  147. <if test="itemLocation != null and itemLocation != ''">#{itemLocation},</if>
  148. <if test="difficultyLevel != null and difficultyLevel != ''">#{difficultyLevel},</if>
  149. <if test="discriminationType != null and discriminationType != ''">#{discriminationType},</if>
  150. <if test="isRecovered != null">#{isRecovered},</if>
  151. <if test="machineOperatingYears != null">#{machineOperatingYears},</if>
  152. <if test="certificateLevel != null and certificateLevel != ''">#{certificateLevel},</if>
  153. <if test="gender != null and gender != ''">#{gender},</if>
  154. <if test="missCheckReasonCategory != null and missCheckReasonCategory != ''">#{missCheckReasonCategory},</if>
  155. <if test="monthlyAssessment != null and monthlyAssessment != ''">#{monthlyAssessment},</if>
  156. <if test="selfTestHasMissCheck != null">#{selfTestHasMissCheck},</if>
  157. <if test="createBy != null and createBy != ''">#{createBy},</if>
  158. <if test="createTime != null">#{createTime},</if>
  159. <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
  160. <if test="updateTime != null">#{updateTime},</if>
  161. <if test="remark != null">#{remark},</if>
  162. <if test="delFlag != null and delFlag != ''">#{delFlag},</if>
  163. </trim>
  164. </insert>
  165. <update id="updateBlockedMissCheckStatistics" parameterType="BlockedMissCheckStatistics">
  166. update blocked_miss_check_statistics
  167. <trim prefix="SET" suffixOverrides=",">
  168. <if test="brigadeId != null">brigade_id = #{brigadeId},</if>
  169. <if test="brigadeName != null and brigadeName != ''">brigade_name = #{brigadeName},</if>
  170. <if test="terminalId != null">terminal_id = #{terminalId},</if>
  171. <if test="terminalName != null and terminalName != ''">terminal_name = #{terminalName},</if>
  172. <if test="areaId != null">area_id = #{areaId},</if>
  173. <if test="areaName != null and areaName != ''">area_name = #{areaName},</if>
  174. <if test="channelId != null">channel_id = #{channelId},</if>
  175. <if test="channelName != null and channelName != ''">channel_name = #{channelName},</if>
  176. <if test="reviewedUserId != null">reviewed_user_id = #{reviewedUserId},</if>
  177. <if test="reviewedUserName != null and reviewedUserName != ''">reviewed_user_name = #{reviewedUserName},</if>
  178. <if test="reviewUserId != null">review_user_id = #{reviewUserId},</if>
  179. <if test="reviewUserName != null and reviewUserName != ''">review_user_name = #{reviewUserName},</if>
  180. <if test="supervisorId != null">supervisor_id = #{supervisorId},</if>
  181. <if test="supervisorName != null and supervisorName != ''">supervisor_name = #{supervisorName},</if>
  182. <if test="actingSupervisorId != null">acting_supervisor_id = #{actingSupervisorId},</if>
  183. <if test="actingSupervisorName != null and actingSupervisorName != ''">acting_supervisor_name = #{actingSupervisorName},</if>
  184. <if test="teamLeaderId != null">team_leader_id = #{teamLeaderId},</if>
  185. <if test="teamLeaderName != null and teamLeaderName != ''">team_leader_name = #{teamLeaderName},</if>
  186. <if test="reviewDate != null">review_date = #{reviewDate},</if>
  187. <if test="missCheckTime != null">miss_check_time = #{missCheckTime},</if>
  188. <if test="missCheckTimePeriod != null and missCheckTimePeriod != ''">miss_check_time_period = #{missCheckTimePeriod},</if>
  189. <if test="missCheckItem != null and missCheckItem != ''">miss_check_item = #{missCheckItem},</if>
  190. <if test="itemLocation != null and itemLocation != ''">item_location = #{itemLocation},</if>
  191. <if test="difficultyLevel != null and difficultyLevel != ''">difficulty_level = #{difficultyLevel},</if>
  192. <if test="discriminationType != null and discriminationType != ''">discrimination_type = #{discriminationType},</if>
  193. <if test="isRecovered != null">is_recovered = #{isRecovered},</if>
  194. <if test="machineOperatingYears != null">machine_operating_years = #{machineOperatingYears},</if>
  195. <if test="certificateLevel != null and certificateLevel != ''">certificate_level = #{certificateLevel},</if>
  196. <if test="gender != null and gender != ''">gender = #{gender},</if>
  197. <if test="missCheckReasonCategory != null and missCheckReasonCategory != ''">miss_check_reason_category = #{missCheckReasonCategory},</if>
  198. <if test="monthlyAssessment != null and monthlyAssessment != ''">monthly_assessment = #{monthlyAssessment},</if>
  199. <if test="selfTestHasMissCheck != null">self_test_has_miss_check = #{selfTestHasMissCheck},</if>
  200. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  201. <if test="updateTime != null">update_time = #{updateTime},</if>
  202. <if test="remark != null">remark = #{remark},</if>
  203. </trim>
  204. where id = #{id}
  205. </update>
  206. <delete id="deleteBlockedMissCheckStatisticsById" parameterType="Long">
  207. update blocked_miss_check_statistics set del_flag = '2' where id = #{id}
  208. </delete>
  209. <delete id="deleteBlockedMissCheckStatisticsByIds" parameterType="String">
  210. update blocked_miss_check_statistics set del_flag = '2' where id in
  211. <foreach item="id" collection="array" open="(" separator="," close=")">
  212. #{id}
  213. </foreach>
  214. </delete>
  215. </mapper>