package thyyxxk.webserver.dao.his;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import thyyxxk.webserver.entity.dictionary.CodeName;

import java.util.List;

@Mapper
public interface MyTestDao {
    @Select("select top 50000 rtrim(inpatient_no) as code, rtrim(isnull(home_street,relation_street)) as name " +
            "from a_patient_mi where district_code is null and isnull(home_street,relation_street) is not null " +
            "and inpatient_no not like 'S%' and LEN(home_street)>=10 and inpatient_no not like 'JT%'")
    List<CodeName> selectPatientRawAddress();

    @Update("update a_patient_mi set province_code=#{province},city_code=#{city},district_code=#{district} where inpatient_no=#{patNo}")
    void updateLocation(String patNo, String province, String city, String district);
}
