package thyyxxk.webserver.dao.his.zhuyuanyisheng;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import thyyxxk.webserver.entity.inpatient.patient.Overview;
import thyyxxk.webserver.entity.login.UserInfoSelect;

import java.util.List;

@Mapper
public interface Level3DoctorSetupDao {

    @Update("<script>" +
            "<foreach collection='list' item='item' separator=';'>" +
            "update zy_actpatient " +
            "set refer_physician   = #{item.referPhysician}, " +
            "    consult_physician = #{item.consultPhysician}, " +
            "    dept_director     = #{item.deptDirector} " +
            "where inpatient_no = #{item.inpatientNo} " +
            "  and admiss_times = #{item.admissTimes} " +
            "</foreach>" +
            "</script>")
    void updateDoctor(@Param("list") List<Overview> userInfoSelects);


    @Update("<script>" +
            "<foreach collection='list' item='item' separator=';'>" +
            "update batj_ba2 " +
            "set zkys = #{item.zkys} " +
            "where zyh = #{item.inpatientNo} " +
            "  and zycs = #{item.inpatientNo} " +
            "</foreach>" +
            "</script>")
    void updateZkys(@Param("list") List<Overview> userInfoSelects);

}
