综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CmcUserHistoryMapper.xml 4.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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.oa.mapper.CmcUserHistoryMapper">
  6. <resultMap type="CmcUserHistory" id="CmcUserHistoryResult">
  7. <result property="historyId" column="history_id" />
  8. <result property="userId" column="user_id" />
  9. <result property="titles" column="titles" />
  10. <result property="certificates" column="certificates" />
  11. <result property="pmLevel" column="pm_level" />
  12. <result property="engineerLevel" column="engineer_level" />
  13. <result property="postLevel" column="post_level" />
  14. <result property="salaryLevel" column="salary_level" />
  15. <result property="updateTime" column="update_time" />
  16. <result property="updateReason" column="update_reason" />
  17. </resultMap>
  18. <sql id="selectCmcUserHistoryVo">
  19. select history_id, user_id, titles, certificates, pm_level, engineer_level, post_level, salary_level, update_time, update_reason from cmc_user_history
  20. </sql>
  21. <select id="selectCmcUserHistoryList" parameterType="CmcUserHistory" resultMap="CmcUserHistoryResult">
  22. <include refid="selectCmcUserHistoryVo"/>
  23. <where>
  24. <if test="userId != null "> and user_id = #{userId}</if>
  25. <if test="titles != null and titles != ''"> and titles = #{titles}</if>
  26. <if test="certificates != null and certificates != ''"> and certificates = #{certificates}</if>
  27. <if test="pmLevel != null and pmLevel != ''"> and pm_level = #{pmLevel}</if>
  28. <if test="engineerLevel != null and engineerLevel != ''"> and engineer_level = #{engineerLevel}</if>
  29. <if test="postLevel != null and postLevel != ''"> and post_level = #{postLevel}</if>
  30. <if test="salaryLevel != null and salaryLevel != ''"> and salary_level = #{salaryLevel}</if>
  31. <if test="updateReason != null and updateReason != ''"> and update_reason = #{updateReason}</if>
  32. </where>
  33. </select>
  34. <select id="selectCmcUserHistoryByUserId" parameterType="Long" resultMap="CmcUserHistoryResult">
  35. <include refid="selectCmcUserHistoryVo"/>
  36. where user_id = #{userId}
  37. </select>
  38. <insert id="insertCmcUserHistory" parameterType="CmcUserHistory">
  39. insert into cmc_user_history
  40. <trim prefix="(" suffix=")" suffixOverrides=",">
  41. <if test="userId != null">user_id,</if>
  42. <if test="titles != null">titles,</if>
  43. <if test="certificates != null">certificates,</if>
  44. <if test="pmLevel != null">pm_level,</if>
  45. <if test="engineerLevel != null">engineer_level,</if>
  46. <if test="postLevel != null">post_level,</if>
  47. <if test="salaryLevel != null">salary_level,</if>
  48. <if test="updateTime != null">update_time,</if>
  49. <if test="updateReason != null">update_reason,</if>
  50. </trim>
  51. <trim prefix="values (" suffix=")" suffixOverrides=",">
  52. <if test="userId != null">#{userId},</if>
  53. <if test="titles != null">#{titles},</if>
  54. <if test="certificates != null">#{certificates},</if>
  55. <if test="pmLevel != null">#{pmLevel},</if>
  56. <if test="engineerLevel != null">#{engineerLevel},</if>
  57. <if test="postLevel != null">#{postLevel},</if>
  58. <if test="salaryLevel != null">#{salaryLevel},</if>
  59. <if test="updateTime != null">#{updateTime},</if>
  60. <if test="updateReason != null">#{updateReason},</if>
  61. </trim>
  62. </insert>
  63. <update id="updateCmcUserHistory" parameterType="CmcUserHistory">
  64. update cmc_user_history
  65. <trim prefix="SET" suffixOverrides=",">
  66. <if test="userId != null">user_id = #{userId},</if>
  67. <if test="titles != null">titles = #{titles},</if>
  68. <if test="certificates != null">certificates = #{certificates},</if>
  69. <if test="pmLevel != null">pm_level = #{pmLevel},</if>
  70. <if test="engineerLevel != null">engineer_level = #{engineerLevel},</if>
  71. <if test="postLevel != null">post_level = #{postLevel},</if>
  72. <if test="salaryLevel != null">salary_level = #{salaryLevel},</if>
  73. <if test="updateTime != null">update_time = #{updateTime},</if>
  74. <if test="updateReason != null">update_reason = #{updateReason},</if>
  75. </trim>
  76. where history_id = #{historyId}
  77. </update>
  78. <delete id="deleteCmcUserHistoryByUserId" parameterType="Long">
  79. delete from cmc_user_history where user_id = #{userId}
  80. </delete>
  81. <delete id="deleteCmcUserHistoryByUserIds" parameterType="String">
  82. delete from cmc_user_history where user_id in
  83. <foreach item="userId" collection="array" open="(" separator="," close=")">
  84. #{userId}
  85. </foreach>
  86. </delete>
  87. </mapper>