TTrainingParticipantsMapper.xml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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.ruoyi.project.training.mapper.TTrainingParticipantsMapper">
  6. <resultMap type="TTrainingParticipants" id="TTrainingParticipantsResult">
  7. <result property="id" column="id" />
  8. <result property="staffId" column="staff_id" />
  9. <result property="companyId" column="company_id" />
  10. <result property="startDate" column="start_date" />
  11. <result property="endDate" column="end_date" />
  12. <result property="score" column="score" />
  13. <result property="operationScore" column="operation_score" />
  14. <result property="trainingPlace" column="training_place" />
  15. <result property="trainingDuration" column="training_duration" />
  16. <result property="trainingCost" column="training_cost" />
  17. <result property="budget" column="budget" />
  18. <result property="remarks" column="remarks" />
  19. <result property="delFlag" column="del_flag" />
  20. <result property="createrCode" column="creater_code" />
  21. <result property="createdate" column="createdate" />
  22. <result property="updaterCode" column="updater_code" />
  23. <result property="updatedate" column="updatedate" />
  24. <result property="companyItem" column="item" />
  25. <result property="courseCode" column="course_code" />
  26. </resultMap>
  27. <sql id="selectTTrainingParticipantsVo">
  28. select d.id, d.staff_id, d.company_id, s.item, s.course_code, d.start_date, d.end_date, d.score, d.operation_score, d.training_place, d.training_duration, d.training_cost, d.budget, d.remarks, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate from t_training_participants d
  29. left join t_training_companylevel s on d.company_id = s.id
  30. </sql>
  31. <select id="selectTTrainingParticipantsList" parameterType="TTrainingParticipants" resultMap="TTrainingParticipantsResult">
  32. <include refid="selectTTrainingParticipantsVo"/>
  33. <where>
  34. <if test="staffId != null "> and d.staff_id = #{staffId}</if>
  35. <if test="companyId != null "> and company_id = #{companyId}</if>
  36. and d.del_flag = 0
  37. </where>
  38. order by s.course_code
  39. </select>
  40. <select id="selectTTrainingParticipantsListTask" parameterType="TTrainingParticipants" resultMap="TTrainingParticipantsResult">
  41. <include refid="selectTTrainingParticipantsVo"/>
  42. <where>
  43. <if test="staffId != null "> and d.staff_id = #{staffId}</if>
  44. <if test="companyId != null "> and company_id = #{companyId}</if>
  45. and d.del_flag = 0
  46. </where>
  47. order by end_date
  48. </select>
  49. <select id="selectTTrainingParticipantsById" parameterType="Long" resultMap="TTrainingParticipantsResult">
  50. <include refid="selectTTrainingParticipantsVo"/>
  51. where id = #{id}
  52. </select>
  53. <insert id="insertTTrainingParticipants" parameterType="TTrainingParticipants">
  54. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  55. SELECT seq_t_training_participants.NEXTVAL as id FROM DUAL
  56. </selectKey>
  57. insert into t_training_participants
  58. <trim prefix="(" suffix=")" suffixOverrides=",">
  59. <if test="id != null">id,</if>
  60. <if test="staffId != null">staff_id,</if>
  61. <if test="companyId != null">company_id,</if>
  62. <if test="startDate != null">start_date,</if>
  63. <if test="endDate != null">end_date,</if>
  64. <if test="score != null">score,</if>
  65. <if test="operationScore != null">operation_score,</if>
  66. <if test="trainingPlace != null">training_place,</if>
  67. <if test="trainingDuration != null">training_duration,</if>
  68. <if test="trainingCost != null">training_cost,</if>
  69. <if test="budget != null">budget,</if>
  70. <if test="remarks != null">remarks,</if>
  71. <if test="delFlag != null">del_flag,</if>
  72. <if test="createrCode != null">creater_code,</if>
  73. <if test="createdate != null">createdate,</if>
  74. <if test="updaterCode != null">updater_code,</if>
  75. <if test="updatedate != null">updatedate,</if>
  76. </trim>
  77. <trim prefix="values (" suffix=")" suffixOverrides=",">
  78. <if test="id != null">#{id},</if>
  79. <if test="staffId != null">#{staffId},</if>
  80. <if test="companyId != null">#{companyId},</if>
  81. <if test="startDate != null">#{startDate},</if>
  82. <if test="endDate != null">#{endDate},</if>
  83. <if test="score != null">#{score},</if>
  84. <if test="operationScore != null">#{operationScore},</if>
  85. <if test="trainingPlace != null">#{trainingPlace},</if>
  86. <if test="trainingDuration != null">#{trainingDuration},</if>
  87. <if test="trainingCost != null">#{trainingCost},</if>
  88. <if test="budget != null">#{budget},</if>
  89. <if test="remarks != null">#{remarks},</if>
  90. <if test="delFlag != null">#{delFlag},</if>
  91. <if test="createrCode != null">#{createrCode},</if>
  92. <if test="createdate != null">#{createdate},</if>
  93. <if test="updaterCode != null">#{updaterCode},</if>
  94. <if test="updatedate != null">#{updatedate},</if>
  95. </trim>
  96. </insert>
  97. <update id="updateTTrainingParticipants" parameterType="TTrainingParticipants">
  98. update t_training_participants
  99. <trim prefix="SET" suffixOverrides=",">
  100. <if test="staffId != null">staff_id = #{staffId},</if>
  101. <if test="companyId != null">company_id = #{companyId},</if>
  102. <if test="startDate != null">start_date = #{startDate},</if>
  103. <if test="endDate != null">end_date = #{endDate},</if>
  104. <if test="score != null">score = #{score},</if>
  105. <if test="operationScore != null">operation_score = #{operationScore},</if>
  106. <if test="trainingPlace != null">training_place = #{trainingPlace},</if>
  107. <if test="trainingDuration != null">training_duration = #{trainingDuration},</if>
  108. <if test="trainingCost != null">training_cost = #{trainingCost},</if>
  109. <if test="budget != null">budget = #{budget},</if>
  110. <if test="remarks != null">remarks = #{remarks},</if>
  111. <if test="delFlag != null">del_flag = #{delFlag},</if>
  112. <if test="createrCode != null">creater_code = #{createrCode},</if>
  113. <if test="createdate != null">createdate = #{createdate},</if>
  114. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  115. <if test="updatedate != null">updatedate = #{updatedate},</if>
  116. </trim>
  117. where id = #{id}
  118. </update>
  119. <update id="updateTTrainingParticipantsByStaffAndCom" parameterType="TTrainingParticipants">
  120. update t_training_participants
  121. <trim prefix="SET" suffixOverrides=",">
  122. <if test="staffId != null">staff_id = #{staffId},</if>
  123. <if test="companyId != null">company_id = #{companyId},</if>
  124. <if test="startDate != null">start_date = #{startDate},</if>
  125. <if test="endDate != null">end_date = #{endDate},</if>
  126. <if test="score != null">score = #{score},</if>
  127. <if test="operationScore != null">operation_score = #{operationScore},</if>
  128. <if test="trainingPlace != null">training_place = #{trainingPlace},</if>
  129. <if test="trainingDuration != null">training_duration = #{trainingDuration},</if>
  130. <if test="trainingCost != null">training_cost = #{trainingCost},</if>
  131. <if test="budget != null">budget = #{budget},</if>
  132. <if test="remarks != null">remarks = #{remarks},</if>
  133. <if test="delFlag != null">del_flag = #{delFlag},</if>
  134. <if test="createrCode != null">creater_code = #{createrCode},</if>
  135. <if test="createdate != null">createdate = #{createdate},</if>
  136. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  137. <if test="updatedate != null">updatedate = #{updatedate},</if>
  138. </trim>
  139. where staff_id = #{staffId} and company_id = #{companyId}
  140. </update>
  141. <update id="deleteTTrainingParticipantsById" parameterType="Long">
  142. update t_training_participants set del_flag = 2 where id = #{id}
  143. </update>
  144. <update id="deleteTTrainingParticipantsByCompanyId" parameterType="TTrainingParticipants">
  145. update t_training_participants set del_flag = 2 where company_id = #{companyId} and staff_id = #{staffId} and del_flag = 0
  146. </update>
  147. <update id="deleteTTrainingParticipantsAll">
  148. update t_training_participants set del_flag = 2 where del_flag = 0
  149. </update>
  150. <update id="deleteTTrainingParticipantsByIds" parameterType="String">
  151. update t_training_participants set del_flag = 2 where id in
  152. <foreach item="id" collection="array" open="(" separator="," close=")">
  153. #{id}
  154. </foreach>
  155. </update>
  156. </mapper>