|
@@ -1,5 +1,7 @@
|
|
|
package thyyxxk.webserver.dao.his.reports;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Constants;
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
@@ -15,13 +17,29 @@ public interface PatientDistributionAddressDao {
|
|
|
// district_code = (select name from t_region where code = district_code),
|
|
|
// a_patient_mi 省市区
|
|
|
|
|
|
- @Select("select inpatient_no, " +
|
|
|
+ @Select("select a.inpatient_no, " +
|
|
|
+ " home_street, " +
|
|
|
" latitude, " +
|
|
|
- " longitude, " +
|
|
|
- " addr_transed_flag " +
|
|
|
- "from a_patient_mi " +
|
|
|
- "where addr_transed_flag = 0")
|
|
|
- List<Patient> inpatientAddress();
|
|
|
+ " longitude," +
|
|
|
+ " a.name " +
|
|
|
+ "from a_patient_mi a," +
|
|
|
+ " ${tableName} b " +
|
|
|
+ "where addr_transed_flag = 0 and a.inpatient_no = b.inpatient_no " +
|
|
|
+ "and ${ew.sqlSegment} ")
|
|
|
+ List<Patient> inpatientAddress(@Param("tableName") String tableName,
|
|
|
+ @Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
|
|
|
+
|
|
|
+
|
|
|
+ @Select("select latitude,\n" +
|
|
|
+ " longitude,\n" +
|
|
|
+ " name,\n" +
|
|
|
+ " rtrim(patient_id) as inpatient_no\n" +
|
|
|
+ "from mz_patient_mi\n" +
|
|
|
+ "where addr_transed_flag = 0\n" +
|
|
|
+ " and lv_date >= #{startTime}\n" +
|
|
|
+ " and lv_date <= #{endTime} ")
|
|
|
+ List<Patient> mzAddress(@Param("startTime") String startTime,
|
|
|
+ @Param("endTime") String endTime);
|
|
|
|
|
|
|
|
|
@Select("select top 5000 inpatient_no," +
|
|
@@ -33,15 +51,25 @@ public interface PatientDistributionAddressDao {
|
|
|
List<Patient> timedTaskPatientData();
|
|
|
|
|
|
|
|
|
+ @Select("select top 5000 patient_id as inpatient_no,\n" +
|
|
|
+ " adress as home_street\n" +
|
|
|
+ "from mz_patient_mi\n" +
|
|
|
+ "where nullif(adress, '') is not null\n" +
|
|
|
+ "order by patient_id desc")
|
|
|
+ List<Patient> mzTimedTaskPatientData();
|
|
|
+
|
|
|
+
|
|
|
@Update("<script>" +
|
|
|
"<foreach collection=\"list\" item=\"item\" index=\"index\" open=\"\" close=\"\" separator=\";\">" +
|
|
|
- "update a_patient_mi " +
|
|
|
+ "update ${tableName} " +
|
|
|
"set latitude = #{item.latitude,jdbcType=REAL}," +
|
|
|
" longitude = #{item.longitude,jdbcType=REAL}, " +
|
|
|
" addr_transed_flag = #{item.addrTransedFlag,jdbcType=INTEGER} " +
|
|
|
- "where inpatient_no = #{item.inpatientNo} " +
|
|
|
+ "where ${patNo} = #{item.inpatientNo} " +
|
|
|
"</foreach>" +
|
|
|
"</script>")
|
|
|
- void updatePatientAddress(@Param("list") List<Patient> patients);
|
|
|
+ void updatePatientAddress(@Param("list") List<Patient> patients,
|
|
|
+ @Param("tableName") String tableName,
|
|
|
+ @Param("patNo") String panNo);
|
|
|
|
|
|
}
|