TTsTrainerMapper.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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.TTsTrainerMapper">
  6. <resultMap type="TTsTrainer" id="TTsTrainerResult">
  7. <result property="trainerId" column="trainer_id" />
  8. <result property="staffId" column="staff_id" />
  9. <result property="trainerName" column="trainer_name" />
  10. <result property="team" column="team" />
  11. <result property="post" column="post" />
  12. <result property="experience" column="experience" />
  13. <result property="apprenticePosition" column="apprentice_position" />
  14. <result property="delFlag" column="del_flag" />
  15. <result property="createrCode" column="creater_code" />
  16. <result property="createdate" column="createdate" />
  17. <result property="updaterCode" column="updater_code" />
  18. <result property="updatedate" column="updatedate" />
  19. <result property="deptId" column="dept_id" />
  20. <result property="remarks" column="remarks" />
  21. <result property="deptName" column="dept_name" />
  22. </resultMap>
  23. <sql id="selectTTsTrainerVo">
  24. select d.trainer_id, d.staff_id, d.trainer_name, d.team, d.post, d.experience, d.apprentice_position, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_ts_trainer d
  25. left join sys_dept s on s.dept_id = d.dept_id
  26. </sql>
  27. <select id="selectTTsTrainerList" parameterType="TTsTrainer" resultMap="TTsTrainerResult">
  28. <include refid="selectTTsTrainerVo"/>
  29. <where>
  30. <if test="staffId != null "> and staff_id = #{staffId}</if>
  31. <if test="trainerName != null and trainerName != ''"> and trainer_name like concat(concat('%', #{trainerName}), '%')</if>
  32. <if test="team != null and team != ''"> and team = #{team}</if>
  33. <if test="post != null and post != ''"> and post = #{post}</if>
  34. <if test="experience != null and experience != ''"> and experience = #{experience}</if>
  35. <if test="apprenticePosition != null and apprenticePosition != ''"> and apprentice_position = #{apprenticePosition}</if>
  36. <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
  37. <if test="createdate != null "> and createdate = #{createdate}</if>
  38. <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
  39. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  40. <if test="deptId != null "> and dept_id = #{deptId}</if>
  41. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  42. and d.del_flag = 0
  43. </where>
  44. <!-- 数据范围过滤 -->
  45. ${params.dataScope}
  46. </select>
  47. <select id="selectTTsTrainerById" parameterType="Long" resultMap="TTsTrainerResult">
  48. <include refid="selectTTsTrainerVo"/>
  49. where trainer_id = #{trainerId}
  50. </select>
  51. <insert id="insertTTsTrainer" parameterType="TTsTrainer">
  52. <selectKey keyProperty="trainerId" resultType="long" order="BEFORE">
  53. SELECT seq_t_ts_trainer.NEXTVAL as trainerId FROM DUAL
  54. </selectKey>
  55. insert into t_ts_trainer
  56. <trim prefix="(" suffix=")" suffixOverrides=",">
  57. <if test="trainerId != null">trainer_id,</if>
  58. <if test="staffId != null">staff_id,</if>
  59. <if test="trainerName != null">trainer_name,</if>
  60. <if test="team != null">team,</if>
  61. <if test="post != null">post,</if>
  62. <if test="experience != null">experience,</if>
  63. <if test="apprenticePosition != null">apprentice_position,</if>
  64. <if test="delFlag != null">del_flag,</if>
  65. <if test="createrCode != null">creater_code,</if>
  66. <if test="createdate != null">createdate,</if>
  67. <if test="updaterCode != null">updater_code,</if>
  68. <if test="updatedate != null">updatedate,</if>
  69. <if test="deptId != null">dept_id,</if>
  70. <if test="remarks != null">remarks,</if>
  71. </trim>
  72. <trim prefix="values (" suffix=")" suffixOverrides=",">
  73. <if test="trainerId != null">#{trainerId},</if>
  74. <if test="staffId != null">#{staffId},</if>
  75. <if test="trainerName != null">#{trainerName},</if>
  76. <if test="team != null">#{team},</if>
  77. <if test="post != null">#{post},</if>
  78. <if test="experience != null">#{experience},</if>
  79. <if test="apprenticePosition != null">#{apprenticePosition},</if>
  80. <if test="delFlag != null">#{delFlag},</if>
  81. <if test="createrCode != null">#{createrCode},</if>
  82. <if test="createdate != null">#{createdate},</if>
  83. <if test="updaterCode != null">#{updaterCode},</if>
  84. <if test="updatedate != null">#{updatedate},</if>
  85. <if test="deptId != null">#{deptId},</if>
  86. <if test="remarks != null">#{remarks},</if>
  87. </trim>
  88. </insert>
  89. <update id="updateTTsTrainer" parameterType="TTsTrainer">
  90. update t_ts_trainer
  91. <trim prefix="SET" suffixOverrides=",">
  92. <if test="staffId != null">staff_id = #{staffId},</if>
  93. <if test="trainerName != null">trainer_name = #{trainerName},</if>
  94. <if test="team != null">team = #{team},</if>
  95. <if test="post != null">post = #{post},</if>
  96. <if test="experience != null">experience = #{experience},</if>
  97. <if test="apprenticePosition != null">apprentice_position = #{apprenticePosition},</if>
  98. <if test="delFlag != null">del_flag = #{delFlag},</if>
  99. <if test="createrCode != null">creater_code = #{createrCode},</if>
  100. <if test="createdate != null">createdate = #{createdate},</if>
  101. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  102. <if test="updatedate != null">updatedate = #{updatedate},</if>
  103. <if test="deptId != null">dept_id = #{deptId},</if>
  104. <if test="remarks != null">remarks = #{remarks},</if>
  105. </trim>
  106. where trainer_id = #{trainerId}
  107. </update>
  108. <update id="deleteTTsTrainerById" parameterType="Long">
  109. update t_ts_trainer set del_flag = 2 where trainer_id = #{trainerId}
  110. </update>
  111. <update id="deleteTTsTrainerByIds" parameterType="String">
  112. update t_ts_trainer set del_flag = 2 where trainer_id in
  113. <foreach item="trainerId" collection="array" open="(" separator="," close=")">
  114. #{trainerId}
  115. </foreach>
  116. </update>
  117. </mapper>