TTsNewMapper.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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.bccnew.mapper.TTsNewMapper">
  6. <resultMap type="TTsNew" id="TTsNewResult">
  7. <result property="newId" column="new_id" />
  8. <result property="staffId" column="staff_id" />
  9. <result property="name" column="name" />
  10. <result property="delFlag" column="del_flag" />
  11. <result property="createrCode" column="creater_code" />
  12. <result property="createdate" column="createdate" />
  13. <result property="updaterCode" column="updater_code" />
  14. <result property="updatedate" column="updatedate" />
  15. <result property="deptId" column="dept_id" />
  16. <result property="planStatus" column="plan_status" />
  17. <result property="planYear" column="plan_year" />
  18. <result property="startdate" column="startdate" />
  19. <result property="enddate" column="enddate" />
  20. <result property="mentorStaffId" column="mentor_staff_id" />
  21. <result property="planType" column="plan_type" />
  22. <result property="remarks" column="remarks" />
  23. <result property="deptName" column="dept_name" />
  24. <result property="staffName" column="staffName" />
  25. <result property="mentorStaffName" column="mentorStaffName" />
  26. <result property="mentorAgreementWordPath" column="mentor_agreement_word_path" />
  27. <result property="targetPlanWordPath" column="target_plan_word_path" />
  28. <result property="appraisalFormWordPath" column="appraisal_form_word_path" />
  29. </resultMap>
  30. <sql id="selectTTsNewVo">
  31. select d.new_id, d.staff_id, d.name,u.name as staffName,u2.name as mentorStaffName, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.plan_status, d.plan_year, d.startdate, d.enddate, d.mentor_staff_id, d.plan_type, d.remarks ,s.dept_name,
  32. d.mentor_agreement_word_path, d.target_plan_word_path, appraisal_form_word_path
  33. from t_ts_new d
  34. left join sys_dept s on s.dept_id = d.dept_id
  35. left join t_staffmgr u on d.staff_id = u.staffid and u.del_flag = 0
  36. left join t_staffmgr u2 on d.mentor_staff_id = u2.staffid and u2.del_flag = 0
  37. </sql>
  38. <select id="selectTTsNewList" parameterType="TTsNew" resultMap="TTsNewResult">
  39. <include refid="selectTTsNewVo"/>
  40. <where>
  41. <if test="staffId != null and staffId != ''"> and staff_id = #{staffId}</if>
  42. <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
  43. <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
  44. <if test="createdate != null "> and createdate = #{createdate}</if>
  45. <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
  46. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  47. <if test="deptId != null "> and dept_id = #{deptId}</if>
  48. <if test="planStatus != null "> and plan_status = #{planStatus}</if>
  49. <if test="planYear != null "> and plan_year = #{planYear}</if>
  50. <if test="startdate != null "> and startdate = #{startdate}</if>
  51. <if test="enddate != null "> and enddate = #{enddate}</if>
  52. <if test="mentorStaffId != null and mentorStaffId != ''"> and mentor_staff_id = #{mentorStaffId}</if>
  53. <if test="planType != null "> and plan_type = #{planType}</if>
  54. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  55. and d.del_flag = 0
  56. </where>
  57. <!-- 数据范围过滤 -->
  58. ${params.dataScope}
  59. order by createdate desc
  60. </select>
  61. <select id="selectTTsNewById" parameterType="Long" resultMap="TTsNewResult">
  62. <include refid="selectTTsNewVo"/>
  63. where new_id = #{newId}
  64. </select>
  65. <insert id="insertTTsNew" parameterType="TTsNew" useGeneratedKeys="true" keyProperty="newId">
  66. <selectKey keyProperty="newId" resultType="long" order="BEFORE">
  67. SELECT seq_t_ts_new.NEXTVAL as newId FROM DUAL
  68. </selectKey>
  69. insert into t_ts_new
  70. <trim prefix="(" suffix=")" suffixOverrides=",">
  71. <if test="newId != null">new_id,</if>
  72. <if test="staffId != null">staff_id,</if>
  73. <if test="name != null">name,</if>
  74. <if test="delFlag != null">del_flag,</if>
  75. <if test="createrCode != null">creater_code,</if>
  76. <if test="createdate != null">createdate,</if>
  77. <if test="updaterCode != null">updater_code,</if>
  78. <if test="updatedate != null">updatedate,</if>
  79. <if test="deptId != null">dept_id,</if>
  80. <if test="planStatus != null">plan_status,</if>
  81. <if test="planYear != null">plan_year,</if>
  82. <if test="startdate != null">startdate,</if>
  83. <if test="enddate != null">enddate,</if>
  84. <if test="mentorStaffId != null">mentor_staff_id,</if>
  85. <if test="planType != null">plan_type,</if>
  86. <if test="remarks != null">remarks,</if>
  87. </trim>
  88. <trim prefix="values (" suffix=")" suffixOverrides=",">
  89. <if test="newId != null">#{newId},</if>
  90. <if test="staffId != null">#{staffId},</if>
  91. <if test="name != null">#{name},</if>
  92. <if test="delFlag != null">#{delFlag},</if>
  93. <if test="createrCode != null">#{createrCode},</if>
  94. <if test="createdate != null">#{createdate},</if>
  95. <if test="updaterCode != null">#{updaterCode},</if>
  96. <if test="updatedate != null">#{updatedate},</if>
  97. <if test="deptId != null">#{deptId},</if>
  98. <if test="planStatus != null">#{planStatus},</if>
  99. <if test="planYear != null">#{planYear},</if>
  100. <if test="startdate != null">#{startdate},</if>
  101. <if test="enddate != null">#{enddate},</if>
  102. <if test="mentorStaffId != null">#{mentorStaffId},</if>
  103. <if test="planType != null">#{planType},</if>
  104. <if test="remarks != null">#{remarks},</if>
  105. </trim>
  106. </insert>
  107. <update id="updateTTsNew" parameterType="TTsNew">
  108. update t_ts_new
  109. <trim prefix="SET" suffixOverrides=",">
  110. <if test="staffId != null">staff_id = #{staffId},</if>
  111. <if test="name != null">name = #{name},</if>
  112. <if test="delFlag != null">del_flag = #{delFlag},</if>
  113. <if test="createrCode != null">creater_code = #{createrCode},</if>
  114. <if test="createdate != null">createdate = #{createdate},</if>
  115. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  116. <if test="updatedate != null">updatedate = #{updatedate},</if>
  117. <if test="deptId != null">dept_id = #{deptId},</if>
  118. <if test="planStatus != null">plan_status = #{planStatus},</if>
  119. <if test="planYear != null">plan_year = #{planYear},</if>
  120. <if test="startdate != null">startdate = #{startdate},</if>
  121. <if test="enddate != null">enddate = #{enddate},</if>
  122. <if test="mentorStaffId != null">mentor_staff_id = #{mentorStaffId},</if>
  123. <if test="planType != null">plan_type = #{planType},</if>
  124. <if test="remarks != null">remarks = #{remarks},</if>
  125. <if test="mentorAgreementWordPath != null">mentor_agreement_word_path = #{mentorAgreementWordPath},</if>
  126. <if test="targetPlanWordPath != null">target_plan_word_path = #{targetPlanWordPath},</if>
  127. <if test="appraisalFormWordPath != null">appraisal_form_word_path = #{appraisalFormWordPath},</if>
  128. </trim>
  129. where new_id = #{newId}
  130. </update>
  131. <update id="deleteTTsNewById" parameterType="Long">
  132. update t_ts_new set del_flag = 2 where new_id = #{newId}
  133. </update>
  134. <update id="deleteTTsNewByIds" parameterType="String">
  135. update t_ts_new set del_flag = 2 where new_id in
  136. <foreach item="newId" collection="array" open="(" separator="," close=")">
  137. #{newId}
  138. </foreach>
  139. </update>
  140. </mapper>