|
|
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd"><mapper namespace="com.chenhai.system.vet.mapper.VetPersonalInfoMapper"> <resultMap type="VetPersonalInfo" id="VetPersonalInfoResult"> <result property="id" column="id" /> <result property="userId" column="user_id" /> <result property="realName" column="real_name" /> <result property="gender" column="gender" /> <result property="birthday" column="birthday" /> <result property="idCard" column="id_card" /> <result property="specialty" column="specialty" /> <result property="workExperience" column="work_experience" /> <result property="hospital" column="hospital" /> <result property="address" column="address" /> <result property="introduction" column="introduction" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> <result property="updateBy" column="update_by" /> <result property="updateTime" column="update_time" /> </resultMap>
<sql id="selectVetPersonalInfoVo"> 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 </sql>
<select id="selectVetPersonalInfoList" parameterType="VetPersonalInfo" resultMap="VetPersonalInfoResult"> <include refid="selectVetPersonalInfoVo"/> <where> <if test="userId != null "> and user_id = #{userId}</if> <if test="realName != null and realName != ''"> and real_name like concat('%', #{realName}, '%')</if> <if test="gender != null and gender != ''"> and gender = #{gender}</if> <if test="birthday != null "> and birthday = #{birthday}</if> <if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if> <if test="specialty != null and specialty != ''"> and specialty = #{specialty}</if> <if test="workExperience != null "> and work_experience = #{workExperience}</if> <if test="hospital != null and hospital != ''"> and hospital = #{hospital}</if> <if test="address != null and address != ''"> and address = #{address}</if> <if test="introduction != null and introduction != ''"> and introduction = #{introduction}</if> </where> </select> <select id="selectVetPersonalInfoById" parameterType="Long" resultMap="VetPersonalInfoResult"> <include refid="selectVetPersonalInfoVo"/> where id = #{id} </select>
<insert id="insertVetPersonalInfo" parameterType="VetPersonalInfo" useGeneratedKeys="true" keyProperty="id"> insert into vet_personal_info <trim prefix="(" suffix=")" suffixOverrides=","> <if test="userId != null">user_id,</if> <if test="realName != null">real_name,</if> <if test="gender != null">gender,</if> <if test="birthday != null">birthday,</if> <if test="idCard != null">id_card,</if> <if test="specialty != null">specialty,</if> <if test="workExperience != null">work_experience,</if> <if test="hospital != null">hospital,</if> <if test="address != null">address,</if> <if test="introduction != null">introduction,</if> <if test="createBy != null">create_by,</if> <if test="createTime != null">create_time,</if> <if test="updateBy != null">update_by,</if> <if test="updateTime != null">update_time,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="userId != null">#{userId},</if> <if test="realName != null">#{realName},</if> <if test="gender != null">#{gender},</if> <if test="birthday != null">#{birthday},</if> <if test="idCard != null">#{idCard},</if> <if test="specialty != null">#{specialty},</if> <if test="workExperience != null">#{workExperience},</if> <if test="hospital != null">#{hospital},</if> <if test="address != null">#{address},</if> <if test="introduction != null">#{introduction},</if> <if test="createBy != null">#{createBy},</if> <if test="createTime != null">#{createTime},</if> <if test="updateBy != null">#{updateBy},</if> <if test="updateTime != null">#{updateTime},</if> </trim> </insert>
<update id="updateVetPersonalInfo" parameterType="VetPersonalInfo"> update vet_personal_info <trim prefix="SET" suffixOverrides=","> <if test="userId != null">user_id = #{userId},</if> <if test="realName != null">real_name = #{realName},</if> <if test="gender != null">gender = #{gender},</if> <if test="birthday != null">birthday = #{birthday},</if> <if test="idCard != null">id_card = #{idCard},</if> <if test="specialty != null">specialty = #{specialty},</if> <if test="workExperience != null">work_experience = #{workExperience},</if> <if test="hospital != null">hospital = #{hospital},</if> <if test="address != null">address = #{address},</if> <if test="introduction != null">introduction = #{introduction},</if> <if test="createBy != null">create_by = #{createBy},</if> <if test="createTime != null">create_time = #{createTime},</if> <if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateTime != null">update_time = #{updateTime},</if> </trim> where id = #{id} </update>
<delete id="deleteVetPersonalInfoById" parameterType="Long"> delete from vet_personal_info where id = #{id} </delete>
<delete id="deleteVetPersonalInfoByIds" parameterType="String"> delete from vet_personal_info where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete></mapper>
|