<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.diagbot.mapper.BasDoctorInfoMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.diagbot.entity.BasDoctorInfo">
        <id column="doctor_id" property="doctorId" />
        <result column="hospital_id" property="hospitalId" />
        <result column="dept_id" property="deptId" />
        <result column="name" property="name" />
        <result column="professor" property="professor" />
        <result column="occup" property="occup" />
        <result column="is_deleted" property="isDeleted" />
        <result column="gmt_create" property="gmtCreate" />
        <result column="gmt_modified" property="gmtModified" />
        <result column="creator" property="creator" />
        <result column="modifier" property="modifier" />
    </resultMap>

    <update id="updateBatchByKey">
        <foreach collection="list" item="item"  separator=";">
            update bas_doctor_info
            <set>
                <if test="item.deptId != null">
                    dept_id = #{item.deptId},
                </if>
                <if test="item.name != null">
                    name = #{item.name},
                </if>
                <if test="item.professor != null">
                    professor = #{item.professor},
                </if>
                <if test="item.occup != null">
                    occup = #{item.occup},
                </if>
                <if test="item.gmtModified != null">
                    gmt_modified = #{item.gmtModified},
                </if>
                <if test="item.modifier != null">
                    modifier = #{item.modifier},
                </if>
            </set>
            where doctor_id = #{item.doctorId} and hospital_id = #{item.hospitalId}
        </foreach>
    </update>

</mapper>
