PersonnelInfoMapper.xml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.shkpr.service.customgateway.zydma.mapper.primary.PersonnelInfoMapper">
  4. <select id="findExistentIds" resultType="java.lang.String">
  5. SELECT uid FROM k2_personnel_info
  6. WHERE uid IN
  7. <foreach item="id" collection="ids" open="(" separator="," close=")">
  8. #{id}
  9. </foreach>
  10. </select>
  11. <select id="findBydUid" resultType="com.shkpr.service.customgateway.zydma.domain.po.PersonnelInfo">
  12. select id,
  13. uid,
  14. account,
  15. password,
  16. real_name,
  17. address,
  18. sex,
  19. phone,
  20. email,
  21. avatar,
  22. role_id,
  23. dept_id,
  24. post_id,
  25. status,
  26. param1,
  27. param2,
  28. create_time,
  29. update_time,
  30. org
  31. from k2_personnel_info
  32. where uid = #{uid,jdbcType=VARCHAR}
  33. </select>
  34. <insert id="save">
  35. insert into k2_personnel_info
  36. <trim prefix="(" suffix=")" suffixOverrides=",">
  37. create_time,
  38. <if test="uid != null and uid != ''">uid,</if>
  39. <if test="account != null and account != ''">account,</if>
  40. <if test="realName != null and realName != ''">real_name,</if>
  41. <if test="phone != null and phone != ''">phone,</if>
  42. <if test="email != null and email != ''">email,</if>
  43. <if test="roleId != null and roleId != ''">role_id,</if>
  44. <if test="status != null">status,</if>
  45. <if test="password != null">"password",</if>
  46. <if test="org != null and org != ''">org,</if>
  47. </trim>
  48. values
  49. <trim prefix="(" suffix=")" suffixOverrides=",">
  50. now(),
  51. <if test="uid != null and uid != ''">#{uid,jdbcType=VARCHAR},</if>
  52. <if test="account != null and account != ''">#{account,jdbcType=VARCHAR},</if>
  53. <if test="realName != null and realName != ''">#{realName,jdbcType=VARCHAR},</if>
  54. <if test="phone != null and phone != ''">#{phone,jdbcType=VARCHAR},</if>
  55. <if test="email != null and email != ''">#{email,jdbcType=VARCHAR},</if>
  56. <if test="roleId != null and roleId != ''">#{roleId,jdbcType=VARCHAR},</if>
  57. <if test="status != null">#{status,jdbcType=SMALLINT},</if>
  58. <if test="password != null">#{password,jdbcType=VARCHAR},</if>
  59. <if test="org != null and org != ''">#{org,jdbcType=VARCHAR},</if>
  60. </trim>
  61. </insert>
  62. <update id="update">
  63. update k2_personnel_info
  64. <set>
  65. <if test="account != null and account != ''">account = #{account,jdbcType=VARCHAR},</if>
  66. <if test="realName != null and realName != ''">real_name = #{realName,jdbcType=VARCHAR},</if>
  67. <if test="phone != null and phone != ''">phone = #{phone,jdbcType=VARCHAR},</if>
  68. <if test="email != null and email != ''">email = #{email,jdbcType=VARCHAR},</if>
  69. <if test="status != null">status = #{status,jdbcType=SMALLINT},</if>
  70. <if test=" password != null">"password" = #{password,jdbcType=VARCHAR},</if>
  71. update_time = now()
  72. </set>
  73. WHERE uid = #{uid,jdbcType=VARCHAR}
  74. </update>
  75. </mapper>