综合办公系统
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 7.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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="deptId" column="dept_id" />
  10. <result property="titles" column="titles" />
  11. <result property="certificates" column="certificates" />
  12. <result property="roleIds" column="roleIds" />
  13. <result property="postIds" column="postIds" />
  14. <result property="pmLevel" column="pm_level" />
  15. <result property="engineerLevel" column="engineer_level" />
  16. <result property="postLevel" column="post_level" />
  17. <result property="salaryLevel" column="salary_level" />
  18. <result property="operatorLevel" column="operator_level" />
  19. <result property="updateTime" column="update_time" />
  20. <result property="updateReason" column="update_reason" />
  21. <result property="politicalAffiliation" column="political_affiliation" />
  22. <result property="graduateSchool" column="graduate_school" />
  23. <result property="major" column="major" />
  24. <result property="degree" column="degree" />
  25. <result property="contractSign" column="contract_sign" />
  26. <result property="contractExpire" column="contract_expire" />
  27. </resultMap>
  28. <sql id="selectCmcUserHistoryVo">
  29. select history_id, user_id, dept_id, titles, certificates, roleIds, postIds, pm_level, engineer_level, post_level, salary_level, operator_level, update_time, update_reason,
  30. political_affiliation, graduate_school, major, degree, contract_sign, contract_expire from cmc_user_history
  31. </sql>
  32. <select id="selectCmcUserHistoryList" parameterType="CmcUserHistory" resultMap="CmcUserHistoryResult">
  33. <include refid="selectCmcUserHistoryVo"/>
  34. <where>
  35. <if test="userId != null "> and user_id = #{userId}</if>
  36. <if test="titles != null and titles != ''"> and titles = #{titles}</if>
  37. <if test="certificates != null and certificates != ''"> and certificates = #{certificates}</if>
  38. <if test="pmLevel != null and pmLevel != ''"> and pm_level = #{pmLevel}</if>
  39. <if test="engineerLevel != null and engineerLevel != ''"> and engineer_level = #{engineerLevel}</if>
  40. <if test="postLevel != null and postLevel != ''"> and post_level = #{postLevel}</if>
  41. <if test="salaryLevel != null and salaryLevel != ''"> and salary_level = #{salaryLevel}</if>
  42. <if test="updateReason != null and updateReason != ''"> and update_reason = #{updateReason}</if>
  43. </where>
  44. order by update_time desc
  45. </select>
  46. <select id="selectCmcUserHistoryByUserId" parameterType="Long" resultMap="CmcUserHistoryResult">
  47. <include refid="selectCmcUserHistoryVo"/>
  48. where user_id = #{userId}
  49. </select>
  50. <insert id="insertCmcUserHistory" parameterType="CmcUserHistory">
  51. insert into cmc_user_history
  52. <trim prefix="(" suffix=")" suffixOverrides=",">
  53. <if test="userId != null">user_id,</if>
  54. <if test="deptId != null">dept_id,</if>
  55. <if test="titles != null">titles,</if>
  56. <if test="certificates != null">certificates,</if>
  57. <if test="roleIds != null">roleIds,</if>
  58. <if test="postIds != null">postIds,</if>
  59. <if test="pmLevel != null">pm_level,</if>
  60. <if test="engineerLevel != null">engineer_level,</if>
  61. <if test="postLevel != null">post_level,</if>
  62. <if test="salaryLevel != null">salary_level,</if>
  63. <if test="operatorLevel != null">operator_level,</if>
  64. <if test="updateTime != null">update_time,</if>
  65. <if test="updateReason != null">update_reason,</if>
  66. <if test="politicalAffiliation != null">political_affiliation,</if>
  67. <if test="graduateSchool != null">graduate_school,</if>
  68. <if test="major != null">major,</if>
  69. <if test="degree != null">degree,</if>
  70. <if test="contractSign != null">contract_sign,</if>
  71. <if test="contractExpire != null">contract_expire,</if>
  72. </trim>
  73. <trim prefix="values (" suffix=")" suffixOverrides=",">
  74. <if test="userId != null">#{userId},</if>
  75. <if test="deptId != null">#{deptId},</if>
  76. <if test="titles != null">#{titles},</if>
  77. <if test="certificates != null">#{certificates},</if>
  78. <if test="roleIds != null">#{roleIds},</if>
  79. <if test="postIds != null">#{postIds},</if>
  80. <if test="pmLevel != null">#{pmLevel},</if>
  81. <if test="engineerLevel != null">#{engineerLevel},</if>
  82. <if test="postLevel != null">#{postLevel},</if>
  83. <if test="salaryLevel != null">#{salaryLevel},</if>
  84. <if test="operatorLevel != null">#{operatorLevel},</if>
  85. <if test="updateTime != null">#{updateTime},</if>
  86. <if test="updateReason != null">#{updateReason},</if>
  87. <if test="politicalAffiliation != null">#{politicalAffiliation},</if>
  88. <if test="graduateSchool != null">#{graduateSchool},</if>
  89. <if test="major != null">#{major},</if>
  90. <if test="degree != null">#{degree},</if>
  91. <if test="contractSign != null">#{contractSign},</if>
  92. <if test="contractExpire != null">#{contractExpire},</if>
  93. </trim>
  94. </insert>
  95. <update id="updateCmcUserHistory" parameterType="CmcUserHistory">
  96. update cmc_user_history
  97. <trim prefix="SET" suffixOverrides=",">
  98. <if test="userId != null">user_id = #{userId},</if>
  99. <if test="deptId != null">dept_id = #{deptId},</if>
  100. <if test="titles != null">titles = #{titles},</if>
  101. <if test="certificates != null">certificates = #{certificates},</if>
  102. <if test="roleIds != null">roleIds = #{roleIds},</if>
  103. <if test="postIds != null">postIds = #{postIds},</if>
  104. <if test="pmLevel != null">pm_level = #{pmLevel},</if>
  105. <if test="engineerLevel != null">engineer_level = #{engineerLevel},</if>
  106. <if test="postLevel != null">post_level = #{postLevel},</if>
  107. <if test="salaryLevel != null">salary_level = #{salaryLevel},</if>
  108. <if test="operatorLevel != null and operatorLevel != ''">#{operatorLevel},</if>
  109. <if test="updateTime != null">update_time = #{updateTime},</if>
  110. <if test="updateReason != null">update_reason = #{updateReason},</if>
  111. <if test="politicalAffiliation != null">#{politicalAffiliation},</if>
  112. <if test="graduateSchool != null">#{graduateSchool},</if>
  113. <if test="major != null">#{major},</if>
  114. <if test="degree != null">#{degree},</if>
  115. <if test="contractSign != null">#{contractSign},</if>
  116. <if test="contractExpire != null">#{contractExpire},</if>
  117. </trim>
  118. where history_id = #{historyId}
  119. </update>
  120. <delete id="deleteCmcUserHistoryByUserId" parameterType="Long">
  121. delete from cmc_user_history where user_id = #{userId}
  122. </delete>
  123. <delete id="deleteCmcUserHistoryByUserIds" parameterType="String">
  124. delete from cmc_user_history where user_id in
  125. <foreach item="userId" collection="array" open="(" separator="," close=")">
  126. #{userId}
  127. </foreach>
  128. </delete>
  129. </mapper>