PersonnelInfoMapper.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.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. <insert id="save">
  12. insert into k2_personnel_info
  13. <trim prefix="(" suffix=")" suffixOverrides=",">
  14. create_time,
  15. <if test="uid != null and uid != ''">uid,</if>
  16. <if test="account != null and account != ''">account,</if>
  17. <if test="realName != null and realName != ''">real_name,</if>
  18. <if test="phone != null and phone != ''">phone,</if>
  19. <if test="email != null and email != ''">email,</if>
  20. <if test="roleId != null and roleId != ''">role_id,</if>
  21. <if test="status != null">status,</if>
  22. <if test="password != null">"password",</if>
  23. <if test="org != null and org != ''">org,</if>
  24. </trim>
  25. values
  26. <trim prefix="(" suffix=")" suffixOverrides=",">
  27. now(),
  28. <if test="uid != null and uid != ''">#{uid,jdbcType=VARCHAR},</if>
  29. <if test="account != null and account != ''">#{account,jdbcType=VARCHAR},</if>
  30. <if test="realName != null and realName != ''">#{realName,jdbcType=VARCHAR},</if>
  31. <if test="phone != null and phone != ''">#{phone,jdbcType=VARCHAR},</if>
  32. <if test="email != null and email != ''">#{email,jdbcType=VARCHAR},</if>
  33. <if test="roleId != null and roleId != ''">#{roleId,jdbcType=VARCHAR},</if>
  34. <if test="status != null">#{status,jdbcType=SMALLINT},</if>
  35. <if test="password != null">#{password,jdbcType=VARCHAR},</if>
  36. <if test="org != null and org != ''">#{org,jdbcType=VARCHAR},</if>
  37. </trim>
  38. </insert>
  39. <update id="update">
  40. update k2_personnel_info
  41. <set>
  42. <if test="account != null and account != ''">account = #{account,jdbcType=VARCHAR},</if>
  43. <if test="realName != null and realName != ''">real_name = #{realName,jdbcType=VARCHAR},</if>
  44. <if test="phone != null and phone != ''">phone = #{phone,jdbcType=VARCHAR},</if>
  45. <if test="email != null and email != ''">email = #{email,jdbcType=VARCHAR},</if>
  46. <if test="status != null">status = #{status,jdbcType=SMALLINT},</if>
  47. <if test=" password != null">"password" = #{password,jdbcType=VARCHAR},</if>
  48. update_time = now()
  49. </set>
  50. WHERE uid = #{uid,jdbcType=VARCHAR}
  51. </update>
  52. </mapper>