PersonnelNonCadreMonthlyAssessmentMapper.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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.personnel.mapper.PersonnelNonCadreMonthlyAssessmentMapper">
  6. <resultMap type="PersonnelNonCadreMonthlyAssessment" id="PersonnelNonCadreMonthlyAssessmentResult">
  7. <result property="tenantId" column="tenant_id"/>
  8. <result property="revision" column="revision"/>
  9. <result property="createBy" column="create_by"/>
  10. <result property="createTime" column="create_time"/>
  11. <result property="updateBy" column="update_by"/>
  12. <result property="updateTime" column="update_time"/>
  13. <result property="remark" column="remark"/>
  14. <result property="id" column="id"/>
  15. <result property="assessmentMonth" column="assessment_month"/>
  16. <result property="userId" column="user_id"/>
  17. <result property="userName" column="user_name"/>
  18. <result property="roleId" column="role_id"/>
  19. <result property="roleKey" column="role_key"/>
  20. <result property="roleName" column="role_name"/>
  21. <result property="employmentType" column="employment_type"/>
  22. <result property="assessmentTeam" column="assessment_team"/>
  23. <result property="post" column="post"/>
  24. <result property="deputyTeamLeaderId" column="deputy_team_leader_id"/>
  25. <result property="deputyTeamLeaderName" column="deputy_team_leader_name"/>
  26. <result property="deputySupervisorId" column="deputy_supervisor_id"/>
  27. <result property="deputySupervisorName" column="deputy_supervisor_name"/>
  28. <result property="deputyManagerId" column="deputy_manager_id"/>
  29. <result property="deputyManagerName" column="deputy_manager_name"/>
  30. <result property="redLineIndexTriggerCount" column="red_line_index_trigger_count"/>
  31. <result property="coreIndexScore" column="core_index_score"/>
  32. <result property="otherIndexScore" column="other_index_score"/>
  33. <result property="otherIndexSafetyScoreWithSocStationQcDeduction"
  34. column="other_index_safety_score_with_soc_station_qc_deduction"/>
  35. <result property="otherIndexSafetyScoreWithoutSocStationQcDeduction"
  36. column="other_index_safety_score_without_soc_station_qc_deduction"/>
  37. <result property="otherIndexNonSafetyDeduction" column="other_index_non_safety_deduction"/>
  38. <result property="nonCoreSafetyPlusCoreDeduction" column="non_core_safety_plus_core_deduction"/>
  39. <result property="socStationQcInvolvedCoreSafetyDeduction"
  40. column="soc_station_qc_involved_core_safety_deduction"/>
  41. <result property="inChargeEmployeeCount" column="in_charge_employee_count"/>
  42. <result property="deductionAverage" column="deduction_average"/>
  43. <result property="totalScore" column="total_score"/>
  44. <result property="rewardAmount" column="reward_amount"/>
  45. <result property="punishmentAmount" column="punishment_amount"/>
  46. <result property="assessmentResult" column="assessment_result"/>
  47. <result property="assessmentResultRemark" column="assessment_result_remark"/>
  48. <result property="applicationMethod" column="application_method"/>
  49. <result property="applicationMethodRemark" column="application_method_remark"/>
  50. <result property="exemption" column="exemption"/>
  51. <result property="exemptionReasonRemark" column="exemption_reason_remark"/>
  52. </resultMap>
  53. <sql id="selectPersonnelNonCadreMonthlyAssessmentVo">
  54. select tenant_id,
  55. revision,
  56. create_by,
  57. create_time,
  58. update_by,
  59. update_time,
  60. remark,
  61. id,
  62. assessment_month,
  63. user_id,
  64. user_name,
  65. role_id,
  66. role_key,
  67. role_name,
  68. employment_type,
  69. assessment_team,
  70. post,
  71. deputy_team_leader_id,
  72. deputy_team_leader_name,
  73. deputy_supervisor_id,
  74. deputy_supervisor_name,
  75. deputy_manager_id,
  76. deputy_manager_name,
  77. red_line_index_trigger_count,
  78. core_index_score,
  79. other_index_score,
  80. other_index_safety_score_with_soc_station_qc_deduction,
  81. other_index_safety_score_without_soc_station_qc_deduction,
  82. other_index_non_safety_deduction,
  83. non_core_safety_plus_core_deduction,
  84. soc_station_qc_involved_core_safety_deduction,
  85. in_charge_employee_count,
  86. deduction_average,
  87. total_score,
  88. reward_amount,
  89. punishment_amount,
  90. assessment_result,
  91. assessment_result_remark,
  92. application_method,
  93. application_method_remark,
  94. exemption,
  95. exemption_reason_remark
  96. from personnel_non_cadre_monthly_assessment
  97. </sql>
  98. <select id="selectPersonnelNonCadreMonthlyAssessmentList" parameterType="PersonnelNonCadreMonthlyAssessment"
  99. resultMap="PersonnelNonCadreMonthlyAssessmentResult">
  100. <include refid="selectPersonnelNonCadreMonthlyAssessmentVo"/>
  101. <where>
  102. <if test="tenantId != null and tenantId != ''">and tenant_id = #{tenantId}</if>
  103. <if test="revision != null ">and revision = #{revision}</if>
  104. <if test="assessmentMonth != null and assessmentMonth != ''">and assessment_month = #{assessmentMonth}</if>
  105. <if test="userId != null ">and user_id = #{userId}</if>
  106. <if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
  107. <if test="roleId != null ">and role_id = #{roleId}</if>
  108. <if test="roleKey != null and roleKey != ''">and role_key = #{roleKey}</if>
  109. <if test="roleName != null and roleName != ''">and role_name like concat('%', #{roleName}, '%')</if>
  110. <if test="employmentType != null and employmentType != ''">and employment_type = #{employmentType}</if>
  111. <if test="assessmentTeam != null and assessmentTeam != ''">and assessment_team = #{assessmentTeam}</if>
  112. <if test="post != null and post != ''">and post = #{post}</if>
  113. <if test="deputyTeamLeaderId != null ">and deputy_team_leader_id = #{deputyTeamLeaderId}</if>
  114. <if test="deputyTeamLeaderName != null and deputyTeamLeaderName != ''">and deputy_team_leader_name like
  115. concat('%', #{deputyTeamLeaderName}, '%')
  116. </if>
  117. <if test="deputySupervisorId != null ">and deputy_supervisor_id = #{deputySupervisorId}</if>
  118. <if test="deputySupervisorName != null and deputySupervisorName != ''">and deputy_supervisor_name like
  119. concat('%', #{deputySupervisorName}, '%')
  120. </if>
  121. <if test="deputyManagerId != null ">and deputy_manager_id = #{deputyManagerId}</if>
  122. <if test="deputyManagerName != null and deputyManagerName != ''">and deputy_manager_name like concat('%',
  123. #{deputyManagerName}, '%')
  124. </if>
  125. <if test="redLineIndexTriggerCount != null ">and red_line_index_trigger_count =
  126. #{redLineIndexTriggerCount}
  127. </if>
  128. <if test="coreIndexScore != null ">and core_index_score = #{coreIndexScore}</if>
  129. <if test="otherIndexScore != null ">and other_index_score = #{otherIndexScore}</if>
  130. <if test="otherIndexSafetyScoreWithSocStationQcDeduction != null ">and
  131. other_index_safety_score_with_soc_station_qc_deduction =
  132. #{otherIndexSafetyScoreWithSocStationQcDeduction}
  133. </if>
  134. <if test="otherIndexSafetyScoreWithoutSocStationQcDeduction != null ">and
  135. other_index_safety_score_without_soc_station_qc_deduction =
  136. #{otherIndexSafetyScoreWithoutSocStationQcDeduction}
  137. </if>
  138. <if test="otherIndexNonSafetyDeduction != null ">and other_index_non_safety_deduction =
  139. #{otherIndexNonSafetyDeduction}
  140. </if>
  141. <if test="nonCoreSafetyPlusCoreDeduction != null ">and non_core_safety_plus_core_deduction =
  142. #{nonCoreSafetyPlusCoreDeduction}
  143. </if>
  144. <if test="socStationQcInvolvedCoreSafetyDeduction != null ">and
  145. soc_station_qc_involved_core_safety_deduction = #{socStationQcInvolvedCoreSafetyDeduction}
  146. </if>
  147. <if test="inChargeEmployeeCount != null ">and in_charge_employee_count = #{inChargeEmployeeCount}</if>
  148. <if test="deductionAverage != null ">and deduction_average = #{deductionAverage}</if>
  149. <if test="totalScore != null ">and total_score = #{totalScore}</if>
  150. <if test="rewardAmount != null ">and reward_amount = #{rewardAmount}</if>
  151. <if test="punishmentAmount != null ">and punishment_amount = #{punishmentAmount}</if>
  152. <if test="assessmentResult != null and assessmentResult != ''">and assessment_result =
  153. #{assessmentResult}
  154. </if>
  155. <if test="assessmentResultRemark != null and assessmentResultRemark != ''">and assessment_result_remark =
  156. #{assessmentResultRemark}
  157. </if>
  158. <if test="applicationMethod != null and applicationMethod != ''">and application_method =
  159. #{applicationMethod}
  160. </if>
  161. <if test="applicationMethodRemark != null and applicationMethodRemark != ''">and application_method_remark
  162. = #{applicationMethodRemark}
  163. </if>
  164. <if test="exemption != null and exemption != ''">and exemption = #{exemption}</if>
  165. <if test="exemptionReasonRemark != null and exemptionReasonRemark != ''">and exemption_reason_remark =
  166. #{exemptionReasonRemark}
  167. </if>
  168. <if test="assessmentMonthStart != null">
  169. and assessment_month >= #{assessmentMonthStart}
  170. </if>
  171. <if test="assessmentMonthEnd != null">
  172. and assessment_month <![CDATA[ <= ]]> #{assessmentMonthEnd}
  173. </if>
  174. </where>
  175. order by create_time desc
  176. </select>
  177. <select id="selectPersonnelNonCadreMonthlyAssessmentById" parameterType="Long"
  178. resultMap="PersonnelNonCadreMonthlyAssessmentResult">
  179. <include refid="selectPersonnelNonCadreMonthlyAssessmentVo"/>
  180. where id = #{id}
  181. </select>
  182. <insert id="insertPersonnelNonCadreMonthlyAssessment" parameterType="PersonnelNonCadreMonthlyAssessment"
  183. useGeneratedKeys="true" keyProperty="id">
  184. insert into personnel_non_cadre_monthly_assessment
  185. <trim prefix="(" suffix=")" suffixOverrides=",">
  186. <if test="tenantId != null">tenant_id,</if>
  187. <if test="revision != null">revision,</if>
  188. <if test="createBy != null">create_by,</if>
  189. <if test="createTime != null">create_time,</if>
  190. <if test="updateBy != null">update_by,</if>
  191. <if test="updateTime != null">update_time,</if>
  192. <if test="remark != null">remark,</if>
  193. <if test="assessmentMonth != null and assessmentMonth != ''">assessment_month,</if>
  194. <if test="userId != null">user_id,</if>
  195. <if test="userName != null and userName != ''">user_name,</if>
  196. <if test="roleId != null">role_id,</if>
  197. <if test="roleKey != null and roleKey != ''">role_key,</if>
  198. <if test="roleName != null and roleName != ''">role_name,</if>
  199. <if test="employmentType != null">employment_type,</if>
  200. <if test="assessmentTeam != null">assessment_team,</if>
  201. <if test="post != null">post,</if>
  202. <if test="deputyTeamLeaderId != null">deputy_team_leader_id,</if>
  203. <if test="deputyTeamLeaderName != null">deputy_team_leader_name,</if>
  204. <if test="deputySupervisorId != null">deputy_supervisor_id,</if>
  205. <if test="deputySupervisorName != null">deputy_supervisor_name,</if>
  206. <if test="deputyManagerId != null">deputy_manager_id,</if>
  207. <if test="deputyManagerName != null">deputy_manager_name,</if>
  208. <if test="redLineIndexTriggerCount != null">red_line_index_trigger_count,</if>
  209. <if test="coreIndexScore != null">core_index_score,</if>
  210. <if test="otherIndexScore != null">other_index_score,</if>
  211. <if test="otherIndexSafetyScoreWithSocStationQcDeduction != null">
  212. other_index_safety_score_with_soc_station_qc_deduction,
  213. </if>
  214. <if test="otherIndexSafetyScoreWithoutSocStationQcDeduction != null">
  215. other_index_safety_score_without_soc_station_qc_deduction,
  216. </if>
  217. <if test="otherIndexNonSafetyDeduction != null">other_index_non_safety_deduction,</if>
  218. <if test="nonCoreSafetyPlusCoreDeduction != null">non_core_safety_plus_core_deduction,</if>
  219. <if test="socStationQcInvolvedCoreSafetyDeduction != null">soc_station_qc_involved_core_safety_deduction,
  220. </if>
  221. <if test="inChargeEmployeeCount != null">in_charge_employee_count,</if>
  222. <if test="deductionAverage != null">deduction_average,</if>
  223. <if test="totalScore != null">total_score,</if>
  224. <if test="rewardAmount != null">reward_amount,</if>
  225. <if test="punishmentAmount != null">punishment_amount,</if>
  226. <if test="assessmentResult != null">assessment_result,</if>
  227. <if test="assessmentResultRemark != null">assessment_result_remark,</if>
  228. <if test="applicationMethod != null">application_method,</if>
  229. <if test="applicationMethodRemark != null">application_method_remark,</if>
  230. <if test="exemption != null">exemption,</if>
  231. <if test="exemptionReasonRemark != null">exemption_reason_remark,</if>
  232. </trim>
  233. <trim prefix="values (" suffix=")" suffixOverrides=",">
  234. <if test="tenantId != null">#{tenantId},</if>
  235. <if test="revision != null">#{revision},</if>
  236. <if test="createBy != null">#{createBy},</if>
  237. <if test="createTime != null">#{createTime},</if>
  238. <if test="updateBy != null">#{updateBy},</if>
  239. <if test="updateTime != null">#{updateTime},</if>
  240. <if test="remark != null">#{remark},</if>
  241. <if test="assessmentMonth != null and assessmentMonth != ''">#{assessmentMonth},</if>
  242. <if test="userId != null">#{userId},</if>
  243. <if test="userName != null and userName != ''">#{userName},</if>
  244. <if test="roleId != null">#{roleId},</if>
  245. <if test="roleKey != null and roleKey != ''">#{roleKey},</if>
  246. <if test="roleName != null and roleName != ''">#{roleName},</if>
  247. <if test="employmentType != null">#{employmentType},</if>
  248. <if test="assessmentTeam != null">#{assessmentTeam},</if>
  249. <if test="post != null">#{post},</if>
  250. <if test="deputyTeamLeaderId != null">#{deputyTeamLeaderId},</if>
  251. <if test="deputyTeamLeaderName != null">#{deputyTeamLeaderName},</if>
  252. <if test="deputySupervisorId != null">#{deputySupervisorId},</if>
  253. <if test="deputySupervisorName != null">#{deputySupervisorName},</if>
  254. <if test="deputyManagerId != null">#{deputyManagerId},</if>
  255. <if test="deputyManagerName != null">#{deputyManagerName},</if>
  256. <if test="redLineIndexTriggerCount != null">#{redLineIndexTriggerCount},</if>
  257. <if test="coreIndexScore != null">#{coreIndexScore},</if>
  258. <if test="otherIndexScore != null">#{otherIndexScore},</if>
  259. <if test="otherIndexSafetyScoreWithSocStationQcDeduction != null">
  260. #{otherIndexSafetyScoreWithSocStationQcDeduction},
  261. </if>
  262. <if test="otherIndexSafetyScoreWithoutSocStationQcDeduction != null">
  263. #{otherIndexSafetyScoreWithoutSocStationQcDeduction},
  264. </if>
  265. <if test="otherIndexNonSafetyDeduction != null">#{otherIndexNonSafetyDeduction},</if>
  266. <if test="nonCoreSafetyPlusCoreDeduction != null">#{nonCoreSafetyPlusCoreDeduction},</if>
  267. <if test="socStationQcInvolvedCoreSafetyDeduction != null">#{socStationQcInvolvedCoreSafetyDeduction},</if>
  268. <if test="inChargeEmployeeCount != null">#{inChargeEmployeeCount},</if>
  269. <if test="deductionAverage != null">#{deductionAverage},</if>
  270. <if test="totalScore != null">#{totalScore},</if>
  271. <if test="rewardAmount != null">#{rewardAmount},</if>
  272. <if test="punishmentAmount != null">#{punishmentAmount},</if>
  273. <if test="assessmentResult != null">#{assessmentResult},</if>
  274. <if test="assessmentResultRemark != null">#{assessmentResultRemark},</if>
  275. <if test="applicationMethod != null">#{applicationMethod},</if>
  276. <if test="applicationMethodRemark != null">#{applicationMethodRemark},</if>
  277. <if test="exemption != null">#{exemption},</if>
  278. <if test="exemptionReasonRemark != null">#{exemptionReasonRemark},</if>
  279. </trim>
  280. </insert>
  281. <update id="updatePersonnelNonCadreMonthlyAssessment" parameterType="PersonnelNonCadreMonthlyAssessment">
  282. update personnel_non_cadre_monthly_assessment
  283. <trim prefix="SET" suffixOverrides=",">
  284. <if test="tenantId != null">tenant_id = #{tenantId},</if>
  285. <if test="revision != null">revision = #{revision},</if>
  286. <if test="createBy != null">create_by = #{createBy},</if>
  287. <if test="createTime != null">create_time = #{createTime},</if>
  288. <if test="updateBy != null">update_by = #{updateBy},</if>
  289. <if test="updateTime != null">update_time = #{updateTime},</if>
  290. <if test="remark != null">remark = #{remark},</if>
  291. <if test="assessmentMonth != null and assessmentMonth != ''">assessment_month = #{assessmentMonth},</if>
  292. <if test="userId != null">user_id = #{userId},</if>
  293. <if test="userName != null and userName != ''">user_name = #{userName},</if>
  294. <if test="roleId != null">role_id = #{roleId},</if>
  295. <if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
  296. <if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
  297. <if test="employmentType != null">employment_type = #{employmentType},</if>
  298. <if test="assessmentTeam != null">assessment_team = #{assessmentTeam},</if>
  299. <if test="post != null">post = #{post},</if>
  300. <if test="deputyTeamLeaderId != null">deputy_team_leader_id = #{deputyTeamLeaderId},</if>
  301. <if test="deputyTeamLeaderName != null">deputy_team_leader_name = #{deputyTeamLeaderName},</if>
  302. <if test="deputySupervisorId != null">deputy_supervisor_id = #{deputySupervisorId},</if>
  303. <if test="deputySupervisorName != null">deputy_supervisor_name = #{deputySupervisorName},</if>
  304. <if test="deputyManagerId != null">deputy_manager_id = #{deputyManagerId},</if>
  305. <if test="deputyManagerName != null">deputy_manager_name = #{deputyManagerName},</if>
  306. <if test="redLineIndexTriggerCount != null">red_line_index_trigger_count = #{redLineIndexTriggerCount},</if>
  307. <if test="coreIndexScore != null">core_index_score = #{coreIndexScore},</if>
  308. <if test="otherIndexScore != null">other_index_score = #{otherIndexScore},</if>
  309. <if test="otherIndexSafetyScoreWithSocStationQcDeduction != null">
  310. other_index_safety_score_with_soc_station_qc_deduction =
  311. #{otherIndexSafetyScoreWithSocStationQcDeduction},
  312. </if>
  313. <if test="otherIndexSafetyScoreWithoutSocStationQcDeduction != null">
  314. other_index_safety_score_without_soc_station_qc_deduction =
  315. #{otherIndexSafetyScoreWithoutSocStationQcDeduction},
  316. </if>
  317. <if test="otherIndexNonSafetyDeduction != null">other_index_non_safety_deduction =
  318. #{otherIndexNonSafetyDeduction},
  319. </if>
  320. <if test="nonCoreSafetyPlusCoreDeduction != null">non_core_safety_plus_core_deduction =
  321. #{nonCoreSafetyPlusCoreDeduction},
  322. </if>
  323. <if test="socStationQcInvolvedCoreSafetyDeduction != null">soc_station_qc_involved_core_safety_deduction =
  324. #{socStationQcInvolvedCoreSafetyDeduction},
  325. </if>
  326. <if test="inChargeEmployeeCount != null">in_charge_employee_count = #{inChargeEmployeeCount},</if>
  327. <if test="deductionAverage != null">deduction_average = #{deductionAverage},</if>
  328. <if test="totalScore != null">total_score = #{totalScore},</if>
  329. <if test="rewardAmount != null">reward_amount = #{rewardAmount},</if>
  330. <if test="punishmentAmount != null">punishment_amount = #{punishmentAmount},</if>
  331. <if test="assessmentResult != null">assessment_result = #{assessmentResult},</if>
  332. <if test="assessmentResultRemark != null">assessment_result_remark = #{assessmentResultRemark},</if>
  333. <if test="applicationMethod != null">application_method = #{applicationMethod},</if>
  334. <if test="applicationMethodRemark != null">application_method_remark = #{applicationMethodRemark},</if>
  335. <if test="exemption != null">exemption = #{exemption},</if>
  336. <if test="exemptionReasonRemark != null">exemption_reason_remark = #{exemptionReasonRemark},</if>
  337. </trim>
  338. where id = #{id}
  339. </update>
  340. <delete id="deletePersonnelNonCadreMonthlyAssessmentById" parameterType="Long">
  341. delete
  342. from personnel_non_cadre_monthly_assessment
  343. where id = #{id}
  344. </delete>
  345. <delete id="deletePersonnelNonCadreMonthlyAssessmentByIds" parameterType="String">
  346. delete from personnel_non_cadre_monthly_assessment where id in
  347. <foreach item="id" collection="array" open="(" separator="," close=")">
  348. #{id}
  349. </foreach>
  350. </delete>
  351. </mapper>