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.

116 lines
6.2 KiB

  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.chenhai.system.vet.mapper.VetPersonalInfoMapper">
  6. <resultMap type="VetPersonalInfo" id="VetPersonalInfoResult">
  7. <result property="id" column="id" />
  8. <result property="userId" column="user_id" />
  9. <result property="realName" column="real_name" />
  10. <result property="gender" column="gender" />
  11. <result property="birthday" column="birthday" />
  12. <result property="idCard" column="id_card" />
  13. <result property="specialty" column="specialty" />
  14. <result property="workExperience" column="work_experience" />
  15. <result property="hospital" column="hospital" />
  16. <result property="address" column="address" />
  17. <result property="introduction" column="introduction" />
  18. <result property="createBy" column="create_by" />
  19. <result property="createTime" column="create_time" />
  20. <result property="updateBy" column="update_by" />
  21. <result property="updateTime" column="update_time" />
  22. </resultMap>
  23. <sql id="selectVetPersonalInfoVo">
  24. select id, user_id, real_name, gender, birthday, id_card, specialty, work_experience, hospital, address, introduction, create_by, create_time, update_by, update_time from vet_personal_info
  25. </sql>
  26. <select id="selectVetPersonalInfoList" parameterType="VetPersonalInfo" resultMap="VetPersonalInfoResult">
  27. <include refid="selectVetPersonalInfoVo"/>
  28. <where>
  29. <if test="userId != null "> and user_id = #{userId}</if>
  30. <if test="realName != null and realName != ''"> and real_name like concat('%', #{realName}, '%')</if>
  31. <if test="gender != null and gender != ''"> and gender = #{gender}</if>
  32. <if test="birthday != null "> and birthday = #{birthday}</if>
  33. <if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
  34. <if test="specialty != null and specialty != ''"> and specialty = #{specialty}</if>
  35. <if test="workExperience != null "> and work_experience = #{workExperience}</if>
  36. <if test="hospital != null and hospital != ''"> and hospital = #{hospital}</if>
  37. <if test="address != null and address != ''"> and address = #{address}</if>
  38. <if test="introduction != null and introduction != ''"> and introduction = #{introduction}</if>
  39. </where>
  40. </select>
  41. <select id="selectVetPersonalInfoById" parameterType="Long" resultMap="VetPersonalInfoResult">
  42. <include refid="selectVetPersonalInfoVo"/>
  43. where id = #{id}
  44. </select>
  45. <insert id="insertVetPersonalInfo" parameterType="VetPersonalInfo" useGeneratedKeys="true" keyProperty="id">
  46. insert into vet_personal_info
  47. <trim prefix="(" suffix=")" suffixOverrides=",">
  48. <if test="userId != null">user_id,</if>
  49. <if test="realName != null">real_name,</if>
  50. <if test="gender != null">gender,</if>
  51. <if test="birthday != null">birthday,</if>
  52. <if test="idCard != null">id_card,</if>
  53. <if test="specialty != null">specialty,</if>
  54. <if test="workExperience != null">work_experience,</if>
  55. <if test="hospital != null">hospital,</if>
  56. <if test="address != null">address,</if>
  57. <if test="introduction != null">introduction,</if>
  58. <if test="createBy != null">create_by,</if>
  59. <if test="createTime != null">create_time,</if>
  60. <if test="updateBy != null">update_by,</if>
  61. <if test="updateTime != null">update_time,</if>
  62. </trim>
  63. <trim prefix="values (" suffix=")" suffixOverrides=",">
  64. <if test="userId != null">#{userId},</if>
  65. <if test="realName != null">#{realName},</if>
  66. <if test="gender != null">#{gender},</if>
  67. <if test="birthday != null">#{birthday},</if>
  68. <if test="idCard != null">#{idCard},</if>
  69. <if test="specialty != null">#{specialty},</if>
  70. <if test="workExperience != null">#{workExperience},</if>
  71. <if test="hospital != null">#{hospital},</if>
  72. <if test="address != null">#{address},</if>
  73. <if test="introduction != null">#{introduction},</if>
  74. <if test="createBy != null">#{createBy},</if>
  75. <if test="createTime != null">#{createTime},</if>
  76. <if test="updateBy != null">#{updateBy},</if>
  77. <if test="updateTime != null">#{updateTime},</if>
  78. </trim>
  79. </insert>
  80. <update id="updateVetPersonalInfo" parameterType="VetPersonalInfo">
  81. update vet_personal_info
  82. <trim prefix="SET" suffixOverrides=",">
  83. <if test="userId != null">user_id = #{userId},</if>
  84. <if test="realName != null">real_name = #{realName},</if>
  85. <if test="gender != null">gender = #{gender},</if>
  86. <if test="birthday != null">birthday = #{birthday},</if>
  87. <if test="idCard != null">id_card = #{idCard},</if>
  88. <if test="specialty != null">specialty = #{specialty},</if>
  89. <if test="workExperience != null">work_experience = #{workExperience},</if>
  90. <if test="hospital != null">hospital = #{hospital},</if>
  91. <if test="address != null">address = #{address},</if>
  92. <if test="introduction != null">introduction = #{introduction},</if>
  93. <if test="createBy != null">create_by = #{createBy},</if>
  94. <if test="createTime != null">create_time = #{createTime},</if>
  95. <if test="updateBy != null">update_by = #{updateBy},</if>
  96. <if test="updateTime != null">update_time = #{updateTime},</if>
  97. </trim>
  98. where id = #{id}
  99. </update>
  100. <delete id="deleteVetPersonalInfoById" parameterType="Long">
  101. delete from vet_personal_info where id = #{id}
  102. </delete>
  103. <delete id="deleteVetPersonalInfoByIds" parameterType="String">
  104. delete from vet_personal_info where id in
  105. <foreach item="id" collection="array" open="(" separator="," close=")">
  106. #{id}
  107. </foreach>
  108. </delete>
  109. </mapper>