综合办公系统
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

CmcUserHistoryMapper.xml 7.9KB

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